11 #include <stk_util/unit_test_support/stk_utest_macros.hpp> 13 #include <stk_mesh/fixtures/QuadFixture.hpp> 14 #include <stk_mesh/fixtures/HexFixture.hpp> 18 STKUNIT_UNIT_TEST ( UnitTestCrackMesh , VerifyDestroy2D )
26 const unsigned nx = 3 , ny = 3 ;
28 for (
unsigned iy = 0 ; iy < ny ; ++iy ) {
29 for (
unsigned ix = 0 ; ix < nx ; ++ix ) {
31 fixture.m_fem_meta.commit();
32 fixture.generate_mesh();
34 fixture.m_bulk_data.modification_begin();
40 fixture.m_bulk_data.destroy_entity( tmp );
43 fixture.m_bulk_data.modification_end();
46 STKUNIT_EXPECT_TRUE ( elem->
log_query() == stk_classic::mesh::EntityLogDeleted );
52 STKUNIT_UNIT_TEST ( UnitTestCrackMesh , VerifyDestroy3D )
60 const unsigned nx = 3 , ny = 3 , nz = 3 ;
62 for (
unsigned iz = 0 ; iz < nz ; ++iz ) {
63 for (
unsigned iy = 0 ; iy < ny ; ++iy ) {
64 for (
unsigned ix = 0 ; ix < nx ; ++ix ) {
66 fixture.m_fem_meta.commit();
67 fixture.generate_mesh();
69 fixture.m_bulk_data.modification_begin();
75 fixture.m_bulk_data.destroy_entity( tmp );
78 fixture.m_bulk_data.modification_end();
81 STKUNIT_EXPECT_TRUE ( elem->
log_query() == stk_classic::mesh::EntityLogDeleted );
90 STKUNIT_UNIT_TEST ( UnitTestCrackMesh , verifyBoxGhosting )
98 fixture.m_fem_meta.commit();
99 fixture.generate_mesh();
110 unsigned right_ordinal = 0;
111 unsigned new_node_id = 28;
116 if ( old_node && right_element ) {
119 for (; rel.first != rel.second; ++rel) {
120 if ( (rel.first->entity()) == right_element) {
121 right_ordinal = rel.first->identifier();
131 if ( right_element &&
150 if ( right_element ) {
154 STKUNIT_EXPECT_TRUE ( new_node.
identifier() == new_node_id );
void declare_relation(Entity &e_from, Entity &e_to, const RelationIdentifier local_id)
Declare a relation and its converse between entities in the same mesh.
bool destroy_relation(Entity &e_from, Entity &e_to, const RelationIdentifier local_id)
Remove all relations between two entities.
EntityModificationLog log_query() const
Query the current state of the entity log.
unsigned parallel_machine_rank(ParallelMachine parallel_machine)
Member function parallel_machine_rank ...
bool modification_end()
Parallel synchronization of modifications and transition to the guaranteed parallel consistent state...
bool modification_begin()
Begin a modification phase during which the mesh bulk data could become parallel inconsistent. This is a parallel synchronous call. The first time this method is called the mesh meta data is verified to be committed and parallel consistent. An exception is thrown if this verification fails.
PairIterRelation relations() const
All Entity relations for which this entity is a member. The relations are ordered from lowest entity-...
Manager for an integrated collection of entities, entity relations, and buckets of field data...
A fundamental unit within the discretization of a problem domain, including but not limited to nodes...
unsigned parallel_rank() const
Rank of the parallel machine's local processor.
Entity & declare_entity(EntityRank ent_rank, EntityId ent_id, const PartVector &parts)
Create or retrieve a locally owned entity of a given rank and id.
EntityId identifier() const
Identifier for this entity which is globally unique for a given entity type.
std::vector< Part *> PartVector
Collections of parts are frequently maintained as a vector of Part pointers.
unsigned owner_rank() const
Parallel processor rank of the processor which owns this entity.