68 { ExtrudeMode::POLYMESH2D,
"polyMesh2D" },
69 { ExtrudeMode::MESHEDSURFACE,
"MeshedSurface" },
114int main(
int argc,
char *argv[])
118 "Create a 3D mesh from a 2D mesh by extruding with specified thickness"
121 argList::addArgument(
"surfaceFormat");
125 argList::noFunctionObjects();
133 Time::controlDictName,
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)
179 const edgeList& edges = fMesh().edges();
182 if (!fMesh().isInternalEdge(edgeI))
184 edgeRegionMap.
insert(edges[edgeI], 0);
196 poly2DMesh.createMesh();
202 polyMesh::defaultRegion,
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)
239 polyMesh::defaultRegion,
240 runTimeExtruded.timeName(),
250 extruder.addFrontBackPatches();
254 extruder.setRefinement(meshMod());
259 mesh().updateMesh(morphMap());
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);
310 mesh().updateMesh(morphMap());
319 mesh().setInstance(
"constant");
323 Info<<
"\nWriting extruded mesh to time = " << runTimeExtruded.timeName()
327 topoSet::removeFiles(
mesh());
328 processorMeshes::removeFiles(
mesh());
Map from edge (expressed as its endpoints) to value. For easier forward declaration it is currently i...
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
A HashTable to objects of type <T> with a label key.
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
const fileName & rootPath() const noexcept
Return root path.
bool found(const word &optName) const
Return true if the named option is found.
const fileName & caseName() const noexcept
Return case name (parallel run) or global case (serial run)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
void reset(autoPtr< T > &&other) noexcept
Delete managed object and set to new given pointer.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
A bounding box defined in terms of min/max extrema points.
scalar minDim() const
Smallest length/height/width dimension.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
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.
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.
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.
const polyBoundaryMesh & patches
const labelList nEdges(UPstream::listGatherValues< label >(aMesh.nEdges()))
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
constexpr char nl
The newline '\n' character (0x0a)
wordList patchNames(nPatches)
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.