PolyFEM
Loading...
Searching...
No Matches
polyfem::mesh::MeshNodes Class Reference

#include <MeshNodes.hpp>

Collaboration diagram for polyfem::mesh::MeshNodes:
[legend]

Public Member Functions

 MeshNodes (const Mesh &mesh, const bool has_poly, const bool connect_nodes, const int max_nodes_per_edge, const int max_nodes_per_face, const int max_nodes_per_cell=0)
 
int n_nodes () const
 
int node_id_from_vertex (int v)
 
int node_id_from_edge (int e)
 
int node_id_from_face (int f)
 
int node_id_from_cell (int c)
 
int node_id_from_primitive (int primitive_id)
 
std::vector< int > node_ids_from_edge (const Navigation::Index &index, const int n_new_nodes)
 
std::vector< int > node_ids_from_face (const Navigation::Index &index, const int n_new_nodes)
 
std::vector< int > node_ids_from_edge (const Navigation3D::Index &index, const int n_new_nodes)
 
std::vector< int > node_ids_from_face (const Navigation3D::Index &index, const int n_new_nodes)
 
std::vector< int > node_ids_from_cell (const Navigation3D::Index &index, const int n_new_nodes)
 
int primitive_from_vertex (int v) const
 
int primitive_from_edge (int e) const
 
int primitive_from_face (int f) const
 
int primitive_from_cell (int c) const
 
bool is_vertex_node (int i) const
 
bool is_edge_node (int i) const
 
bool is_face_node (int i) const
 
bool is_cell_node (int i) const
 
int num_vertex_nodes () const
 
int num_edge_nodes () const
 
int num_face_nodes () const
 
int num_cell_nodes () const
 
int vertex_from_node_id (int node_id) const
 
int edge_from_node_id (int node_id) const
 
int face_from_node_id (int node_id) const
 
int cell_from_node_id (int node_id) const
 
const std::vector< int > & primitive_to_node () const
 
const std::vector< int > & node_to_primitive_gid () const
 
const std::vector< int > & node_to_primitive () const
 
RowVectorNd node_position (int node_id) const
 
bool is_boundary (int node_id) const
 
bool is_primitive_boundary (int primitive) const
 
bool is_interface (int node_id) const
 
bool is_primitive_interface (int primitive) const
 
bool is_boundary_or_interface (const int node_id) const
 
std::vector< int > boundary_nodes () const
 

Private Member Functions

int count_nonnegative_nodes (int start_i, int end_i) const
 

Private Attributes

const Meshmesh_
 
const bool connect_nodes_
 
const int edge_offset_
 
const int face_offset_
 
const int cell_offset_
 
const int max_nodes_per_edge_
 
const int max_nodes_per_face_
 
const int max_nodes_per_cell_
 
std::vector< int > primitive_to_node_
 
std::vector< int > node_to_primitive_
 
std::vector< int > node_to_primitive_gid_
 
Eigen::MatrixXd nodes_
 
std::vector< bool > is_boundary_
 
std::vector< bool > is_interface_
 

Detailed Description

Definition at line 17 of file MeshNodes.hpp.

Constructor & Destructor Documentation

◆ MeshNodes()

polyfem::mesh::MeshNodes::MeshNodes ( const Mesh mesh,
const bool  has_poly,
const bool  connect_nodes,
const int  max_nodes_per_edge,
const int  max_nodes_per_face,
const int  max_nodes_per_cell = 0 
)

Member Function Documentation

◆ boundary_nodes()

std::vector< int > polyfem::mesh::MeshNodes::boundary_nodes ( ) const

Definition at line 592 of file MeshNodes.cpp.

References is_boundary_, n_nodes(), and primitive_to_node_.

Here is the call graph for this function:

◆ cell_from_node_id()

int polyfem::mesh::MeshNodes::cell_from_node_id ( int  node_id) const

Definition at line 583 of file MeshNodes.cpp.

References cell_offset_, n_nodes(), and node_to_primitive_.

Here is the call graph for this function:

◆ count_nonnegative_nodes()

int polyfem::mesh::MeshNodes::count_nonnegative_nodes ( int  start_i,
int  end_i 
) const
private

Definition at line 607 of file MeshNodes.cpp.

References primitive_to_node_.

Referenced by num_cell_nodes(), num_edge_nodes(), num_face_nodes(), and num_vertex_nodes().

Here is the caller graph for this function:

◆ edge_from_node_id()

int polyfem::mesh::MeshNodes::edge_from_node_id ( int  node_id) const

Definition at line 569 of file MeshNodes.cpp.

References edge_offset_, face_offset_, and node_to_primitive_.

◆ face_from_node_id()

int polyfem::mesh::MeshNodes::face_from_node_id ( int  node_id) const

Definition at line 576 of file MeshNodes.cpp.

References cell_offset_, face_offset_, and node_to_primitive_.

◆ is_boundary()

bool polyfem::mesh::MeshNodes::is_boundary ( int  node_id) const
inline

Definition at line 69 of file MeshNodes.hpp.

References is_boundary_, and node_to_primitive_.

Referenced by is_boundary_or_interface(), and MeshNodes().

Here is the caller graph for this function:

◆ is_boundary_or_interface()

bool polyfem::mesh::MeshNodes::is_boundary_or_interface ( const int  node_id) const
inline

Definition at line 77 of file MeshNodes.hpp.

References is_boundary(), and is_interface().

Here is the call graph for this function:

◆ is_cell_node()

bool polyfem::mesh::MeshNodes::is_cell_node ( int  i) const
inline

Definition at line 48 of file MeshNodes.hpp.

References cell_offset_.

◆ is_edge_node()

bool polyfem::mesh::MeshNodes::is_edge_node ( int  i) const
inline

Definition at line 46 of file MeshNodes.hpp.

References edge_offset_, and face_offset_.

◆ is_face_node()

bool polyfem::mesh::MeshNodes::is_face_node ( int  i) const
inline

Definition at line 47 of file MeshNodes.hpp.

References cell_offset_, and face_offset_.

◆ is_interface()

bool polyfem::mesh::MeshNodes::is_interface ( int  node_id) const
inline

Definition at line 73 of file MeshNodes.hpp.

References is_interface_, and node_to_primitive_.

Referenced by is_boundary_or_interface().

Here is the caller graph for this function:

◆ is_primitive_boundary()

bool polyfem::mesh::MeshNodes::is_primitive_boundary ( int  primitive) const
inline

Definition at line 70 of file MeshNodes.hpp.

References is_boundary_.

◆ is_primitive_interface()

bool polyfem::mesh::MeshNodes::is_primitive_interface ( int  primitive) const
inline

Definition at line 74 of file MeshNodes.hpp.

References is_interface_.

◆ is_vertex_node()

bool polyfem::mesh::MeshNodes::is_vertex_node ( int  i) const
inline

Definition at line 45 of file MeshNodes.hpp.

References edge_offset_.

◆ n_nodes()

int polyfem::mesh::MeshNodes::n_nodes ( ) const
inline

Definition at line 23 of file MeshNodes.hpp.

References node_to_primitive_.

Referenced by boundary_nodes(), polyfem::basis::SplineBasis2d::build_bases(), polyfem::basis::SplineBasis3d::build_bases(), cell_from_node_id(), MeshNodes(), node_id_from_primitive(), node_ids_from_cell(), node_ids_from_edge(), node_ids_from_edge(), node_ids_from_face(), node_ids_from_face(), and num_cell_nodes().

Here is the caller graph for this function:

◆ node_id_from_cell()

int polyfem::mesh::MeshNodes::node_id_from_cell ( int  c)

Definition at line 555 of file MeshNodes.cpp.

References cell_offset_, max_nodes_per_cell_, and node_id_from_primitive().

Referenced by node_ids_from_cell().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ node_id_from_edge()

int polyfem::mesh::MeshNodes::node_id_from_edge ( int  e)

Definition at line 545 of file MeshNodes.cpp.

References edge_offset_, max_nodes_per_edge_, and node_id_from_primitive().

Here is the call graph for this function:

◆ node_id_from_face()

int polyfem::mesh::MeshNodes::node_id_from_face ( int  f)

Definition at line 550 of file MeshNodes.cpp.

References face_offset_, max_nodes_per_face_, and node_id_from_primitive().

Here is the call graph for this function:

◆ node_id_from_primitive()

int polyfem::mesh::MeshNodes::node_id_from_primitive ( int  primitive_id)

Definition at line 157 of file MeshNodes.cpp.

References polyfem::mesh::Mesh::cell_barycenter(), cell_offset_, connect_nodes_, polyfem::mesh::Mesh::edge_barycenter(), edge_offset_, polyfem::mesh::Mesh::face_barycenter(), face_offset_, mesh_, n_nodes(), node_to_primitive_, node_to_primitive_gid_, nodes_, polyfem::mesh::Mesh::point(), and primitive_to_node_.

Referenced by node_id_from_cell(), node_id_from_edge(), node_id_from_face(), and node_id_from_vertex().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ node_id_from_vertex()

int polyfem::mesh::MeshNodes::node_id_from_vertex ( int  v)

Definition at line 540 of file MeshNodes.cpp.

References node_id_from_primitive().

Here is the call graph for this function:

◆ node_ids_from_cell()

std::vector< int > polyfem::mesh::MeshNodes::node_ids_from_cell ( const Navigation3D::Index index,
const int  n_new_nodes 
)

Definition at line 462 of file MeshNodes.cpp.

References polyfem::mesh::Mesh3D::cell_node(), cell_offset_, connect_nodes_, polyfem::mesh::Navigation3D::Index::element, polyfem::mesh::Mesh::is_simplex(), max_nodes_per_cell_, mesh_, n_nodes(), node_id_from_cell(), node_to_primitive_, node_to_primitive_gid_, nodes_, and primitive_to_node_.

Here is the call graph for this function:

◆ node_ids_from_edge() [1/2]

std::vector< int > polyfem::mesh::MeshNodes::node_ids_from_edge ( const Navigation3D::Index index,
const int  n_new_nodes 
)

Definition at line 252 of file MeshNodes.cpp.

References polyfem::mesh::Navigation3D::Index::edge, polyfem::mesh::Mesh3D::edge_node(), edge_offset_, max_nodes_per_edge_, mesh_, n_nodes(), node_position(), node_to_primitive_, node_to_primitive_gid_, nodes_, and primitive_to_node_.

Here is the call graph for this function:

◆ node_ids_from_edge() [2/2]

std::vector< int > polyfem::mesh::MeshNodes::node_ids_from_edge ( const Navigation::Index index,
const int  n_new_nodes 
)

◆ node_ids_from_face() [1/2]

std::vector< int > polyfem::mesh::MeshNodes::node_ids_from_face ( const Navigation3D::Index index,
const int  n_new_nodes 
)

◆ node_ids_from_face() [2/2]

std::vector< int > polyfem::mesh::MeshNodes::node_ids_from_face ( const Navigation::Index index,
const int  n_new_nodes 
)

Definition at line 310 of file MeshNodes.cpp.

References connect_nodes_, polyfem::mesh::Navigation::Index::face, polyfem::mesh::Mesh2D::face_node(), face_offset_, polyfem::mesh::Mesh::is_simplex(), max_nodes_per_face_, mesh_, n_nodes(), node_to_primitive_, node_to_primitive_gid_, nodes_, and primitive_to_node_.

Here is the call graph for this function:

◆ node_position()

RowVectorNd polyfem::mesh::MeshNodes::node_position ( int  node_id) const
inline

Definition at line 66 of file MeshNodes.hpp.

References node_to_primitive_, and nodes_.

Referenced by node_ids_from_edge(), and node_ids_from_edge().

Here is the caller graph for this function:

◆ node_to_primitive()

const std::vector< int > & polyfem::mesh::MeshNodes::node_to_primitive ( ) const
inline

Definition at line 63 of file MeshNodes.hpp.

References node_to_primitive_.

◆ node_to_primitive_gid()

const std::vector< int > & polyfem::mesh::MeshNodes::node_to_primitive_gid ( ) const
inline

Definition at line 62 of file MeshNodes.hpp.

References node_to_primitive_gid_.

◆ num_cell_nodes()

int polyfem::mesh::MeshNodes::num_cell_nodes ( ) const
inline

Definition at line 53 of file MeshNodes.hpp.

References cell_offset_, count_nonnegative_nodes(), and n_nodes().

Here is the call graph for this function:

◆ num_edge_nodes()

int polyfem::mesh::MeshNodes::num_edge_nodes ( ) const
inline

Definition at line 51 of file MeshNodes.hpp.

References count_nonnegative_nodes(), edge_offset_, and face_offset_.

Here is the call graph for this function:

◆ num_face_nodes()

int polyfem::mesh::MeshNodes::num_face_nodes ( ) const
inline

Definition at line 52 of file MeshNodes.hpp.

References cell_offset_, count_nonnegative_nodes(), and face_offset_.

Here is the call graph for this function:

◆ num_vertex_nodes()

int polyfem::mesh::MeshNodes::num_vertex_nodes ( ) const
inline

Definition at line 50 of file MeshNodes.hpp.

References count_nonnegative_nodes(), and edge_offset_.

Here is the call graph for this function:

◆ primitive_from_cell()

int polyfem::mesh::MeshNodes::primitive_from_cell ( int  c) const
inline

Definition at line 43 of file MeshNodes.hpp.

References cell_offset_.

◆ primitive_from_edge()

int polyfem::mesh::MeshNodes::primitive_from_edge ( int  e) const
inline

Definition at line 41 of file MeshNodes.hpp.

References edge_offset_.

◆ primitive_from_face()

int polyfem::mesh::MeshNodes::primitive_from_face ( int  f) const
inline

Definition at line 42 of file MeshNodes.hpp.

References face_offset_.

◆ primitive_from_vertex()

int polyfem::mesh::MeshNodes::primitive_from_vertex ( int  v) const
inline

Definition at line 40 of file MeshNodes.hpp.

◆ primitive_to_node()

const std::vector< int > & polyfem::mesh::MeshNodes::primitive_to_node ( ) const
inline

Definition at line 61 of file MeshNodes.hpp.

References primitive_to_node_.

◆ vertex_from_node_id()

int polyfem::mesh::MeshNodes::vertex_from_node_id ( int  node_id) const

Definition at line 562 of file MeshNodes.cpp.

References edge_offset_, and node_to_primitive_.

Member Data Documentation

◆ cell_offset_

◆ connect_nodes_

const bool polyfem::mesh::MeshNodes::connect_nodes_
private

◆ edge_offset_

◆ face_offset_

◆ is_boundary_

std::vector<bool> polyfem::mesh::MeshNodes::is_boundary_
private

Definition at line 103 of file MeshNodes.hpp.

Referenced by boundary_nodes(), is_boundary(), is_primitive_boundary(), and MeshNodes().

◆ is_interface_

std::vector<bool> polyfem::mesh::MeshNodes::is_interface_
private

Definition at line 104 of file MeshNodes.hpp.

Referenced by is_interface(), is_primitive_interface(), and MeshNodes().

◆ max_nodes_per_cell_

const int polyfem::mesh::MeshNodes::max_nodes_per_cell_
private

Definition at line 94 of file MeshNodes.hpp.

Referenced by node_id_from_cell(), and node_ids_from_cell().

◆ max_nodes_per_edge_

const int polyfem::mesh::MeshNodes::max_nodes_per_edge_
private

Definition at line 92 of file MeshNodes.hpp.

Referenced by node_id_from_edge(), node_ids_from_edge(), and node_ids_from_edge().

◆ max_nodes_per_face_

const int polyfem::mesh::MeshNodes::max_nodes_per_face_
private

Definition at line 93 of file MeshNodes.hpp.

Referenced by node_id_from_face(), node_ids_from_face(), and node_ids_from_face().

◆ mesh_

const Mesh& polyfem::mesh::MeshNodes::mesh_
private

◆ node_to_primitive_

◆ node_to_primitive_gid_

std::vector<int> polyfem::mesh::MeshNodes::node_to_primitive_gid_
private

◆ nodes_

Eigen::MatrixXd polyfem::mesh::MeshNodes::nodes_
private

◆ primitive_to_node_


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