37 std::string outputMeshFile)
38 : rocpackFile(
std::move(rocpackFile)),
39 outputMeshFile(
std::move(outputMeshFile)) {}
42 jsoncons::optional<Periodic3DOpts> periodic3DOpts)
43 : periodic3DOpts(
std::move(periodic3DOpts)) {}
56 this->
files_ = std::move(files);
69 std::cerr <<
"Valid choices for 3D meshing algorithm are " 70 <<
" 1 (Delunay), 4 (Frontal), 7 (MMG3D), 9 (R-Tree), 10 (HXT)" 74 if (!(periodic3DOpts.elemOrder == 1 || periodic3DOpts.elemOrder == 2)) {
75 std::cerr <<
"Only element orders 1 and 2 are supported!" << std::endl;
85 <<
"Valid choices for 2D meshing algorithm are " 86 <<
" 1 (MeshAdapt), 2 (Automatic), 5 (Delunay), " 87 <<
" 6 (Frontal Delunay), 7 (BAMG), 8 (Frontal Delunay for Quads)" 88 <<
" 9 (Packing of Parallelograms)." << std::endl;
92 this->
opts_ = std::move(opts);
100 this->files_.outputMeshFile);
104 objrocPck->applyFilter(this->opts_.upperThreshold.value_or(0.),
112 objrocPck->assignRefinement(this->opts_.refineLevel.value());
117 objrocPck->shrinkVolumes(this->opts_.scaleValue.value());
120 objrocPck->setMeshSize(this->opts_.meshSize.value());
127 if (periodic3D.customDomain && periodic3D.setPeriodicGeo) {
129 <<
"WARNING!! -> Cannot make geometry periodic using custom bounds." 130 <<
" using remove geometries on boundary option instead for meshing!" 133 objrocPck->translateAll(periodic3D.transferMesh[0],
134 periodic3D.transferMesh[1],
135 periodic3D.transferMesh[2]);
137 objrocPck->setElementOrder(periodic3D.elemOrder);
139 if (periodic3D.createCohesive) {
140 objrocPck->sanityCheckOn();
141 objrocPck->enableCohesiveElements();
144 switch (periodic3D.physGrpOptions) {
147 case PhysGrpOpts::PER_SHAPE:
148 objrocPck->enablePhysicalGroupsPerShape();
153 if (periodic3D.enablePatches) objrocPck->enableSurfacePatches();
155 if (periodic3D.setPeriodicGeo) objrocPck->setPeriodicGeometry();
157 if (periodic3D.customDomain) {
158 const auto &customDomain = periodic3D.customDomain.value();
159 objrocPck->setCustomDomain(
160 {customDomain.initial[0], customDomain.initial[1],
161 customDomain.initial[2], customDomain.length[0],
162 customDomain.length[1], customDomain.length[2]});
163 objrocPck->removeBoundaryVolumes();
164 objrocPck->setPeriodicMesh();
165 objrocPck->rocPack2Periodic3D();
167 objrocPck->setPeriodicGeometry();
168 objrocPck->setPeriodicMesh();
169 objrocPck->rocPack2Periodic3D();
173 objrocPck->rocPack2Surf();
176 if (objrocPck)
delete objrocPck;
bool enableDefaultOut
Enable default output formats.
jsoncons::optional< Periodic3DOpts > periodic3DOpts
If periodic3D has value, then options for the 3D mesh.
const Files & getFiles() const
void setFiles(Files files)
This class converts Rockpack output file into periodic geometry and writes into STL, VTK, .MSH, and ExodusII file format.
void execute() const override
Run the workflow represented by the driver.
jsoncons::optional< double > upperThreshold
Upper threshold for filtering (w.r.t mean)
jsoncons::optional< int > refineLevel
Refinement applied to original mesh.
int meshAlgorithm
Meshing algorithm of choice.
jsoncons::optional< double > scaleValue
Value of scaling between 0 to 1 with 1 being no scaling.
jsoncons::optional< double > lowerThreshold
Lower threshold for filtering (w.r.t mean)
const Opts & getOpts() const
jsoncons::optional< double > meshSize
Mesh size.
bool preserveSize
Boolean for preserving pack sizes instead of packing fraction.
bool removeBoundaryPacks
Boolean for removal of volumes intersecting boundary.