MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / init_boundary_face_adjacencies

Method init_boundary_face_adjacencies

tools/Assembler/Mesh/TriangleMesh.cpp:229–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227}
228
229void TriangleMesh::init_boundary_face_adjacencies() {
230 const size_t num_boundary_edges = m_boundary_edges.rows();
231 const size_t num_boundary_vertices = m_boundary.size();
232 std::vector<std::set<size_t> > bd_vertex_edge_adjacencies(num_boundary_vertices);
233 for (size_t i=0; i<num_boundary_edges; i++) {
234 const VectorI& edge = m_boundary_edges.row(i);
235 bd_vertex_edge_adjacencies[edge[0]].insert(i);
236 bd_vertex_edge_adjacencies[edge[1]].insert(i);
237 }
238
239 std::vector<size_t> adj;
240 std::vector<size_t> adj_idx;
241 adj_idx.push_back(0);
242 for (size_t i=0; i<num_boundary_vertices; i++) {
243 const std::set<size_t>& neighbors = bd_vertex_edge_adjacencies[i];
244 adj.insert(adj.end(), neighbors.begin(), neighbors.end());
245 adj_idx.push_back(adj.size());
246 }
247
248 m_boundary_node_edge_adj.resize(adj.size());
249 std::copy(adj.begin(), adj.end(), m_boundary_node_edge_adj.data());
250
251 m_boundary_node_edge_adj_idx.resize(adj_idx.size());
252 std::copy(adj_idx.begin(), adj_idx.end(), m_boundary_node_edge_adj_idx.data());
253}
254
255void TriangleMesh::init_boundary_lengths() {
256 const size_t num_edges = m_boundary_edges.rows();

Callers

nothing calls this directly

Calls 4

sizeMethod · 0.45
insertMethod · 0.45
endMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected