DSC
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DSC::DeformableSimplicialComplex Class Reference

Public Member Functions

 DeformableSimplicialComplex (std::vector< vec3 > &points, std::vector< int > &tets, const std::vector< int > &tet_labels)
 SimplicialComplex constructor.
 
 DeformableSimplicialComplex (std::shared_ptr< is_mesh::ISMesh > ismesh)
 SimplicialComplex constructor.
 
std::shared_ptr< is_mesh::ISMeshget_shared_is_mesh ()
 
is_mesh::ISMeshget_is_mesh ()
 
virtual void set_is_mesh (std::shared_ptr< is_mesh::ISMesh > ismesh)
 
void set_avg_edge_length (double avg_edge_length=0.)
 
void set_parameters (parameters pars_)
 
parameters get_parameters ()
 
virtual void add_design_domain (std::shared_ptr< is_mesh::Geometry > geometry)
 
virtual void clear_design_domain ()
 
void set_subdomain (std::shared_ptr< is_mesh::Geometry > subdomain)
 
void clear_subdomain ()
 
std::shared_ptr
< is_mesh::Geometry
get_subdomain ()
 
virtual void set_labels (const is_mesh::Geometry &geometry, int label)
 
virtual bool is_movable (const is_mesh::NodeKey &nid)
 
virtual void set_destination (const is_mesh::NodeKey &nid, const vec3 &dest)
 
is_mesh::NodeIterator nodes () const
 
is_mesh::EdgeIterator edges () const
 
is_mesh::FaceIterator faces () const
 
is_mesh::TetrahedronIterator tetrahedra () const
 
double get_min_tet_quality () const
 
double get_deg_tet_quality () const
 
double get_deg_face_quality () const
 
double get_min_face_quality () const
 
double get_avg_edge_length () const
 
const is_mesh::MultipleGeometryget_design_domain () const
 
void smooth_interface_laplacian (is_mesh::SimplexSet< is_mesh::NodeKey > nodes, double weight=0.5)
 
void smooth_interface_taubin (is_mesh::SimplexSet< is_mesh::NodeKey > nodes, double u=0.5, double v=-0.52)
 
void deform (int num_steps=10, bool optimizeMeshStructure=true)
 
double intersection_with_link (const is_mesh::NodeKey &n, const vec3 &destination)
 
is_mesh::NodeKey split (const is_mesh::TetrahedronKey &tid)
 
is_mesh::NodeKey split (const is_mesh::FaceKey &fid)
 
is_mesh::NodeKey split (const is_mesh::EdgeKey &eid)
 
std::vector< vec3get_interface_face_positions ()
 
vec3 get_normal (const is_mesh::FaceKey &fid)
 
vec3 get_normal (const is_mesh::NodeKey &nid)
 
vec3 get_barycenter (const is_mesh::NodeKey &nid, bool interface=false)
 
double quality (const is_mesh::EdgeKey &eid)
 
is_mesh::FaceKey largest_face (const is_mesh::SimplexSet< is_mesh::FaceKey > &fids)
 
is_mesh::EdgeKey shortest_edge (const is_mesh::SimplexSet< is_mesh::EdgeKey > &eids)
 
is_mesh::EdgeKey longest_edge (const is_mesh::SimplexSet< is_mesh::EdgeKey > &eids)
 
double min_quality (const is_mesh::SimplexSet< is_mesh::TetrahedronKey > &tids)
 
double min_quality (const is_mesh::SimplexSet< is_mesh::FaceKey > &fids, const vec3 &pos)
 
double min_quality (const is_mesh::SimplexSet< is_mesh::FaceKey > &fids, const vec3 &pos_old, const vec3 &pos_new)
 
void min_quality (const is_mesh::SimplexSet< is_mesh::FaceKey > &fids, const vec3 &pos_old, const vec3 &pos_new, double &min_q_old, double &min_q_new)
 
double get_max_edge_length () const
 
double compute_avg_edge_length ()
 
double cos_dihedral_angle (const is_mesh::FaceKey &f1, const is_mesh::FaceKey &f2)
 
double dihedral_angle (const is_mesh::FaceKey &f1, const is_mesh::FaceKey &f2)
 
std::vector< double > cos_dihedral_angles (const is_mesh::TetrahedronKey &tid)
 
double min_cos_dihedral_angle (const is_mesh::TetrahedronKey &t)
 
double min_dihedral_angle (const is_mesh::TetrahedronKey &t)
 
void get_qualities (std::vector< int > &histogram, double &min_quality)
 
void get_dihedral_angles (std::vector< int > &histogram, double &min_angle, double &max_angle)
 
double min_quality ()
 
void count_nodes (int &total, int &object)
 Counts the total number of nodes and the number of nodes on the interface(s).
 
void count_edges (int &total, int &object)
 Counts the total number of edges and the number of edges on the interface(s).
 
void count_faces (int &total, int &object)
 Counts the total number of faces and the number of faces on the interface(s).
 
void count_tetrahedra (int &total, int &object)
 Counts the total number of tetrahedra and the number of tetrahedra in the object(s).
 
void test_split_collapse ()
 
void test_flip23_flip32 ()
 
void test_flip44 ()
 
void test_flip22 ()
 
bool validity_check ()
 

Static Public Member Functions

static std::string header_version ()
 
static std::string lib_version ()
 

Protected Member Functions

virtual bool is_unsafe_editable (const is_mesh::NodeKey &nid)
 
virtual bool is_unsafe_editable (const is_mesh::EdgeKey &eid)
 
virtual bool is_unsafe_editable (const is_mesh::FaceKey &fid)
 
virtual bool is_unsafe_editable (const is_mesh::TetrahedronKey &tid)
 
virtual bool is_safe_editable (const is_mesh::NodeKey &nid)
 
virtual bool is_safe_editable (const is_mesh::EdgeKey &eid)
 
virtual bool is_safe_editable (const is_mesh::FaceKey &fid)
 
virtual bool is_safe_editable (const is_mesh::TetrahedronKey &tid)
 
void set_pos (const is_mesh::NodeKey &nid, const vec3 &p)
 

Protected Attributes

std::shared_ptr< is_mesh::ISMeshis_mesh_ptr
 
is_mesh::MultipleGeometry design_domain
 
double AVG_LENGTH
 
double AVG_AREA
 
double AVG_VOLUME
 
double FLIP_EDGE_INTERFACE_FLATNESS = 0.995
 
parameters pars
 

Member Function Documentation

double DSC::DeformableSimplicialComplex::cos_dihedral_angle ( const is_mesh::FaceKey f1,
const is_mesh::FaceKey f2 
)

Returns the cosine to the dihedral angle between face f1 and face f2.

void DSC::DeformableSimplicialComplex::deform ( int  num_steps = 10,
bool  optimizeMeshStructure = true 
)

Moves all the vertices to their destination which can be set by the set_destination() function.

double DSC::DeformableSimplicialComplex::dihedral_angle ( const is_mesh::FaceKey f1,
const is_mesh::FaceKey f2 
)

Returns the dihedral angle between face f1 and face f2.

vec3 DSC::DeformableSimplicialComplex::get_barycenter ( const is_mesh::NodeKey nid,
bool  interface = false 
)

Calculates the average position of the neighbouring nodes to node n. If interface is true, the average position is only calculated among the neighbouring nodes which are interface.

void DSC::DeformableSimplicialComplex::get_dihedral_angles ( std::vector< int > &  histogram,
double &  min_angle,
double &  max_angle 
)

Calculates the dihedral angles in the SimplicialComplex and returns these in a histogram, along with the minimum and maximum dihedral angles.

vec3 DSC::DeformableSimplicialComplex::get_normal ( const is_mesh::FaceKey fid)

Returns the normal to interface face fid.

vec3 DSC::DeformableSimplicialComplex::get_normal ( const is_mesh::NodeKey nid)

Returns the normal to interface node n.

double DSC::DeformableSimplicialComplex::intersection_with_link ( const is_mesh::NodeKey n,
const vec3 destination 
)

Returns the intersection point (= pos + t*(destination-pos)) with the link of the node n and when moving the node n to the new position destination.

bool DSC::DeformableSimplicialComplex::is_safe_editable ( const is_mesh::NodeKey nid)
protectedvirtual

key exists and is non interface and non boundary

bool DSC::DeformableSimplicialComplex::is_safe_editable ( const is_mesh::EdgeKey eid)
protectedvirtual

key exists and is non interface and non boundary

bool DSC::DeformableSimplicialComplex::is_safe_editable ( const is_mesh::FaceKey fid)
protectedvirtual

key exists and is non interface and non boundary

bool DSC::DeformableSimplicialComplex::is_safe_editable ( const is_mesh::TetrahedronKey tid)
protectedvirtual

key exists

bool DSC::DeformableSimplicialComplex::is_unsafe_editable ( const is_mesh::NodeKey nid)
protectedvirtual

key exists and is non boundary

bool DSC::DeformableSimplicialComplex::is_unsafe_editable ( const is_mesh::EdgeKey eid)
protectedvirtual

key exists and is non boundary

bool DSC::DeformableSimplicialComplex::is_unsafe_editable ( const is_mesh::FaceKey fid)
protectedvirtual

key exists and is non boundary

bool DSC::DeformableSimplicialComplex::is_unsafe_editable ( const is_mesh::TetrahedronKey tid)
protectedvirtual

key exists

FaceKey DSC::DeformableSimplicialComplex::largest_face ( const is_mesh::SimplexSet< is_mesh::FaceKey > &  fids)

Returns the largest face in the simplex set.

EdgeKey DSC::DeformableSimplicialComplex::longest_edge ( const is_mesh::SimplexSet< is_mesh::EdgeKey > &  eids)

Returns the longest edge in the simplex set.

double DSC::DeformableSimplicialComplex::min_cos_dihedral_angle ( const is_mesh::TetrahedronKey t)

Returns the cosine of the minimum dihedral angle between the faces of tetrahedron t.

double DSC::DeformableSimplicialComplex::min_dihedral_angle ( const is_mesh::TetrahedronKey t)

Returns the minimum dihedral angle between the faces of tetrahedron t.

double DSC::DeformableSimplicialComplex::min_quality ( const is_mesh::SimplexSet< is_mesh::TetrahedronKey > &  tids)

Returns the minimum quality of the tetrahedra in simplex set s.

double DSC::DeformableSimplicialComplex::min_quality ( const is_mesh::SimplexSet< is_mesh::FaceKey > &  fids,
const vec3 pos 
)

Returns the minimum tetrahedral quality of a node with position pos. The faces in the link of the node should be passed in fids.

double DSC::DeformableSimplicialComplex::min_quality ( const is_mesh::SimplexSet< is_mesh::FaceKey > &  fids,
const vec3 pos_old,
const vec3 pos_new 
)

Returns the new minimum tetrahedral quality when moving a node from old_pos to new_pos. The faces in the link of the node should be passed in fids.

void DSC::DeformableSimplicialComplex::min_quality ( const is_mesh::SimplexSet< is_mesh::FaceKey > &  fids,
const vec3 pos_old,
const vec3 pos_new,
double &  min_q_old,
double &  min_q_new 
)

Returns the old (in min_q_old) and new (in min_q_new) minimum tetrahedral quality of when moving a node from old_pos to new_pos. The faces in the link of the node should be passed in fids.

void DSC::DeformableSimplicialComplex::set_destination ( const is_mesh::NodeKey nid,
const vec3 dest 
)
virtual

Sets the destination where the node n is moved to when deform() is called.

void DSC::DeformableSimplicialComplex::set_pos ( const is_mesh::NodeKey nid,
const vec3 p 
)
protected

Sets the position of node n.

EdgeKey DSC::DeformableSimplicialComplex::shortest_edge ( const is_mesh::SimplexSet< is_mesh::EdgeKey > &  eids)

Returns the shortest edge in the simplex set.

NodeKey DSC::DeformableSimplicialComplex::split ( const is_mesh::TetrahedronKey tid)

Split a tetrahedron t and returns the new node which is positioned at the barycenter of the vertices of t.

NodeKey DSC::DeformableSimplicialComplex::split ( const is_mesh::FaceKey fid)

Split a face f and returns the new node which is positioned at the barycenter of the vertices of f.

NodeKey DSC::DeformableSimplicialComplex::split ( const is_mesh::EdgeKey eid)

Split an edge e and returns the new node which is placed at the middle of e.

bool DSC::DeformableSimplicialComplex::validity_check ( )

Validates that the constraints in the parameters is satisfied


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