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

Method read_mesh

cpp/dolfinx/io/XDMFFile.cpp:186–202  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

184}
185//-----------------------------------------------------------------------------
186mesh::Mesh<double>
187XDMFFile::read_mesh(const fem::CoordinateElement<double>& element,
188 mesh::GhostMode mode, const std::string& name,
189 const std::string& xpath,
190 std::optional<std::int32_t> max_facet_to_cell_links) const
191{
192 // Read mesh data
193 auto [cells, cshape] = XDMFFile::read_topology_data(name, xpath);
194 auto [x, xshape] = XDMFFile::read_geometry_data(name, xpath);
195
196 // Create mesh
197 const std::vector<double>& _x = std::get<std::vector<double>>(x);
198 mesh::Mesh<double> mesh = mesh::create_mesh(
199 _comm.comm(), cells, element, _x, xshape, mode, max_facet_to_cell_links);
200 mesh.name = name;
201 return mesh;
202}
203//-----------------------------------------------------------------------------
204std::pair<std::vector<std::int64_t>, std::array<std::size_t, 2>>
205XDMFFile::read_topology_data(const std::string& name,

Callers 1

test_read_named_meshtagsFunction · 0.45

Calls 2

create_meshFunction · 0.50
commMethod · 0.45

Tested by 1

test_read_named_meshtagsFunction · 0.36