reconstructParMesh: Added -allRegions option
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/dynamicMesh/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools
|
||||
-lmeshTools \
|
||||
-lregionModels
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -50,6 +50,7 @@ Description
|
||||
#include "fvMeshAdder.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "extrapolatedCalculatedFvPatchFields.H"
|
||||
#include "regionProperties.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -479,6 +480,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
#include "addRegionOption.H"
|
||||
#include "addAllRegionsOption.H"
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
|
||||
@ -498,18 +500,21 @@ int main(int argc, char *argv[])
|
||||
<< endl;
|
||||
|
||||
|
||||
word regionName = polyMesh::defaultRegion;
|
||||
word regionDir = word::null;
|
||||
|
||||
if
|
||||
(
|
||||
args.optionReadIfPresent("region", regionName)
|
||||
&& regionName != polyMesh::defaultRegion
|
||||
)
|
||||
const wordList regionNames(selectRegionNames(args, runTime));
|
||||
if (regionNames.size() > 1)
|
||||
{
|
||||
regionDir = regionName;
|
||||
Info<< "Operating on region " << regionName << nl << endl;
|
||||
Info<< "Operating on regions " << regionNames[0];
|
||||
for (label regioni = 1; regioni < regionNames.size() - 1; ++ regioni)
|
||||
{
|
||||
Info<< ", " << regionNames[regioni];
|
||||
}
|
||||
Info<< " and " << regionNames.last() << nl << endl;
|
||||
}
|
||||
else if (regionNames[0] != polyMesh::defaultRegion)
|
||||
{
|
||||
Info<< "Operating on region " << regionNames[0] << nl << endl;
|
||||
}
|
||||
|
||||
|
||||
scalar mergeTol = defaultMergeTol;
|
||||
args.optionReadIfPresent("mergeTol", mergeTol);
|
||||
@ -596,6 +601,14 @@ int main(int argc, char *argv[])
|
||||
databases[proci].setTime(timeDirs[timeI], timeI);
|
||||
}
|
||||
|
||||
forAll(regionNames, regioni)
|
||||
{
|
||||
const word& regionName = regionNames[regioni];
|
||||
const word regionDir =
|
||||
regionName == polyMesh::defaultRegion
|
||||
? word::null
|
||||
: regionName;
|
||||
|
||||
IOobject facesIO
|
||||
(
|
||||
"faces",
|
||||
@ -708,7 +721,11 @@ int main(int argc, char *argv[])
|
||||
renumber(map().addedCellMap(), cellProcAddressing[proci]);
|
||||
renumber(map().addedFaceMap(), faceProcAddressing[proci]);
|
||||
renumber(map().addedPointMap(), pointProcAddressing[proci]);
|
||||
renumber(map().addedPatchMap(), boundaryProcAddressing[proci]);
|
||||
renumber
|
||||
(
|
||||
map().addedPatchMap(),
|
||||
boundaryProcAddressing[proci]
|
||||
);
|
||||
}
|
||||
for (label step=2; step<nProcs*2; step*=2)
|
||||
{
|
||||
@ -720,7 +737,8 @@ int main(int argc, char *argv[])
|
||||
continue;
|
||||
}
|
||||
|
||||
Info<< "Merging mesh " << proci << " with " << next << endl;
|
||||
Info<< "Merging mesh " << proci << " with " << next
|
||||
<< endl;
|
||||
|
||||
// Find geometrically shared points/faces.
|
||||
autoPtr<faceCoupleInfo> couples = determineCoupledFaces
|
||||
@ -819,7 +837,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
// See if any points on the mastermesh have become connected
|
||||
// because of connections through processor meshes.
|
||||
mergeSharedPoints(mergeDist, masterMesh[0], pointProcAddressing);
|
||||
mergeSharedPoints
|
||||
(
|
||||
mergeDist,
|
||||
masterMesh[0],
|
||||
pointProcAddressing
|
||||
);
|
||||
|
||||
// Save some properties on the reconstructed mesh
|
||||
masterInternalFaces = masterMesh[0].nInternalFaces();
|
||||
@ -929,8 +952,8 @@ int main(int argc, char *argv[])
|
||||
&& masterFacei < masterInternalFaces
|
||||
)
|
||||
{
|
||||
// proc face is now external but used to be internal face.
|
||||
// Check if we have owner or neighbour.
|
||||
// proc face is now external but used to be internal
|
||||
// face. Check if we have owner or neighbour.
|
||||
|
||||
label procOwn = procMesh.faceOwner()[procFacei];
|
||||
label masterOwn = masterOwner[masterFacei];
|
||||
@ -1008,6 +1031,7 @@ int main(int argc, char *argv[])
|
||||
Info<< endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Info<< "End.\n" << endl;
|
||||
|
||||
@ -6,6 +6,8 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
cleanCase
|
||||
rm -rf \
|
||||
0/cellToRegion \
|
||||
0/*/cellToRegion \
|
||||
constant/*/polyMesh \
|
||||
constant/extendedFeatureEdgeMesh \
|
||||
constant/triSurface/*.eMesh
|
||||
|
||||
@ -7,17 +7,13 @@ cd ${0%/*} || exit 1 # Run from this directory
|
||||
# Meshing
|
||||
runApplication blockMesh
|
||||
runApplication topoSet
|
||||
runApplication decomposePar -copyZero
|
||||
runParallel splitMeshRegions -cellZones -overwrite
|
||||
runApplication splitMeshRegions -cellZones -overwrite
|
||||
runApplication decomposePar -copyZero -allRegions
|
||||
|
||||
# Simulation
|
||||
runParallel $(getApplication)
|
||||
|
||||
# Reconstruct
|
||||
for region in bottomWater topAir heater leftSolid rightSolid
|
||||
do
|
||||
runApplication -s $region reconstructParMesh -constant -region $region
|
||||
done
|
||||
runApplication reconstructPar -allRegions
|
||||
|
||||
# Post-process
|
||||
|
||||
@ -15,10 +15,7 @@ runParallel splitMeshRegions -cellZones -overwrite
|
||||
runParallel $(getApplication)
|
||||
|
||||
# Reconstruct
|
||||
for region in bottomAir topAir heater leftSolid rightSolid
|
||||
do
|
||||
runApplication -s $region reconstructParMesh -constant -region $region
|
||||
done
|
||||
runApplication reconstructParMesh -constant -allRegions
|
||||
runApplication reconstructPar -allRegions
|
||||
|
||||
# Post-process
|
||||
|
||||
Reference in New Issue
Block a user