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
f5628d72
Commit
f5628d72
authored
Jun 26, 2018
by
Andrew Heather
Browse files
BUG: AMI/ACMI - corrected setting of [src|tgt]MagSf for parallel runs. See
#856
#906
parent
0b14c637
Changes
10
Hide whitespace changes
Inline
Side-by-side
src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C
View file @
f5628d72
...
...
@@ -605,9 +605,11 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
requireMatch_
(
requireMatch
),
singlePatchProc_
(
-
999
),
lowWeightCorrection_
(
lowWeightCorrection
),
srcMagSf_
(),
srcAddress_
(),
srcWeights_
(),
srcWeightsSum_
(),
tgtMagSf_
(),
tgtAddress_
(),
tgtWeights_
(),
tgtWeightsSum_
(),
...
...
@@ -636,9 +638,11 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
requireMatch_
(
requireMatch
),
singlePatchProc_
(
-
999
),
lowWeightCorrection_
(
lowWeightCorrection
),
srcMagSf_
(),
srcAddress_
(),
srcWeights_
(),
srcWeightsSum_
(),
tgtMagSf_
(),
tgtAddress_
(),
tgtWeights_
(),
tgtWeightsSum_
(),
...
...
@@ -668,9 +672,11 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
requireMatch_
(
requireMatch
),
singlePatchProc_
(
-
999
),
lowWeightCorrection_
(
lowWeightCorrection
),
srcMagSf_
(),
srcAddress_
(),
srcWeights_
(),
srcWeightsSum_
(),
tgtMagSf_
(),
tgtAddress_
(),
tgtWeights_
(),
tgtWeightsSum_
(),
...
...
@@ -700,9 +706,11 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
requireMatch_
(
requireMatch
),
singlePatchProc_
(
-
999
),
lowWeightCorrection_
(
lowWeightCorrection
),
srcMagSf_
(),
srcAddress_
(),
srcWeights_
(),
srcWeightsSum_
(),
tgtMagSf_
(),
tgtAddress_
(),
tgtWeights_
(),
tgtWeightsSum_
(),
...
...
@@ -727,9 +735,11 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::AMIInterpolation
requireMatch_
(
fineAMI
.
requireMatch_
),
singlePatchProc_
(
fineAMI
.
singlePatchProc_
),
lowWeightCorrection_
(
-
1
.
0
),
srcMagSf_
(),
srcAddress_
(),
srcWeights_
(),
srcWeightsSum_
(),
tgtMagSf_
(),
tgtAddress_
(),
tgtWeights_
(),
tgtWeightsSum_
(),
...
...
@@ -884,7 +894,7 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
tgtFaceIDs
);
TargetPatch
const
TargetPatch
newTgtPatch
(
SubList
<
face
>
...
...
@@ -917,11 +927,11 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update
tgtWeights_
);
// Note: using patch face areas calculated by the AMI method
// - TODO: should move into the calculate method
srcMagSf_
.
transfer
(
AMIPtr
->
srcMagSf
());
tgtMagSf_
.
transfer
(
AMIPtr
->
tgtMagSf
());
map
.
reverseDistribute
(
tgtPatch
.
size
(),
tgtMagSf_
);
// - TODO: move into the calculate or normalise method?
AMIPtr
->
setMagSf
(
tgtPatch
,
map
,
srcMagSf_
,
tgtMagSf_
);
// Now
// ~~~
...
...
src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.H
View file @
f5628d72
...
...
@@ -84,11 +84,11 @@ protected:
const
TargetPatch
&
tgtPatch_
;
//- Flag to indicate that the two patches are co-directional and
//
that the orientation of the target patch should be reversed
//
-
that the orientation of the target patch should be reversed
const
bool
reverseTarget_
;
//- Flag to indicate that the two patches must be matched/an overlap
//
exists between them
//
-
exists between them
const
bool
requireMatch_
;
//- Source face areas
...
...
@@ -98,7 +98,7 @@ protected:
List
<
scalar
>
tgtMagSf_
;
//- Labels of faces that are not overlapped by any target faces
//
(should be empty for correct functioning)
//
-
(should be empty for correct functioning)
labelList
srcNonOverlap_
;
//- Octree used to find face seeds
...
...
@@ -254,8 +254,17 @@ public:
label
tgtFacei
=
-
1
)
=
0
;
//- Set the face areas for parallel runs
virtual
void
setMagSf
(
const
TargetPatch
&
tgtPatch
,
const
mapDistribute
&
map
,
scalarList
&
srcMagSf
,
scalarList
&
tgtMagSf
)
const
=
0
;
//- Normalise the weight. Can optionally subset addressing
//
(e.g. for mapNearest)
//
-
(e.g. for mapNearest)
virtual
void
normaliseWeights
(
const
bool
verbose
,
...
...
src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/directAMI/directAMI.C
View file @
f5628d72
...
...
@@ -313,6 +313,20 @@ void Foam::directAMI<SourcePatch, TargetPatch>::calculate
}
template
<
class
SourcePatch
,
class
TargetPatch
>
void
Foam
::
directAMI
<
SourcePatch
,
TargetPatch
>::
setMagSf
(
const
TargetPatch
&
tgtPatch
,
const
mapDistribute
&
map
,
scalarList
&
srcMagSf
,
scalarList
&
tgtMagSf
)
const
{
srcMagSf
=
std
::
move
(
this
->
srcMagSf_
);
tgtMagSf
=
scalarList
(
tgtPatch
.
size
(),
1
.
0
);
}
template
<
class
SourcePatch
,
class
TargetPatch
>
void
Foam
::
directAMI
<
SourcePatch
,
TargetPatch
>::
normaliseWeights
(
...
...
src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/directAMI/directAMI.H
View file @
f5628d72
...
...
@@ -134,6 +134,15 @@ public:
label
tgtFacei
=
-
1
);
//- Set the face areas for parallel runs
virtual
void
setMagSf
(
const
TargetPatch
&
tgtPatch
,
const
mapDistribute
&
map
,
scalarList
&
srcMagSf
,
scalarList
&
tgtMagSf
)
const
;
//- Normalise the weight. Can optionally subset addressing
// (e.g. for mapNearest)
virtual
void
normaliseWeights
...
...
src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/faceAreaWeightAMI/faceAreaWeightAMI.C
View file @
f5628d72
...
...
@@ -648,6 +648,21 @@ void Foam::faceAreaWeightAMI<SourcePatch, TargetPatch>::calculate
}
template
<
class
SourcePatch
,
class
TargetPatch
>
void
Foam
::
faceAreaWeightAMI
<
SourcePatch
,
TargetPatch
>::
setMagSf
(
const
TargetPatch
&
tgtPatch
,
const
mapDistribute
&
map
,
scalarList
&
srcMagSf
,
scalarList
&
tgtMagSf
)
const
{
srcMagSf
=
std
::
move
(
this
->
srcMagSf_
);
tgtMagSf
=
std
::
move
(
this
->
tgtMagSf_
);
map
.
reverseDistribute
(
tgtPatch
.
size
(),
tgtMagSf
);
}
template
<
class
SourcePatch
,
class
TargetPatch
>
void
Foam
::
faceAreaWeightAMI
<
SourcePatch
,
TargetPatch
>::
normaliseWeights
(
...
...
src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/faceAreaWeightAMI/faceAreaWeightAMI.H
View file @
f5628d72
...
...
@@ -180,8 +180,17 @@ public:
label
tgtFacei
=
-
1
);
//- Set the face areas for parallel runs
virtual
void
setMagSf
(
const
TargetPatch
&
tgtPatch
,
const
mapDistribute
&
map
,
scalarList
&
srcMagSf
,
scalarList
&
tgtMagSf
)
const
;
//- Normalise the weight. Can optionally subset addressing
//
(e.g. for mapNearest)
//
-
(e.g. for mapNearest)
virtual
void
normaliseWeights
(
const
bool
verbose
,
...
...
src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/mapNearestAMI/mapNearestAMI.C
View file @
f5628d72
...
...
@@ -347,6 +347,20 @@ void Foam::mapNearestAMI<SourcePatch, TargetPatch>::calculate
}
template
<
class
SourcePatch
,
class
TargetPatch
>
void
Foam
::
mapNearestAMI
<
SourcePatch
,
TargetPatch
>::
setMagSf
(
const
TargetPatch
&
tgtPatch
,
const
mapDistribute
&
map
,
scalarList
&
srcMagSf
,
scalarList
&
tgtMagSf
)
const
{
srcMagSf
=
std
::
move
(
this
->
srcMagSf_
);
tgtMagSf
=
scalarList
(
tgtPatch
.
size
(),
1
.
0
);
}
template
<
class
SourcePatch
,
class
TargetPatch
>
void
Foam
::
mapNearestAMI
<
SourcePatch
,
TargetPatch
>::
normaliseWeights
(
...
...
src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/mapNearestAMI/mapNearestAMI.H
View file @
f5628d72
...
...
@@ -138,8 +138,17 @@ public:
label
tgtFacei
=
-
1
);
//- Set the face areas for parallel runs
virtual
void
setMagSf
(
const
TargetPatch
&
tgtPatch
,
const
mapDistribute
&
map
,
scalarList
&
srcMagSf
,
scalarList
&
tgtMagSf
)
const
;
//- Normalise the weight. Can optionally subset addressing
//
(e.g. for mapNearest)
//
-
(e.g. for mapNearest)
virtual
void
normaliseWeights
(
const
bool
verbose
,
...
...
src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/partialFaceAreaWeightAMI/partialFaceAreaWeightAMI.C
View file @
f5628d72
...
...
@@ -150,4 +150,32 @@ void Foam::partialFaceAreaWeightAMI<SourcePatch, TargetPatch>::calculate
}
template
<
class
SourcePatch
,
class
TargetPatch
>
void
Foam
::
partialFaceAreaWeightAMI
<
SourcePatch
,
TargetPatch
>::
setMagSf
(
const
TargetPatch
&
tgtPatch
,
const
mapDistribute
&
map
,
scalarList
&
srcMagSf
,
scalarList
&
tgtMagSf
)
const
{
srcMagSf
=
std
::
move
(
this
->
srcMagSf_
);
scalarList
newTgtMagSf
(
std
::
move
(
this
->
tgtMagSf_
));
map
.
reverseDistribute
(
tgtPatch
.
size
(),
newTgtMagSf
);
// Assign default sizes. Override selected values with
// calculated values. This is to support ACMI
// where some of the target faces are never used (so never get sent
// over and hence never assigned to)
tgtMagSf
=
tgtPatch
.
magFaceAreas
();
for
(
const
labelList
&
smap
:
map
.
subMap
())
{
UIndirectList
<
scalar
>
(
tgtMagSf
,
smap
)
=
UIndirectList
<
scalar
>
(
newTgtMagSf
,
smap
);
}
}
// ************************************************************************* //
src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/partialFaceAreaWeightAMI/partialFaceAreaWeightAMI.H
View file @
f5628d72
...
...
@@ -120,6 +120,15 @@ public:
label
srcFacei
=
-
1
,
label
tgtFacei
=
-
1
);
//- Set the face areas for parallel runs
virtual
void
setMagSf
(
const
TargetPatch
&
tgtPatch
,
const
mapDistribute
&
map
,
scalarList
&
srcMagSf
,
scalarList
&
tgtMagSf
)
const
;
};
...
...
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