132 using namespace Foam;
152 const word& patchName,
153 const word& patchType,
169 <<
"Already have patch " << patchName
170 <<
" but of type " << newPatches[
patchi]->type()
177 label startFacei = 0;
181 startFacei = pp.
start()+pp.size();
185 patchDict.
set(
"type", patchType);
186 patchDict.
set(
"nFaces", 0);
187 patchDict.
set(
"startFace", startFacei);
205 void deleteEmptyPatches(
fvMesh& mesh)
222 forAll(masterNames, masterI)
236 oldToNew[
patchi] = --notUsedI;
240 oldToNew[
patchi] = usedI++;
251 oldToNew[
patchi] = --notUsedI;
255 oldToNew[
patchi] = usedI++;
264 if (oldToNew[
patchi] == -1)
273 oldToNew[
patchi] = --notUsedI;
277 oldToNew[
patchi] = usedI++;
286 enum class connectivity
295 struct isInternalEqOp
297 void operator()(connectivity&
x,
const connectivity&
y)
const
299 if (
x == connectivity::unset)
304 else if (
y == connectivity::unset)
315 x = connectivity::error;
323 return os << static_cast<label>(
p);
331 p =
static_cast<connectivity
>(l);
350 const label facei = extrudeFaces[i];
351 const label zonei = extrudeFaceZoneIDs[i];
354 zoneConnectivity[zonei],
356 ? connectivity::internal
365 forAll(zoneConnectivity, zonei)
367 switch (zoneConnectivity[zonei])
369 case connectivity::unset:
372 zoneIsInternal[zonei] =
false;
375 zoneIsInternal[zonei] =
false;
377 case connectivity::internal:
378 zoneIsInternal[zonei] =
true;
380 case connectivity::error:
382 <<
"Zone " << zoneNames[zonei]
383 <<
" contains both internal and boundary faces."
389 return zoneIsInternal;
437 const labelList& eFaces = edgeFaces[edgeI];
440 labelList& globalEFaces = globalEdgeFaces[edgeI];
444 globalEFaces[i] = globalFaces.
toGlobal(eFaces[i]);
458 return globalEdgeFaces;
463 label findUncoveredPatchFace
467 const label meshEdgeI
474 extrudeFaceSet.insert(extrudeFaces[i]);
481 label facei = eFaces[i];
488 && !extrudeFaceSet.found(facei)
499 label findUncoveredCyclicPatchFace
503 const label meshEdgeI
510 extrudeFaceSet.insert(extrudeFaces[i]);
517 label facei = eFaces[i];
523 && isA<cyclicPolyPatch>(pbm[
patchi])
524 && !extrudeFaceSet.found(facei)
535 void addCouplingPatches
538 const bool isShellMesh,
541 const word& nbrRegionName,
551 Pout<<
"Adding coupling patches:" <<
nl <<
nl
552 <<
"patchID\tpatch\ttype" <<
nl
553 <<
"-------\t-----\t----"
586 oppositePatchNames.swap(regionOppositePatchNames);
600 patchDict.
add(
"neighbourRegion", nbrRegionName);
605 const word patchNamePrefix =
608 const word nbrPatchNamePrefix =
611 word bottomPatchName;
612 word bottomNbrPatchName;
614 word topNbrPatchName;
616 if (zoneIsInternal[zonei])
619 patchNamePrefix + zoneNames[zonei] +
"_bottom";
621 nbrPatchNamePrefix + zoneNames[zonei] +
"_bottom";
623 patchNamePrefix + zoneNames[zonei] +
"_top";
625 nbrPatchNamePrefix + zoneNames[zonei] +
"_top";
627 else if (!oppositeZoneNames[zonei].empty())
629 bottomPatchName = patchNamePrefix + zoneNames[zonei];
630 bottomNbrPatchName = nbrPatchNamePrefix + zoneNames[zonei];
631 topPatchName = patchNamePrefix + oppositeZoneNames[zonei];
632 topNbrPatchName = nbrPatchNamePrefix + oppositeZoneNames[zonei];
636 bottomPatchName = patchNamePrefix + zoneNames[zonei];
637 bottomNbrPatchName = nbrPatchNamePrefix + zoneNames[zonei];
638 topPatchName = zoneNames[zonei] +
"_top";
646 if (regionPatchNames.size())
648 bottomNbrPatchName = regionPatchNames[zonei];
650 if (oppositePatchNames.size())
652 topPatchName = oppositePatchNames[zonei];
654 if (regionOppositePatchNames.size())
656 topNbrPatchName = regionOppositePatchNames[zonei];
659 const bool bothMapped =
660 zoneIsInternal[zonei] || !oppositeZoneNames[zonei].
empty();
662 const bool bottomMapped = bothMapped || !(intrude && isShellMesh);
663 const bool topMapped = bothMapped || intrude;
665 const bool bottomExtruded = !isShellMesh && intrude;
666 const bool topExtruded = !bottomExtruded;
671 bottomPatchDict = patchDict;
675 !intrude ? bottomNbrPatchName : topNbrPatchName
679 bottomPatchDict.
add(
"isExtrudedRegion", isShellMesh);
683 zoneBottomPatch[zonei] = addPatch
688 : !bottomMapped ? polyPatch::typeName
690 ? mappedWallPolyPatch::typeName
691 : mappedExtrudedWallPolyPatch::typeName,
696 Pout<< zoneBottomPatch[zonei]
697 <<
'\t' << newPatches[zoneBottomPatch[zonei]]->name()
698 <<
'\t' << newPatches[zoneBottomPatch[zonei]]->type()
701 if (!isShellMesh && !bothMapped)
continue;
706 topPatchDict = patchDict;
710 !intrude ? topNbrPatchName : bottomNbrPatchName
714 topPatchDict.
add(
"isExtrudedRegion", isShellMesh);
718 zoneTopPatch[zonei] = addPatch
722 oppositePatchTypes.
size() ? oppositePatchTypes[zonei]
723 : !topMapped ? polyPatch::typeName
725 ? mappedWallPolyPatch::typeName
726 : mappedExtrudedWallPolyPatch::typeName,
731 Pout<< zoneTopPatch[zonei]
732 <<
'\t' << newPatches[zoneTopPatch[zonei]]->name()
733 <<
'\t' << newPatches[zoneTopPatch[zonei]]->type()
737 Pout<<
"Added " << newPatches.
size()-nOldPatches
738 <<
" inter-region patches." <<
nl
761 if (eFaces.
size() == 2)
768 && extrudeEdgeGlobalFaces[edgeI].size() == 2
778 const label facei = findUncoveredPatchFace
782 extrudeEdgeMeshEdges[edgeI]
790 zoneSideNFaces[extrudeFaceZoneIDs[facei]] ++;
799 return zoneSideNFaces;
809 const word& oneDPolyPatchType,
813 Pout<<
"Adding patches for sides on zones:" <<
nl <<
nl
814 <<
"patchID\tpatch" <<
nl <<
"-------\t-----" <<
endl;
818 const label nOldPatches = newPatches.
size();
822 forAll(zoneSideNFaces, zoneI)
826 if (oneDPolyPatchType ==
"empty")
828 patchName =
"oneDEmptyPatch";
829 zoneSidePatches[zoneI] = addPatch
833 emptyPolyPatch::typeName,
838 else if (oneDPolyPatchType ==
"wedge")
840 patchName =
"oneDWedgePatch";
841 zoneSidePatches[zoneI] = addPatch
845 wedgePolyPatch::typeName,
853 <<
"Type " << oneDPolyPatchType <<
" does not exist "
857 Pout<< zoneSidePatches[zoneI] <<
'\t' << patchName <<
nl;
862 forAll(zoneSideNFaces, zoneI)
864 if (zoneSideNFaces[zoneI] > 0)
866 word patchName = zoneNames[zoneI] +
"_" +
"side";
868 zoneSidePatches[zoneI] = addPatch
877 Pout<< zoneSidePatches[zoneI] <<
'\t' << patchName <<
nl;
882 Pout<<
"Added " << newPatches.
size() - nOldPatches <<
" zone-side patches."
885 return zoneSidePatches;
910 forAll(extrudeEdgeGlobalFaces, edgeI)
912 const labelList& eFaces = extrudeEdgeGlobalFaces[edgeI];
917 label proci = procID[eFaces[i]];
918 minProcID[edgeI] =
min(minProcID[edgeI], proci);
919 maxProcID[edgeI] =
max(maxProcID[edgeI], proci);
926 extrudeEdgeMeshEdges,
934 extrudeEdgeMeshEdges,
940 Pout<<
"Adding processor or cyclic patches:" <<
nl <<
nl
941 <<
"patchID\tpatch" <<
nl <<
"-------\t-----" <<
endl;
943 const label nOldPatches = newPatches.
size();
953 && extrudeEdgeGlobalFaces[edgeI].size() == 2
957 label nbrProci = minProcID[edgeI];
960 nbrProci = maxProcID[edgeI];
968 const label facei = findUncoveredCyclicPatchFace
972 extrudeEdgeMeshEdges[edgeI]
979 const label newPatchi = findPatchID
985 extrudeEdgeSidePatches[edgeI] = newPatchi;
990 <<
"Unable to determine coupled patch addressing"
1000 extrudeEdgeSidePatches[edgeI] = findPatchID(newPatches,
name);
1002 if (extrudeEdgeSidePatches[edgeI] == -1)
1006 patchDict.
add(
"neighbProcNo", nbrProci);
1008 extrudeEdgeSidePatches[edgeI] = addPatch
1012 processorPolyPatch::typeName,
1017 Pout<< extrudeEdgeSidePatches[edgeI] <<
'\t' <<
name <<
nl;
1023 Pout<<
"Added " << newPatches.
size() - nOldPatches
1024 <<
" coupled patches." <<
nl <<
endl;
1026 return extrudeEdgeSidePatches;
1030 int main(
int argc,
char *argv[])
1049 <<
"Patches are not synchronised on all processors."
1050 <<
" Per processor patches " << allNames
1067 <<
"Cannot extrude into same region as mesh." <<
endl
1069 <<
"Shell region : " << shellRegionName
1074 enum class zoneSourceType
1081 static const wordList zoneSourceTypeNames
1088 static const wordList zoneSourcesTypeNames
1099 auto lookupZones = [&](
const zoneSourceType&
type)
1101 const word& keyword = zoneSourcesTypeNames[unsigned(
type)];
1112 "opposite" + keyword.capitalise(),
1117 zoneNames.
size() - oppositeZoneNames.
size(),
1126 lookupZones(zoneSourceType::zone);
1127 lookupZones(zoneSourceType::set);
1128 lookupZones(zoneSourceType::patch);
1133 const unsigned typei = unsigned(zoneSourceTypes[zonei]);
1135 if (oppositeZoneNames[zonei].empty())
1137 Info<<
indent <<
"From " << zoneSourceTypeNames[typei] <<
" \""
1138 << zoneNames[zonei] <<
"\"" <<
nl;
1142 Info<<
indent <<
"Between " << zoneSourcesTypeNames[typei] <<
" \""
1143 << zoneNames[zonei] <<
"\" and \"" << oppositeZoneNames[zonei]
1151 Switch oneDNonManifoldEdges(
false);
1152 word oneDPatchType(emptyPolyPatch::typeName);
1156 dict.
lookup(
"oneDPolyPatchType") >> oneDPatchType;
1161 if (oneDNonManifoldEdges)
1163 Info<<
"Extruding as 1D columns with sides in patch type "
1165 <<
" and connected points (except on non-manifold areas)."
1170 Info<<
"Extruding as 1D columns with sides in patch type "
1172 <<
" and duplicated points (overlapping volumes)."
1189 meshInstance = runTime.name();
1195 Info<<
"Writing meshes to " << meshInstance <<
nl <<
endl;
1203 if (zoneSourceTypes[zonei] != zoneSourceType::zone)
continue;
1205 zoneMeshZoneID[zonei] =
1208 if (zoneMeshZoneID[zonei] == -1)
1211 <<
"Cannot find zone " << zoneNames[zonei]
1216 if (!oppositeZoneNames[zonei].empty())
1218 oppositeZoneMeshZoneID[zonei] =
1221 if (oppositeZoneMeshZoneID[zonei] == -1)
1224 <<
"Cannot find opposite zone " << oppositeZoneNames[zonei]
1233 labelList extrudeFaces, oppositeExtrudeFaces;
1234 labelList extrudeFaceZoneIDs, oppositeExtrudeFaceZoneIDs;
1235 boolList extrudeFaceFlips, oppositeExtrudeFaceFlips;
1242 if (zoneSourceTypes[zonei] == zoneSourceType::set)
1244 zoneSets.set(zonei,
new faceSet(mesh, zoneNames[zonei]));
1245 if (!oppositeZoneNames.
empty())
1247 oppositeZoneSets.set
1250 new faceSet(mesh, oppositeZoneNames[zonei])
1262 switch (zoneSourceTypes[zonei])
1264 case zoneSourceType::zone:
1267 mesh.
faceZones()[zoneMeshZoneID[zonei]];
1272 if (!oppositeZoneNames[zonei].empty())
1275 mesh.
faceZones()[oppositeZoneMeshZoneID[zonei]];
1279 <<
"Opposite zone " << oppositeZoneNames[zonei]
1280 <<
"is a different size from it's "
1281 <<
"corresponding zone " << zoneNames[zonei]
1284 oppositeFacesDyn.
append(sfz);
1296 case zoneSourceType::set:
1298 const faceSet& fs = zoneSets[zonei];
1303 if (!oppositeZoneNames[zonei].empty())
1305 const faceSet& sfs = oppositeZoneSets[zonei];
1309 <<
"Opposite set " << oppositeZoneNames[zonei]
1310 <<
"is a different size from it's "
1311 <<
"corresponding zone " << zoneNames[zonei]
1326 case zoneSourceType::patch:
1334 if (!oppositeZoneNames[zonei].empty())
1338 if (spp.size() != pp.size())
1341 <<
"Opposite patch " << oppositeZoneNames[zonei]
1342 <<
"is a different size from it's "
1343 <<
"corresponding zone " << zoneNames[zonei]
1366 extrudeFaceZoneIDs.
transfer(zoneIDsDyn);
1367 extrudeFaceFlips.
transfer(flipsDyn);
1368 oppositeExtrudeFaces.
transfer(oppositeFacesDyn);
1369 oppositeExtrudeFaceZoneIDs.
transfer(oppositeZoneIDsDyn);
1370 oppositeExtrudeFaceFlips.
transfer(oppositeFlipsDyn);
1375 forAll(extrudeFaceList, facei)
1377 if (intrude != extrudeFaceFlips[facei])
1379 extrudeFaceList[facei].flip();
1393 calcZoneIsInternal(mesh, zoneNames, extrudeFaces, extrudeFaceZoneIDs)
1397 Info<<
"extrudePatch :"
1417 const globalIndex globalExtrudeFaces(extrudePatch.size());
1427 extrudeEdgeMeshEdges
1434 extrudeEdgeGlobalFaces,
1446 regionPatches.append
1451 regionPatches.
size(),
1464 labelList zoneTopPatch, zoneBottomPatch;
1512 interMeshBottomPatch
1543 labelList extrudeFaceTopPatchID(extrudePatch.size());
1544 labelList extrudeFaceBottomPatchID(extrudePatch.size());
1545 forAll(extrudeFaceZoneIDs, facei)
1547 extrudeFaceTopPatchID[facei] =
1548 zoneTopPatch[extrudeFaceZoneIDs[facei]];
1549 extrudeFaceBottomPatchID[facei] =
1550 zoneBottomPatch[extrudeFaceZoneIDs[facei]];
1564 extrudeEdgeMeshEdges,
1565 extrudeEdgeGlobalFaces
1588 addExtrudeEdgeSidePatches
1593 extrudeEdgeMeshEdges,
1594 extrudeEdgeFacesMap,
1595 extrudeEdgeGlobalFaces,
1615 labelList& ePatches = extrudeEdgePatches[edgeI];
1623 zoneSidePatches[extrudeFaceZoneIDs[eFaces[i]]];
1626 if (oneDNonManifoldEdges)
1628 if (eFaces.
size() != 2)
1630 nonManifoldEdge[edgeI] =
true;
1635 nonManifoldEdge[edgeI] =
true;
1638 else if (eFaces.
size() == 2)
1642 else if (extrudeEdgeSidePatches[edgeI] != -1)
1648 ePatches[i] = extrudeEdgeSidePatches[edgeI];
1654 const label facei = findUncoveredPatchFace
1658 extrudeEdgeMeshEdges[edgeI]
1663 const label newPatchi =
1680 zoneSidePatches[extrudeFaceZoneIDs[eFaces[i]]];
1684 nonManifoldEdge[edgeI] =
true;
1711 forAll(pointLocalRegions, facei)
1714 const face& pRegions = pointLocalRegions[facei];
1717 localRegionPoints[pRegions[fp]] =
f[fp];
1726 forAll(pointLocalRegions, facei)
1728 const face& pRegions = pointLocalRegions[facei];
1731 const label localRegionI = pRegions[fp];
1736 localSum[localRegionI] +=
1739 extrudePatch.
points()[extrudePatch[facei][fp]]
1751 forAll(localSum, localRegionI)
1753 label globalRegionI = localToGlobalRegion[localRegionI];
1754 globalSum.insert(globalRegionI, localSum[localRegionI]);
1761 forAll(localToGlobalRegion, localRegionI)
1763 label globalRegionI = localToGlobalRegion[localRegionI];
1764 localRegionNormals[localRegionI] = globalSum[globalRegionI];
1766 localRegionNormals /=
mag(localRegionNormals) ;
1772 forAll(firstDisp, regionI)
1778 localRegionPoints[regionI]
1781 const vector&
n = localRegionNormals[regionI];
1782 firstDisp[regionI] = model()(regionPt,
n, 1) - regionPt;
1811 regionPatches[
patchi] = ppPtr->
clone(regionMesh.boundaryMesh()).ptr();
1815 regionMesh.removeFvBoundary();
1816 regionMesh.addFvPatches(regionPatches,
true);
1829 extruder.setRefinement
1832 model().expansionRatio(),
1834 extrudeFaceTopPatchID,
1835 extrudeFaceBottomPatchID,
1846 forAll(localRegionPoints, regioni)
1848 const label pointi = localRegionPoints[regioni];
1850 const vector&
n = localRegionNormals[regioni];
1852 for (
label layeri = 1; layeri <= model().nLayers(); layeri++)
1854 newPoints[meshPointi++] = model()(pt,
n, layeri);
1858 meshMod.changeMesh(regionMesh,
false);
1862 regionMesh.setInstance(meshInstance);
1865 deleteEmptyPatches(regionMesh);
1868 Info<<
"Writing mesh " << regionMesh.name() <<
" to "
1869 << regionMesh.facesInstance() <<
nl <<
endl;
1883 forAll(extrudeFaces, facei)
1885 const label meshFacei = extrudeFaces[facei];
1886 const label zonei = extrudeFaceZoneIDs[facei];
1887 const bool flip = extrudeFaceFlips[facei];
1899 interMeshBottomPatch[zonei],
1900 zoneMeshZoneID[zonei],
1913 interMeshBottomPatch[zonei],
1914 zoneMeshZoneID[zonei],
1920 forAll(extrudeFaces, facei)
1922 if (oppositeExtrudeFaces[facei] != -1)
1924 const label meshFacei = oppositeExtrudeFaces[facei];
1925 const label zonei = oppositeExtrudeFaceZoneIDs[facei];
1926 const bool flip = oppositeExtrudeFaceFlips[facei];
1938 interMeshTopPatch[zonei],
1939 zoneMeshZoneID[zonei],
1952 interMeshTopPatch[zonei],
1953 zoneMeshZoneID[zonei],
1960 const label meshFacei = extrudeFaces[facei];
1961 const label zonei = extrudeFaceZoneIDs[facei];
1962 const bool flip = extrudeFaceFlips[facei];
1978 interMeshTopPatch[zonei],
1995 interMeshTopPatch[zonei],
2004 addBafflesMap = meshMod.changeMesh(mesh,
false);
2010 if (addBafflesMap().hasMotionPoints())
2012 mesh.
setPoints(addBafflesMap().preMotionPoints());
2018 deleteEmptyPatches(mesh);
2020 Info<<
"Writing mesh " << mesh.
name() <<
" to "
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
List< Key > toc() const
Return the table of contents.
label size() const
Return number of elements in table.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
autoPtr< IOobject > clone() const
Clone.
const word & name() const
Return name.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void append(const T &)
Append an element at the end of the list.
void size(const label)
Override size to be inconsistent with allocated storage.
void setSize(const label)
Reset size of List.
A HashTable to objects of type <T> with a label key.
label findZoneID(const word &zoneName) const
Find zone index given a name.
wordList names() const
Return a list of zone names.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual Ostream & write(const char)=0
Write character.
A list of faces which address into the list of points.
label nEdges() const
Return number of edges in patch.
label nPoints() const
Return number of points supporting patch faces.
labelList meshEdges(const edgeList &allEdges, const labelListList &cellEdges, const labelList &faceCells) const
Return labels of patch edges in the global edge list using.
const labelList & meshPoints() const
Return labelList of mesh points in patch. They are constructed.
const Field< PointType > & points() const
Return reference to global points.
const List< FaceType > & localFaces() const
Return patch faces addressing into local point list.
const labelListList & edgeFaces() const
Return edge-face addressing.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
const Field< PointType > & faceNormals() const
Return face normals for patch.
const Field< PointType > & faceCentres() const
Return face centres for patch.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
static void mapCombineScatter(const List< commsStruct > &comms, Container &Values, const int tag, const label comm)
Scatter data. Reverse of combineGather.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
static void mapCombineGather(const List< commsStruct > &comms, Container &Values, const CombineOp &cop, const int tag, const label comm)
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
A List with indirect addressing.
label size() const
Return the number of elements in the list.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
void swap(UList< T > &)
Swap two ULists of the same type in constant time.
T & last()
Return the last element of the list.
static bool master(const label communicator=0)
Am I the master process.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
label size() const
Return the number of elements in the UPtrList.
static void addNote(const string &)
Add extra notes for the usage information.
bool optionFound(const word &opt) const
Return true if the named option is found.
const word & executable() const
Name of executable without the path.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Creates mesh by extruding a patch.
static void calcPointRegions(const globalMeshData &globalData, const primitiveFacePatch &patch, const PackedBoolList &nonManifoldEdge, const bool syncNonCollocated, faceList &pointGlobalRegions, faceList &pointLocalRegions, labelList &localToGlobalRegion)
Helper: calculate point regions. The point region is the.
A list of keyword definitions, which are a keyword followed by any number of values (e....
T lookupOrDefaultBackwardsCompatible(const wordList &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T, trying a list of keywords in sequence.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
void set(entry *)
Assign a new entry, overwrite any existing entry.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Class containing processor-to-processor mapping information.
void distribute(List< T > &fld, const bool dummyTransform=true, const int tag=UPstream::msgType()) const
Distribute data using default commsType.
Class to handle errors and exceptions in a simple, consistent stream-based manner.
static autoPtr< extrudeModel > New(const dictionary &)
Select null constructed.
A subset of mesh faces organised as a primitive patch.
const boolList & flipMap() const
Return face flip map.
A face is a list of labels corresponding to mesh vertices.
Mesh data needed to do the Finite Volume discretisation.
void addFvPatches(const List< polyPatch * > &, const bool validBoundary=true)
Add boundary patches. Constructor helper.
virtual bool write(const bool write=true) const
Write mesh using IO settings from time.
void removeFvBoundary()
Remove boundary patches. Warning: fvPatchFields hold ref to.
const word & name() const
Return reference to name.
virtual void topoChange(const polyTopoChangeMap &map)
Update mesh corresponding to the given map.
void clearOut()
Clear all geometry and addressing.
virtual void setPoints(const pointField &)
Reset the points.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
label toGlobal(const label i) const
From local to global.
label whichPatch(const label faceIndex) const
Return patch index for a given face label.
wordList names() const
Return a list of patch names.
bool checkParallelSync(const bool report=false) const
Check whether all procs have all patches and in same order. Return.
Mesh consisting of general polyhedral cells.
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 globalMeshData & globalData() const
Return parallel info.
const fileName & pointsInstance() const
Return the current instance directory for points.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const labelList & faceNeighbour() const
Return face neighbour.
virtual const pointField & points() const
Return raw points.
void setInstance(const fileName &)
Set the instance for mesh files.
A patch is a list of labels that address the faces in the global face list.
static autoPtr< polyPatch > New(const word &patchType, const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Return a pointer to a new patch created on freestore from.
label start() const
Return start label of this patch in the polyMesh face list.
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
Direct mesh changes based on v1.3 polyTopoChange syntax.
const labelListList & pointEdges() const
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
const labelListList & edgeFaces() const
bool isInternalFace(const label faceIndex) const
Return true if given face label is internal to the mesh.
static word newName(const label myProcNo, const label neighbProcNo)
Return the name of a processorPolyPatch.
A class for handling words, derived from string.
static const word null
An empty word.
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
int main(int argc, char *argv[])
const fvPatchList & patches
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
IOdictionary systemDict(const word &dictName, const argList &args, const objectRegistry &ob, const word ®ionName=polyMesh::defaultRegion)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
errorManip< error > abort(error &err)
vectorField pointField
pointField is a vectorField.
Ostream & incrIndent(Ostream &os)
Increment the indent level.
List< bool > boolList
Bool container classes.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Istream & operator>>(Istream &, directionInfo &)
dimensioned< scalar > mag(const dimensioned< Type > &)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
prefixOSstream Pout(cout, "Pout")
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
static const label labelMax
labelList identityMap(const label len)
Create identity map (map[i] == i) of given length.
Ostream & operator<<(Ostream &, const ensightPart &)
Ostream & indent(Ostream &os)
Indent stream.
static const label labelMin
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
wordList patchTypes(nPatches)
wordList patchNames(nPatches)
faceListList boundary(nPatches)
Foam::argList args(argc, argv)