9 #ifndef stk_mesh_EntityImpl_hpp 10 #define stk_mesh_EntityImpl_hpp 12 #include <stk_util/util/PairIter.hpp> 14 #include <stk_util/environment/ReportHandler.hpp> 16 #include <stk_mesh/base/Types.hpp> 17 #include <stk_mesh/base/Relation.hpp> 18 #include <stk_mesh/base/Trace.hpp> 33 EntityImpl(
const EntityKey & arg_key );
40 const EntityKey & key()
const {
return m_key ; }
41 PairIterRelation relations()
const {
return PairIterRelation(m_relation); }
42 PairIterRelation relations(
unsigned rank )
const ;
43 PairIterRelation node_relations( )
const 45 RelationVector::const_iterator i = m_relation.begin();
46 RelationVector::const_iterator e = m_relation.end();
49 e = std::lower_bound( i , e , hi , LessRelation() );
51 return PairIterRelation( i , e );
54 RelationVector::const_iterator node_relation(
unsigned ordinal)
const 55 {
return m_relation.begin() + ordinal; }
61 Bucket & bucket()
const 63 ThrowAssert(m_bucket);
67 Bucket* bucket_ptr()
const 72 bool is_bucket_valid()
const {
return m_bucket != NULL; }
73 unsigned bucket_ordinal()
const {
return m_bucket_ord ; }
74 unsigned owner_rank()
const {
return m_owner_rank ; }
75 size_t synchronized_count()
const {
return m_sync_count ; }
80 bool destroy_relation( Entity & e_to,
const RelationIdentifier local_id);
81 bool declare_relation( Entity & e_to,
82 const RelationIdentifier local_id,
84 bool is_back_relation =
false);
87 bool insert(
const EntityCommInfo & val );
88 bool erase(
const EntityCommInfo & val );
89 bool erase(
const Ghosting & ghost );
90 void comm_clear_ghosting();
93 void set_bucket_and_ordinal( Bucket * in_bucket,
unsigned ordinal )
95 TraceIfWatching(
"stk_classic::mesh::impl::EntityRepository::set_bucket_and_ordinal", LOG_ENTITY, key());
98 m_bucket_ord = ordinal;
102 bool set_owner_rank(
unsigned in_owner_rank )
104 TraceIfWatching(
"stk_classic::mesh::impl::EntityRepository::set_owner_rank", LOG_ENTITY, key());
106 if ( in_owner_rank != m_owner_rank ) {
107 m_owner_rank = in_owner_rank;
113 void set_sync_count(
size_t sync_count )
115 TraceIfWatching(
"stk_classic::mesh::impl::EntityRepository::set_sync_count", LOG_ENTITY, key());
117 m_sync_count = sync_count;
125 TraceIfWatching(
"stk_classic::mesh::impl::EntityRepository::log_clear", LOG_ENTITY, key());
127 m_mod_log = EntityLogNoChange;
132 TraceIfWatching(
"stk_classic::mesh::impl::EntityRepository::log_deleted", LOG_ENTITY, key());
134 m_mod_log = EntityLogDeleted;
141 void log_resurrect();
150 void log_modified_and_propagate();
153 void log_created_parallel_copy();
155 bool marked_for_destruction()
const 168 return m_mod_log == EntityLogDeleted;
172 void set_key(EntityKey key);
176 void update_key(EntityKey key);
179 void compress_relation_capacity();
186 unsigned m_bucket_ord ;
187 unsigned m_owner_rank ;
188 size_t m_sync_count ;
192 EntityImpl & operator = (
const EntityImpl & );
196 EntityImpl::EntityImpl(
const EntityKey & arg_key )
203 m_mod_log( EntityLogCreated )
205 TraceIfWatching(
"stk_classic::mesh::impl::EntityImpl::EntityImpl", LOG_ENTITY, arg_key);
209 EntityImpl::EntityImpl()
216 m_mod_log( EntityLogCreated )
raw_relation_id_type raw_relation_id() const
The encoded relation raw_relation_id.
EntityId entity_id(const EntityKey &key)
Given an entity key, return the identifier for the entity.
PairIter< std::vector< EntityCommInfo >::const_iterator > PairIterEntityComm
Span of ( communication-subset-ordinal , process-rank ) pairs for the communication of an entity...
std::vector< Relation > RelationVector
Span of a sorted relations for a given domain entity.
EntityRank entity_rank(const EntityKey &key)
Given an entity key, return an entity type (rank).
bool insert(PartVector &v, Part &part)
Insert a part into a properly ordered collection of parts. Returns true if this is a new insertion...