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_face (const Navigation3D::Index &index, const int n_new_nodes, const int n_new_nodesq)
 
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
 
const std::vector< int > & in_ordered_vertices () const
 
RowVectorNd node_position (int node_id) const
 
void finalize ()
 Called once all the nodes are created (at the end of the basis construction): computes the node tags from the mesh.
 
int node_tag (const int node_id) const
 Point-selection id of a node (Mesh::get_node_id of its vertex): -1 for nodes that are not on a vertex, and for every node if the mesh has no node ids or finalize() was not called.
 
bool has_node_tags () 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 Mesh & mesh_
 
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_
 
std::vector< int > in_ordered_vertices_
 
std::vector< int > node_tags_
 

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 836 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

◆ count_nonnegative_nodes()

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

Definition at line 851 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 795 of file MeshNodes.cpp.

References edge_offset_, face_offset_, max_nodes_per_edge_, and node_to_primitive_.

◆ face_from_node_id()

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

Definition at line 802 of file MeshNodes.cpp.

References cell_offset_, face_offset_, max_nodes_per_face_, and node_to_primitive_.

◆ finalize()

void polyfem::mesh::MeshNodes::finalize ( )

Called once all the nodes are created (at the end of the basis construction): computes the node tags from the mesh.

Definition at line 818 of file MeshNodes.cpp.

References polyfem::mesh::Mesh::get_node_id(), polyfem::mesh::Mesh::has_node_ids(), is_vertex_node(), mesh_, n_nodes(), node_tags_, and node_to_primitive_.

Here is the call graph for this function:

◆ has_node_tags()

bool polyfem::mesh::MeshNodes::has_node_tags ( ) const
inline

Definition at line 81 of file MeshNodes.hpp.

References node_tags_.

Referenced by polyfem::assembler::Problem::setup_nodal_bc().

Here is the caller graph for this function:

◆ in_ordered_vertices()

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

Definition at line 66 of file MeshNodes.hpp.

References in_ordered_vertices_.

◆ is_boundary()

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

Definition at line 84 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 92 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 50 of file MeshNodes.hpp.

References cell_offset_.

◆ is_edge_node()

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

Definition at line 48 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 49 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 88 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 85 of file MeshNodes.hpp.

References is_boundary_.

◆ is_primitive_interface()

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

Definition at line 89 of file MeshNodes.hpp.

References is_interface_.

◆ is_vertex_node()

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

Definition at line 47 of file MeshNodes.hpp.

References edge_offset_.

Referenced by finalize().

Here is the caller graph for this function:

◆ 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(), finalize(), 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 node_ids_from_face().

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 781 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 771 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 776 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 159 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_, in_ordered_vertices_, polyfem::log_and_throw_error(), max_nodes_per_cell_, max_nodes_per_edge_, max_nodes_per_face_, 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 766 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 
)

◆ 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 265 of file MeshNodes.cpp.

References polyfem::mesh::Navigation3D::Index::edge, polyfem::mesh::Mesh3D::edge_node(), edge_offset_, in_ordered_vertices_, 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/3]

◆ node_ids_from_face() [2/3]

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

◆ node_ids_from_face() [3/3]

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

Definition at line 320 of file MeshNodes.cpp.

References connect_nodes_, polyfem::mesh::Navigation::Index::face, polyfem::mesh::Mesh2D::face_node(), face_offset_, in_ordered_vertices_, 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 69 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_tag()

int polyfem::mesh::MeshNodes::node_tag ( const int  node_id) const
inline

Point-selection id of a node (Mesh::get_node_id of its vertex): -1 for nodes that are not on a vertex, and for every node if the mesh has no node ids or finalize() was not called.

Definition at line 77 of file MeshNodes.hpp.

References node_tags_.

Referenced by polyfem::assembler::RhsAssembler::compute_energy(), polyfem::io::OutGeometryData::save_points(), and polyfem::assembler::Problem::setup_nodal_bc().

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 65 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 64 of file MeshNodes.hpp.

References node_to_primitive_gid_.

◆ num_cell_nodes()

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

Definition at line 55 of file MeshNodes.hpp.

References cell_offset_, count_nonnegative_nodes(), and primitive_to_node_.

Here is the call graph for this function:

◆ num_edge_nodes()

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

Definition at line 53 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 54 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 52 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 45 of file MeshNodes.hpp.

References cell_offset_, and max_nodes_per_cell_.

◆ primitive_from_edge()

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

Definition at line 43 of file MeshNodes.hpp.

References edge_offset_, and max_nodes_per_edge_.

◆ primitive_from_face()

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

Definition at line 44 of file MeshNodes.hpp.

References face_offset_, and max_nodes_per_face_.

◆ primitive_from_vertex()

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

Definition at line 42 of file MeshNodes.hpp.

◆ primitive_to_node()

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

Definition at line 63 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 788 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_

◆ in_ordered_vertices_

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

◆ is_boundary_

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

Definition at line 118 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 119 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

◆ max_nodes_per_edge_

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

◆ max_nodes_per_face_

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

◆ mesh_

◆ node_tags_

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

Definition at line 125 of file MeshNodes.hpp.

Referenced by finalize(), has_node_tags(), and node_tag().

◆ 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: