mapFields: Minimum hack provided by Mattijs to get mapFields working again
This version is very inefficient in parallel and does not provide the -parallelSource or -parallelTarget options which will need to be reinstanted in the future or we could revert mapFields to the OpenFOAM-2.2 version.
This commit is contained in:
@ -41,8 +41,7 @@ void mapConsistentMesh
|
||||
(
|
||||
const fvMesh& meshSource,
|
||||
const fvMesh& meshTarget,
|
||||
const word& mapMethod,
|
||||
const word& AMIMapMethod,
|
||||
const meshToMesh::interpolationMethod& mapMethod,
|
||||
const bool subtract,
|
||||
const HashSet<word>& selectedFields,
|
||||
const bool noLagrangian
|
||||
@ -51,7 +50,7 @@ void mapConsistentMesh
|
||||
Info<< nl << "Consistently creating and mapping fields for time "
|
||||
<< meshSource.time().timeName() << nl << endl;
|
||||
|
||||
meshToMesh interp(meshSource, meshTarget, mapMethod, AMIMapMethod);
|
||||
meshToMesh interp(meshSource, meshTarget, mapMethod);
|
||||
|
||||
if (subtract)
|
||||
{
|
||||
@ -80,8 +79,7 @@ void mapSubMesh
|
||||
const fvMesh& meshTarget,
|
||||
const HashTable<word>& patchMap,
|
||||
const wordList& cuttingPatches,
|
||||
const word& mapMethod,
|
||||
const word& AMIMapMethod,
|
||||
const meshToMesh::interpolationMethod& mapMethod,
|
||||
const bool subtract,
|
||||
const HashSet<word>& selectedFields,
|
||||
const bool noLagrangian
|
||||
@ -95,7 +93,6 @@ void mapSubMesh
|
||||
meshSource,
|
||||
meshTarget,
|
||||
mapMethod,
|
||||
AMIMapMethod,
|
||||
patchMap,
|
||||
cuttingPatches
|
||||
);
|
||||
@ -187,13 +184,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
"mapMethod",
|
||||
"word",
|
||||
"specify the mapping method (direct|mapNearest|cellVolumeWeight)"
|
||||
);
|
||||
argList::addOption
|
||||
(
|
||||
"patchMapMethod",
|
||||
"word",
|
||||
"specify the patch mapping method (direct|mapNearest|faceAreaWeight)"
|
||||
"specify the mapping method"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
@ -240,50 +231,17 @@ int main(int argc, char *argv[])
|
||||
|
||||
const bool consistent = args.optionFound("consistent");
|
||||
|
||||
meshToMesh::interpolationMethod mapMethod =
|
||||
meshToMesh::imCellVolumeWeight;
|
||||
|
||||
word mapMethod = meshToMesh::interpolationMethodNames_
|
||||
[
|
||||
meshToMesh::imCellVolumeWeight
|
||||
];
|
||||
|
||||
if (args.optionReadIfPresent("mapMethod", mapMethod))
|
||||
if (args.optionFound("mapMethod"))
|
||||
{
|
||||
Info<< "Mapping method: " << mapMethod << endl;
|
||||
mapMethod = meshToMesh::interpolationMethodNames_[args["mapMethod"]];
|
||||
|
||||
Info<< "Mapping method: "
|
||||
<< meshToMesh::interpolationMethodNames_[mapMethod] << endl;
|
||||
}
|
||||
|
||||
|
||||
word patchMapMethod;
|
||||
if (meshToMesh::interpolationMethodNames_.found(mapMethod))
|
||||
{
|
||||
// Lookup corresponding AMI method
|
||||
meshToMesh::interpolationMethod method =
|
||||
meshToMesh::interpolationMethodNames_[mapMethod];
|
||||
|
||||
patchMapMethod = AMIPatchToPatchInterpolation::interpolationMethodToWord
|
||||
(
|
||||
meshToMesh::interpolationMethodAMI(method)
|
||||
);
|
||||
}
|
||||
|
||||
// Optionally override
|
||||
if (args.optionFound("patchMapMethod"))
|
||||
{
|
||||
patchMapMethod = args["patchMapMethod"];
|
||||
|
||||
Info<< "Patch mapping method: " << patchMapMethod << endl;
|
||||
}
|
||||
|
||||
|
||||
if (patchMapMethod.empty())
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "No valid patchMapMethod for method " << mapMethod
|
||||
<< ". Please supply one through the 'patchMapMethod' option"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const bool subtract = args.optionFound("subtract");
|
||||
if (subtract)
|
||||
{
|
||||
@ -356,7 +314,6 @@ int main(int argc, char *argv[])
|
||||
meshSource,
|
||||
meshTarget,
|
||||
mapMethod,
|
||||
patchMapMethod,
|
||||
subtract,
|
||||
selectedFields,
|
||||
noLagrangian
|
||||
@ -371,7 +328,6 @@ int main(int argc, char *argv[])
|
||||
patchMap,
|
||||
addProcessorPatches(meshTarget, cuttingPatches),
|
||||
mapMethod,
|
||||
patchMapMethod,
|
||||
subtract,
|
||||
selectedFields,
|
||||
noLagrangian
|
||||
|
||||
Reference in New Issue
Block a user