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];
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];
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()
547 if (newPatch != patchi)
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[])
567 runTime.functionObjects().off();
594 if (!iter().isDict())
598 const word& key = iter().keyword();
601 const word cyclicName = dict.
lookup(
"cyclicMasterPatchName");
602 const word wallName = dict.
lookup(
"wallPatchName");
604 nameAndType[0] = key;
605 nameAndType[1] = wallName;
606 nameAndType[2] = cyclicName;
607 coupledAndPatches.append(nameAndType);
610 forAll(setsAndPatches, setI)
612 Info<<
"Faces in faceSet " << setsAndPatches[setI][0]
613 <<
" become baffles in patch " << setsAndPatches[setI][1]
617 forAll(coupledAndPatches, setI)
619 Info<<
"Faces in faceSet " << coupledAndPatches[setI][0]
620 <<
" become coupled baffles in patch " << coupledAndPatches[setI][1]
625 const word defaultPatch(dict.
lookup(
"defaultPatch"));
627 Info<<
"Faces that get exposed become boundary faces in patch " 628 << defaultPatch <<
endl;
630 const word blockedSetName(dict.
lookup(
"blockedCells"));
632 Info<<
"Reading blocked cells from cellSet " << blockedSetName
643 forAll(setsAndPatches, setI)
645 faceSet fSet(mesh, setsAndPatches[setI][0]);
647 label patchi = findPatch
650 setsAndPatches[setI][1]
655 if (wantedPatch[iter.key()] != -1)
658 <<
"Face " << iter.key()
659 <<
" is in faceSet " << setsAndPatches[setI][0]
660 <<
" destined for patch " << setsAndPatches[setI][1]
661 <<
" but also in patch " << wantedPatch[iter.key()]
664 wantedPatch[iter.key()] =
patchi;
673 forAll(coupledAndPatches, setI)
676 const label cyclicId =
677 findPatch(patches, coupledAndPatches[setI][2]);
679 const label cyclicSlaveId = findPatch
682 refCast<const cyclicFvPatch>
685 ).neighbFvPatch().
name()
688 faceSet fSet(mesh, coupledAndPatches[setI][0]);
689 label patchi = findPatch(patches, coupledAndPatches[setI][1]);
693 if (coupledWantedPatch[iter.key()] != -1)
696 <<
"Face " << iter.key()
697 <<
" is in faceSet " << coupledAndPatches[setI][0]
698 <<
" destined for patch " << coupledAndPatches[setI][1]
699 <<
" but also in patch " << coupledWantedPatch[iter.key()]
702 coupledWantedPatch[iter.key()] =
patchi;
703 cyclicWantedPatch_half0[iter.key()] = cyclicId;
704 cyclicWantedPatch_half1[iter.key()] = cyclicSlaveId;
722 cellSet blockedCells(mesh, blockedSetName);
725 blockedCells.invert(mesh.
nCells());
744 cyclicWantedPatch_half0,
750 cyclicWantedPatch_half1,
768 || iter()->headerClassName()
774 objects.add(*iter());
810 sphericalTensorNames.size()
878 surfSphericalTensorNames.size()
887 surfSphericalTensorFlds
897 surfSymmTensorNames.size()
927 Info<<
"Writing mesh without blockedCells to time " << runTime.value()
933 scalarFlds[i].rename(scalarNames[i]);
938 vectorFlds[i].rename(vectorNames[i]);
941 forAll(sphericalTensorFlds, i)
943 sphericalTensorFlds[i].rename(sphericalTensorNames[i]);
948 symmTensorFlds[i].rename(symmTensorNames[i]);
953 tensorFlds[i].rename(tensorNames[i]);
960 surfScalarFlds[i].rename(surfScalarNames[i]);
965 surfVectorFlds[i].rename(surfVectorNames[i]);
968 forAll(surfSphericalTensorFlds, i)
970 surfSphericalTensorFlds[i].rename(surfSphericalTensorNames[i]);
973 forAll(surfSymmTensorFlds, i)
975 surfSymmTensorFlds[i].rename(surfSymmTensorNames[i]);
978 forAll(surfTensorNames, i)
980 surfTensorFlds[i].rename(surfTensorNames[i]);
1012 cyclicWantedPatch_half0,
1020 cyclicWantedPatch_half1,
1032 createCoupledBaffles
1041 createCyclicCoupledBaffles
1044 cyclicWantedPatch_half0,
1045 cyclicWantedPatch_half1,
1071 initCreatedPatches<volScalarField>
1077 initCreatedPatches<volVectorField>
1083 initCreatedPatches<volSphericalTensorField>
1089 initCreatedPatches<volSymmTensorField>
1095 initCreatedPatches<volTensorField>
1102 initCreatedPatches<surfaceScalarField>
1108 initCreatedPatches<surfaceVectorField>
1114 initCreatedPatches<surfaceSphericalTensorField>
1120 initCreatedPatches<surfaceSymmTensorField>
1126 initCreatedPatches<surfaceTensorField>
1135 if (map().hasMotionPoints())
1140 Info<<
"Writing mesh with split blockedFaces to time " << runTime.value()
1155 if (cellRegion.nRegions() > 1)
1158 <<
"Removing blocked faces and cells created " 1159 << cellRegion.nRegions()
1160 <<
" regions that are not connected via a face." <<
nl 1161 <<
" This is not supported in solvers." <<
nl 1162 <<
" Use" <<
nl <<
nl 1163 <<
" splitMeshRegions <root> <case> -largestOnly" <<
nl <<
nl 1164 <<
" to extract a single region of the mesh." <<
nl 1165 <<
" This mesh will be written to a new timedirectory" 1166 <<
" so might have to be moved back to constant/" <<
nl 1169 word startFrom(runTime.controlDict().lookup(
"startFrom"));
1171 if (startFrom !=
"latestTime")
1174 <<
"To run splitMeshRegions please set your" 1175 <<
" startFrom entry to latestTime" <<
endl;
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
This class separates the mesh into distinct unconnected regions, each of which is then given a label ...
const labelList & patchMap() const
Return patch map.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
List of IOobjects with searching and retrieving facilities.
const faceZoneMesh & faceZones() const
Return face zone mesh.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Class describing modification of a face.
const fileName & facesInstance() const
Return the current instance directory for faces.
A face is a list of labels corresponding to mesh vertices.
A 1D vector of objects of type <T> with a fixed size <Size>.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual const labelList & faceNeighbour() const
Return face neighbour.
static const char *const typeName
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
Foam::tmp< Foam::GeometricField< Type, Foam::fvPatchField, Foam::volMesh > > volField(const Foam::fvMeshSubset &, const Foam::GeometricField< Type, Foam::fvPatchField, Foam::volMesh > &vf)
Wrapper to get hold of the field or the subsetted field.
const boolList & flipMap() const
Return face flip map.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
label findPatchID(const word &patchName) const
Find patch index given a name.
Generic GeometricField class.
label whichFace(const label globalCellID) const
Helper function to re-direct to zone::localID(...)
Vector< scalar > vector
A scalar version of the templated Vector.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A face addition data class. A face can be inflated either from a point or from another face and can e...
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
const labelList & oldPatchSizes() const
Return list of the old patch sizes.
face reverseFace() const
Return face with reverse direction.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
SymmTensor< scalar > symmTensor
SymmTensor of scalars.
A class for handling words, derived from string.
const polyPatch & patch() const
Return the polyPatch.
wordList names() const
Return a list of patch names.
virtual const labelList & faceOwner() const
Return face owner.
const labelList & faceMap() const
Return face map.
virtual const faceList & faces() const
Return raw faces.
An STL-conforming hash table.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
const fvPatch & patch() const
Return patch.
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
Post-processing mesh subset tool. Given the original mesh and the list of selected cells...
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
label whichZone(const label objectIndex) const
Given a global object index, return the zone it is in.
virtual tmp< scalarField > movePoints(const pointField &)
Move points, returns volumes swept by faces in motion.
const fvPatch & patch() const
Return patch.
const fvMesh & subMesh() const
Return reference to subset mesh.
#define WarningInFunction
Report a warning using Foam::Warning.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
A collection of cell labels.
Mesh data needed to do the Finite Volume discretisation.
Direct mesh changes based on v1.3 polyTopoChange syntax.
label start() const
Return start label of this patch in the polyMesh face list.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A subset of mesh faces organised as a primitive patch.
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars.
Foam::argList args(argc, argv)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static tmp< GeometricField< Type, fvPatchField, volMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &, const fvMesh &sMesh, const labelList &patchMap, const labelList &cellMap, const labelList &faceMap)
Map volume field.
A List with indirect addressing.
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Tensor< scalar > tensor
Tensor of scalars.
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 & baseMesh() const
Original mesh.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
label setAction(const topoAction &action)
For compatibility with polyTopoChange: set topological action.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.