libMesh
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MixedDimensionNonUniformRefinement3D Class Reference
Inheritance diagram for MixedDimensionNonUniformRefinement3D:
[legend]

Public Member Functions

 CPPUNIT_TEST_SUITE (MixedDimensionNonUniformRefinement3D)
 Given a mesh with 36 HEX8 elements and an overlapping QUAD4 element located in the center of the HEX8 elements, this test ensures that when a single HEX8 element is flagged for refinement, which is a neighbor of the QUAD4 element, that the QUAD4 element will is also be flagged for refinement due to an underrefined_boundary_limit of 0 (default) and the neighboring HEX8 element (with respect to the QUAD4 element) will also refined due to an overrefined_boundary_limit of 0 (default). More...
 
 CPPUNIT_TEST (testMesh)
 
 CPPUNIT_TEST (testDofOrdering)
 
 CPPUNIT_TEST_SUITE_END ()
 
void setUp ()
 
void tearDown ()
 
void testMesh ()
 
void testDofOrdering ()
 

Protected Member Functions

void build_mesh ()
 

Protected Attributes

ReplicatedMesh_mesh
 

Detailed Description

Definition at line 852 of file mixed_dim_mesh_test.C.

Member Function Documentation

void MixedDimensionNonUniformRefinement3D::build_mesh ( )
protected

Definition at line 873 of file mixed_dim_mesh_test.C.

References libMesh::ReplicatedMesh::add_elem(), libMesh::ReplicatedMesh::add_point(), libMesh::MeshBase::elem_ref(), libMesh::ReplicatedMesh::node_ptr(), libMesh::MeshBase::prepare_for_use(), libMesh::Real, libMesh::Elem::REFINE, libMesh::MeshRefinement::refine_and_coarsen_elements(), libMesh::MeshBase::set_mesh_dimension(), libMesh::Elem::set_node(), libMesh::Elem::set_refinement_flag(), libMesh::Elem::subdomain_id(), TestCommWorld, and libMesh::x.

874  {
876 
878 
879  //Add the nodes
880  for (unsigned int z = 0; z < 5; z++)
881  {
882  for (unsigned int y = 0; y < 4; y++)
883  {
884  for (unsigned int x = 0; x < 4; x++)
885  {
886  _mesh->add_point( Point(Real(x),Real(y),Real(z)), 16*z+4*y+x);
887  }
888  }
889  }
890 
891  {
892  //Add the HEX8 elements
893  for (unsigned int z = 0; z < 4; z++)
894  {
895  for (unsigned int y = 0; y < 3; y++)
896  {
897  for (unsigned int x = 0; x < 3; x++)
898  {
899  Elem* hex = _mesh->add_elem( new Hex8 );
900  hex->set_node(0) = _mesh->node_ptr(x+4*y +16*z );
901  hex->set_node(1) = _mesh->node_ptr(x+4*y +16*z + 1);
902  hex->set_node(2) = _mesh->node_ptr(x+4*(y+1)+16*z + 1);
903  hex->set_node(3) = _mesh->node_ptr(x+4*(y+1)+16*z );
904  hex->set_node(4) = _mesh->node_ptr(x+4*y +16*(z+1) );
905  hex->set_node(5) = _mesh->node_ptr(x+4*y +16*(z+1) + 1);
906  hex->set_node(6) = _mesh->node_ptr(x+4*(y+1)+16*(z+1) + 1);
907  hex->set_node(7) = _mesh->node_ptr(x+4*(y+1)+16*(z+1) );
908  }
909  }
910  }
911  Elem* quad = _mesh->add_elem( new Quad4 );
912  unsigned int x=1,y=1,z=2;
913  quad->set_node(0) = _mesh->node_ptr(x+4*y +16*z );
914  quad->set_node(1) = _mesh->node_ptr(x+4*y +16*z + 1);
915  quad->set_node(2) = _mesh->node_ptr(x+4*(y+1)+16*z + 1);
916  quad->set_node(3) = _mesh->node_ptr(x+4*(y+1)+16*z );
917 
918  // 2D elements will have subdomain id 0, this one will have 1
919  quad->subdomain_id() = 1;
920  }
921 
922  // libMesh will renumber, but we numbered according to its scheme
923  // anyway. We do this because when we call uniformly_refine subsequently,
924  // it's going use skip_renumber=false.
925  _mesh->prepare_for_use(false /*skip_renumber*/);
926 
927 #ifdef LIBMESH_ENABLE_AMR
928  //Flag the bottom element for refinement
929  _mesh->elem_ref(13).set_refinement_flag(Elem::REFINE);
931 #endif
932  }
virtual Node * add_point(const Point &p, const dof_id_type id=DofObject::invalid_id, const processor_id_type proc_id=DofObject::invalid_processor_id) libmesh_override
functions for adding /deleting nodes elements.
virtual const Node * node_ptr(const dof_id_type i) const libmesh_override
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
virtual Node *& set_node(const unsigned int i)
Definition: elem.h:1941
The QUAD4 is an element in 2D composed of 4 nodes.
Definition: face_quad4.h:49
virtual Elem * add_elem(Elem *e) libmesh_override
Add elem e to the end of the element array.
libMesh::Parallel::Communicator * TestCommWorld
Definition: driver.C:28
This is the base class from which all geometric element types are derived.
Definition: elem.h:89
void set_refinement_flag(const RefinementState rflag)
Sets the value of the refinement flag for the element.
Definition: elem.h:2513
PetscErrorCode Vec x
This is the MeshRefinement class.
void prepare_for_use(const bool skip_renumber_nodes_and_elements=false, const bool skip_find_neighbors=false)
Prepare a newly created (or read) mesh for use.
Definition: mesh_base.C:174
subdomain_id_type subdomain_id() const
Definition: elem.h:1951
void set_mesh_dimension(unsigned char d)
Resets the logical dimension of the mesh.
Definition: mesh_base.h:199
virtual const Elem & elem_ref(const dof_id_type i) const
Definition: mesh_base.h:490
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool refine_and_coarsen_elements()
Refines and coarsens user-requested elements.
A Point defines a location in LIBMESH_DIM dimensional Real space.
Definition: point.h:38
MixedDimensionNonUniformRefinement3D::CPPUNIT_TEST ( testMesh  )
MixedDimensionNonUniformRefinement3D::CPPUNIT_TEST ( testDofOrdering  )
MixedDimensionNonUniformRefinement3D::CPPUNIT_TEST_SUITE ( MixedDimensionNonUniformRefinement3D  )

Given a mesh with 36 HEX8 elements and an overlapping QUAD4 element located in the center of the HEX8 elements, this test ensures that when a single HEX8 element is flagged for refinement, which is a neighbor of the QUAD4 element, that the QUAD4 element will is also be flagged for refinement due to an underrefined_boundary_limit of 0 (default) and the neighboring HEX8 element (with respect to the QUAD4 element) will also refined due to an overrefined_boundary_limit of 0 (default).

MixedDimensionNonUniformRefinement3D::CPPUNIT_TEST_SUITE_END ( )
void MixedDimensionNonUniformRefinement3D::setUp ( )

Definition at line 935 of file mixed_dim_mesh_test.C.

936  {
937  this->build_mesh();
938  }
void MixedDimensionNonUniformRefinement3D::tearDown ( )

Definition at line 940 of file mixed_dim_mesh_test.C.

941  {
942  delete _mesh;
943  }
void MixedDimensionNonUniformRefinement3D::testDofOrdering ( )

Definition at line 1076 of file mixed_dim_mesh_test.C.

References libMesh::EquationSystems::add_system(), CPPUNIT_TEST_SUITE_REGISTRATION(), libMesh::DofMap::dof_indices(), libMesh::ReplicatedMesh::elem_ptr(), libMesh::FIRST, libMesh::EquationSystems::get_system(), and libMesh::EquationSystems::init().

1077  {
1078 #ifdef LIBMESH_ENABLE_AMR
1079  EquationSystems es(*_mesh);
1080  es.add_system<LinearImplicitSystem>("TestDofSystem");
1081  es.get_system("TestDofSystem").add_variable("u",FIRST);
1082  es.init();
1083 
1084  DofMap& dof_map = es.get_system("TestDofSystem").get_dof_map();
1085 
1086  //Elements to the left of the QUAD4 elements
1087  std::vector<dof_id_type> elem41_dof_indices, elem42_dof_indices, elem43_dof_indices, elem44_dof_indices;
1088  //Elements to the right of the QUAD4 elements
1089  std::vector<dof_id_type> elem45_dof_indices, elem46_dof_indices, elem47_dof_indices, elem48_dof_indices;
1090  //QUAD4 elements
1091  std::vector<dof_id_type> elem53_dof_indices, elem54_dof_indices, elem55_dof_indices, elem56_dof_indices;
1092 
1093  dof_map.dof_indices( _mesh->elem_ptr(41), elem41_dof_indices );
1094  dof_map.dof_indices( _mesh->elem_ptr(42), elem42_dof_indices );
1095  dof_map.dof_indices( _mesh->elem_ptr(43), elem43_dof_indices );
1096  dof_map.dof_indices( _mesh->elem_ptr(44), elem44_dof_indices );
1097  dof_map.dof_indices( _mesh->elem_ptr(45), elem45_dof_indices );
1098  dof_map.dof_indices( _mesh->elem_ptr(46), elem46_dof_indices );
1099  dof_map.dof_indices( _mesh->elem_ptr(47), elem47_dof_indices );
1100  dof_map.dof_indices( _mesh->elem_ptr(48), elem48_dof_indices );
1101  dof_map.dof_indices( _mesh->elem_ptr(53), elem53_dof_indices );
1102  dof_map.dof_indices( _mesh->elem_ptr(54), elem54_dof_indices );
1103  dof_map.dof_indices( _mesh->elem_ptr(55), elem55_dof_indices );
1104  dof_map.dof_indices( _mesh->elem_ptr(56), elem56_dof_indices );
1105 
1106  /* The dofs for the QUAD4 (ids = 53, 54, 55, and 56) element should be the same
1107  as the face of the HEX8 elements HEX8 (id=41, 42, 43, and 44) left of the
1108  QUAD4 elements. */
1109  CPPUNIT_ASSERT_EQUAL( elem53_dof_indices[0], elem41_dof_indices[4] );
1110  CPPUNIT_ASSERT_EQUAL( elem53_dof_indices[1], elem41_dof_indices[5] );
1111  CPPUNIT_ASSERT_EQUAL( elem53_dof_indices[2], elem41_dof_indices[6] );
1112  CPPUNIT_ASSERT_EQUAL( elem53_dof_indices[3], elem41_dof_indices[7] );
1113 
1114  CPPUNIT_ASSERT_EQUAL( elem54_dof_indices[0], elem42_dof_indices[4] );
1115  CPPUNIT_ASSERT_EQUAL( elem54_dof_indices[1], elem42_dof_indices[5] );
1116  CPPUNIT_ASSERT_EQUAL( elem54_dof_indices[2], elem42_dof_indices[6] );
1117  CPPUNIT_ASSERT_EQUAL( elem54_dof_indices[3], elem42_dof_indices[7] );
1118 
1119  CPPUNIT_ASSERT_EQUAL( elem55_dof_indices[0], elem43_dof_indices[4] );
1120  CPPUNIT_ASSERT_EQUAL( elem55_dof_indices[1], elem43_dof_indices[5] );
1121  CPPUNIT_ASSERT_EQUAL( elem55_dof_indices[2], elem43_dof_indices[6] );
1122  CPPUNIT_ASSERT_EQUAL( elem55_dof_indices[3], elem43_dof_indices[7] );
1123 
1124  CPPUNIT_ASSERT_EQUAL( elem56_dof_indices[0], elem44_dof_indices[4] );
1125  CPPUNIT_ASSERT_EQUAL( elem56_dof_indices[1], elem44_dof_indices[5] );
1126  CPPUNIT_ASSERT_EQUAL( elem56_dof_indices[2], elem44_dof_indices[6] );
1127  CPPUNIT_ASSERT_EQUAL( elem56_dof_indices[3], elem44_dof_indices[7] );
1128 
1129  /* The dofs for the QUAD4 (ids = 53, 54, 55, and 56) element should be the same
1130  as the face of the HEX8 elements HEX8 (id=45, 46, 47, and 49) left of the
1131  QUAD4 elements. */
1132  CPPUNIT_ASSERT_EQUAL( elem53_dof_indices[0], elem45_dof_indices[0] );
1133  CPPUNIT_ASSERT_EQUAL( elem53_dof_indices[1], elem45_dof_indices[1] );
1134  CPPUNIT_ASSERT_EQUAL( elem53_dof_indices[2], elem45_dof_indices[2] );
1135  CPPUNIT_ASSERT_EQUAL( elem53_dof_indices[3], elem45_dof_indices[3] );
1136 
1137  CPPUNIT_ASSERT_EQUAL( elem54_dof_indices[0], elem46_dof_indices[0] );
1138  CPPUNIT_ASSERT_EQUAL( elem54_dof_indices[1], elem46_dof_indices[1] );
1139  CPPUNIT_ASSERT_EQUAL( elem54_dof_indices[2], elem46_dof_indices[2] );
1140  CPPUNIT_ASSERT_EQUAL( elem54_dof_indices[3], elem46_dof_indices[3] );
1141 
1142  CPPUNIT_ASSERT_EQUAL( elem55_dof_indices[0], elem47_dof_indices[0] );
1143  CPPUNIT_ASSERT_EQUAL( elem55_dof_indices[1], elem47_dof_indices[1] );
1144  CPPUNIT_ASSERT_EQUAL( elem55_dof_indices[2], elem47_dof_indices[2] );
1145  CPPUNIT_ASSERT_EQUAL( elem55_dof_indices[3], elem47_dof_indices[3] );
1146 
1147  CPPUNIT_ASSERT_EQUAL( elem56_dof_indices[0], elem48_dof_indices[0] );
1148  CPPUNIT_ASSERT_EQUAL( elem56_dof_indices[1], elem48_dof_indices[1] );
1149  CPPUNIT_ASSERT_EQUAL( elem56_dof_indices[2], elem48_dof_indices[2] );
1150  CPPUNIT_ASSERT_EQUAL( elem56_dof_indices[3], elem48_dof_indices[3] );
1151 
1152  /* The dofs for the HEX8 elements (id=41, 42, 43, and 44) should be the same
1153  on the left side of the QUAD4 elements as the HEX8 elements (id=45, 46, 47, and 48)
1154  on the right as QUAD4 elements. */
1155  CPPUNIT_ASSERT_EQUAL( elem41_dof_indices[4], elem45_dof_indices[0] );
1156  CPPUNIT_ASSERT_EQUAL( elem41_dof_indices[5], elem45_dof_indices[1] );
1157  CPPUNIT_ASSERT_EQUAL( elem41_dof_indices[6], elem45_dof_indices[2] );
1158  CPPUNIT_ASSERT_EQUAL( elem41_dof_indices[7], elem45_dof_indices[3] );
1159 
1160  CPPUNIT_ASSERT_EQUAL( elem42_dof_indices[4], elem46_dof_indices[0] );
1161  CPPUNIT_ASSERT_EQUAL( elem42_dof_indices[5], elem46_dof_indices[1] );
1162  CPPUNIT_ASSERT_EQUAL( elem42_dof_indices[6], elem46_dof_indices[2] );
1163  CPPUNIT_ASSERT_EQUAL( elem42_dof_indices[7], elem46_dof_indices[3] );
1164 
1165  CPPUNIT_ASSERT_EQUAL( elem43_dof_indices[4], elem47_dof_indices[0] );
1166  CPPUNIT_ASSERT_EQUAL( elem43_dof_indices[5], elem47_dof_indices[1] );
1167  CPPUNIT_ASSERT_EQUAL( elem43_dof_indices[6], elem47_dof_indices[2] );
1168  CPPUNIT_ASSERT_EQUAL( elem43_dof_indices[7], elem47_dof_indices[3] );
1169 
1170  CPPUNIT_ASSERT_EQUAL( elem44_dof_indices[4], elem48_dof_indices[0] );
1171  CPPUNIT_ASSERT_EQUAL( elem44_dof_indices[5], elem48_dof_indices[1] );
1172  CPPUNIT_ASSERT_EQUAL( elem44_dof_indices[6], elem48_dof_indices[2] );
1173  CPPUNIT_ASSERT_EQUAL( elem44_dof_indices[7], elem48_dof_indices[3] );
1174 
1175  /* The dofs for the QUAD4 elements (ids = 53, 54, 55, and 56) should be the
1176  same for shared nodes. */
1177  CPPUNIT_ASSERT_EQUAL( elem53_dof_indices[1], elem54_dof_indices[0] );
1178  CPPUNIT_ASSERT_EQUAL( elem53_dof_indices[2], elem54_dof_indices[3] );
1179  CPPUNIT_ASSERT_EQUAL( elem53_dof_indices[3], elem55_dof_indices[0] );
1180  CPPUNIT_ASSERT_EQUAL( elem53_dof_indices[2], elem55_dof_indices[1] );
1181  CPPUNIT_ASSERT_EQUAL( elem53_dof_indices[2], elem56_dof_indices[0] );
1182  CPPUNIT_ASSERT_EQUAL( elem54_dof_indices[3], elem55_dof_indices[1] );
1183  CPPUNIT_ASSERT_EQUAL( elem54_dof_indices[3], elem56_dof_indices[0] );
1184  CPPUNIT_ASSERT_EQUAL( elem54_dof_indices[2], elem56_dof_indices[1] );
1185  CPPUNIT_ASSERT_EQUAL( elem55_dof_indices[1], elem56_dof_indices[0] );
1186  CPPUNIT_ASSERT_EQUAL( elem55_dof_indices[2], elem56_dof_indices[3] );
1187 
1188 
1189 #endif
1190  }
virtual const Elem * elem_ptr(const dof_id_type i) const libmesh_override
This is the EquationSystems class.
This class provides a specific system class.
unsigned int add_variable(const std::string &var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=libmesh_nullptr)
Adds the variable var to the list of variables for this system.
Definition: system.C:1101
This class handles the numbering of degrees of freedom on a mesh.
Definition: dof_map.h:167
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
Fills the vector di with the global degree of freedom indices for the element.
Definition: dof_map.C:1917
void MixedDimensionNonUniformRefinement3D::testMesh ( )

Definition at line 945 of file mixed_dim_mesh_test.C.

References libMesh::ReplicatedMesh::elem_ptr(), libMesh::MeshBase::elem_ref(), libMesh::Elem::interior_parent(), libMesh::ReplicatedMesh::n_active_elem(), libMesh::ReplicatedMesh::n_elem(), libMesh::ReplicatedMesh::n_nodes(), libMesh::Elem::node_id(), and libMesh::Elem::parent().

946  {
947 #ifdef LIBMESH_ENABLE_AMR
948  // We should have 57 total and 54 active elements.
949  CPPUNIT_ASSERT_EQUAL( (dof_id_type)57, _mesh->n_elem() );
950  CPPUNIT_ASSERT_EQUAL( (dof_id_type)54, _mesh->n_active_elem() );
951 
952  // We should have 113 nodes
953  CPPUNIT_ASSERT_EQUAL( (dof_id_type)113, _mesh->n_nodes() );
954 
955  // QUAD4,id=53 should have same nodes as a face in HEX8, id=39
956  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(53).node_id(0),
957  _mesh->elem_ref(41).node_id(4) );
958  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(53).node_id(1),
959  _mesh->elem_ref(41).node_id(5) );
960  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(53).node_id(2),
961  _mesh->elem_ref(41).node_id(6) );
962  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(53).node_id(3),
963  _mesh->elem_ref(41).node_id(7) );
964 
965  // QUAD4,id=53 should have same nodes as a face in HEX8, id=45
966  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(53).node_id(0),
967  _mesh->elem_ref(45).node_id(0) );
968  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(53).node_id(1),
969  _mesh->elem_ref(45).node_id(1) );
970  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(53).node_id(2),
971  _mesh->elem_ref(45).node_id(2) );
972  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(53).node_id(3),
973  _mesh->elem_ref(45).node_id(3) );
974 
975  // QUAD4,id=54 should have same nodes as a face in HEX8, id=42
976  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(54).node_id(0),
977  _mesh->elem_ref(42).node_id(4) );
978  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(54).node_id(1),
979  _mesh->elem_ref(42).node_id(5) );
980  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(54).node_id(2),
981  _mesh->elem_ref(42).node_id(6) );
982  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(54).node_id(3),
983  _mesh->elem_ref(42).node_id(7) );
984 
985  // QUAD4,id=54 should have same nodes as a face in HEX8, id=46
986  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(54).node_id(0),
987  _mesh->elem_ref(46).node_id(0) );
988  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(54).node_id(1),
989  _mesh->elem_ref(46).node_id(1) );
990  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(54).node_id(2),
991  _mesh->elem_ref(46).node_id(2) );
992  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(54).node_id(3),
993  _mesh->elem_ref(46).node_id(3) );
994 
995  // QUAD4,id=55 should have same nodes as a face in HEX8, id=43
996  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(55).node_id(0),
997  _mesh->elem_ref(43).node_id(4) );
998  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(55).node_id(1),
999  _mesh->elem_ref(43).node_id(5) );
1000  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(55).node_id(2),
1001  _mesh->elem_ref(43).node_id(6) );
1002  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(55).node_id(3),
1003  _mesh->elem_ref(43).node_id(7) );
1004 
1005  // QUAD4,id=55 should have same nodes as a face in HEX8, id=47
1006  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(55).node_id(0),
1007  _mesh->elem_ref(47).node_id(0) );
1008  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(55).node_id(1),
1009  _mesh->elem_ref(47).node_id(1) );
1010  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(55).node_id(2),
1011  _mesh->elem_ref(47).node_id(2) );
1012  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(55).node_id(3),
1013  _mesh->elem_ref(47).node_id(3) );
1014 
1015  // QUAD4,id=56 should have same nodes as a face in HEX8, id=44
1016  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(56).node_id(0),
1017  _mesh->elem_ref(44).node_id(4) );
1018  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(56).node_id(1),
1019  _mesh->elem_ref(44).node_id(5) );
1020  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(56).node_id(2),
1021  _mesh->elem_ref(44).node_id(6) );
1022  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(56).node_id(3),
1023  _mesh->elem_ref(44).node_id(7) );
1024 
1025  // QUAD4,id=56 should have same nodes as a face in HEX8, id=48
1026  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(56).node_id(0),
1027  _mesh->elem_ref(48).node_id(0) );
1028  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(56).node_id(1),
1029  _mesh->elem_ref(48).node_id(1) );
1030  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(56).node_id(2),
1031  _mesh->elem_ref(48).node_id(2) );
1032  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(56).node_id(3),
1033  _mesh->elem_ref(48).node_id(3) );
1034 
1035  // Shared node between the QUAD4 elements should have the same global id
1036  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(53).node_id(1),
1037  _mesh->elem_ref(54).node_id(0) );
1038  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(53).node_id(2),
1039  _mesh->elem_ref(54).node_id(3) );
1040  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(53).node_id(3),
1041  _mesh->elem_ref(55).node_id(0) );
1042  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(53).node_id(2),
1043  _mesh->elem_ref(55).node_id(1) );
1044  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(54).node_id(3),
1045  _mesh->elem_ref(56).node_id(0) );
1046  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(54).node_id(2),
1047  _mesh->elem_ref(56).node_id(1) );
1048  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(55).node_id(1),
1049  _mesh->elem_ref(56).node_id(0) );
1050  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(55).node_id(2),
1051  _mesh->elem_ref(56).node_id(3) );
1052 
1053  // QUAD4 child elements should have the correct parent
1054  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(53).parent(),
1055  _mesh->elem_ptr(36) );
1056  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(54).parent(),
1057  _mesh->elem_ptr(36) );
1058  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(55).parent(),
1059  _mesh->elem_ptr(36) );
1060  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(56).parent(),
1061  _mesh->elem_ptr(36) );
1062 
1063  // QUAD4 child elements should have the correct interior_parent
1064  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(53).interior_parent(),
1065  _mesh->elem_ptr(41) );
1066  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(54).interior_parent(),
1067  _mesh->elem_ptr(42) );
1068  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(55).interior_parent(),
1069  _mesh->elem_ptr(43) );
1070  CPPUNIT_ASSERT_EQUAL( _mesh->elem_ref(56).interior_parent(),
1071  _mesh->elem_ptr(44) );
1072 
1073 #endif
1074  }
virtual const Elem * elem_ptr(const dof_id_type i) const libmesh_override
const Elem * parent() const
Definition: elem.h:2346
const Elem * interior_parent() const
Definition: elem.C:951
virtual dof_id_type n_elem() const libmesh_override
virtual const Elem & elem_ref(const dof_id_type i) const
Definition: mesh_base.h:490
virtual dof_id_type n_nodes() const libmesh_override
virtual dof_id_type n_active_elem() const libmesh_override
dof_id_type node_id(const unsigned int i) const
Definition: elem.h:1831
uint8_t dof_id_type
Definition: id_types.h:64

Member Data Documentation

ReplicatedMesh* MixedDimensionNonUniformRefinement3D::_mesh
protected

Definition at line 871 of file mixed_dim_mesh_test.C.


The documentation for this class was generated from the following file: