112 int main(
int argc,
char *argv[])
131 const ExtrudeMode surfaceFormat = ExtrudeModeNames[args[1]];
132 const bool overwrite = args.optionFound(
"overwrite");
134 Info<<
"Extruding from " << ExtrudeModeNames[surfaceFormat]
135 <<
" at time " << runTimeExtruded.timeName() <<
endl;
142 runTimeExtruded.system(),
161 if (surfaceFormat == MESHEDSURFACE)
167 labelList patchSizes(1, fMesh().nEdges() - fMesh().nInternalEdges());
169 const edgeList& edges = fMesh().edges();
172 if (!fMesh().isInternalEdge(edgeI))
174 edgeRegionMap.
insert(edges[edgeI], 0);
186 poly2DMesh.createMesh();
195 runTimeExtruded.constant(),
208 Info<<
"Constructing patches." <<
endl;
215 poly2DMesh.patchNames()[
patchi],
216 poly2DMesh.patchSizes()[
patchi],
217 poly2DMesh.patchStarts()[
patchi],
226 else if (surfaceFormat == POLYMESH2D)
235 runTimeExtruded.timeName(),
246 extruder.addFrontBackPatches();
250 extruder.setRefinement(meshMod());
264 const scalar mergeDim = 1e-4 * bb.
minDim();
271 const edge& e = edges[edgeI];
273 scalar d = e.
mag(points);
277 Info<<
"Merging edge " << e <<
" since length " << d
278 <<
" << " << mergeDim <<
nl;
281 collapsePointToLocation.set(e[1], points[e[0]]);
289 collapser.consistentCollapse
293 collapsePointToLocation,
300 collapser.setRefinement(allPointInfo, meshModCollapse);
304 = meshModCollapse.changeMesh(
mesh(),
false);
319 Info<<
"\nWriting extruded mesh to time = " << runTimeExtruded.timeName()
const functionObjectList & functionObjects() const
Return the list of function objects.
#define forAll(list, i)
Loop across all elements in list.
const boundBox & bounds() const
Return mesh bounding box.
void off()
Switch the function objects off.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
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.
scalar minDim() const
Smallest length/height/width dimension.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
virtual const pointField & points() const
Return raw points.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
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)
static word controlDictName
The default control dictionary name (normally "controlDict")
scalar mag(const pointField &) const
Return scalar magnitude.
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.
void addPatches(const List< polyPatch * > &, const bool validBoundary=true)
Add boundary patches.
Calculates points shared by more than two processor patches or cyclic patches.
Given a 2D mesh insert all the topology changes to extrude. Does not work in parallel.
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...
virtual bool write() const
Write mesh using IO settings from time.
A HashTable to objects of type <T> with a label key.