proteus  1.8.1
C/C++/Fortran libraries
Macros
mesh.cpp File Reference
#include "mesh.h"
#include "meshio.h"
#include <set>
#include <valarray>
#include <string>
#include <sstream>
#include <iostream>
#include <fstream>
#include <cstring>
Include dependency graph for mesh.cpp:

Go to the source code of this file.

Macros

#define DEBUG_REFINE
 
#define REAL   double
 
#define REAL_LOCAL
 
const int DEFAULT_ELEMENT_MATERIAL =0
 
const int DEFAULT_NODE_MATERIAL =-1
 
const int INTERIOR_NODE_MATERIAL =0
 
const int EXTERIOR_NODE_MATERIAL =1
 
const int INTERIOR_ELEMENT_BOUNDARY_MATERIAL =0
 
const int EXTERIOR_ELEMENT_BOUNDARY_MATERIAL =1
 
int edgeMeshElements (const int &nx, Mesh &mesh)
 
int regularEdgeMeshNodes (const int &nx, const double &Lx, Mesh &mesh)
 
int regularRectangularToTriangularMeshElements (const int &nx, const int &ny, Mesh &mesh, int triangleFlag)
 
int regularRectangularToTriangularElementBoundaryMaterials (const double &Lx, const double &Ly, Mesh &mesh)
 
int regularRectangularToTriangularMeshNodes (const int &nx, const int &ny, const double &Lx, const double &Ly, Mesh &mesh)
 
void reorientNodes_tet (double *nodeArray, int *nodes)
 
int reorientTetrahedralMesh (Mesh &mesh)
 
int regularHexahedralToTetrahedralMeshElements (const int &nx, const int &ny, const int &nz, Mesh &mesh)
 
int regularHexahedralToTetrahedralElementBoundaryMaterials (const double &Lx, const double &Ly, const double &Lz, Mesh &mesh)
 
int regularHexahedralMeshElementBoundaryMaterials (const double &Lx, const double &Ly, const double &Lz, Mesh &mesh)
 
int regularQuadrilateralMeshElementBoundaryMaterials (const double &Lx, const double &Ly, Mesh &mesh)
 
int regularMeshNodes (const int &nx, const int &ny, const int &nz, const double &Lx, const double &Ly, const double &Lz, Mesh &mesh)
 
int regularMeshNodes2D (const int &nx, const int &ny, const double &Lx, const double &Ly, 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 regularHexahedralMeshElements (const int &nx, const int &ny, const int &nz, const int &px, const int &py, const int &pz, Mesh &mesh)
 
int regularQuadrilateralMeshElements (const int &nx, const int &ny, Mesh &mesh)
 
int regularNURBSMeshElements (const int &nx, const int &ny, const int &nz, const int &px, const int &py, const int &pz, Mesh &mesh)
 
int constructElementBoundaryElementsArray_edge (Mesh &mesh)
 
int constructElementBoundaryElementsArray_triangle (Mesh &mesh)
 
int constructElementBoundaryElementsArray_quadrilateral (Mesh &mesh)
 
int constructElementBoundaryElementsArray_tetrahedron (Mesh &mesh)
 
int constructElementBoundaryElementsArray_hexahedron (Mesh &mesh)
 
int constructElementBoundaryElementsArray_NURBS (Mesh &mesh)
 
int constructElementBoundaryElementsArrayWithGivenElementBoundaryAndEdgeNumbers_NURBS (Mesh &mesh)
 
int constructElementBoundaryElementsArrayWithGivenElementBoundaryNumbers_edge (Mesh &mesh)
 
int constructElementBoundaryElementsArrayWithGivenElementBoundaryNumbers_triangle (Mesh &mesh)
 
int constructElementBoundaryElementsArrayWithGivenElementBoundaryNumbers_quadrilateral (Mesh &mesh)
 
int constructElementBoundaryElementsArrayWithGivenElementBoundaryNumbers_tetrahedron (Mesh &mesh)
 
int constructElementBoundaryElementsArrayWithGivenElementBoundaryAndEdgeNumbers_edge (Mesh &mesh)
 
int constructElementBoundaryElementsArrayWithGivenElementBoundaryAndEdgeNumbers_triangle (Mesh &mesh)
 
int constructElementBoundaryElementsArrayWithGivenElementBoundaryAndEdgeNumbers_quadrilateral (Mesh &mesh)
 
int constructElementBoundaryElementsArrayWithGivenElementBoundaryAndEdgeNumbers_tetrahedron (Mesh &mesh)
 
int constructElementBoundaryElementsArrayWithGivenElementBoundaryAndEdgeNumbers_hexahedron (Mesh &mesh)
 
double edgeLength (int nL, int nR, const double *nodeArray)
 
double triangleArea (int n0, int n1, int n2, const double *nodeArray)
 
double tetrahedronVolume (int n0, int n1, int n2, int n3, const double *nodeArray)
 
int allocateGeometricInfo_tetrahedron (Mesh &mesh)
 
int computeGeometricInfo_tetrahedron (Mesh &mesh)
 
double hexahedronVolume (int n0, int n1, int n2, int n3, int n4, int n5, int n6, int n7, const double *nodeArray)
 
int allocateGeometricInfo_hexahedron (Mesh &mesh)
 
int computeGeometricInfo_hexahedron (Mesh &mesh)
 
int allocateGeometricInfo_NURBS (Mesh &mesh)
 
int computeGeometricInfo_NURBS (Mesh &mesh)
 
int allocateGeometricInfo_triangle (Mesh &mesh)
 
int computeGeometricInfo_triangle (Mesh &mesh)
 
int allocateGeometricInfo_quadrilateral (Mesh &mesh)
 
int computeGeometricInfo_quadrilateral (Mesh &mesh)
 
int allocateGeometricInfo_edge (Mesh &mesh)
 
int computeGeometricInfo_edge (Mesh &mesh)
 
int allocateNodeAndElementNodeDataStructures (Mesh &mesh, int nElements_global, int nNodes_global, int nNodes_element)
 
int globallyRefineEdgeMesh (const int &nLevels, Mesh &mesh, MultilevelMesh &multilevelMesh, bool averageNewNodeFlags)
 
int globallyRefineTriangularMesh (const int &nLevels, Mesh &mesh, MultilevelMesh &multilevelMesh, bool averageNewNodeFlags)
 
int globallyRefineQuadrilateralMesh (const int &nLevels, Mesh &mesh, MultilevelMesh &multilevelMesh, bool averageNewNodeFlags)
 
int globallyRefineTetrahedralMesh (const int &nLevels, Mesh &mesh, MultilevelMesh &multilevelMesh, bool averageNewNodeFlags)
 
int globallyRefineHexahedralMesh (const int &nLevels, Mesh &mesh, MultilevelMesh &multilevelMesh, bool averageNewNodeFlags)
 
int assignElementBoundaryMaterialTypesFromParent (Mesh &parentMesh, Mesh &childMesh, const int *levelElementParentsArray, const int &nSpace_global)
 
int readElements (std::istream &meshFile, Mesh &mesh)
 
int writeNodes (std::ostream &meshFile, const Mesh &mesh)
 
int writeElements (std::ostream &meshFile, const Mesh &mesh)
 
int setFromTriangleElements (triangulateio *trimesh, Mesh &mesh, int base)
 
int setFromTriangleNodes (triangulateio *trimesh, Mesh &mesh, int base)
 
int copyElementBoundaryMaterialTypesFromTriangle (triangulateio *trimesh, Mesh &mesh, int base)
 
int readTriangleMesh (Mesh &mesh, const char *filebase, int triangleIndexBase)
 
int writeTriangleMesh (Mesh &mesh, const char *filebase, int triangleIndexBase)
 
int readTriangleElementBoundaryMaterialTypes (Mesh &mesh, const char *filebase, int triangleIndexBase)
 
int readTetgenMesh (Mesh &mesh, const char *filebase, int tetgenIndexBase)
 
int readTetgenElementBoundaryMaterialTypes (Mesh &mesh, const char *filebase, int tetgenIndexBase)
 
int writeTetgenMesh (Mesh &mesh, const char *filebase, int tetgenIndexBase)
 
int read3DM (Mesh &mesh, const char *filebase, int indexBase)
 
int read2DM (Mesh &mesh, const char *filebase, int indexBase)
 
int readHex (Mesh &mesh, const char *filebase, int indexBase)
 
int readBC (Mesh &mesh, const char *filebase, int indexBase)
 
int write3dmMesh (Mesh &mesh, const char *filebase, int adhIndexBase)
 
int write2dmMesh (Mesh &mesh, const char *filebase, int adhIndexBase)
 
int growMultilevelMesh (int nLevels2add, MultilevelMesh &multilevelMesh)
 
int locallyRefineEdgeMesh (MultilevelMesh &multilevelMesh, int *elementTagArray)
 
int locallyRefineTriangleMesh (MultilevelMesh &multilevelMesh, int *elementTagArray)
 
int setNewestNodeBasesToLongestEdge (MultilevelMesh &multilevelMesh)
 
int locallyRefineTriangleMesh_redGreen (MultilevelMesh &multilevelMesh, int *elementTagArray)
 
int locallyRefineTriangleMesh_4T (MultilevelMesh &multilevelMesh, int *elementTagArray)
 
bool newestNodeBisect (int eN, int &nElements_global, int &nNodes_global, std::vector< double > &nodeArray, std::vector< int > &elementNodesArray, std::vector< int > &elementNeighborsArray, std::vector< std::list< int > > &childrenList, std::vector< int > &elementParentsArray, std::vector< int > &bases, std::vector< bool > &refined)
 
bool add4TnodesForRefinement2d (int eN, int &nNodes_global, std::vector< bool > &refined, std::vector< int > &edgeMidNodesArray, const int *elementNodesArray, const int *elementBoundariesArray, const int *elementNeighborsArray, const double *nodeArray)
 
bool add4TnodesForConformity2d (int eN, int ebN_longest, int ebN_neig, int eN_neig, int &nNodes_global, std::vector< bool > &refined, std::vector< int > &edgeMidNodesArray, const int *elementNodesArray, const int *elementBoundariesArray, const int *elementNeighborsArray, const double *nodeArray)
 
int findLocalLongestEdge2d (int eN, const int *elementNodesArray, const double *nodeArray)
 
bool subdivideTriangle4T (int eN_parent, int &eN_new, int *elementParentsArray, int *elementChildrenOffsets, int *elementChildrenArray, int *elementNodesArray_child, const std::vector< int > &edgeMidNodesArray, const std::vector< bool > &refined, const int *elementNodesArray_parent, const int *elementBoundariesArray_parent, const double *nodeArray_parent)
 

Macro Definition Documentation

◆ DEBUG_REFINE

#define DEBUG_REFINE

Definition at line 2 of file mesh.cpp.

◆ REAL

#define REAL   double

Definition at line 30 of file mesh.cpp.

◆ REAL_LOCAL

#define REAL_LOCAL

Definition at line 31 of file mesh.cpp.

Function Documentation

◆ edgeLength()

double edgeLength ( int  nL,
int  nR,
const double *  nodeArray 
)
inline

Definition at line 3484 of file mesh.cpp.

◆ growMultilevelMesh()

int growMultilevelMesh ( int  nLevels2add,
MultilevelMesh multilevelMesh 
)

Definition at line 5813 of file mesh.cpp.

◆ hexahedronVolume()

double hexahedronVolume ( int  n0,
int  n1,
int  n2,
int  n3,
int  n4,
int  n5,
int  n6,
int  n7,
const double *  nodeArray 
)
inline

Definition at line 3629 of file mesh.cpp.

◆ reorientNodes_tet()

void reorientNodes_tet ( double *  nodeArray,
int *  nodes 
)
inline

Definition at line 197 of file mesh.cpp.

◆ tetrahedronVolume()

double tetrahedronVolume ( int  n0,
int  n1,
int  n2,
int  n3,
const double *  nodeArray 
)
inline

Definition at line 3505 of file mesh.cpp.

◆ triangleArea()

double triangleArea ( int  n0,
int  n1,
int  n2,
const double *  nodeArray 
)
inline

Definition at line 3493 of file mesh.cpp.

Variable Documentation

◆ DEFAULT_ELEMENT_MATERIAL

const int DEFAULT_ELEMENT_MATERIAL =0

Definition at line 48 of file mesh.cpp.

◆ DEFAULT_NODE_MATERIAL

const int DEFAULT_NODE_MATERIAL =-1

Definition at line 49 of file mesh.cpp.

◆ EXTERIOR_ELEMENT_BOUNDARY_MATERIAL

const int EXTERIOR_ELEMENT_BOUNDARY_MATERIAL =1

Definition at line 53 of file mesh.cpp.

◆ EXTERIOR_NODE_MATERIAL

const int EXTERIOR_NODE_MATERIAL =1

Definition at line 51 of file mesh.cpp.

◆ INTERIOR_ELEMENT_BOUNDARY_MATERIAL

const int INTERIOR_ELEMENT_BOUNDARY_MATERIAL =0

Definition at line 52 of file mesh.cpp.

◆ INTERIOR_NODE_MATERIAL

const int INTERIOR_NODE_MATERIAL =0

Definition at line 50 of file mesh.cpp.