Sierra Toolkit
Version of the Day
EntityKey.cpp
1
/*------------------------------------------------------------------------*/
2
/* Copyright 2010 Sandia Corporation. */
3
/* Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive */
4
/* license for use of this work by or on behalf of the U.S. Government. */
5
/* Export of this program may require a license from the */
6
/* United States Government. */
7
/*------------------------------------------------------------------------*/
8
9
10
#include <sstream>
11
#include <stdexcept>
12
13
#include <stk_util/util/StaticAssert.hpp>
14
15
#include <stk_util/environment/ReportHandler.hpp>
16
17
#include <stk_mesh/base/EntityKey.hpp>
18
19
namespace
stk_classic
{
20
namespace
mesh {
21
22
EntityKey::EntityKey
( EntityRank
entity_rank
,
23
EntityKey::raw_key_type
entity_id
)
24
: key( ( raw_key_type(
entity_rank
) << id_digits ) |
entity_id
)
25
{
26
enum
{ OK =
StaticAssert
<
sizeof
(
EntityKey
) ==
27
sizeof
(EntityKey::raw_key_type) >::OK };
28
29
ThrowAssertMsg( rank() ==
entity_rank
,
30
"entity_rank out of range, entity_rank= "
<<
entity_rank
<<
" rank() = "
<< rank() <<
" entity_id= "
<<
entity_id
<<
" id() = "
<<
id
() );
31
32
ThrowAssertMsg(
id
() ==
entity_id
,
33
"entity_id out of range, entity_rank= "
<<
entity_rank
<<
" rank() = "
<< rank() <<
" entity_id= "
<<
entity_id
<<
" id() = "
<<
id
() );
34
}
35
36
37
}
38
}
39
stk_classic
Sierra Toolkit.
Definition:
AlgorithmRunner.cpp:16
stk_classic::mesh::EntityKey::EntityKey
EntityKey()
Definition:
base/EntityKey.hpp:97
stk_classic::mesh::entity_id
EntityId entity_id(const EntityKey &key)
Given an entity key, return the identifier for the entity.
Definition:
base/EntityKey.hpp:167
stk_classic::StaticAssert
Compile-time assertion.
Definition:
StaticAssert.hpp:23
stk_classic::mesh::entity_rank
EntityRank entity_rank(const EntityKey &key)
Given an entity key, return an entity type (rank).
Definition:
base/EntityKey.hpp:161
stk_mesh
stk_mesh
base
EntityKey.cpp
Generated by
1.8.16