DSC
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Classes | Public Member Functions | Friends | List of all members
is_mesh::ISMesh Class Reference

Public Member Functions

 ISMesh (std::vector< vec3 > &points, std::vector< int > &tets, const std::vector< int > &tet_labels)
 
 ISMesh (const ISMesh &mesh)
 
unsigned int get_no_nodes () const
 
unsigned int get_no_edges () const
 
unsigned int get_no_faces () const
 
unsigned int get_no_tets () const
 
unsigned int get_max_node_key () const
 
unsigned int get_max_edge_key () const
 
unsigned int get_max_face_key () const
 
unsigned int get_max_tet_key () const
 
std::shared_ptr< Geometryget_subdomain ()
 
void clear_subdomain ()
 
void set_subdomain (std::shared_ptr< Geometry > subdomain)
 
unsigned int get_number_of_threads () const
 
void set_number_of_threads (unsigned int m_number_of_threads)
 
std::vector< TetrahedronKeyfind_par_tet (std::function< bool(Tetrahedron &)> include)
 
std::vector< FaceKeyfind_par_face (std::function< bool(Face &)> include)
 
std::vector< EdgeKeyfind_par_edge (std::function< bool(Edge &)> include)
 
std::vector< NodeKeyfind_par_node (std::function< bool(Node &)> include)
 
template<typename key_type , typename value_type >
std::vector< key_type > find_par (std::function< bool(value_type &)> include)
 
template<typename value_type >
void for_each_par (std::function< void(value_type &, int)> fn)
 
template<typename simplex_type , typename return_type >
return_type map_reduce_par (std::function< return_type(simplex_type &)> map_fn, std::function< return_type(return_type, return_type)> reduce_fn, return_type default_value={})
 
template<typename value_type >
void for_each_par_sp (double partitionsize, int dimension, std::function< void(value_type &node, int threadid)> fn)
 
NodeIterator nodes () const
 
EdgeIterator edges () const
 
FaceIterator faces () const
 
TetrahedronIterator tetrahedra () const
 
void set_label (const TetrahedronKey &tid, int label)
 
Nodeget (const NodeKey &nid)
 
Edgeget (const EdgeKey &eid)
 
Faceget (const FaceKey &fid)
 
Tetrahedronget (const TetrahedronKey &tid)
 
const Nodeget (const NodeKey &nid) const
 
const Edgeget (const EdgeKey &eid) const
 
const Faceget (const FaceKey &fid) const
 
const Tetrahedronget (const TetrahedronKey &tid) const
 
SimplexSet< NodeKeyget_sorted_nodes (const FaceKey &fid, const TetrahedronKey &tid)
 
SimplexSet< NodeKeyget_sorted_nodes (const FaceKey &fid)
 
template<typename key_type >
SimplexSet< NodeKeyget_nodes (const SimplexSet< key_type > &keys)
 
template<typename key_type >
SimplexSet< EdgeKeyget_edges (const SimplexSet< key_type > &keys)
 
template<typename key_type >
SimplexSet< FaceKeyget_faces (const SimplexSet< key_type > &keys)
 
template<typename key_type >
SimplexSet< TetrahedronKeyget_tets (const SimplexSet< key_type > &keys)
 
NodeKey get_node (const EdgeKey &eid1, const EdgeKey &eid2)
 
NodeKey get_node (const EdgeKey &eid, const NodeKey &nid)
 
EdgeKey get_edge (const NodeKey &nid1, const NodeKey &nid2)
 
EdgeKey get_edge (const FaceKey &fid1, const FaceKey &fid2)
 
FaceKey get_face (const NodeKey &nid1, const NodeKey &nid2, const NodeKey &nid3)
 
FaceKey get_face (const TetrahedronKey &tid1, const TetrahedronKey &tid2)
 
TetrahedronKey get_tet (const TetrahedronKey &tid, const FaceKey &fid)
 
std::vector< vec3get_pos (const SimplexSet< NodeKey > &nids)
 
bool exists (const TetrahedronKey &t)
 
bool exists (const FaceKey &f)
 
bool exists (const EdgeKey &e)
 
bool exists (const NodeKey &n)
 
bool excluded (const TetrahedronKey &t)
 
bool excluded (const FaceKey &f)
 
bool excluded (const EdgeKey &e)
 
bool excluded (const NodeKey &n)
 
bool is_clockwise_order (const NodeKey &nid, SimplexSet< NodeKey > &nids)
 
void orient_cc (const NodeKey &nid, SimplexSet< NodeKey > &nids)
 
bool is_inverted (const TetrahedronKey &tid)
 
bool is_inverted_destination (const TetrahedronKey &tid)
 
NodeKey insert_node (const vec3 &p)
 
EdgeKey insert_edge (NodeKey node1, NodeKey node2)
 
FaceKey insert_face (EdgeKey edge1, EdgeKey edge2, EdgeKey edge3)
 
TetrahedronKey insert_tetrahedron (FaceKey face1, FaceKey face2, FaceKey face3, FaceKey face4)
 
vec3 get_barycenter (const SimplexSet< NodeKey > &nids, bool interface=false)
 
NodeKey split (const EdgeKey &eid, const vec3 &pos, const vec3 &destination)
 
void collapse (const EdgeKey &eid, const NodeKey &nid, double weight=0.5)
 
FaceKey flip_32 (const EdgeKey &eid)
 
EdgeKey flip_23 (const FaceKey &fid)
 
void flip (const EdgeKey &eid, const FaceKey &fid1, const FaceKey &fid2)
 
void flip_22 (const FaceKey &fid1, const FaceKey &fid2)
 
void flip_44 (const FaceKey &fid1, const FaceKey &fid2)
 
double volume_destination (const is_mesh::SimplexSet< is_mesh::NodeKey > &nids)
 
double signed_volume_destination (const is_mesh::SimplexSet< is_mesh::NodeKey > &nids)
 
void garbage_collect ()
 
virtual void scale (const vec3 &s)
 
void extract_surface_mesh (std::vector< vec3 > &points, std::vector< int > &faces)
 
void extract_surface_mesh_debug (std::vector< vec3 > &points, std::vector< int > &faces)
 
void extract_tet_mesh (std::vector< vec3 > &points, std::vector< int > &tets, std::vector< int > &tet_labels)
 
void validity_check (bool skip_boundary_check=false)
 
long add_gc_listener (std::function< void(const GarbageCollectDeletions &)> fn)
 
bool remove_gc_listener (long id)
 
long add_label_listener (std::function< void(const TetrahedronKey &tid, unsigned int oldValue)> fn)
 
bool remove_label_listener (long id)
 
long add_split_listener (std::function< void(const NodeKey &nid_new, const NodeKey &nid1, const NodeKey &nid2)> fn)
 
bool remove_split_listener (long id)
 
long add_collapse_listener (std::function< void(const NodeKey &nid, const NodeKey &nid_removed, double weight)> fn)
 
bool remove_collapse_listener (long id)
 
template<typename value_type >
void for_each_par_sp (double partitionsize, int dimension, std::function< void(value_type &, int)> fn)
 
template<>
kernel< NodeKey, Node > & get_kernel ()
 
template<>
kernel< EdgeKey, Edge > & get_kernel ()
 
template<>
kernel< FaceKey, Face > & get_kernel ()
 
template<>
kernel< TetrahedronKey,
Tetrahedron > & 
get_kernel ()
 

Friends

class Node
 
class Edge
 
class Face
 
class Tetrahedron
 

Member Function Documentation

void is_mesh::ISMesh::collapse ( const EdgeKey eid,
const NodeKey nid,
double  weight = 0.5 
)

Collapses the edge eid. The node nid must be adjacent to eid before the collapse. The node nid survives, while the other is removed. The weight parameter specifies how the attributes of the old nodes are weighted in the surviving node. For example the position of the surviving node is given by (1.-weight)*get(nid).get_pos() + weight*get(nid_remove).get_pos(). This means that if weight is 0, the surviving node retain its attributes.

vec3 is_mesh::ISMesh::get_barycenter ( const SimplexSet< NodeKey > &  nids,
bool  interface = false 
)

Calculates the average position of the nodes in the simplex set nids. If interface is true, the average position is only calculated among the nodes which are interface.

EdgeKey is_mesh::ISMesh::get_edge ( const NodeKey nid1,
const NodeKey nid2 
)

Returns the edge between the nodes nid1 and nid2.

EdgeKey is_mesh::ISMesh::get_edge ( const FaceKey fid1,
const FaceKey fid2 
)

Returns the edge shared by the faces fid1 and fid2.

FaceKey is_mesh::ISMesh::get_face ( const NodeKey nid1,
const NodeKey nid2,
const NodeKey nid3 
)

Returns the face between the nodes nid1, nid2 and nid3.

FaceKey is_mesh::ISMesh::get_face ( const TetrahedronKey tid1,
const TetrahedronKey tid2 
)

Returns the face shared by the tetrahedra tid1 and tid2.

NodeKey is_mesh::ISMesh::get_node ( const EdgeKey eid1,
const EdgeKey eid2 
)

Returns the node shared by the edges eid1 and eid2.

NodeKey is_mesh::ISMesh::get_node ( const EdgeKey eid,
const NodeKey nid 
)

Returns the node adjacent to edge eid which is not nid.

vector< vec3 > is_mesh::ISMesh::get_pos ( const SimplexSet< NodeKey > &  nids)

Returns the positions of nodes nids.

TetrahedronKey is_mesh::ISMesh::get_tet ( const TetrahedronKey tid,
const FaceKey fid 
)

Returns the tetrahedron which shares the face fid with tid, i.e. the neighbour to tid.

EdgeKey is_mesh::ISMesh::insert_edge ( NodeKey  node1,
NodeKey  node2 
)

Inserts an edge into the mesh. Updates the co-boundary of the boundary nodes with the newly created edge. Leaves the closure of the edge in an uncompressed state.

FaceKey is_mesh::ISMesh::insert_face ( EdgeKey  edge1,
EdgeKey  edge2,
EdgeKey  edge3 
)

Inserts a face into the mesh. Updates the co-boundary of the boundary faces with the newly created face. Leaves the closure of the face in an uncompressed state.

NodeKey is_mesh::ISMesh::insert_node ( const vec3 p)

Inserts a node into the mesh. Trivial.

TetrahedronKey is_mesh::ISMesh::insert_tetrahedron ( FaceKey  face1,
FaceKey  face2,
FaceKey  face3,
FaceKey  face4 
)

Inserts a tetrahedron into the mesh. Updates the co-boundary of the boundary edges with the newly created tetrahedron. Leaves the closure of the tetrahedron in an uncompressed state.

bool is_mesh::ISMesh::is_inverted ( const TetrahedronKey tid)

Returns whether the tetrahedron with ID tid is inverted.


The documentation for this class was generated from the following files: