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
2d96fc50
Commit
2d96fc50
authored
Jul 26, 2016
by
Andrew Heather
Browse files
BUG: mapFields function object - evaluate constraint patches after mapping. Fixes
#190
parent
cd8be89b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/postProcessing/functionObjects/utilities/mapFields/mapFields.H
View file @
2d96fc50
...
...
@@ -122,6 +122,13 @@ class mapFieldsFO
//- Helper function to create the mesh-to-mesh interpolation
void
createInterpolation
(
const
dictionary
&
dict
);
//- Helper function to evaluate constraint patches after mapping
template
<
class
Type
>
void
evaluateConstraintTypes
(
GeometricField
<
Type
,
fvPatchField
,
volMesh
>&
fld
)
const
;
//- Helper function to interpolate and write the fied
template
<
class
Type
>
bool
writeFieldType
()
const
;
...
...
src/postProcessing/functionObjects/utilities/mapFields/mapFieldsTemplates.C
View file @
2d96fc50
...
...
@@ -25,6 +25,91 @@ License
#include
"meshToMesh.H"
template
<
class
Type
>
void
Foam
::
mapFieldsFO
::
evaluateConstraintTypes
(
GeometricField
<
Type
,
fvPatchField
,
volMesh
>&
fld
)
const
{
typename
GeometricField
<
Type
,
fvPatchField
,
volMesh
>::
GeometricBoundaryField
&
fldBf
=
fld
.
boundaryField
();
if
(
Pstream
::
defaultCommsType
==
Pstream
::
blocking
||
Pstream
::
defaultCommsType
==
Pstream
::
nonBlocking
)
{
label
nReq
=
Pstream
::
nRequests
();
forAll
(
fldBf
,
patchi
)
{
fvPatchField
<
Type
>&
tgtField
=
fldBf
[
patchi
];
if
(
tgtField
.
type
()
==
tgtField
.
patch
().
patch
().
type
()
&&
polyPatch
::
constraintType
(
tgtField
.
patch
().
patch
().
type
())
)
{
tgtField
.
initEvaluate
(
Pstream
::
defaultCommsType
);
}
}
// Block for any outstanding requests
if
(
Pstream
::
parRun
()
&&
Pstream
::
defaultCommsType
==
Pstream
::
nonBlocking
)
{
Pstream
::
waitRequests
(
nReq
);
}
forAll
(
fldBf
,
patchi
)
{
fvPatchField
<
Type
>&
tgtField
=
fldBf
[
patchi
];
if
(
tgtField
.
type
()
==
tgtField
.
patch
().
patch
().
type
()
&&
polyPatch
::
constraintType
(
tgtField
.
patch
().
patch
().
type
())
)
{
tgtField
.
evaluate
(
Pstream
::
defaultCommsType
);
}
}
}
else
if
(
Pstream
::
defaultCommsType
==
Pstream
::
scheduled
)
{
const
lduSchedule
&
patchSchedule
=
fld
.
mesh
().
globalData
().
patchSchedule
();
forAll
(
patchSchedule
,
patchEvali
)
{
label
patchi
=
patchSchedule
[
patchEvali
].
patch
;
fvPatchField
<
Type
>&
tgtField
=
fldBf
[
patchi
];
if
(
tgtField
.
type
()
==
tgtField
.
patch
().
patch
().
type
()
&&
polyPatch
::
constraintType
(
tgtField
.
patch
().
patch
().
type
())
)
{
if
(
patchSchedule
[
patchEvali
].
init
)
{
tgtField
.
initEvaluate
(
Pstream
::
scheduled
);
}
else
{
tgtField
.
evaluate
(
Pstream
::
scheduled
);
}
}
}
}
}
template
<
class
Type
>
bool
Foam
::
mapFieldsFO
::
writeFieldType
()
const
{
...
...
@@ -53,6 +138,9 @@ bool Foam::mapFieldsFO::writeFieldType() const
if
(
log_
)
Info
<<
": interpolated"
;
FieldType
fieldMapRegion
(
mapRegionIO
,
tfieldMapRegion
);
evaluateConstraintTypes
(
fieldMapRegion
);
fieldMapRegion
.
write
();
if
(
log_
)
Info
<<
" and written"
<<
nl
;
...
...
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