24 namespace unstructured_impl {
26 template<
size_t DIMENSION,
typename REAL_TYPE =
double>
36 virtual std::vector<size_t>
37 entities(
size_t from_dimension,
size_t to_dimension,
size_t id)
const = 0;
39 virtual const util::crs & entities_crs(
size_t,
size_t)
const = 0;
41 virtual const std::vector<size_t> & local_to_global(
size_t dim)
const = 0;
43 virtual const std::map<size_t, size_t> & global_to_local(
44 size_t dim)
const = 0;
46 virtual void create_graph(
size_t from_dimension,
48 size_t min_connections,
53 std::vector<byte_t> & buffer)
const = 0;
59 const std::vector<size_t> & local_ids) = 0;
61 virtual void build_connectivity() = 0;
63 virtual void vertex(
size_t id,
real_t * coord)
const = 0;
65 virtual const std::vector<size_t> & face_owners()
const = 0;
66 virtual const std::vector<size_t> & region_ids()
const = 0;
72 template<
typename DATA_TYPE,
typename BUFFER_TYPE>
74 cast_insert(DATA_TYPE
const *
const data,
size_t len, BUFFER_TYPE & buf) {
75 using buf_value_t = std::decay_t<decltype(buf[0])>;
76 auto n =
sizeof(DATA_TYPE) * len;
77 auto p =
reinterpret_cast<const buf_value_t *
>(data);
78 buf.insert(buf.end(), p, p + n);
84 template<
typename BUFFER_TYPE,
typename DATA_TYPE>
86 uncast(BUFFER_TYPE
const *& buffer,
size_t len, DATA_TYPE * data) {
87 auto n =
sizeof(DATA_TYPE) * len;
88 auto p =
reinterpret_cast<BUFFER_TYPE *
>(data);
89 std::copy(buffer, buffer + n, p);
90 auto start = buffer + n;
virtual std::vector< size_t > entities(size_t from_dimension, size_t to_dimension, size_t id) const =0
Definition: definition.hh:35
unsigned char byte_t
a byte type used for migrating data
Definition: parallel_definition.hh:31
int start(const std::function< int()> &action)
Definition: execution.hh:69
REAL_TYPE real_t
the floating point type
Definition: parallel_definition.hh:34
Definition: parallel_definition.hh:27
Definition: control.hh:31
static constexpr size_t dimension()
Definition: definition.hh:51