21 #ifndef __MESH_TOPOLOGY_H 22 #define __MESH_TOPOLOGY_H 29 #include <dolfin/common/Variable.h> 30 #include "MeshConnectivity.h" 63 std::size_t
dim()
const;
66 std::size_t
size(std::size_t dim)
const;
79 void clear(std::size_t d0, std::size_t d1);
82 void init(std::size_t dim);
86 void init(std::size_t dim, std::size_t local_size, std::size_t global_size);
93 void init_ghost(std::size_t dim, std::size_t index);
98 std::int64_t global_index)
100 dolfin_assert(dim < _global_indices.size());
101 dolfin_assert(local_index < _global_indices[dim].
size());
102 _global_indices[
dim][local_index] = global_index;
109 dolfin_assert(d < _global_indices.size());
110 return _global_indices[d];
117 dolfin_assert(dim < _global_indices.size());
118 return !_global_indices[
dim].empty();
124 {
return (_shared_entities.find(dim) != _shared_entities.end()); }
128 std::map<std::int32_t, std::set<unsigned int> >&
133 const std::map<std::int32_t, std::set<unsigned int> >&
140 {
return _cell_owner; }
146 {
return _cell_owner; }
153 std::size_t d1)
const;
159 std::string
str(
bool verbose)
const;
171 std::map<std::vector<std::size_t>,
172 std::pair<std::vector<std::size_t>,
178 std::vector<unsigned int> num_entities;
181 std::vector<std::size_t> ghost_offset_index;
184 std::vector<std::size_t> global_num_entities;
187 std::vector<std::vector<std::int64_t> > _global_indices;
191 std::map<unsigned int, std::map<std::int32_t, std::set<unsigned int>>>
197 std::vector<unsigned int> _cell_owner;
200 std::vector<std::vector<MeshConnectivity> > connectivity;
void clear()
Clear all data.
Definition: MeshTopology.cpp:102
Definition: MeshTopology.h:46
std::map< std::int32_t, std::set< unsigned int > > & shared_entities(unsigned int dim)
Definition: MeshTopology.cpp:186
Common base class for DOLFIN variables.
Definition: Variable.h:35
bool have_shared_entities(unsigned int dim) const
Definition: MeshTopology.h:123
MeshTopology & operator=(const MeshTopology &topology)
Assignment.
Definition: MeshTopology.cpp:53
std::size_t size_global(std::size_t dim) const
Return global number of entities for given dimension.
Definition: MeshTopology.cpp:84
std::size_t size(std::size_t dim) const
Return number of entities for given dimension.
Definition: MeshTopology.cpp:75
void init_ghost(std::size_t dim, std::size_t index)
Initialise the offset index of ghost entities for this dimension.
Definition: MeshTopology.cpp:156
size_t hash() const
Return hash based on the hash of cell-vertex connectivity.
Definition: MeshTopology.cpp:205
Definition: MeshConnectivity.h:39
bool have_global_indices(std::size_t dim) const
Definition: MeshTopology.h:115
void set_global_index(std::size_t dim, std::size_t local_index, std::int64_t global_index)
Definition: MeshTopology.h:97
std::map< std::vector< std::size_t >, std::pair< std::vector< std::size_t >, std::vector< std::vector< std::size_t > > > > coloring
Definition: MeshTopology.h:173
std::vector< unsigned int > & cell_owner()
Definition: MeshTopology.h:139
void init(std::size_t dim)
Initialize topology of given maximum dimension.
Definition: MeshTopology.cpp:121
std::size_t ghost_offset(std::size_t dim) const
Definition: MeshTopology.cpp:93
void init_global_indices(std::size_t dim, std::size_t size)
Definition: MeshTopology.cpp:162
dolfin::MeshConnectivity & operator()(std::size_t d0, std::size_t d1)
Return connectivity for given pair of topological dimensions.
Definition: MeshTopology.cpp:169
const std::vector< std::int64_t > & global_indices(std::size_t d) const
Definition: MeshTopology.h:107
MeshTopology()
Create empty mesh topology.
Definition: MeshTopology.cpp:31
std::string str(bool verbose) const
Return informal string representation (pretty-print)
Definition: MeshTopology.cpp:210
const std::vector< unsigned int > & cell_owner() const
Definition: MeshTopology.h:145
~MeshTopology()
Destructor.
Definition: MeshTopology.cpp:48
std::size_t dim() const
Return topological dimension.
Definition: MeshTopology.cpp:70