76 {
77 LOG_UNIT_TEST;
82
84 auto & nodal_system = es.add_system<
System>(
"nodal_system");
86 auto & nodal_dof_map = nodal_system.get_dof_map();
87 nodal_dof_map.remove_default_ghosting();
88 auto & elem_system = es.add_system<
System>(
"elem_system");
90 auto & elem_dof_map = elem_system.get_dof_map();
91 elem_dof_map.remove_default_ghosting();
92
93 es.init();
94
95 {
96 auto n_evaluable = std::distance(
mesh.evaluable_elements_begin(nodal_dof_map),
97 mesh.evaluable_elements_end(nodal_dof_map));
98 typedef decltype(n_evaluable) comp_type;
99 switch (rank)
100 {
101 case 0:
102 CPPUNIT_ASSERT_EQUAL(n_evaluable, comp_type(9));
103 break;
104
105 case 1:
106 CPPUNIT_ASSERT_EQUAL(n_evaluable, comp_type(1));
107 break;
108
109 default:
110 CPPUNIT_ASSERT_EQUAL(n_evaluable, comp_type(0));
111 break;
112 }
113 }
114
115 {
116 auto n_evaluable = std::distance(
mesh.evaluable_elements_begin(elem_dof_map),
117 mesh.evaluable_elements_end(elem_dof_map));
118 typedef decltype(n_evaluable) comp_type;
119 switch (rank)
120 {
121 case 0:
122 CPPUNIT_ASSERT_EQUAL(n_evaluable, comp_type(
TestCommWorld->size() == 1 ? 9 : 8));
123 break;
124
125 case 1:
126 CPPUNIT_ASSERT_EQUAL(n_evaluable, comp_type(1));
127 break;
128
129 default:
130 CPPUNIT_ASSERT_EQUAL(n_evaluable, comp_type(0));
131 break;
132 }
133 }
134
135 {
136 std::vector<const DofMap *> dof_maps = {&nodal_dof_map, &elem_dof_map};
137 auto n_evaluable = std::distance(
mesh.multi_evaluable_elements_begin(dof_maps),
138 mesh.multi_evaluable_elements_end(dof_maps));
139 typedef decltype(n_evaluable) comp_type;
140 switch (rank)
141 {
142 case 0:
143 CPPUNIT_ASSERT_EQUAL(n_evaluable, comp_type(
TestCommWorld->size() == 1 ? 9 : 8));
144 break;
145
146 case 1:
147 CPPUNIT_ASSERT_EQUAL(n_evaluable, comp_type(1));
148 break;
149
150 default:
151 CPPUNIT_ASSERT_EQUAL(n_evaluable, comp_type(0));
152 break;
153 }
154 }
155 }
This is the EquationSystems class.
virtual std::unique_ptr< Partitioner > & partitioner()
A partitioner to use at each partitioning.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
Manages consistently variables, degrees of freedom, and coefficient vectors.
unsigned int add_variable(std::string_view var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
Adds the variable var to the list of variables for this system.
Communicator * TestCommWorld