MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / vtk_quadrilateral

Function vtk_quadrilateral

cpp/dolfinx/io/cells.cpp:372–399  ·  view source on GitHub ↗

-----------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

370}
371//-----------------------------------------------------------------------------
372std::vector<std::uint16_t> vtk_quadrilateral(int num_nodes)
373{
374 std::vector<std::uint16_t> map;
375 map.reserve(num_nodes);
376
377 // Vertices
378 map.insert(map.begin(), {0, 1, 3, 2});
379
380 const int n
381 = io::cells::cell_degree(mesh::CellType::quadrilateral, num_nodes);
382
383 // Edges
384 const int edge_nodes = n - 1;
385 for (int k = 0; k < edge_nodes; ++k)
386 map.push_back(4 + k);
387 for (int k = 0; k < edge_nodes; ++k)
388 map.push_back(4 + 2 * edge_nodes + k);
389 for (int k = 0; k < edge_nodes; ++k)
390 map.push_back(4 + 3 * edge_nodes + k);
391 for (int k = 0; k < edge_nodes; ++k)
392 map.push_back(4 + edge_nodes + k);
393
394 // Face
395 for (int k = 0; k < edge_nodes * edge_nodes; ++k)
396 map.push_back(4 + edge_nodes * 4 + k);
397
398 return map;
399}
400//-----------------------------------------------------------------------------
401std::vector<std::uint16_t> vtk_hexahedron(int num_nodes)
402{

Callers 1

perm_vtkMethod · 0.85

Calls 1

insertMethod · 0.80

Tested by

no test coverage detected