9 #include <dolfinx/common/MPI.h>
10 #include <dolfinx/fem/CoordinateElement.h>
11 #include <dolfinx/graph/AdjacencyList.h>
42 template <
typename AdjacencyList32,
typename Array,
typename Vector64>
46 : _dim(
dim), _dofmap(std::forward<AdjacencyList32>(
dofmap)),
47 _index_map(
index_map), _cmap(element), _x(std::forward<Array>(
x)),
50 assert(_x.size() % 3 == 0);
51 if (_x.size() / 3 != _input_global_indices.size())
52 throw std::runtime_error(
"Geometry size mis-match");
77 std::shared_ptr<const common::IndexMap>
index_map()
const;
83 std::span<const double>
x()
const;
90 std::span<double>
x();
108 std::shared_ptr<const common::IndexMap> _index_map;
115 std::vector<double> _x;
118 std::vector<std::int64_t> _input_global_indices;
145 const std::span<const double>& x,
int dim,
146 const std::function<std::vector<int>(
A CoordinateElement manages coordinate mappings for isoparametric cells.
Definition: CoordinateElement.h:32
This class provides a static adjacency list data structure. It is commonly used to store directed gra...
Definition: AdjacencyList.h:26
Geometry stores the geometry imposed on a mesh.
Definition: Geometry.h:28
~Geometry()=default
Destructor.
Geometry(const std::shared_ptr< const common::IndexMap > &index_map, AdjacencyList32 &&dofmap, const fem::CoordinateElement &element, Array &&x, int dim, Vector64 &&input_global_indices)
Constructor.
Definition: Geometry.h:43
const graph::AdjacencyList< std::int32_t > & dofmap() const
DOF map.
Definition: Geometry.cpp:21
Geometry & operator=(Geometry &&)=default
Move Assignment.
std::shared_ptr< const common::IndexMap > index_map() const
Index map.
Definition: Geometry.cpp:26
std::span< const double > x() const
Access geometry degrees-of-freedom data (const version).
Definition: Geometry.cpp:33
Geometry(Geometry &&)=default
Move constructor.
Geometry(const Geometry &)=default
Copy constructor.
int dim() const
Return Euclidean dimension of coordinate system.
Definition: Geometry.cpp:19
const fem::CoordinateElement & cmap() const
The element that describes the geometry map.
Definition: Geometry.cpp:35
const std::vector< std::int64_t > & input_global_indices() const
Global user indices.
Definition: Geometry.cpp:37
Geometry & operator=(const Geometry &)=delete
Copy Assignment.
Topology stores the topology of a mesh, consisting of mesh entities and connectivity (incidence relat...
Definition: Topology.h:44
Miscellaneous classes, functions and types.
Mesh data structures and algorithms on meshes.
Definition: DofMap.h:30
mesh::Geometry create_geometry(MPI_Comm comm, const Topology &topology, const fem::CoordinateElement &element, const graph::AdjacencyList< std::int64_t > &cells, const std::span< const double > &x, int dim, const std::function< std::vector< int >(const graph::AdjacencyList< std::int32_t > &)> &reorder_fn=nullptr)
Build Geometry from input data.
Definition: Geometry.cpp:44