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()
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
static void addNote(const string ¬e)
Add extra notes for the usage information.
static void removeFiles(const polyMesh &mesh)
Helper: remove all procAddressing files from mesh instance.
void off()
Switch the function objects off.
constexpr char nl
The newline '\n' character (0x0a)
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
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.
A bounding box defined in terms of min/max extrema points.
Ignore writing from objectRegistry::writeObject()
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.
#define forAll(list, i)
Loop across all elements in list.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
static void removeFiles(const polyMesh &)
Helper: remove all sets files from mesh instance.
const dimensionedScalar e
Elementary charge.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh corresponding to the given map.
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
static word defaultRegion
Return the default region name.
wordList patchNames(nPatches)
static word controlDictName
The default control dictionary name (normally "controlDict")
const fileName & caseName() const noexcept
Return case name (parallel run) or global case (serial run)
virtual bool write(const bool writeOnProc=true) const
Write mesh using IO settings from time.
Convert a primitivePatch into a 2D polyMesh.
const fileName & rootPath() const noexcept
Return root path.
static autoPtr< extrudeModel > New(const dictionary &dict)
Select null constructed.
const edgeList & edges() const
Return mesh edges. Uses calcEdges.
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.
void setInstance(const fileName &instance, const IOobjectOption::writeOption wOpt=IOobject::AUTO_WRITE)
Set the instance for mesh files.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
const functionObjectList & functionObjects() const
Return the list of function objects.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Direct mesh changes based on v1.3 polyTopoChange syntax.
const polyBoundaryMesh & patches
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
messageStream Info
Information stream (stdout output on master, null elsewhere)
const boundBox & bounds() const noexcept
Return mesh bounding box.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
A patch is a list of labels that address the faces in the global face list.
void addPatches(polyPatchList &plist, const bool validBoundary=true)
Add boundary patches.
Foam::argList args(argc, argv)
Defines the attributes of an object for which implicit objectRegistry management is supported...
scalar minDim() const
Smallest length/height/width dimension.
Do not request registration (bool: false)
bool found(const word &optName) const
Return true if the named option is found.
A HashTable to objects of type <T> with a label key.
static constexpr const zero Zero
Global zero (0)