29 #ifndef NEMOSYS_ROCPACK_H_ 30 #define NEMOSYS_ROCPACK_H_ 34 #include "nemosys_export.h" 95 rocPack(
const std::string &fname,
const std::string &outName);
99 ~rocPack() { std::cout <<
"rockPack class destroyed" << std::endl; }
110 void createCohesiveElements(
const std::string &filename,
111 const std::string &outname);
116 void rocPack2Periodic3D();
120 void removeBoundaryVolumes();
124 void setPeriodicGeometry();
128 void setPeriodicMesh();
134 void shrinkVolumes(
const double percntg);
139 void smoothSurfaces(
const int smoothingParam);
144 void setMeshSize(
const double size);
148 void enablePhysicalGrps();
152 void enableTwoPhysGrps();
156 void enableDefOuts();
160 void enableSurfacePatches();
164 void enablePhysicalGroupsPerShape();
171 void translateAll(
const double &X,
const double &Y,
const double &Z);
175 void setCustomDomain(
const std::vector<double> &domainBounds);
179 void setMeshingAlgorithm(
const int &mshAlg);
184 void sanityCheckOn();
188 void setNodeLocations(
const int &
x,
const int &
y,
const int &
z);
192 void setRandomSurface(
const int &surf);
196 void enableCohesiveElements();
202 bool getTestResult();
207 void assignRefinement(
const int &refineLvl);
213 void applyFilter(
const double &upperThreshold,
const double &lowerThreshold);
217 void setSizePreservation();
221 void setElementOrder(
const int &order);
242 void geomToVolFrac();
250 std::string findWord(
const std::string &word);
259 std::vector<std::string> getShapeData(
const int &iter,
const std::string &a,
260 const std::vector<std::string> &L);
271 void makePeriodic(
const bool rmbPacks);
275 void normalizeVerts();
279 void scaleVols(
const int &vol,
const int &index);
283 void performSmoothing();
288 void geomToSTL(
const std::string &writeFile);
293 void geomToVTK(
const std::string &writeFile);
298 void geomToMsh(
const std::string &writeFile);
303 void modifyInpMesh(
const std::string &modifyFile);
325 std::vector<double> rotateByQuaternion(
const rocQuaternion &q,
326 const std::vector<double> &v);
331 void tagBoundaryPacks();
339 void mapPeriodicSurfaces(
const std::vector<std::pair<int, int>> &prevTags);
343 void geomToPeriodic3D();
349 std::vector<std::vector<std::pair<int, int>>> getAllPoints(
350 std::vector<std::pair<int, int>>
surfaces);
359 std::vector<std::pair<int, int>> getPeriodicSurfs(
360 const std::vector<std::vector<std::pair<int, int>>> &vertsOneSide,
361 const std::vector<std::vector<std::pair<int, int>>> &vertsOtherSide,
362 const int &indexTranslate,
const double &amountTranslate);
367 void writePeriodicNodes();
376 bool existsOnPeriodicBoundary(
const std::vector<double> &getPt1,
377 const std::vector<double> &getPt2,
378 const std::vector<double> &getPt);
385 void makeSphere(
const int &n);
390 void makeEllipsoid(
const int &n);
395 void makeCylinder(
const int &n);
401 void makeCrystalShape(
const int &n,
const int &index);
405 void createVtkCell(vtkSmartPointer<vtkUnstructuredGrid> dataSet,
406 const int cellType, std::vector<int> &vrtIds);
410 void assignPeriodicEqNodes();
462 std::vector<std::vector<std::vector<double>>>
verts;
466 std::vector<std::vector<std::vector<int>>>
faces;
491 bool ellipsoidPresent =
false;
495 bool enablePeriodicity =
false;
500 bool removeBoundaryPacks =
false;
508 bool periodic3D =
false;
548 bool matchingCoords =
false;
552 bool matchingCoordsX =
false;
556 bool matchingCoordsY =
false;
560 bool matchingCoordsZ =
false;
564 double shrinkScale = 1.0;
568 int smoothingIter = 0;
572 bool enableSmoothing =
false;
576 bool enableScaling =
false;
584 bool enablePhysGrp =
false;
588 bool just2Physgrps =
false;
620 bool assignSidePatches =
false;
636 bool cstmDomain =
false;
640 int randomSurfTest = 0;
644 int meshingAlgorithm = 1;
648 bool defOutputs =
false;
652 bool physGrpPerShape =
false;
709 std::vector<int> eqRefNodes = std::vector<int>(4);
713 bool internalCohesiveBool =
false;
740 double globalScaling = 1;
748 double filterAbove = 0.0;
752 double filterBelow = 0.0;
756 bool filterOn =
false;
764 bool enableSizePreserve =
false;
768 int elementOrder = 1;
775 #endif // NEMOSYS_ROCPACK_H_
std::vector< std::vector< double > > rotateParams
Vector of rotate coordinates for all packs.
std::vector< int > MasterZ
Master periodic surfaces in Z direction.
double Zdim
Z dimension of box geometry.
std::vector< std::vector< std::vector< double > > > verts
Vector of crystal shape vertices.
double Xdim
X dimension of box geometry.
std::vector< std::size_t > surrNodeTags
Stores node tags for surronding physical group.
This class converts Rockpack output file into periodic geometry and writes into STL, VTK, .MSH, and ExodusII file format.
std::string InFile
rocPack output file name
std::string packName
Name of pack shape.
std::vector< int > slaveInterfaceId
Storage vector for identifying which slave nodes are interface nodes.
A struct to respresent quaternion.
std::string OutFile
Output STL/VTK file name.
std::vector< int > slaveY
Surfaces linked to master periodic surface in Y direction.
std::vector< int > ellipsoidPhysicalGroup
Arrays for group per shape.
std::vector< int > slaveX
Surfaces linked to master periodic surface in X direction.
std::vector< double > ellipsoidRad
Vector of Ellipsoid radii.
std::vector< std::vector< double > > translateParams
Vector of translate coordinates for all packs.
std::vector< double > scaleOfPack
Vector of scales for all packs.
std::vector< int > spherePhysicalGroup
Arrays for group per shape.
std::vector< std::vector< std::vector< int > > > faces
Vector of crystal shape faces.
std::vector< std::size_t > geomsNodeTags
Stores node tags for geometries physical group.
std::vector< double > cylParams
Vector of cylinder parameters.
std::vector< int > icosidodecahedronPhysicalGroup
Arrays for group per shape.
std::vector< int > petnPhysicalGroup
Arrays for group per shape.
std::vector< std::string > crystalNames
Vector for storing crystal names.
std::vector< double > boxPt
Vector of box starting coordinates.
std::vector< int > MasterY
Master periodic surfaces in Y direction.
~rocPack()
rocPack standard destructor
std::vector< std::size_t > interfaceNodes
Vector for stroing nodes at conformal interface.
std::vector< int > slaveZ
Surfaces linked to master periodic surface in Z direction.
std::vector< double > surrCoords
Stores node coordinates for surronding physical group.
std::vector< int > geomElementIds
Store cells in surrounding for cohesive elements without physical groups.
std::map< std::string, std::vector< std::pair< vtkIdType, int > > > surfaces
Map from SURFACE name to (element id, side) (id and side both use .inp IDs)
std::map< int, int > storeShapeNames
Map for storing shape names against volume Sphere = 0 Ellipsoid = 1 Cylinder = 2 HMX = 3 PETN = 4 Ico...
std::vector< int > multiGrpIndices
Group indices for multi groups (useful in cohesive elements)
std::vector< int > hmxPhysicalGroup
Arrays for group per shape.
std::vector< int > ptsReplacer
Storage vector for linking interface and duplicate nodes Replaces new duplicated nodes at place of ol...
std::vector< std::string > uniqueNames
Vector for storing shapes.
int surroundingGrp
Tag number.
double Ydim
Y dimension of box geometry.
std::vector< std::string > nameOfPcks
Vector of pack shape names.
std::vector< std::vector< int > > storeMultiPhysGrps
Stores all physical groups in index sized by total volumes.
std::vector< std::pair< int, int > > bndryPackTags
Stores volume index of packs interseting boundary.
std::vector< int > filteredGeoms
Vector for identification of removed geometries.
std::vector< std::string > shapeNames
Vector for storing base shape names.
std::vector< int > MasterX
Master periodic surfaces in X direction.
std::vector< int > cylindersPhysicalGroup
Arrays for group per shape.
std::vector< int > linkMultiPhysGrps
Vector of all volumes for multi-physical groups.
std::vector< int > ptsCohesiveGrp
psudo-physical group vector for cohesive elements material assignment
std::vector< double > geomsCoords
Stores node coordinates for geometries physical group.