Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
4fea7b3b
Commit
4fea7b3b
authored
Feb 12, 2020
by
mattijs
Browse files
BUG: SPDP: PrecisionAdaptor copies input list. Fixes
#1590
.
parent
09db19c3
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/fields/Fields/Field/PrecisionAdaptor/PrecisionAdaptor.H
View file @
4fea7b3b
...
...
@@ -169,11 +169,14 @@ class PrecisionAdaptor
// Private Member Functions
//- Copy in field
void
copyInput
(
const
Container
<
InputType
>&
input
)
void
copyInput
(
const
Container
<
InputType
>&
input
,
const
bool
copy
)
{
Container
<
Type
>*
p
=
new
Container
<
Type
>
(
input
.
size
());
this
->
reset
(
p
);
std
::
copy
(
input
.
cbegin
(),
input
.
cend
(),
p
->
begin
());
if
(
copy
)
{
std
::
copy
(
input
.
cbegin
(),
input
.
cend
(),
p
->
begin
());
}
}
...
...
@@ -185,8 +188,8 @@ public:
// Constructors
//- Construct from Container<InputType>, copying on input
as
required
PrecisionAdaptor
(
Container
<
InputType
>&
input
)
//- Construct from Container<InputType>, copying on input
if
required
PrecisionAdaptor
(
Container
<
InputType
>&
input
,
const
bool
copy
=
true
)
:
tmpNrc
<
Container
<
Type
>>
(),
ref_
(
input
)
...
...
@@ -197,7 +200,7 @@ public:
}
else
{
this
->
copyInput
(
input
);
this
->
copyInput
(
input
,
copy
);
}
}
...
...
src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCentresAndVols.C
View file @
4fea7b3b
...
...
@@ -82,18 +82,14 @@ void Foam::primitiveMesh::makeCellCentresAndVols
{
typedef
Vector
<
solveScalar
>
solveVector
;
// Clear the fields for accumulation. Note1: we're doing this before
// any precision conversion since this might complain about illegal numbers.
// Note2: zero is a special value which is perfectly converted into zero
// in the new precision
cellCtrs_s
=
Zero
;
cellVols_s
=
0
.
0
;
PrecisionAdaptor
<
solveVector
,
vector
>
tcellCtrs
(
cellCtrs_s
);
PrecisionAdaptor
<
solveVector
,
vector
>
tcellCtrs
(
cellCtrs_s
,
false
);
Field
<
solveVector
>&
cellCtrs
=
tcellCtrs
.
ref
();
PrecisionAdaptor
<
solveScalar
,
scalar
>
tcellVols
(
cellVols_s
);
PrecisionAdaptor
<
solveScalar
,
scalar
>
tcellVols
(
cellVols_s
,
false
);
Field
<
solveScalar
>&
cellVols
=
tcellVols
.
ref
();
cellCtrs
=
Zero
;
cellVols
=
0
.
0
;
const
labelList
&
own
=
faceOwner
();
const
labelList
&
nei
=
faceNeighbour
();
...
...
src/parallel/decompose/kahipDecomp/kahipDecomp.C
View file @
4fea7b3b
...
...
@@ -229,7 +229,7 @@ Foam::label Foam::kahipDecomp::decomposeSerial
// Output: cell -> processor addressing
decomp
.
resize
(
numCells
);
PrecisionAdaptor
<
int
,
label
,
List
>
decomp_param
(
decomp
);
PrecisionAdaptor
<
int
,
label
,
List
>
decomp_param
(
decomp
,
false
);
#if 0 // WIP: #ifdef KAFFPA_CPP_INTERFACE
...
...
src/parallel/decompose/metisDecomp/metisDecomp.C
View file @
4fea7b3b
...
...
@@ -196,7 +196,7 @@ Foam::label Foam::metisDecomp::decomposeSerial
// Output: cell -> processor addressing
decomp
.
resize
(
numCells
);
PrecisionAdaptor
<
idx_t
,
label
,
List
>
decomp_param
(
decomp
);
PrecisionAdaptor
<
idx_t
,
label
,
List
>
decomp_param
(
decomp
,
false
);
// Output: number of cut edges
idx_t
edgeCut
=
0
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment