73 const bool flipFaceFlux,
74 const label newPatchi,
81 if (!modifiedFace[facei])
99 modifiedFace[facei] = 1;
130 const Type& exposedValue,
131 const word GeomVolType,
141 if (iter()->headerClassName() == GeomVolType)
143 const word fieldName = iter()->name();
145 Info<<
"Subsetting field " << fieldName <<
endl;
159 subFields[i++].boundaryFieldRef()[
patchi];
161 label newStart =
fld.patch().patch().start();
178 ].patch().patch().start();
184 if (oldFacei < oldStart || oldFacei >= oldStart+oldSize)
186 fld[j] = exposedValue;
197 void subsetSurfaceFields
202 const Type& exposedValue,
203 const word GeomSurfType,
213 if (iter()->headerClassName() == GeomSurfType)
215 const word& fieldName = iter.key();
217 Info<<
"Subsetting field " << fieldName <<
endl;
232 subFields[i++].boundaryFieldRef()[
patchi];
234 label newStart =
fld.patch().patch().start();
251 ].patch().patch().start();
257 if (oldFacei < oldStart || oldFacei >= oldStart+oldSize)
259 fld[j] = exposedValue;
271 template<
class GeoField>
272 void initCreatedPatches
276 const typename GeoField::value_type initValue
281 mesh.objectRegistry::lookupClass<GeoField>()
287 iterator fieldIter =
fields.begin();
288 fieldIter !=
fields.end();
292 GeoField& field =
const_cast<GeoField&
>(*fieldIter());
294 typename GeoField::Boundary& fieldBf =
295 field.boundaryFieldRef();
302 fieldBf[
patchi] = initValue;
304 if (fieldBf[
patchi].fixesValue())
306 fieldBf[
patchi] == initValue;
314 void createCoupledBaffles
324 forAll(coupledWantedPatch, facei)
326 if (coupledWantedPatch[facei] != -1)
330 bool zoneFlip =
false;
334 const faceZone& fZone = faceZones[zoneID];
346 coupledWantedPatch[facei],
355 bool zoneFlip =
false;
359 const faceZone& fZone = faceZones[zoneID];
370 coupledWantedPatch[facei],
381 void createCyclicCoupledBaffles
392 forAll(cyclicMasterPatch, facei)
394 if (cyclicMasterPatch[facei] != -1)
399 bool zoneFlip =
false;
403 const faceZone& fZone = faceZones[zoneID];
414 cyclicMasterPatch[facei],
422 forAll(cyclicSlavePatch, facei)
424 if (cyclicSlavePatch[facei] != -1)
430 bool zoneFlip =
false;
434 const faceZone& fZone = faceZones[zoneID];
445 cyclicSlavePatch[facei],
464 Info <<
"faceZone:createBaffle " << faceZones <<
endl;
465 forAll(wantedPatch, facei)
467 if (wantedPatch[facei] != -1)
472 bool zoneFlip =
false;
476 const faceZone& fZone = faceZones[zoneID];
499 bool zoneFlip =
false;
503 const faceZone& fZone = faceZones[zoneID];
537 <<
"Illegal patch " << patchName
538 <<
nl <<
"Valid patches are " <<
patches.names()
550 <<
"Patch " << patchName
551 <<
" should have the same patch index on all processors." <<
nl
552 <<
"On my processor it has index " <<
patchi
553 <<
" ; on some other processor it has index " << newPatch
562 int main(
int argc,
char *argv[])
593 if (!iter().isDict())
597 const word& key = iter().keyword();
603 nameAndType[0] = key;
604 nameAndType[1] = wallName;
605 nameAndType[2] = cyclicName;
606 coupledAndPatches.append(nameAndType);
609 forAll(setsAndPatches, setI)
611 Info<<
"Faces in faceSet " << setsAndPatches[setI][0]
612 <<
" become baffles in patch " << setsAndPatches[setI][1]
616 forAll(coupledAndPatches, setI)
618 Info<<
"Faces in faceSet " << coupledAndPatches[setI][0]
619 <<
" become coupled baffles in patch " << coupledAndPatches[setI][1]
626 Info<<
"Faces that get exposed become boundary faces in patch "
627 << defaultPatch <<
endl;
631 Info<<
"Reading blocked cells from cellSet " << blockedSetName
642 forAll(setsAndPatches, setI)
644 faceSet fSet(mesh, setsAndPatches[setI][0]);
649 setsAndPatches[setI][1]
654 if (wantedPatch[iter.key()] != -1)
657 <<
"Face " << iter.key()
658 <<
" is in faceSet " << setsAndPatches[setI][0]
659 <<
" destined for patch " << setsAndPatches[setI][1]
660 <<
" but also in patch " << wantedPatch[iter.key()]
663 wantedPatch[iter.key()] =
patchi;
672 forAll(coupledAndPatches, setI)
675 const label cyclicId =
676 findPatch(
patches, coupledAndPatches[setI][2]);
678 const label cyclicSlaveId = findPatch
681 refCast<const cyclicFvPatch>
684 ).neighbFvPatch().name()
687 faceSet fSet(mesh, coupledAndPatches[setI][0]);
692 if (coupledWantedPatch[iter.key()] != -1)
695 <<
"Face " << iter.key()
696 <<
" is in faceSet " << coupledAndPatches[setI][0]
697 <<
" destined for patch " << coupledAndPatches[setI][1]
698 <<
" but also in patch " << coupledWantedPatch[iter.key()]
701 coupledWantedPatch[iter.key()] =
patchi;
702 cyclicWantedPatch_half0[iter.key()] = cyclicId;
703 cyclicWantedPatch_half1[iter.key()] = cyclicSlaveId;
721 cellSet blockedCells(mesh, blockedSetName);
724 blockedCells.invert(mesh.
nCells());
743 cyclicWantedPatch_half0,
749 cyclicWantedPatch_half1,
767 || iter()->headerClassName()
809 sphericalTensorNames.size()
877 surfSphericalTensorNames.size()
886 surfSphericalTensorFlds
896 surfSymmTensorNames.size()
926 Info<<
"Writing mesh without blockedCells to time "
927 << runTime.userTimeName() <<
endl;
932 scalarFlds[i].rename(scalarNames[i]);
934 scalarFlds[i].checkIn();
938 vectorFlds[i].rename(vectorNames[i]);
940 vectorFlds[i].checkIn();
942 forAll(sphericalTensorFlds, i)
944 sphericalTensorFlds[i].rename(sphericalTensorNames[i]);
946 sphericalTensorFlds[i].checkIn();
950 symmTensorFlds[i].rename(symmTensorNames[i]);
952 symmTensorFlds[i].checkIn();
956 tensorFlds[i].rename(tensorNames[i]);
958 tensorFlds[i].checkIn();
964 surfScalarFlds[i].rename(surfScalarNames[i]);
966 surfScalarFlds[i].checkIn();
970 surfVectorFlds[i].rename(surfVectorNames[i]);
972 surfVectorFlds[i].checkIn();
974 forAll(surfSphericalTensorFlds, i)
976 surfSphericalTensorFlds[i].rename(surfSphericalTensorNames[i]);
978 surfSphericalTensorFlds[i].checkIn();
980 forAll(surfSymmTensorFlds, i)
982 surfSymmTensorFlds[i].rename(surfSymmTensorNames[i]);
984 surfSymmTensorFlds[i].checkIn();
986 forAll(surfTensorNames, i)
988 surfTensorFlds[i].rename(surfTensorNames[i]);
990 surfTensorFlds[i].checkIn();
1021 cyclicWantedPatch_half0,
1029 cyclicWantedPatch_half1,
1041 createCoupledBaffles
1050 createCyclicCoupledBaffles
1053 cyclicWantedPatch_half0,
1054 cyclicWantedPatch_half1,
1081 initCreatedPatches<volScalarField>
1087 initCreatedPatches<volVectorField>
1093 initCreatedPatches<volSphericalTensorField>
1099 initCreatedPatches<volSymmTensorField>
1105 initCreatedPatches<volTensorField>
1112 initCreatedPatches<surfaceScalarField>
1118 initCreatedPatches<surfaceVectorField>
1124 initCreatedPatches<surfaceSphericalTensorField>
1130 initCreatedPatches<surfaceSymmTensorField>
1136 initCreatedPatches<surfaceTensorField>
1145 if (map().hasMotionPoints())
1150 Info<<
"Writing mesh with split blockedFaces to time "
1151 << runTime.userTimeName() <<
endl;
1165 if (cellRegion.nRegions() > 1)
1168 <<
"Removing blocked faces and cells created "
1169 << cellRegion.nRegions()
1170 <<
" regions that are not connected via a face." <<
nl
1171 <<
" This is not supported in solvers." <<
nl
1172 <<
" Use" <<
nl <<
nl
1173 <<
" splitMeshRegions <root> <case> -largestOnly" <<
nl <<
nl
1174 <<
" to extract a single region of the mesh." <<
nl
1175 <<
" This mesh will be written to a new timedirectory"
1176 <<
" so might have to be moved back to constant/" <<
nl
1179 word startFrom(runTime.controlDict().lookup(
"startFrom"));
1181 if (startFrom !=
"latestTime")
1184 <<
"To run splitMeshRegions please set your"
1185 <<
" startFrom entry to latestTime" <<
endl;
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
static const char *const typeName
A 1D vector of objects of type <T> with a fixed size <Size>.
Generic GeometricField class.
An STL-conforming hash table.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
List of IOobjects with searching and retrieving facilities.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A List with indirect addressing.
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
bool optionFound(const word &opt) const
Return true if the named option is found.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A collection of cell labels.
A list of keyword definitions, which are a keyword followed by any number of values (e....
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
A subset of mesh faces organised as a primitive patch.
const boolList & flipMap() const
Return face flip map.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
A face is a list of labels corresponding to mesh vertices.
Post-processing mesh subset tool. Given the original mesh and the list of selected cells,...
const labelList & faceMap() const
Return face map.
const fvMesh & baseMesh() const
Original mesh.
void setLargeCellSubset(const labelList ®ion, const label currentRegion, const label patchID=-1, const bool syncCouples=true)
Set the subset from all cells with region == currentRegion.
const fvMesh & subMesh() const
Return reference to subset mesh.
const labelList & patchMap() const
Return patch map.
static tmp< VolField< Type > > interpolate(const VolField< Type > &, const fvMesh &sMesh, const labelList &patchMap, const labelList &cellMap, const labelList &faceMap)
Map volume field.
Mesh data needed to do the Finite Volume discretisation.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
virtual bool write(const bool write=true) const
Write mesh using IO settings from time.
virtual void topoChange(const polyTopoChangeMap &map)
Update mesh corresponding to the given map.
virtual void setPoints(const pointField &)
Reset the points.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
A face addition data class. A face can be inflated either from a point or from another face and can e...
const fileName & facesInstance() const
Return the current instance directory for faces.
const meshFaceZones & faceZones() const
Return face zones.
virtual const faceList & faces() const
Return raw faces.
virtual const labelList & faceOwner() const
Return face owner.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const labelList & faceNeighbour() const
Return face neighbour.
Class describing modification of a face.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const labelList & oldPatchSizes() const
Return list of the old patch sizes.
Direct mesh changes based on v1.3 polyTopoChange syntax.
autoPtr< polyTopoChangeMap > changeMesh(polyMesh &mesh, const bool inflate, const bool syncParallel=true, const bool orderCells=false, const bool orderPoints=false)
Inplace changes mesh without change of patches.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
This class separates the mesh into distinct unconnected regions, each of which is then given a label ...
A class for handling words, derived from string.
Foam::tmp< Foam::VolField< Type > > volField(const Foam::fvMeshSubset &, const Foam::VolField< Type > &vf)
Wrapper to get hold of the field or the subsetted field.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
int main(int argc, char *argv[])
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(Cloud< passiveParticle >, particles, iter) { positions[particlei++]=iter().position(mesh);} for(i=0;i< pTraits< point >::nComponents;i++) { forAll(positions, particlei) { gmvFile<< component(positions[particlei], i)<< ' ';} gmvFile<< nl;}}forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const fvPatchList & patches
Info<< "Calculating turbulent flame speed field St\n"<< endl;volScalarField St(IOobject("St", runTime.name(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), flameWrinkling->Xi() *Su);multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
#define WarningInFunction
Report a warning using Foam::Warning.
errorManipArg< error, int > exit(error &err, const int errNo=1)
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Tensor< scalar > tensor
Tensor of scalars.
Ostream & endl(Ostream &os)
Add newline and flush stream.
SymmTensor< scalar > symmTensor
SymmTensor of scalars.
Vector< scalar > vector
A scalar version of the templated Vector.
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
Foam::argList args(argc, argv)