35 CSRMatrix MeshTopology::NodeCellNodeIncidence(shared_ptr<Mesh> mesh)
37 const auto& nodes = mesh->GetNodes();
38 const size_t num_nodes = nodes.size();
47 for (
size_t n_i = 0; n_i < num_nodes; ++n_i) {
48 const auto node = nodes[n_i];
51 for (
const auto nbr : mesh->GetNodeOwningNeighbors(node)) {
52 const int c_i = nbr.GetCell()->GetIndex();
71 CSRMatrix MeshTopology::NodeEdgeNodeIncidence(shared_ptr<Mesh> mesh)
73 const auto& nodes = mesh->GetNodes();
74 const size_t num_nodes = nodes.size();
83 for (
size_t n_i = 0; n_i < num_nodes; ++n_i) {
84 const auto node = nodes[n_i];
87 for (
const auto nbr : mesh->GetNodeOwningNeighbors(node)) {
88 const int n1_i = nbr.GetNb1()->GetIndex();
89 const int n2_i = nbr.GetNb2()->GetIndex();
Namespace for miscellaneous utilities.
Represents a binary matrix with n rows and m columns in a Compressed Sparse Row representation.
Namespace for the core simulator.
Interface for MeshTopology.
std::vector< std::size_t > row_ptr
Indices to col_ind elements where rows start.
std::vector< int > col_ind
Indices of columns that have nonzeros in a row.