// element ids / proc_id: // |-------|-------|-------| // | | | | // | 1/0 | 4/2 | 7/2 | // | | | | // |-------|-------|-------| // | | | | // | 2/0 | 5/1 | 8/2 | // | | | | // |-------|-------|-------| // | | | | // | 3/0 | 6/2 | 9/2 | // | | | | // |-------|-------|-------| inline void setupKeyholeMesh3D_case1(stk::mesh::BulkData& bulk) { ThrowRequire(bulk.parallel_size() == 3); stk::io::fill_mesh("generated:3x1x3", bulk); stk::mesh::EntityProcVec elementProcChanges; if (bulk.parallel_rank() == 1) { elementProcChanges.push_back(stk::mesh::EntityProc(bulk.get_entity(stk::topology::ELEM_RANK,4u),2)); elementProcChanges.push_back(stk::mesh::EntityProc(bulk.get_entity(stk::topology::ELEM_RANK,6u),2)); } bulk.change_entity_owner(elementProcChanges); }
inline void setupKeyholeMesh3D_case2(stk::mesh::BulkData& bulk) { ThrowRequire(bulk.parallel_size() == 3); stk::io::fill_mesh("generated:3x1x3", bulk); stk::mesh::EntityProcVec elementProcChanges; if (bulk.parallel_rank() == 1) { elementProcChanges.push_back(stk::mesh::EntityProc(bulk.get_entity(stk::topology::ELEM_RANK,4),2)); elementProcChanges.push_back(stk::mesh::EntityProc(bulk.get_entity(stk::topology::ELEM_RANK,6),2)); } bulk.change_entity_owner(elementProcChanges); bulk.modification_begin(); if (bulk.parallel_rank() == 1) { stk::mesh::Entity local_element5 = bulk.get_entity(stk::topology::ELEM_RANK,5); const bool delete_success = bulk.destroy_entity(local_element5); ThrowRequire(delete_success); } bulk.modification_end(); }