Go to the documentation of this file.
68 { ExtrudeMode::POLYMESH2D,
"polyMesh2D" },
69 { ExtrudeMode::MESHEDSURFACE,
"MeshedSurface" },
114 int main(
int argc,
char *argv[])
118 "Create a 3D mesh from a 2D mesh by extruding with specified thickness"
139 runTimeExtruded.functionObjects().off();
141 const ExtrudeMode surfaceFormat = ExtrudeModeNames[
args[1]];
142 const bool overwrite =
args.
found(
"overwrite");
144 Info<<
"Extruding from " << ExtrudeModeNames[surfaceFormat]
145 <<
" at time " << runTimeExtruded.timeName() <<
endl;
152 runTimeExtruded.system(),
171 if (surfaceFormat == MESHEDSURFACE)
177 labelList patchSizes(1, fMesh().nEdges() - fMesh().nInternalEdges());
179 const edgeList& edges = fMesh().edges();
182 if (!fMesh().isInternalEdge(edgeI))
184 edgeRegionMap.
insert(edges[edgeI], 0);
196 poly2DMesh.createMesh();
203 runTimeExtruded.constant(),
209 std::move(poly2DMesh.points()),
210 std::move(poly2DMesh.faces()),
211 std::move(poly2DMesh.owner()),
212 std::move(poly2DMesh.neighbour())
215 Info<<
"Constructing patches." <<
endl;
222 poly2DMesh.patchNames()[patchi],
223 poly2DMesh.patchSizes()[patchi],
224 poly2DMesh.patchStarts()[patchi],
233 else if (surfaceFormat == POLYMESH2D)
240 runTimeExtruded.timeName(),
250 extruder.addFrontBackPatches();
254 extruder.setRefinement(meshMod());
268 const scalar mergeDim = 1
e-4 * bb.
minDim();
275 const edge&
e = edges[edgeI];
281 Info<<
"Merging edge " <<
e <<
" since length " << d
282 <<
" << " << mergeDim <<
nl;
285 collapsePointToLocation.set(
e[1],
points[
e[0]]);
293 collapser.consistentCollapse
297 collapsePointToLocation,
304 collapser.setRefinement(allPointInfo, meshModCollapse);
308 = meshModCollapse.changeMesh(
mesh(),
false);
323 Info<<
"\nWriting extruded mesh to time = " << runTimeExtruded.timeName()
void addPatches(PtrList< polyPatch > &plist, const bool validBoundary=true)
static autoPtr< T > New(Args &&... args)
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
virtual const pointField & points() const
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Calculates points shared by more than two processor patches or cyclic patches.
virtual bool write(const bool valid=true) const
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
static word defaultRegion
static constexpr const zero Zero
const fileName & caseName() const noexcept
Direct mesh changes based on v1.3 polyTopoChange syntax.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
static void addNote(const string ¬e)
bool insert(const Key &key, const T &obj)
A HashTable to objects of type <T> with a label key.
Ostream & endl(Ostream &os)
const edgeList & edges() const
static word controlDictName
static void addArgument(const string &argName, const string &usage="")
Does polyTopoChanges to remove edges. Can remove faces due to edge collapse but can not remove cells ...
static void noFunctionObjects(bool addWithOption=false)
Generic templated field type.
A patch is a list of labels that address the faces in the global face list.
virtual void updateMesh(const mapPolyMesh &mpm)
static autoPtr< extrudeModel > New(const dictionary &dict)
wordList patchNames(nPatches)
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
const boundBox & bounds() const
void reset(autoPtr< T > &&other) noexcept
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Convert a primitivePatch into a 2D polyMesh.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static void removeFiles(const polyMesh &mesh)
const dimensionedScalar e
const polyBoundaryMesh & patches
A bounding box defined in terms of min/max extrema points.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
label collapseEdge(triSurface &surf, const scalar minLen)
Given a 2D mesh insert all the topology changes to extrude. Does not work in parallel.
Foam::argList args(argc, argv)
static void removeFiles(const polyMesh &)
void setInstance(const fileName &instance, const IOobject::writeOption wOpt=IOobject::AUTO_WRITE)
const fileName & rootPath() const noexcept
bool found(const word &optName) const