24 int64_t nfaces, nvols;
34 check = this->
ProcessNodes(NodeFileName, *gmesh, nnodes);
42 check = this->
ProcessFaces(FaceFileName, *gmesh, nfaces);
50 check = this->
ProcessTetra(TetraFileName, *gmesh, nvols);
61 std::cout << time << std::endl;
68 std::ifstream NodeFile(NodeFileName.c_str());
71 int64_t ID, index, nnodes, dim, nattributes, BoundMarkers, bcmark;
75 NodeFile >> nnodes >> dim >> nattributes >> BoundMarkers;
79 std::cout << __PRETTY_FUNCTION__ <<
" - dim must be equal to 3" << std::endl;
83 for(int64_t i = 0; i < nnodes; i++){
84 NodeFile >> ID >> X >> Y >> Z;
85 if (nattributes) NodeFile >> attr;
86 if (BoundMarkers) NodeFile >> bcmark;
92 gmesh.
NodeVec()[index].Initialize(ID, coord, gmesh);
103 std::ifstream FaceFile(FaceFileName.c_str());
105 int64_t nfaces, BoundMarker, ID, mat;
106 int64_t NO1, NO2, NO3, index;
110 FaceFile >> nfaces >> BoundMarker;
112 numberfaces = nfaces;
114 for(int64_t i = 0; i < nfaces; i++){
115 FaceFile >> ID >> NO1 >> NO2 >> NO3;
116 if (BoundMarker) FaceFile >> mat;
129 std::ifstream TetraFile(TetraFileName.c_str());
130 int64_t nvols, n, mat, nattr, ID, NO1, NO2, NO3, NO4, index;
133 TetraFile >> nvols >> n >> nattr;
137 if (n != 4) std::cout << __PRETTY_FUNCTION__ <<
" - tetrahedra must have only four nodes" << std::endl;
139 for(int64_t i = 0; i < nvols; i++){
140 TetraFile >> ID >> NO1 >> NO2 >> NO3 >> NO4;
141 if (nattr) TetraFile >> mat;
int AllocateNewElement()
Makes more room for new elements.
std::map< int64_t, int64_t > fNodeIndices
Nodes in tetgen are counted from 1 to n as a fortran based code.
virtual TPZGeoEl * CreateGeoElement(MElementType type, TPZVec< int64_t > &cornerindexes, int matid, int64_t &index, int reftype=1)
Generic method for creating a geometric element. Putting this method centrally facilitates the modifi...
Timing class. Absolutely copied from GNU time. Take a look at
std::string & processName(int i)
Gets the process name (for reporting purposes).
void start(int i)
Turns the timer on.
bool ProcessNodes(std::string NodeFileName, TPZGeoMesh &gmesh, int64_t &numbernodes)
Process nodes.
Contains declaration of TPZMesh class which defines a geometrical mesh and contains a corresponding l...
Contains the TPZReadTetGen class which implement the interface between TPZGeoMesh and the files produ...
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
TPZGeoMesh * Process(std::string NodeFileName, std::string FaceFileName, std::string TetraFileName)
Convert tetgen files in a TPZGeoMesh object.
bool ProcessTetra(std::string TetraFileName, TPZGeoMesh &gmesh, int64_t &numbervols)
Process tetrahedras.
void BuildConnectivity()
Build the connectivity of the grid.
Controls several timers at once. Utility.
This class implements a geometric mesh for the pz environment. Geometry.
void stop(int i)
Turns the timer off, and computes the elapsed time.
bool ProcessFaces(std::string FaceFileName, TPZGeoMesh &gmesh, int64_t &numberfaces)
Process faces.