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"
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)
Add boundary patches.
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
virtual const pointField & points() const
Return raw points.
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
Write mesh using IO settings from time.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
static word defaultRegion
Return the default region name.
static constexpr const zero Zero
Global zero (0)
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)
Add extra notes for the usage information.
const functionObjectList & functionObjects() const
Return the list of function objects.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
A HashTable to objects of type <T> with a label key.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
static word controlDictName
The default control dictionary name (normally "controlDict")
const fileName & rootPath() const
Return root path.
#define forAll(list, i)
Loop across all elements in list.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
Does polyTopoChanges to remove edges. Can remove faces due to edge collapse but can not remove cells ...
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
void off()
Switch the function objects off.
messageStream Info
Information stream (uses stdout - output is on the master only)
A patch is a list of labels that address the faces in the global face list.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
scalar minDim() const
Smallest length/height/width dimension.
static autoPtr< extrudeModel > New(const dictionary &dict)
Select null constructed.
wordList patchNames(nPatches)
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
const boundBox & bounds() const
Return mesh bounding box.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Convert a primitivePatch into a 2D polyMesh.
static void removeFiles(const polyMesh &mesh)
Helper: remove all procAddressing files from mesh instance.
const dimensionedScalar e
Elementary charge.
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....
const fileName & caseName() const
Return case name (parallel run) or global case (serial run)
label collapseEdge(triSurface &surf, const scalar minLen)
Keep collapsing all edges < 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 &)
Helper: remove all sets files from mesh instance.
void setInstance(const fileName &instance, const IOobject::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
bool found(const word &optName) const
Return true if the named option is found.