DOLFINx
0.1.0
DOLFINx C++ interface
|
9 #include <dolfinx/common/MPI.h>
10 #include <dolfinx/fem/CoordinateElement.h>
11 #include <dolfinx/graph/AdjacencyList.h>
14 #include <xtensor/xbuilder.hpp>
15 #include <xtensor/xtensor.hpp>
16 #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)});
57 xt::view(c, xt::all(), xt::range(0, _dim)) = _x;
84 std::shared_ptr<const common::IndexMap>
index_map()
const;
87 xt::xtensor<double, 2>&
x();
90 const xt::xtensor<double, 2>&
x()
const;
107 std::shared_ptr<const common::IndexMap> _index_map;
113 xt::xtensor<double, 2> _x;
116 std::vector<std::int64_t> _input_global_indices;
124 const xt::xtensor<double, 2>& x);
const graph::AdjacencyList< std::int32_t > & dofmap() const
DOF map.
Definition: Geometry.cpp:21
xt::xtensor< double, 2 > & x()
Geometry degrees-of-freedom.
Definition: Geometry.cpp:31
const fem::CoordinateElement & cmap() const
The element that describes the geometry map.
Definition: Geometry.cpp:35
This class provides a static adjacency list data structure. It is commonly used to store directed gra...
Definition: AdjacencyList.h:46
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
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)
Build Geometry FIXME: document.
Definition: Geometry.cpp:45
Geometry & operator=(const Geometry &)=delete
Copy Assignment.
int dim() const
Return Euclidean dimension of coordinate system.
Definition: Geometry.cpp:19
std::shared_ptr< const common::IndexMap > index_map() const
Index map.
Definition: Geometry.cpp:26
~Geometry()=default
Destructor.
const std::vector< std::int64_t > & input_global_indices() const
Global user indices.
Definition: Geometry.cpp:37
Geometry stores the geometry imposed on a mesh.
Definition: Geometry.h:36
This class manages coordinate mappings for isoparametric cells.
Definition: CoordinateElement.h:30