#include <tetmesh.h>
Inheritance diagram for mesh::TetMesh:
Public Types | |
typedef std::vector< Tet >::iterator | tet_iterator |
typedef std::vector< Face >::iterator | face_iterator |
typedef std::vector< Edge >::iterator | edge_iterator |
typedef std::vector< Point >::iterator | point_iterator |
Public Member Functions | |
TetMesh () | |
virtual | ~TetMesh () |
virtual void | initPoint (int nofPoint) |
virtual void | insertPoint (int id, double x, double y, double z) |
virtual void | initTet (int nofTet) |
virtual void | insertTet (id_t global_id, id_t id0, id_t id1, id_t id2, id_t id3, id_t material) |
void | setBoundaryOnFace (id_t face) |
void | setSymmetryPlaneOnFace (id_t face, int symId) |
void | generateEdges () |
void | generateFaces () |
void | load_materials (const char *fileName) |
Materials * | get_materials () const |
Tet * | get_tet (id_t id) const |
Face * | get_face (id_t id) const |
Edge * | get_edge (id_t id) const |
Point * | get_point (id_t id) const |
const id_t & | get_nof_tets () const |
const id_t & | get_nof_faces () const |
const id_t & | get_nof_edges () const |
const id_t & | get_nof_points () const |
LooseOctree< Tet > * | get_octree () const |
void | get_bounding_box (Vector3 ¢er, Vector3 &extent) const |
id_t | insertEdge (id_t node0, id_t node1) |
id_t | insertFace (id_t tet, id_t node0, id_t node1, id_t node2) |
virtual id_t | lookupEdge (id_t node0, id_t node1) |
virtual id_t | lookupFace (id_t node0, id_t node1, id_t node2) |
virtual void | finalize_mesh (int nofSym) |
void | log_mesh_info () |
void | construct_octree () |
bool | is_inside (const Vector3 &p) const |
void | find_tets_by_point (const Vector3 &p, std::vector< Tet * > &tets) const |
template<typename CurveType> | |
double | find_boundary (const CurveType &curve, double x_in, double x_out) const |
tet_iterator | tet_begin () |
tet_iterator | tet_end () |
face_iterator | face_begin () |
face_iterator | face_end () |
edge_iterator | edge_begin () |
edge_iterator | edge_end () |
point_iterator | point_begin () |
point_iterator | point_end () |
surface_iterator | surface_begin () |
surface_iterator | surface_end () |
Static Public Member Functions | |
static TetMesh * | get_instance () |
Protected Member Functions | |
void | dump_face_map (std::ostream &os) |
Private Types | |
typedef std::pair< id_t, id_t > | EdgeMapKey |
typedef utility::triple< id_t, id_t, id_t > | FaceMapKey |
typedef std::map< EdgeMapKey, id_t > | EdgeMap |
typedef std::map< FaceMapKey, id_t > | FaceMap |
Private Member Functions | |
TetMesh (const TetMesh &) | |
TetMesh & | operator= (const TetMesh &) |
Private Attributes | |
id_t | _nofTet |
id_t | _nofPoint |
id_t | _nofEdge |
id_t | _nofFace |
Materials * | _materials |
int | _nofSym |
id_t | _tetCounter |
std::vector< Tet > | _tets |
std::vector< Face > | _faces |
std::vector< Edge > | _edges |
std::vector< Point > | _points |
EdgeMap | _edgeMap |
FaceMap | _faceMap |
LooseOctree< Tet > * | _octree |
Static Private Attributes | |
static TetMesh * | instance_ = 0 |
Classes | |
class | surface_iterator |
Definition at line 46 of file tetmesh.h.
typedef std::vector<Edge>::iterator mesh::TetMesh::edge_iterator |
typedef std::map<EdgeMapKey,id_t> mesh::TetMesh::EdgeMap [private] |
typedef std::pair<id_t, id_t> mesh::TetMesh::EdgeMapKey [private] |
typedef std::vector<Face>::iterator mesh::TetMesh::face_iterator |
typedef std::map<FaceMapKey,id_t> mesh::TetMesh::FaceMap [private] |
typedef utility::triple<id_t, id_t, id_t> mesh::TetMesh::FaceMapKey [private] |
typedef std::vector<Point>::iterator mesh::TetMesh::point_iterator |
typedef std::vector<Tet>::iterator mesh::TetMesh::tet_iterator |
mesh::TetMesh::TetMesh | ( | ) |
mesh::TetMesh::~TetMesh | ( | ) | [virtual] |
mesh::TetMesh::TetMesh | ( | const TetMesh & | ) | [private] |
Copy constructor: private, undefined: disallow copy
void mesh::TetMesh::construct_octree | ( | ) |
Construct octree for locating tetrahedrons in mesh
Definition at line 290 of file tetmesh.cpp.
References _octree, mesh::Tet::get_bounding_box(), get_bounding_box(), get_nof_tets(), get_tet(), is_inside(), mesh::Tet::is_inside(), tet_begin(), tet_end(), mesh::Vector3::x, mesh::Vector3::y, and mesh::Vector3::z.
Referenced by h5_cartesian_sampling(), main(), and FemaxxDriver::postprocess().
Here is the call graph for this function:
void mesh::TetMesh::dump_face_map | ( | std::ostream & | os | ) | [protected] |
edge_iterator mesh::TetMesh::edge_begin | ( | ) | [inline] |
Return edge_iterator pointing to first Edge
Definition at line 290 of file tetmesh.h.
References _edges.
Referenced by FemaxMesh::constructY(), FemaxMesh::constructY_transp(), h5_write_eigenfeield_retrieve_DoF_efficient(), and mesh::ParallelTetMesh::set_edge_gids().
edge_iterator mesh::TetMesh::edge_end | ( | ) | [inline] |
Return edge_iterator pointing beyond last Face
Definition at line 294 of file tetmesh.h.
References _edges.
Referenced by FemaxMesh::constructY(), FemaxMesh::constructY_transp(), h5_write_eigenfeield_retrieve_DoF_efficient(), and mesh::ParallelTetMesh::set_edge_gids().
face_iterator mesh::TetMesh::face_begin | ( | ) | [inline] |
Return face_iterator pointing to first Face
Definition at line 282 of file tetmesh.h.
References _faces.
Referenced by h5_write_eigenfeield_retrieve_DoF_efficient(), mesh::ParallelTetMesh::set_edge_gids(), mesh::ParallelTetMesh::set_face_gids(), mesh::ParallelTetMesh::set_point_ownership(), and surface_begin().
face_iterator mesh::TetMesh::face_end | ( | ) | [inline] |
Return face_iterator pointing beyond last Face
Definition at line 286 of file tetmesh.h.
References _faces.
Referenced by h5_write_eigenfeield_retrieve_DoF_efficient(), mesh::ParallelTetMesh::set_edge_gids(), mesh::ParallelTetMesh::set_face_gids(), mesh::ParallelTetMesh::set_point_ownership(), surface_begin(), and surface_end().
void mesh::TetMesh::finalize_mesh | ( | int | nofSym | ) | [virtual] |
Finalize and validate the mesh data structures
nofSym | number of symmetry planes in the mesh |
Reimplemented in mesh::ParallelTetMesh.
Definition at line 232 of file tetmesh.cpp.
References _edgeMap, _faceMap, and _nofSym.
Referenced by TetMeshBuilder::finalize_bc(), and mesh::ParallelTetMesh::finalize_mesh().
double mesh::TetMesh::find_boundary | ( | const CurveType & | curve, | |
double | x_in, | |||
double | x_out | |||
) | const [inline] |
Find boundary of mesh using bisection along a parametrised curve.
Definition at line 251 of file tetmesh.h.
References is_inside().
Referenced by CometGapFinder::get_gap(), and postprocess::VtkExport::integrate_a_to_b().
Here is the call graph for this function:
Find all tets in mesh which contain the specified point p. The found tets are returned in "tets". If p is outside the mesh an empty vector is returned. If p is on a shared face/edge/point, "tets" may contain more than one entry.
Referenced by NedelecMesh::eval(), NedelecMesh::eval_curl(), h5_cartesian_sampling(), and is_inside().
void mesh::TetMesh::generateEdges | ( | ) |
Generates all edges. This method must be called only after all Tets have been inserted. Updates _edges and _edgeOrientation members of all Tets.
Definition at line 86 of file tetmesh.cpp.
References get_edge(), insertEdge(), tet_begin(), and tet_end().
Referenced by TetMeshBuilder::finalize_coord(), and TetMeshBuilder::finalize_tet().
Here is the call graph for this function:
void mesh::TetMesh::generateFaces | ( | ) |
Generates all faces. This method must be called only after all Tets have been inserted. Updates _faces members of all Tets.
Definition at line 105 of file tetmesh.cpp.
References mesh::Tet::get_face_point_lids(), insertFace(), tet_begin(), and tet_end().
Referenced by TetMeshBuilder::finalize_coord(), and TetMeshBuilder::finalize_tet().
Here is the call graph for this function:
Compute center and extent (halved) of the bounding box of the whole mesh.
Definition at line 275 of file tetmesh.cpp.
References mesh::Point::get_coord(), get_nof_points(), get_point(), mesh::Vector3::make_floor(), and max.
Referenced by construct_octree(), and postprocess::VtkExport::export_eigenfields2().
Here is the call graph for this function:
Return Edge object with given id
Definition at line 249 of file tetmesh.cpp.
References _edges.
Referenced by NedelecMesh::generate_sorted_AM(), generateEdges(), mesh::Tet::get_edge(), mesh::Face::get_edge(), NedelecMesh::set_map(), LagrangeMesh::set_map(), setBoundaryOnFace(), and setSymmetryPlaneOnFace().
Return Face object with given id
Definition at line 245 of file tetmesh.cpp.
References _faces.
Referenced by NedelecElement2::get_dof_ids(), mesh::Tet::get_face(), insertFace(), setBoundaryOnFace(), and setSymmetryPlaneOnFace().
static TetMesh* mesh::TetMesh::get_instance | ( | ) | [inline, static] |
Return pointer to single TetMesh instance.
Definition at line 320 of file tetmesh.h.
References instance_.
Referenced by mesh::Tet::get_mesh(), and mesh::Face::get_mesh().
Materials * mesh::TetMesh::get_materials | ( | ) | const |
Sets the material properties (if any)
Definition at line 58 of file tetmesh.cpp.
References _materials.
Referenced by NedelecElement::get_AeMe().
const id_t& mesh::TetMesh::get_nof_edges | ( | ) | const [inline] |
Return number of edges
Definition at line 181 of file tetmesh.h.
References _nofEdge.
Referenced by NedelecMesh::gdof(), NedelecMesh::generate_sorted_AM(), NedelecElement2::get_dof_ids(), h5_write_eigenfeield_retrieve_DoF_efficient(), LagrangeMesh::LagrangeMesh(), NedelecMesh::NedelecMesh(), mesh::ParallelTetMesh::set_edge_gids(), NedelecMesh::set_map(), and LagrangeMesh::set_map().
const id_t& mesh::TetMesh::get_nof_faces | ( | ) | const [inline] |
Return number of faces
Definition at line 177 of file tetmesh.h.
References _nofFace.
Referenced by h5_write_eigenfeield_retrieve_DoF_efficient(), NedelecMesh::NedelecMesh(), mesh::ParallelTetMesh::set_face_gids(), and NedelecMesh::set_map().
const id_t& mesh::TetMesh::get_nof_points | ( | ) | const [inline] |
Return number of points
Definition at line 184 of file tetmesh.h.
References _nofPoint.
Referenced by postprocess::VtkExport::export_mesh(), export_mesh(), LagrangeMesh::gdof(), get_bounding_box(), h5_write_eigenpoint(), LagrangeMesh::LagrangeMesh(), LagrangeMesh::set_map(), mesh::ParallelTetMesh::set_point_ownership(), and vtk_export_eigenfields().
const id_t& mesh::TetMesh::get_nof_tets | ( | ) | const [inline] |
Return number of local tets
Definition at line 173 of file tetmesh.h.
References _nofTet.
Referenced by construct_octree(), postprocess::VtkExport::export_mesh(), export_mesh(), mesh::ParallelTetMesh::get_num_global_tets(), h5_write_eigenfield(), h5_write_eigenmesh(), NedelecMesh::set_map(), and vtk_export_eigenfields().
LooseOctree<Tet>* mesh::TetMesh::get_octree | ( | ) | const [inline] |
Return pointer to Octree or 0 if it is not constructed.
Definition at line 187 of file tetmesh.h.
References _octree.
Referenced by eval_gap_voltage(), and eval_tangetial_efield().
Return Point object with given id
Definition at line 253 of file tetmesh.cpp.
References _points.
Referenced by mesh::Tet::CoordinateMatrix::CoordinateMatrix(), postprocess::VtkExport::export_mesh(), export_mesh(), get_bounding_box(), mesh::Tet::get_corner(), mesh::Face::get_corner(), LagrangeMesh::set_map(), setBoundaryOnFace(), setSymmetryPlaneOnFace(), and vtk_export_eigenfields().
Return Tet object with given id
Definition at line 241 of file tetmesh.cpp.
References _tets.
Referenced by construct_octree(), postprocess::VtkExport::export_mesh(), export_mesh(), mesh::Face::get_corner_id(), mesh::Face::get_edge_id(), h5_compute_eigenquality(), NedelecMesh::q_factor(), NedelecMesh::set_map(), and vtk_export_eigenfields().
void mesh::TetMesh::initPoint | ( | int | nofPoint | ) | [virtual] |
Reserve space for nofPoint mesh points
Reimplemented in mesh::ParallelTetMesh.
Definition at line 63 of file tetmesh.cpp.
References _nofPoint, and _points.
Referenced by TetMeshBuilder::init_coord(), and mesh::ParallelTetMesh::initPoint().
void mesh::TetMesh::initTet | ( | int | nofTet | ) | [virtual] |
Reserve space for nofTet tets
Reimplemented in mesh::ParallelTetMesh.
Definition at line 68 of file tetmesh.cpp.
References _nofTet, and _tets.
Referenced by TetMeshBuilder::init_tet(), and mesh::ParallelTetMesh::initTet().
Return id of edge with corners node0, node1. Add a new Edge to the mesh if it has not already been constructed.
Definition at line 120 of file tetmesh.cpp.
References _edgeMap, _edges, and _nofEdge.
Referenced by generateEdges().
Return id of face with corners node0, node1, node2. Construct a new Face if it has not already been constructed.
tet | Id of the Tet for which the Face is inserted. | |
node0 | Point id of face corner 0. | |
node1 | Point id of face corner 1. | |
node2 | Point id of face corner 2. |
Definition at line 135 of file tetmesh.cpp.
References _faceMap, _faces, _nofFace, get_face(), and mesh::Face::set_tet_id().
Referenced by generateFaces().
Here is the call graph for this function:
void mesh::TetMesh::insertPoint | ( | int | id, | |
double | x, | |||
double | y, | |||
double | z | |||
) | [virtual] |
Add a new point to the mesh
Reimplemented in mesh::ParallelTetMesh.
Definition at line 73 of file tetmesh.cpp.
References _points.
Referenced by mesh::ParallelTetMesh::insertPoint(), and TetMeshBuilder::set_coord().
void mesh::TetMesh::insertTet | ( | id_t | global_id, | |
id_t | id0, | |||
id_t | id1, | |||
id_t | id2, | |||
id_t | id3, | |||
id_t | material | |||
) | [virtual] |
Inserts a new Tet into the TetMesh. Tet ids are assigned in consecutive order.
id0 | id of the corner 0 | |
id1 | id of the corner 1 | |
id2 | id of the corner 2 | |
id3 | id of the corner 3 |
Reimplemented in mesh::ParallelTetMesh.
Definition at line 78 of file tetmesh.cpp.
References _tetCounter, and _tets.
Referenced by mesh::ParallelTetMesh::insertTet(), and TetMeshBuilder::set_tet().
bool mesh::TetMesh::is_inside | ( | const Vector3 & | p | ) | const [inline] |
Return true if p is in inside the mesh, i.e. inside at least one tet of the mesh.
Definition at line 236 of file tetmesh.h.
References find_tets_by_point().
Referenced by construct_octree(), find_boundary(), and CometGapFinder::get_gap().
Here is the call graph for this function:
void mesh::TetMesh::load_materials | ( | const char * | fileName | ) |
Sets the material properties (if any)
Definition at line 54 of file tetmesh.cpp.
References _materials.
Referenced by FemaxxDriver::load_mesh().
void mesh::TetMesh::log_mesh_info | ( | ) |
Dump mesh summary info to info channel
Definition at line 257 of file tetmesh.cpp.
References _nofEdge, _nofFace, _nofPoint, _nofSym, _nofTet, and rlog::bytes2str().
Referenced by FemaxxDriver::load_mesh(), and load_mesh().
Here is the call graph for this function:
Return edge connecting node0 and node1. A runtime_error is thrown if the edge does not exist.
Definition at line 165 of file tetmesh.cpp.
References _edgeMap.
Referenced by setBoundaryOnFace(), and setSymmetryPlaneOnFace().
Return face connecting by node0, node1 and node2. A runtime_error is thrown if the face does not exist.
Reimplemented in mesh::ParallelTetMesh.
Definition at line 175 of file tetmesh.cpp.
References _faceMap.
Referenced by mesh::ParallelTetMesh::lookupFace(), and TetMeshBuilder::set_bc().
Assignment operator: private, undefined: disallow assignment
point_iterator mesh::TetMesh::point_begin | ( | ) | [inline] |
Return point_iterator pointing to first Point
Definition at line 298 of file tetmesh.h.
References _points.
Referenced by h5_write_eigenpoint(), main(), and mesh::ParallelTetMesh::set_point_ownership().
point_iterator mesh::TetMesh::point_end | ( | ) | [inline] |
Return point_iterator pointing beyond last Point
Definition at line 302 of file tetmesh.h.
References _points.
Referenced by h5_write_eigenpoint(), main(), and mesh::ParallelTetMesh::set_point_ownership().
void mesh::TetMesh::setBoundaryOnFace | ( | id_t | face | ) |
Updates the boundary info of the face and asociated edges and nodes to reflect the fact that the face is on the boundary.
face | face located at the boundary |
Definition at line 202 of file tetmesh.cpp.
References mesh::Face::get_corner_id(), get_edge(), get_face(), get_point(), lookupEdge(), and mesh::Entity::set_boundary().
Referenced by TetMeshBuilder::set_bc().
Here is the call graph for this function:
void mesh::TetMesh::setSymmetryPlaneOnFace | ( | id_t | face, | |
int | symId | |||
) |
Updates the boundary info of the face and asociated edges and nodes to reflect the fact that the face is on symmetry plane symId.
face | face located on symmetry plane symId | |
symId | id of the symmetry plane with 0 <= symId < 3. |
Definition at line 217 of file tetmesh.cpp.
References mesh::Face::get_corner_id(), get_edge(), get_face(), get_point(), lookupEdge(), and mesh::Entity::set_symmetry_plane().
Referenced by TetMeshBuilder::set_bc().
Here is the call graph for this function:
surface_iterator mesh::TetMesh::surface_begin | ( | ) | [inline] |
Return surface_iterator pointing to first surface.
Definition at line 306 of file tetmesh.h.
References face_begin(), face_end(), and mesh::TetMesh::surface_iterator::search().
Referenced by h5_compute_eigenquality(), and NedelecMesh::q_factor().
Here is the call graph for this function:
surface_iterator mesh::TetMesh::surface_end | ( | ) | [inline] |
Return surface_iterator pointing beyond last surface.
Definition at line 313 of file tetmesh.h.
References face_end().
Referenced by h5_compute_eigenquality(), and NedelecMesh::q_factor().
Here is the call graph for this function:
tet_iterator mesh::TetMesh::tet_begin | ( | ) | [inline] |
Return tet_iterator pointing to first Tet
Definition at line 274 of file tetmesh.h.
References _tets.
Referenced by NedelecMesh::assembleAM(), construct_octree(), mesh::ParallelTetMesh::fix_edge_orientation(), generateEdges(), generateFaces(), h5_write_eigenfield(), and h5_write_eigenmesh().
tet_iterator mesh::TetMesh::tet_end | ( | ) | [inline] |
Return tet_iterator pointing beyond last Tet
Definition at line 278 of file tetmesh.h.
References _tets.
Referenced by NedelecMesh::assembleAM(), construct_octree(), mesh::ParallelTetMesh::fix_edge_orientation(), generateEdges(), generateFaces(), h5_write_eigenfield(), and h5_write_eigenmesh().
EdgeMap mesh::TetMesh::_edgeMap [private] |
Definition at line 358 of file tetmesh.h.
Referenced by finalize_mesh(), insertEdge(), and lookupEdge().
std::vector<Edge> mesh::TetMesh::_edges [private] |
Vector of Edge objects.
Definition at line 353 of file tetmesh.h.
Referenced by edge_begin(), edge_end(), get_edge(), and insertEdge().
FaceMap mesh::TetMesh::_faceMap [private] |
Definition at line 359 of file tetmesh.h.
Referenced by finalize_mesh(), insertFace(), and lookupFace().
std::vector<Face> mesh::TetMesh::_faces [private] |
Vector of Face objects.
Definition at line 349 of file tetmesh.h.
Referenced by face_begin(), face_end(), get_face(), and insertFace().
Materials* mesh::TetMesh::_materials [private] |
id_t mesh::TetMesh::_nofEdge [private] |
Definition at line 335 of file tetmesh.h.
Referenced by get_nof_edges(), insertEdge(), and log_mesh_info().
id_t mesh::TetMesh::_nofFace [private] |
Definition at line 336 of file tetmesh.h.
Referenced by get_nof_faces(), insertFace(), and log_mesh_info().
id_t mesh::TetMesh::_nofPoint [private] |
Definition at line 334 of file tetmesh.h.
Referenced by get_nof_points(), initPoint(), and log_mesh_info().
int mesh::TetMesh::_nofSym [private] |
id_t mesh::TetMesh::_nofTet [private] |
Definition at line 333 of file tetmesh.h.
Referenced by get_nof_tets(), initTet(), and log_mesh_info().
LooseOctree<Tet>* mesh::TetMesh::_octree [private] |
Definition at line 360 of file tetmesh.h.
Referenced by construct_octree(), get_octree(), and ~TetMesh().
std::vector<Point> mesh::TetMesh::_points [private] |
Vector of Point objects.
Definition at line 357 of file tetmesh.h.
Referenced by get_point(), initPoint(), insertPoint(), point_begin(), and point_end().
id_t mesh::TetMesh::_tetCounter [private] |
std::vector<Tet> mesh::TetMesh::_tets [private] |
Vector of Tet objects.
Definition at line 345 of file tetmesh.h.
Referenced by get_tet(), initTet(), insertTet(), tet_begin(), and tet_end().
TetMesh * mesh::TetMesh::instance_ = 0 [static, private] |
Pointer to single TetMesh instance (Singleton)
Definition at line 364 of file tetmesh.h.
Referenced by get_instance(), TetMesh(), and ~TetMesh().