113 int main(
int argc,
char *argv[])
132 const ExtrudeMode surfaceFormat = ExtrudeModeNames[args[1]];
133 const bool overwrite = args.optionFound(
"overwrite");
135 Info<<
"Extruding from " << ExtrudeModeNames[surfaceFormat]
136 <<
" at time " << runTimeExtruded.timeName() <<
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(),
209 Info<<
"Constructing patches." <<
endl;
216 poly2DMesh.patchNames()[
patchi],
217 poly2DMesh.patchSizes()[
patchi],
218 poly2DMesh.patchStarts()[
patchi],
227 else if (surfaceFormat == POLYMESH2D)
236 runTimeExtruded.timeName(),
247 extruder.addFrontBackPatches();
251 extruder.setRefinement(meshMod());
265 const scalar mergeDim = 1e-4 * bb.
minDim();
272 const edge& e = edges[edgeI];
274 scalar d = e.
mag(points);
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);
320 Info<<
"\nWriting extruded mesh to time = " << runTimeExtruded.timeName()
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
#define forAll(list, i)
Loop across all elements in list.
void off()
Switch the function objects off.
virtual bool write(const bool valid=true) const
Write mesh using IO settings from time.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Does polyTopoChanges to remove edges. Can remove faces due to edge collapse but can not remove cells ...
label collapseEdge(triSurface &surf, const scalar minLen)
Keep collapsing all edges < minLen.
static SLList< string > validArgs
A list of valid (mandatory) arguments.
A bounding box defined in terms of the points at its extremities.
Initialise the NamedEnum HashTable from the static list of names.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
virtual const pointField & points() const
Return raw points.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
static autoPtr< extrudeModel > New(const dictionary &)
Select null constructed.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Xfer< T > xferMove(T &)
Construct by transferring the contents of the arg.
wordList patchNames(nPatches)
scalar mag(const pointField &) const
Return scalar magnitude.
static word controlDictName
The default control dictionary name (normally "controlDict")
void addPatches(const List< polyPatch *> &, const bool validBoundary=true)
Add boundary patches.
Convert a primitivePatch into a 2D polyMesh.
void set(T *)
Set pointer to that given.
void setInstance(const fileName &)
Set the instance for mesh files.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
Calculates points shared by more than two processor patches or cyclic patches.
const boundBox & bounds() const
Return mesh bounding box.
Given a 2D mesh insert all the topology changes to extrude. Does not work in parallel.
const functionObjectList & functionObjects() const
Return the list of function objects.
Direct mesh changes based on v1.3 polyTopoChange syntax.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Mesh consisting of general polyhedral cells.
A patch is a list of labels that address the faces in the global face list.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
scalar minDim() const
Smallest length/height/width dimension.
A HashTable to objects of type <T> with a label key.