42 #include "MapMeshes.H"
46 void mapConsistentMesh
48 const fvMesh& meshSource,
49 const fvMesh& meshTarget,
50 const word& mapMethod,
51 const word& AMIMapMethod,
52 const word& procMapMethod,
54 const wordRes& selectedFields,
55 const bool noLagrangian
58 Info<<
nl <<
"Consistently creating and mapping fields for time "
59 << meshSource.time().timeName() <<
nl <<
endl;
67 meshToMesh::procMapMethodNames_[procMapMethod]
93 const fvMesh& meshSource,
94 const fvMesh& meshTarget,
95 const HashTable<word>& patchMap,
97 const word& mapMethod,
98 const word& AMIMapMethod,
99 const word& procMapMethod,
101 const wordRes& selectedFields,
102 const bool noLagrangian
105 Info<<
nl <<
"Creating and mapping fields for time "
106 << meshSource.time().timeName() <<
nl <<
endl;
116 meshToMesh::procMapMethodNames_[procMapMethod]
142 int main(
int argc,
char *argv[])
146 "Map volume fields from one mesh to another"
149 argList::addArgument(
"sourceCase");
154 "scalar|'latestTime'",
155 "Specify the source time"
161 "Specify the source region"
167 "Specify the target region"
169 argList::addBoolOption
172 "Source and target geometry and boundary conditions identical"
178 "Specify the mapping method "
179 "(direct|mapNearest|cellVolumeWeight|correctedCellVolumeWeight)"
185 "Specify the patch mapping method (direct|mapNearest|faceAreaWeight)"
191 "Specify the processor distribution map method (AABB|LOD)"
193 argList::addBoolOption
196 "Subtract mapped source from target"
202 "Specify single or multiple fields to reconstruct (all by default)."
203 " Eg, 'T' or '(p T U \"alpha.*\")'"
205 argList::addBoolOption
208 "Skip mapping lagrangian positions and fields"
211 argList
args(argc, argv);
217 const fileName casePath =
args[1];
218 const fileName rootDirSource = casePath.
path();
219 const fileName caseDirSource = casePath.
name();
221 Info<<
"Source: " << rootDirSource <<
" " << caseDirSource <<
endl;
222 word sourceRegion = fvMesh::defaultRegion;
225 Info<<
"Source region: " << sourceRegion <<
endl;
228 Info<<
"Target: " << rootDirTarget <<
" " << caseDirTarget <<
endl;
229 word targetRegion = fvMesh::defaultRegion;
232 Info<<
"Target region: " << targetRegion <<
endl;
235 const bool consistent =
args.
found(
"consistent");
238 word mapMethod = meshToMesh::interpolationMethodNames_
240 meshToMesh::interpolationMethod::imCellVolumeWeight
245 Info<<
"Mapping method: " << mapMethod <<
endl;
249 if (meshToMesh::interpolationMethodNames_.
found(mapMethod))
252 meshToMesh::interpolationMethod method =
253 meshToMesh::interpolationMethodNames_[mapMethod];
255 patchMapMethod = meshToMesh::interpolationMethodAMI(method);
259 meshToMesh::procMapMethodNames_
261 meshToMesh::procMapMethod::pmAABB
266 Info<<
"Processor map method: " << procMapMethod <<
endl;
273 Info<<
"Patch mapping method: " << patchMapMethod <<
endl;
277 if (patchMapMethod.empty())
280 <<
"No valid patchMapMethod for method " << mapMethod
281 <<
". Please supply one through the 'patchMapMethod' option"
288 Info<<
"Subtracting mapped source field from target" <<
endl;
292 const wordRes selectedFields(
args.
getList<wordRe>(
"fields",
false));
294 const bool noLagrangian =
args.
found(
"noLagrangian");
296 #include "createTimes.H"
298 HashTable<word> patchMap;
303 IOdictionary mapFieldsDict
310 IOobject::MUST_READ_IF_MODIFIED,
316 mapFieldsDict.readEntry(
"patchMap", patchMap);
317 mapFieldsDict.readEntry(
"cuttingPatches", cuttingPatches);
320 #include "setTimeIndex.H"
344 Info<<
"Source mesh size: " << meshSource.globalData().nTotalCells() <<
tab
345 <<
"Target mesh size: " << meshTarget.globalData().nTotalCells()