24 #ifndef __MESH_ENTITY_H 25 #define __MESH_ENTITY_H 30 #include <dolfin/geometry/Point.h> 70 void init(
const Mesh& mesh, std::size_t dim, std::size_t index);
81 return (_mesh == e._mesh && _dim == e._dim
82 && _local_index == e._local_index);
114 {
return _local_index; }
124 const std::vector<std::int64_t>& global_indices
126 if (global_indices.empty())
128 return global_indices[_local_index];
141 {
return _mesh->
topology()(_dim,
dim).size(_local_index); }
153 {
return _mesh->
topology()(_dim,
dim).size_global(_local_index); }
163 const unsigned int*
entities(std::size_t dim)
const 165 const unsigned int* initialized_mesh_entities
167 dolfin_assert(initialized_mesh_entities);
168 return initialized_mesh_entities;
176 {
return _mesh->
id(); }
215 const std::map<std::int32_t, std::set<unsigned int>>& sharing_map
217 const auto map_it = sharing_map.find(_local_index);
218 if (map_it == sharing_map.end())
219 return std::set<unsigned int>();
221 return map_it->second;
231 const std::map<std::int32_t, std::set<unsigned int>>& sharing_map
233 return (sharing_map.find(_local_index) != sharing_map.end());
241 unsigned int owner()
const;
251 std::string
str(
bool verbose)
const;
267 std::size_t _local_index;
std::int64_t global_index() const
Definition: MeshEntity.h:122
std::map< std::int32_t, std::set< unsigned int > > & shared_entities(unsigned int dim)
Definition: MeshTopology.cpp:186
bool operator==(const MeshEntity &e) const
Definition: MeshEntity.h:79
const Mesh & mesh() const
Definition: MeshEntity.h:99
Definition: SubsetIterator.h:41
bool have_shared_entities(unsigned int dim) const
Definition: MeshTopology.h:123
std::size_t index() const
Definition: MeshEntity.h:113
unsigned int owner() const
Definition: MeshEntity.cpp:146
bool is_ghost() const
Definition: MeshEntity.h:207
std::size_t dim() const
Definition: MeshEntity.h:106
std::size_t id() const
Definition: Variable.h:68
std::size_t ghost_offset(std::size_t dim) const
Definition: MeshTopology.cpp:93
Point midpoint() const
Definition: MeshEntity.cpp:115
MeshTopology & topology()
Definition: Mesh.h:219
std::set< unsigned int > sharing_processes() const
Definition: MeshEntity.h:213
Definition: MeshEntityIterator.h:64
std::size_t num_entities(std::size_t dim) const
Definition: MeshEntity.h:140
std::size_t mesh_id() const
Definition: MeshEntity.h:175
std::size_t num_global_entities(std::size_t dim) const
Definition: MeshEntity.h:152
bool incident(const MeshEntity &entity) const
Definition: MeshEntity.cpp:69
void init(const Mesh &mesh, std::size_t dim, std::size_t index)
Definition: MeshEntity.cpp:39
Definition: MeshEntity.h:42
const unsigned int * entities(std::size_t dim) const
Definition: MeshEntity.h:163
virtual ~MeshEntity()
Destructor.
Definition: MeshEntity.cpp:64
std::string str(bool verbose) const
Definition: MeshEntity.cpp:162
bool operator!=(const MeshEntity &e) const
Definition: MeshEntity.h:92
MeshEntity()
Default Constructor.
Definition: MeshEntity.h:47
const std::vector< std::int64_t > & global_indices(std::size_t d) const
Definition: MeshTopology.h:107
bool is_shared() const
Definition: MeshEntity.h:227
Base class for MeshEntityIterators.
Definition: MeshEntityIteratorBase.h:36