114 int main(
int argc,
char *argv[])
132 const ExtrudeMode surfaceFormat = ExtrudeModeNames[
args[1]];
135 Info<<
"Extruding from " << ExtrudeModeNames[surfaceFormat]
136 <<
" at time " << runTimeExtruded.name() <<
endl;
143 runTimeExtruded.system(),
162 if (surfaceFormat == MESHEDSURFACE)
168 labelList patchSizes(1, fMesh().nEdges() - fMesh().nInternalEdges());
170 const edgeList& edges = fMesh().edges();
173 if (!fMesh().isInternalEdge(edgeI))
175 edgeRegionMap.
insert(edges[edgeI], 0);
187 poly2DMesh.createMesh();
196 runTimeExtruded.constant(),
202 move(poly2DMesh.points()),
203 move(poly2DMesh.faces()),
204 move(poly2DMesh.owner()),
205 move(poly2DMesh.neighbour())
209 Info<<
"Constructing patches." <<
endl;
216 poly2DMesh.patchNames()[
patchi],
217 poly2DMesh.patchSizes()[
patchi],
218 poly2DMesh.patchStarts()[
patchi],
220 mesh().boundaryMesh(),
227 else if (surfaceFormat == POLYMESH2D)
236 runTimeExtruded.name(),
247 extruder.addFrontBackPatches();
251 extruder.setRefinement(meshMod());
256 mesh().topoChange(map);
261 const edgeList& edges = mesh().edges();
264 const boundBox& bb = mesh().bounds();
265 const scalar mergeDim = 1
e-4 * bb.
minDim();
272 const edge&
e = edges[edgeI];
278 Info<<
"Merging edge " <<
e <<
" since length " << d
279 <<
" << " << mergeDim <<
nl;
282 collapsePointToLocation.set(
e[1],
points[
e[0]]);
290 collapser.consistentCollapse
294 collapsePointToLocation,
301 collapser.setRefinement(allPointInfo, meshModCollapse);
305 = meshModCollapse.changeMesh(mesh(),
false);
307 mesh().topoChange(map);
316 mesh().setInstance(
"constant");
320 Info<<
"\nWriting extruded mesh to time = " << runTimeExtruded.name()
#define forAll(list, i)
Loop across all elements in list.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A HashTable to objects of type <T> with a label key.
Initialise the NamedEnum HashTable from the static list of names.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static word controlDictName
The default control dictionary name (normally "controlDict")
const fileName & caseName() const
Return case name (parallel run) or global case (serial run)
bool optionFound(const word &opt) const
Return true if the named option is found.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
const fileName & rootPath() const
Return root path.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
void set(T *)
Set pointer to that given.
A bounding box defined in terms of the points at its extremities.
scalar minDim() const
Smallest length/height/width dimension.
Does polyTopoChanges to remove edges. Can remove faces due to edge collapse but can not remove cells ...
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Given a 2D mesh insert all the topology changes to extrude. Does not work in parallel.
static autoPtr< extrudeModel > New(const dictionary &)
Select null constructed.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Calculates points shared by more than two processor patches or cyclic patches.
Convert a primitivePatch into a 2D polyMesh.
Mesh consisting of general polyhedral cells.
static word defaultRegion
Return the default region name.
A patch is a list of labels that address the faces in the global face list.
Direct mesh changes based on v1.3 polyTopoChange syntax.
label collapseEdge(triSurface &surf, const scalar minLen)
Keep collapsing all edges < minLen.
int main(int argc, char *argv[])
const fvPatchList & patches
Ostream & endl(Ostream &os)
Add newline and flush stream.
wordList patchNames(nPatches)
Foam::argList args(argc, argv)