proteus
1.8.1
C/C++/Fortran libraries
|
Go to the documentation of this file.
8 double start,stop,diff;
9 string outfilename,infilename;
10 cout<<
"Testing simple mesh generation"<<endl;
11 cout<<
"Enter nx,ny, and nz"<<endl;
13 cout<<
"Print mesh? (n/filename/cout)"<<endl;
17 start = CurrentTime();
18 if (ny == 1 && nz == 1)
20 cout<<
"Generating Edge Mesh Elements"<<endl;
22 cout<<
"Generating Edge Mesh Nodes"<<endl;
27 cout<<
"Generating Triangular Mesh Elements"<<endl;
29 cout<<
"Generating Triangular Mesh Nodes"<<endl;
34 cout<<
"Generating Tetrahedral Mesh Elements"<<endl;
36 cout<<
"Generating Tetrahedral Mesh Nodes"<<endl;
40 cout<<
"Elapsed time for mesh generation = "<<(stop-start)<<
"s"<<endl;
45 cout<<
"Writing mesh"<<endl;
46 start = CurrentTime();
47 if(outfilename !=
"n")
49 if(outfilename !=
"cout")
51 ofstream outfile(outfilename.c_str());
62 cout<<
"Elapsed time for writing mesh = "<<(stop-start)<<
"s"<<endl;
65 cout<<
"Testing readElements"<<endl;
66 cout<<
"Enter mesh filename"<<endl;
68 cout<<
"Reading mesh from "<<infilename<<endl;
69 start = CurrentTime();
70 ifstream infile(infilename.c_str());
73 cout<<
"Elapsed time for reading mesh = "<<(stop-start)<<
"s"<<endl;
76 cout<<
"Testing global refinement"<<endl;
77 cout<<
"Enter nLevels"<<endl;
80 start = CurrentTime();
89 cout<<
"Elapsed time for global refinements = "<<(stop-start)<<
"s"<<endl;
90 mesh = multilevelMesh.
meshArray[nLevels-1];
95 cout<<
"nElements_global = "<<mesh.nElements_global<<endl;
96 cout<<
"nNodes_global = "<<mesh.nNodes_global<<endl;
98 cout<<
"Constructing element boundary element arrays"<<endl;
99 if (ny == 1 && nz == 1)
133 cout<<
"Print mesh? (n/filename/cout)"<<endl;
135 start = CurrentTime();
136 if(outfilename !=
"n")
138 if(outfilename !=
"cout")
140 ofstream outfile(outfilename.c_str());
150 stop = CurrentTime();
151 cout<<
"Elapsed time for writing mesh = "<<(stop-start)<<
"s"<<endl;
153 ofstream datFile(
"edgeMesh.dat");
164 for (
int i=0;i<multilevelMesh.
nLevels;i++)
int * elementBoundaryNodesArray
int constructElementBoundaryElementsArray_triangle(Mesh &mesh)
int nNodes_elementBoundary
int nElementBoundaries_global
void deleteMesh(Mesh &mesh)
int regularHexahedralToTetrahedralMeshElements(const int &nx, const int &ny, const int &nz, Mesh &mesh)
int readElements(std::istream &meshFile, Mesh &mesh)
int regularRectangularToTriangularMeshNodes(const int &nx, const int &ny, const double &Lx, const double &Ly, Mesh &mesh)
int writeNodes(std::ostream &meshFile, const Mesh &mesh)
int globallyRefineEdgeMesh(const int &nLevels, Mesh &mesh, MultilevelMesh &multilevelMesh, bool averageNewNodeFlags)
int edgeMeshElements(const int &nx, Mesh &mesh)
int computeGeometricInfo_tetrahedron(Mesh &mesh)
int constructElementBoundaryElementsArray_tetrahedron(Mesh &mesh)
int constructElementBoundaryElementsArray_edge(Mesh &mesh)
int regularEdgeMeshNodes(const int &nx, const double &Lx, Mesh &mesh)
void initializeMesh(Mesh &mesh)
int regularHexahedralToTetrahedralMeshNodes(const int &nx, const int &ny, const int &nz, const double &Lx, const double &Ly, const double &Lz, Mesh &mesh)
int globallyRefineTetrahedralMesh(const int &nLevels, Mesh &mesh, MultilevelMesh &multilevelMesh, bool averageNewNodeFlags)
int globallyRefineTriangularMesh(const int &nLevels, Mesh &mesh, MultilevelMesh &multilevelMesh, bool averageNewNodeFlags)
int regularRectangularToTriangularMeshElements(const int &nx, const int &ny, Mesh &mesh, int triangleFlag)
int writeElements(std::ostream &meshFile, const Mesh &mesh)