9 #include <dolfinx/common/MPI.h>
10 #include <dolfinx/fem/CoordinateElement.h>
11 #include <dolfinx/graph/AdjacencyList.h>
12 #include <dolfinx/graph/scotch.h>
16 #include <xtensor/xbuilder.hpp>
17 #include <xtensor/xtensor.hpp>
18 #include <xtensor/xview.hpp>
27 class CoordinateElement;
40 template <
typename AdjacencyList32,
typename Array,
typename Vector64>
44 : _dim(
x.shape(1)), _dofmap(std::forward<AdjacencyList32>(
dofmap)),
45 _index_map(
index_map), _cmap(element), _x(std::forward<Array>(
x)),
48 assert(_x.shape(1) > 0 and _x.shape(1) <= 3);
49 if (_x.shape(0) != _input_global_indices.size())
50 throw std::runtime_error(
"Size mis-match");
55 xt::xtensor<double, 2> c
56 = xt::zeros<double>({_x.shape(0),
static_cast<std::size_t
>(3)});
60 auto x_view = xt::view(c, xt::all(), xt::range(0, _dim));
89 std::shared_ptr<const common::IndexMap>
index_map()
const;
92 xt::xtensor<double, 2>&
x();
95 const xt::xtensor<double, 2>&
x()
const;
112 std::shared_ptr<const common::IndexMap> _index_map;
118 xt::xtensor<double, 2> _x;
121 std::vector<std::int64_t> _input_global_indices;
130 const xt::xtensor<double, 2>& x,
131 const std::function<std::vector<int>(
This class manages coordinate mappings for isoparametric cells.
Definition: CoordinateElement.h:29
This class provides a static adjacency list data structure. It is commonly used to store directed gra...
Definition: AdjacencyList.h:47
Geometry stores the geometry imposed on a mesh.
Definition: Geometry.h:37
Geometry(const std::shared_ptr< const common::IndexMap > &index_map, AdjacencyList32 &&dofmap, const fem::CoordinateElement &element, Array &&x, Vector64 &&input_global_indices)
Constructor.
Definition: Geometry.h:41
const graph::AdjacencyList< std::int32_t > & dofmap() const
DOF map.
Definition: Geometry.cpp:22
~Geometry()=default
Destructor.
Geometry & operator=(Geometry &&)=default
Move Assignment.
const fem::CoordinateElement & cmap() const
The element that describes the geometry map.
Definition: Geometry.cpp:36
xt::xtensor< double, 2 > & x()
Geometry degrees-of-freedom.
Definition: Geometry.cpp:32
std::shared_ptr< const common::IndexMap > index_map() const
Index map.
Definition: Geometry.cpp:27
const std::vector< std::int64_t > & input_global_indices() const
Global user indices.
Definition: Geometry.cpp:38
Geometry & operator=(const Geometry &)=delete
Copy Assignment.
Geometry(Geometry &&)=default
Move constructor.
Geometry(const Geometry &)=default
Copy constructor.
int dim() const
Return Euclidean dimension of coordinate system.
Definition: Geometry.cpp:20
Topology stores the topology of a mesh, consisting of mesh entities and connectivity (incidence relat...
Definition: Topology.h:56
Miscellaneous classes, functions and types.
Finite element method functionality.
Definition: assemble_matrix_impl.h:23
Mesh data structures and algorithms on meshes.
Definition: DirichletBC.h:20
mesh::Geometry create_geometry(MPI_Comm comm, const Topology &topology, const fem::CoordinateElement &coordinate_element, const graph::AdjacencyList< std::int64_t > &cells, const xt::xtensor< double, 2 > &x, const std::function< std::vector< int >(const graph::AdjacencyList< std::int32_t > &)> &reorder_fn=nullptr)
Build Geometry.
Definition: Geometry.cpp:45