1 #include <libmesh/equation_systems.h> 2 #include <libmesh/int_range.h> 3 #include <libmesh/mesh.h> 4 #include <libmesh/node.h> 5 #include <libmesh/dof_map.h> 6 #include <libmesh/mesh_generation.h> 7 #include <libmesh/replicated_mesh.h> 8 #include <libmesh/mesh_function.h> 9 #include <libmesh/numeric_vector.h> 10 #include <libmesh/mesh_refinement.h> 11 #include <libmesh/sparse_matrix.h> 12 #include "libmesh/string_to_enum.h" 13 #include <libmesh/cell_tet4.h> 14 #include <libmesh/zero_function.h> 15 #include <libmesh/linear_implicit_system.h> 16 #include <libmesh/transient_system.h> 17 #include <libmesh/quadrature_gauss.h> 18 #include <libmesh/node_elem.h> 19 #include <libmesh/edge_edge2.h> 20 #include <libmesh/dg_fem_context.h> 21 #include <libmesh/enum_solver_type.h> 22 #include <libmesh/enum_preconditioner_type.h> 23 #include <libmesh/linear_solver.h> 24 #include <libmesh/parallel.h> 25 #include <libmesh/face_quad4.h> 26 #include <libmesh/face_quad9.h> 27 #include <libmesh/face_quad8.h> 28 #include <libmesh/face_tri3.h> 29 #include <libmesh/face_tri6.h> 30 #include <libmesh/face_tri7.h> 31 #include <libmesh/cell_hex8.h> 32 #include <libmesh/cell_hex20.h> 33 #include <libmesh/cell_hex27.h> 34 #include <libmesh/cell_tet10.h> 35 #include <libmesh/cell_tet14.h> 36 #include <libmesh/boundary_info.h> 71 map_type & coupled_elements)
override 78 for (
const auto & elem :
as_range(range_begin, range_end))
80 if (elem->id() == node_elem_id_1)
82 if (elem->processor_id() != p)
84 coupled_elements.emplace(elem, null_mat);
88 coupled_elements.emplace(neighbor, null_mat);
91 if (elem->id() == node_elem_id_2)
93 if (elem->processor_id() != p)
95 coupled_elements.emplace(elem, null_mat);
99 coupled_elements.emplace(neighbor, null_mat);
118 { this->mesh_reinit(); }
133 std::vector<dof_id_type> dof_indices;
140 for ( ; el != end_el; ++el)
142 const Elem* elem = *el;
149 dof_map.dof_indices (elem, dof_indices);
150 const unsigned int n_dofs = dof_indices.size();
152 Ke.
resize (n_dofs, n_dofs);
155 for(
unsigned int i=0; i<n_dofs; i++)
169 dof_indices.resize(6);
184 const unsigned int n_dofs = dof_indices.size();
185 Ke.
resize (n_dofs, n_dofs);
188 for(
unsigned int i=0; i<n_dofs; i++)
212 std::vector<dof_id_type> dof_indices;
231 FEBase* neighbor_side_fe = NULL;
236 for (
const auto & elem :
mesh.active_local_element_ptr_range())
246 const std::vector<Real> &JxW = elem_fe->
get_JxW();
247 const std::vector<std::vector<Real> >& phi = elem_fe->
get_phi();
248 const std::vector<std::vector<RealGradient> >& dphi = elem_fe->
get_dphi();
253 for (
unsigned int qp=0; qp != n_qpoints; qp++)
254 for (
unsigned int i=0; i != n_dofs; i++)
255 for (
unsigned int j=0; j != n_dofs; j++)
258 for (
unsigned int qp=0; qp != n_qpoints; qp++)
259 for (
unsigned int i=0; i != n_dofs; i++)
267 for (context.
side = 0; context.
side != elem->n_sides(); ++context.
side)
284 const std::vector<Real> &JxW_face = side_fe->
get_JxW();
285 const std::vector<std::vector<Real> >& phi_face = side_fe->
get_phi();
287 FEBase* neighbor_side_fe = NULL;
292 const std::vector<std::vector<Real> >& phi_neighbor_face =
299 for (
unsigned int qp=0; qp<n_sidepoints; qp++)
301 for (
unsigned int i=0; i<n_dofs; i++)
302 for (
unsigned int j=0; j<n_dofs; j++)
305 JxW_face[qp] * phi_face[i][qp] * phi_face[j][qp];
308 for (
unsigned int i=0; i<n_dofs; i++)
309 for (
unsigned int j=0; j<n_neighbor_dofs; j++)
312 JxW_face[qp] * phi_face[i][qp] * phi_neighbor_face[j][qp];
315 for (
unsigned int i=0; i<n_neighbor_dofs; i++)
316 for (
unsigned int j=0; j<n_neighbor_dofs; j++)
319 JxW_face[qp] * phi_neighbor_face[i][qp] * phi_neighbor_face[j][qp];
322 for (
unsigned int i=0; i<n_neighbor_dofs; i++)
323 for (
unsigned int j=0; j<n_dofs; j++)
326 JxW_face[qp] * phi_neighbor_face[i][qp] * phi_face[j][qp];
356 const Real & x = p(0);
357 const Real & y = LIBMESH_DIM > 1 ? p(1) : 0;
358 const Real & z = LIBMESH_DIM > 2 ? p(2) : 0;
360 return x*(1-x)*(1-x) + x*x*(1-y) + x*(1-y)*(1-z) + y*(1-y)*z + z*(1-z)*(1-z);
369 const Real & x = p(0);
370 const Real & y = LIBMESH_DIM > 1 ? p(1) : 0;
371 const Real & z = LIBMESH_DIM > 2 ? p(2) : 0;
373 return x + 2*y + 3*z - 1;
382 const Real & x = p(0);
383 const Real & y = LIBMESH_DIM > 1 ? p(1) : 0;
384 const Real & z = LIBMESH_DIM > 2 ? p(2) : 0;
386 return (3*x < 1) + (3*y < 2) + (3*z > 2);
394 virtual std::unique_ptr<FunctionBase<Number>>
clone ()
const 395 {
return std::make_unique<TripleFunction>(offset); }
399 const Real = 0.)
override 402 virtual void operator() (
const Point & p,
406 libmesh_assert_greater(output.
size(), 0);
408 output(0) =
cubic_test(p, params,
"",
"") + offset;
409 if (output.
size() > 0)
411 if (output.
size() > 1)
422 return cubic_test(p, params,
"",
"") + offset;
441 CPPUNIT_TEST( test100KVariables );
443 CPPUNIT_TEST( testPostInitAddVector );
444 CPPUNIT_TEST( testAddVectorProjChange );
445 CPPUNIT_TEST( testAddVectorTypeChange );
446 CPPUNIT_TEST( testPostInitAddVectorTypeChange );
448 CPPUNIT_TEST( testProjectHierarchicEdge3 );
450 CPPUNIT_TEST( testProjectHierarchicQuad9 );
451 CPPUNIT_TEST( testProjectHierarchicTri6 );
452 CPPUNIT_TEST( testProjectHierarchicTri7 );
453 CPPUNIT_TEST( test2DProjectVectorFETri3 );
454 CPPUNIT_TEST( test2DProjectVectorFEQuad4 );
455 CPPUNIT_TEST( test2DProjectVectorFETri6 );
456 CPPUNIT_TEST( test2DProjectVectorFETri7 );
457 CPPUNIT_TEST( test2DProjectVectorFEQuad8 );
458 CPPUNIT_TEST( test2DProjectVectorFEQuad9 );
459 #ifdef LIBMESH_HAVE_SOLVER 460 CPPUNIT_TEST( testBlockRestrictedVarNDofs );
462 #endif // LIBMESH_DIM > 1 464 CPPUNIT_TEST( testProjectHierarchicHex27 );
465 CPPUNIT_TEST( testProjectMeshFunctionHex27 );
466 CPPUNIT_TEST( testBoundaryProjectCube );
467 CPPUNIT_TEST( test3DProjectVectorFETet4 );
468 CPPUNIT_TEST( test3DProjectVectorFEHex8 );
469 CPPUNIT_TEST( test3DProjectVectorFETet10 );
470 CPPUNIT_TEST( test3DProjectVectorFETet14 );
471 CPPUNIT_TEST( test3DProjectVectorFEHex20 );
472 CPPUNIT_TEST( test3DProjectVectorFEHex27 );
473 #ifdef LIBMESH_HAVE_SOLVER 474 CPPUNIT_TEST( testSetSystemParameterOverEquationSystem);
475 CPPUNIT_TEST( testAssemblyWithDgFemContext );
477 #endif // LIBMESH_DIM > 2 478 #ifdef LIBMESH_HAVE_SOLVER 479 CPPUNIT_TEST( testDofCouplingWithVarGroups );
482 #ifdef LIBMESH_ENABLE_AMR 483 #ifdef LIBMESH_HAVE_METAPHYSICL 484 #ifdef LIBMESH_HAVE_PETSC 485 CPPUNIT_TEST( testProjectMatrixEdge2 );
487 CPPUNIT_TEST( testProjectMatrixQuad4 );
488 CPPUNIT_TEST( testProjectMatrixTri3 );
489 #endif // LIBMESH_DIM > 1 491 CPPUNIT_TEST( testProjectMatrixHex8 );
492 CPPUNIT_TEST( testProjectMatrixTet4 );
493 #endif // LIBMESH_DIM > 2 494 #endif // LIBMESH_HAVE_PETSC 495 #endif // LIBMESH_HAVE_METAPHYSICL 496 #endif // LIBMESH_ENABLE_AMR 498 CPPUNIT_TEST_SUITE_END();
504 std::set<subdomain_id_type> & u_subdomains,
505 std::set<subdomain_id_type> & v_subdomains,
506 std::set<subdomain_id_type> & w_subdomains,
509 const Elem * elem = locator(p);
513 if (u_subdomains.count(sbd_id))
515 LIBMESH_ASSERT_NUMBERS_EQUAL(
cubic_test(p,param,
"",
""),
516 sys.point_value(0,p),
518 LIBMESH_ASSERT_NUMBERS_EQUAL
522 LIBMESH_ASSERT_NUMBERS_EQUAL
527 if (v_subdomains.count(sbd_id))
529 LIBMESH_ASSERT_NUMBERS_EQUAL
532 LIBMESH_ASSERT_NUMBERS_EQUAL
536 LIBMESH_ASSERT_NUMBERS_EQUAL
541 if (w_subdomains.count(sbd_id))
543 LIBMESH_ASSERT_NUMBERS_EQUAL
546 LIBMESH_ASSERT_NUMBERS_EQUAL
550 LIBMESH_ASSERT_NUMBERS_EQUAL
597 std::vector<std::string> var_names(n_dofs);
599 var_names[i] = std::to_string(i);
610 CPPUNIT_ASSERT_EQUAL(sys.
n_dofs(), n_dofs*5);
611 for (
const Node * node :
mesh.node_ptr_range())
612 CPPUNIT_ASSERT_EQUAL(
dof_id_type(node->n_vars(0)), n_dofs);
632 CPPUNIT_ASSERT_EQUAL(late_vec.size(),
dof_id_type(11));
633 CPPUNIT_ASSERT_EQUAL(late_vec.local_size(), sys.
solution->local_size());
662 CPPUNIT_ASSERT_EQUAL(late_vec.type(),
PARALLEL);
668 CPPUNIT_ASSERT_EQUAL(late_vec.type(),
GHOSTED);
674 CPPUNIT_ASSERT_EQUAL(late_vec.type(),
GHOSTED);
690 CPPUNIT_ASSERT_EQUAL(late_vec.type(),
PARALLEL);
701 late_vec.set(i, 2.0*i);
705 CPPUNIT_ASSERT_EQUAL(late_vec.type(),
GHOSTED);
707 std::vector<dof_id_type> dof_indices;
708 for (
auto & elem :
mesh.active_local_element_ptr_range())
710 dof_map.dof_indices (elem, dof_indices);
712 for (
auto d : dof_indices)
713 CPPUNIT_ASSERT_EQUAL(late_vec(d),
Number(2.0*d));
727 std::set<subdomain_id_type> u_subdomains {0, 1, 4, 5},
728 v_subdomains {1, 2, 3, 4},
729 w_subdomains {0, 1, 2, 3, 4};
740 for (
auto & elem :
mesh.element_ptr_range())
741 elem->subdomain_id() = elem->id();
745 sys.project_solution(&tfunc);
752 locator->enable_out_of_mesh_mode();
753 for (
Real x = 0.1; x < 1; x += 0.2)
754 tripleValueTest(
Point(x), sys, *locator,
755 u_subdomains, v_subdomains, w_subdomains,
758 #ifdef LIBMESH_ENABLE_AMR 759 for (
auto & elem :
mesh.element_ptr_range())
760 if ((elem->id()/2)%2)
765 locator->enable_out_of_mesh_mode();
766 for (
Real x = 0.1; x < 1; x += 0.2)
767 tripleValueTest(
Point(x), sys, *locator,
768 u_subdomains, v_subdomains, w_subdomains,
792 for (
const auto & node :
mesh.local_node_ptr_range())
796 auto dof_index = node->dof_number(sys.number(), u_var, i);
797 sys.solution->set(dof_index, (*node)(i));
802 sys.solution->close();
805 #ifdef LIBMESH_ENABLE_AMR 806 for (
auto & elem :
mesh.element_ptr_range())
811 for (
const auto & node :
mesh.local_node_ptr_range())
816 auto dof_index = node->dof_number(sys.number(), u_var, i);
817 auto value = (*sys.solution)(dof_index);
831 auto u_var = sys.add_variable
836 0., 1., 0., 1., 0., 1.,
843 for (
const auto & node :
mesh.local_node_ptr_range())
847 auto dof_index = node->dof_number(sys.number(), u_var, i);
848 sys.solution->set(dof_index, (*node)(i));
853 sys.solution->close();
856 #ifdef LIBMESH_ENABLE_AMR 857 for (
auto & elem :
mesh.element_ptr_range())
862 for (
const auto & node :
mesh.local_node_ptr_range())
866 auto dof_index = node->dof_number(sys.number(), u_var, i);
867 auto value = (*sys.solution)(dof_index);
881 std::set<subdomain_id_type> u_subdomains {0, 1, 4, 5},
882 v_subdomains {1, 2, 3, 4},
883 w_subdomains {0, 1, 2, 3, 4};
894 for (
auto & elem :
mesh.element_ptr_range())
895 elem->subdomain_id() = elem->id()/2;
899 sys.project_solution(&tfunc);
906 locator->enable_out_of_mesh_mode();
907 for (
Real x = 0.1; x < 1; x += 0.2)
908 for (
Real y = 0.1; y < 1; y += 0.2)
909 tripleValueTest(
Point(x,y), sys, *locator,
910 u_subdomains, v_subdomains, w_subdomains,
913 #ifdef LIBMESH_ENABLE_AMR 914 for (
auto & elem :
mesh.element_ptr_range())
915 if ((elem->id()/2)%2)
920 locator->enable_out_of_mesh_mode();
921 for (
Real x = 0.1; x < 1; x += 0.2)
922 for (
Real y = 0.1; y < 1; y += 0.2)
923 tripleValueTest(
Point(x,y), sys, *locator,
924 u_subdomains, v_subdomains, w_subdomains,
937 std::set<subdomain_id_type> u_subdomains {0, 1, 4, 5},
938 v_subdomains {1, 2, 3, 4},
939 w_subdomains {0, 1, 2, 3, 4};
947 0., 1., 0., 1., 0., 1.,
950 for (
auto & elem :
mesh.element_ptr_range())
951 elem->subdomain_id() = elem->id()/6;
955 sys.project_solution(&tfunc);
962 locator->enable_out_of_mesh_mode();
963 for (
Real x = 0.1; x < 1; x += 0.2)
964 for (
Real y = 0.1; y < 1; y += 0.2)
965 for (
Real z = 0.1; z < 1; z += 0.2)
966 tripleValueTest(
Point(x,y,z), sys, *locator,
967 u_subdomains, v_subdomains, w_subdomains,
970 #ifdef LIBMESH_ENABLE_AMR 971 for (
auto & elem :
mesh.element_ptr_range())
972 if ((elem->id()/2)%2)
977 locator->enable_out_of_mesh_mode();
978 for (
Real x = 0.1; x < 1; x += 0.2)
979 for (
Real y = 0.1; y < 1; y += 0.2)
980 for (
Real z = 0.1; z < 1; z += 0.2)
981 tripleValueTest(
Point(x,y,z), sys, *locator,
982 u_subdomains, v_subdomains, w_subdomains,
999 0., 1., 0., 1., 0., 1.,
1005 std::vector<unsigned int> variables;
1007 std::sort(variables.begin(),variables.end());
1009 std::unique_ptr< NumericVector<Number> > mesh_function_vector =
1011 mesh_function_vector->init(sys.
n_dofs(),
false,
SERIAL);
1012 sys.
solution->localize( *mesh_function_vector );
1015 *mesh_function_vector,
1018 mesh_function.
init();
1031 0., 1., 0., 1., 0., 1.,
1037 for (
Real x = 0.1; x < 1; x += 0.2)
1038 for (
Real y = 0.1; y < 1; y += 0.2)
1039 for (
Real z = 0.1; z < 1; z += 0.2)
1042 LIBMESH_ASSERT_NUMBERS_EQUAL
1070 0., 1., 0., 1., 0., 1.,
1074 std::set<dof_id_type> projected_nodes_set;
1076 for (
const auto & elem :
mesh.element_ptr_range())
1078 for (
auto side : elem->side_index_range())
1080 std::vector<boundary_id_type> vec_to_fill;
1083 auto vec_it = std::find(vec_to_fill.begin(), vec_to_fill.end(), SIDE_BOUNDARY_ID);
1084 if (vec_it != vec_to_fill.end())
1086 for (
unsigned int node_index=0; node_index<elem->n_nodes(); node_index++)
1088 if( elem->is_node_on_side(node_index, side))
1090 projected_nodes_set.insert(elem->node_id(node_index));
1098 for (
const auto & elem :
mesh.element_ptr_range())
1101 side_max_x = 0, side_min_y = 0,
1102 side_max_y = 0, side_max_z = 0;
1105 found_side_max_x =
false, found_side_max_y =
false,
1106 found_side_min_y =
false, found_side_max_z =
false;
1108 for (
auto side : elem->side_index_range())
1113 found_side_max_x =
true;
1119 found_side_min_y =
true;
1125 found_side_max_y =
true;
1131 found_side_max_z =
true;
1138 if (found_side_max_x && found_side_max_y && found_side_max_z)
1139 for (
auto n : elem->node_index_range())
1140 if (elem->is_node_on_side(n, side_max_x) &&
1141 elem->is_node_on_side(n, side_max_y) &&
1142 elem->is_node_on_side(n, side_max_z))
1144 projected_nodes_set.insert(elem->node_id(n));
1151 if (found_side_max_x && found_side_min_y)
1152 for (
auto e : elem->edge_index_range())
1153 if (elem->is_edge_on_side(e, side_max_x) &&
1154 elem->is_edge_on_side(e, side_min_y))
1158 for (
unsigned int node_index=0; node_index<elem->n_nodes(); node_index++)
1160 if (elem->is_node_on_edge(node_index, e))
1162 projected_nodes_set.insert(elem->node_id(node_index));
1172 std::set<boundary_id_type> boundary_ids;
1173 boundary_ids.insert(NODE_BOUNDARY_ID);
1174 boundary_ids.insert(EDGE_BOUNDARY_ID);
1175 boundary_ids.insert(SIDE_BOUNDARY_ID);
1176 std::vector<unsigned int> variables;
1177 variables.push_back(u_var);
1188 Real ref_l1_norm =
static_cast<Real>(
mesh.
n_nodes()) - static_cast<Real>(projected_nodes_set.size());
1208 Point new_point_a(2.);
1209 Point new_point_b(3.);
1213 new_edge_elem->
set_node(0, new_node_a);
1214 new_edge_elem->set_node(1, new_node_b);
1223 node_elem_2->
set_node(0, new_node_a);
1236 std::set<subdomain_id_type> theta_subdomains;
1237 theta_subdomains.insert(10);
1252 equation_systems.
init ();
1279 Point new_point_a(2.);
1280 Point new_point_b(3.);
1284 new_edge_elem->
set_node(0, new_node_a);
1285 new_edge_elem->set_node(1, new_node_b);
1296 equation_systems.
parameters.
set<
unsigned int>(
"linear solver maximum iterations") = 0;
1308 0., 1., 0., 1., 0., 1.,
1312 li_system.get_linear_solver()->set_solver_type(
GMRES);
1317 li_system.parameters.set<
unsigned int>(
"linear solver maximum iterations") = 5;
1318 li_system.parameters.set<
Real>(
"linear solver tolerance") = 1e-100;
1321 equation_systems.
init ();
1327 CPPUNIT_ASSERT_EQUAL(li_system.n_linear_iterations(), 5u);
1345 0., 1., 0., 1., 0., 1.,
1371 for (
const auto & elem :
mesh.element_ptr_range())
1373 Point c = elem->vertex_average();
1374 if (c(0) <= 0.5 && c(1) <= 0.5)
1375 elem->subdomain_id() = 0;
1377 elem->subdomain_id() = 1;
1387 std::set<subdomain_id_type> block0;
1388 std::set<subdomain_id_type> block1;
1393 equation_systems.
init();
1395 std::vector<dof_id_type> u0_dofs;
1397 std::vector<dof_id_type> u1_dofs;
1400 std::set<dof_id_type> sys_u0_dofs;
1402 std::set<dof_id_type> sys_u1_dofs;
1411 const std::size_t c9 = 9;
1412 const std::size_t c21 = 21;
1413 CPPUNIT_ASSERT_EQUAL(c9, u0_dofs.size());
1414 CPPUNIT_ASSERT_EQUAL(c21, u1_dofs.size());
1415 CPPUNIT_ASSERT_EQUAL(c9, sys_u0_dofs.size());
1416 CPPUNIT_ASSERT_EQUAL(c21, sys_u1_dofs.size());
1419 #ifdef LIBMESH_ENABLE_AMR 1420 #ifdef LIBMESH_HAVE_METAPHYSICL 1421 #ifdef LIBMESH_HAVE_PETSC 1443 std::set<dof_id_type> coarse_nodes({0,1,2,3,4});
1444 std::vector<dof_id_type> node_order_f({0,5,1,6,2,7,3,8,4});
1447 int n_old_dofs = sys.
n_dofs();
1450 std::map <dof_id_type, dof_id_type> node2dof_c;
1451 for (
const auto & node :
mesh.node_ptr_range() )
1454 node2dof_c.insert( std::pair<dof_id_type,dof_id_type>( node->id() , cdof_id) );
1463 std::map <dof_id_type, dof_id_type> node2dof_f;
1464 for (
const auto & node :
mesh.local_node_ptr_range() )
1467 node2dof_f.insert( std::pair<dof_id_type,dof_id_type>(node->id() , fdof_id) );
1471 int n_new_dofs = sys.
n_dofs();
1475 int n_old_dofs_local = ndofs_old_end - ndofs_old_first;
1478 std::unique_ptr<SparseMatrix<Number> > proj_mat_ptr =
1481 proj_mat.
init(n_new_dofs, n_old_dofs, n_new_dofs_local, n_old_dofs_local);
1486 std::unique_ptr<SparseMatrix<Number> > gold_mat_ptr =
1489 gold_mat.
init(n_new_dofs, n_old_dofs, n_new_dofs_local, n_old_dofs_local);
1492 for (
const auto & node :
mesh.local_node_ptr_range() )
1495 dof_id_type fdof_id = (node2dof_f.find(node_id))->second;
1497 if (coarse_nodes.find(node_id) != coarse_nodes.end() )
1501 auto cdof_id = node2dof_c.find(node_id);
1502 gold_mat.
set(fdof_id, cdof_id->second, 1.0);
1509 auto node_loc = std::find(node_order_f.begin(), node_order_f.end(), node_id);
1512 auto dof_p = node2dof_c.find(node_p);
1513 auto dof_n = node2dof_c.find(node_n);
1515 gold_mat.
set(fdof_id, dof_p->second, 0.5);
1516 gold_mat.
set(fdof_id, dof_n->second, 0.5);
1524 gold_mat.
add(-1.0, proj_mat);
1543 if (elem_type == Utility::string_to_enum<ElemType>(
"QUAD4"))
1548 else if (elem_type == Utility::string_to_enum<ElemType>(
"TRI3"))
1557 std::set<dof_id_type> coarse_nodes;
1558 std::map<dof_id_type, std::vector<dof_id_type>> side_nbr_nodes;
1559 std::map<dof_id_type, std::vector<dof_id_type>> int_nbr_nodes;
1562 if (elem_type == Utility::string_to_enum<ElemType>(
"QUAD4"))
1564 coarse_nodes.insert({0,1,2,3,4,5,6,7,8});
1566 side_nbr_nodes.insert({9, {0,1}});
1567 side_nbr_nodes.insert({14, {1,2}});
1568 side_nbr_nodes.insert({11, {0,3}});
1569 side_nbr_nodes.insert({12, {1,4}});
1570 side_nbr_nodes.insert({16, {2,5}});
1571 side_nbr_nodes.insert({13, {3,4}});
1572 side_nbr_nodes.insert({17, {4,5}});
1573 side_nbr_nodes.insert({19, {3,6}});
1574 side_nbr_nodes.insert({20, {4,7}});
1575 side_nbr_nodes.insert({23, {5,8}});
1576 side_nbr_nodes.insert({21, {6,7}});
1577 side_nbr_nodes.insert({24, {7,8}});
1579 int_nbr_nodes.insert({10, {0,1,3,4}});
1580 int_nbr_nodes.insert({15, {1,2,4,5}});
1581 int_nbr_nodes.insert({18, {3,4,6,7}});
1582 int_nbr_nodes.insert({22, {4,5,7,8}});
1584 else if (elem_type == Utility::string_to_enum<ElemType>(
"TRI3"))
1586 coarse_nodes.insert({0,1,2,3});
1588 side_nbr_nodes.insert({4, {0,1}});
1589 side_nbr_nodes.insert({5, {0,3}});
1590 side_nbr_nodes.insert({6, {1,3}});
1591 side_nbr_nodes.insert({7, {0,2}});
1592 side_nbr_nodes.insert({8, {2,3}});
1596 int n_old_dofs = sys.
n_dofs();
1599 std::map <dof_id_type, dof_id_type> node2dof_c;
1600 for (
const auto & node :
mesh.node_ptr_range() )
1603 node2dof_c.insert( std::pair<dof_id_type,dof_id_type>( node->id() , cdof_id) );
1612 std::map <dof_id_type, dof_id_type> node2dof_f;
1613 for (
const auto & node :
mesh.local_node_ptr_range() )
1616 node2dof_f.insert( std::pair<dof_id_type,dof_id_type>(node->id() , fdof_id) );
1620 int n_new_dofs = sys.
n_dofs();
1624 int n_old_dofs_local = ndofs_old_end - ndofs_old_first;
1627 std::unique_ptr<SparseMatrix<Number> > proj_mat_ptr =
1630 proj_mat.
init(n_new_dofs, n_old_dofs, n_new_dofs_local, n_old_dofs_local);
1635 std::unique_ptr<SparseMatrix<Number> > gold_mat_ptr =
1638 gold_mat.
init(n_new_dofs, n_old_dofs, n_new_dofs_local, n_old_dofs_local);
1641 for (
const auto & node :
mesh.local_node_ptr_range() )
1644 dof_id_type fdof_id = (node2dof_f.find(node_id))->second;
1646 if (coarse_nodes.find(node_id) != coarse_nodes.end() )
1650 auto cdof_id = node2dof_c.find(node_id);
1651 gold_mat.
set(fdof_id, cdof_id->second, 1.0);
1654 else if ( side_nbr_nodes.find(node_id) != side_nbr_nodes.end() )
1658 auto node_nbrs = side_nbr_nodes.find(node_id);
1659 for (
auto nbr : node_nbrs->second)
1661 auto nbr_dof = node2dof_c.find(nbr);
1662 gold_mat.
set(fdof_id, nbr_dof->second, 0.5);
1670 auto node_nbrs = int_nbr_nodes.find(node_id);
1671 for (
auto nbr : node_nbrs->second)
1673 auto nbr_dof = node2dof_c.find(nbr);
1674 gold_mat.
set(fdof_id, nbr_dof->second, 0.25);
1683 proj_mat.
add(-1.0, gold_mat);
1702 if (elem_type == Utility::string_to_enum<ElemType>(
"HEX8"))
1705 0., 1., 0., 1., 0., 1.,
1707 else if (elem_type == Utility::string_to_enum<ElemType>(
"TET4"))
1726 std::set<dof_id_type> coarse_nodes;
1727 std::map<dof_id_type, std::vector<dof_id_type>> side_nbr_nodes;
1728 std::map<dof_id_type, std::vector<dof_id_type>> face_nbr_nodes;
1729 std::map<dof_id_type, std::vector<dof_id_type>> int_nbr_nodes;
1731 if (elem_type == Utility::string_to_enum<ElemType>(
"HEX8"))
1733 coarse_nodes.insert({0,1,2,3,4,5,6,7});
1736 side_nbr_nodes.insert({8, {0,1}});
1737 side_nbr_nodes.insert({10, {0,2}});
1738 side_nbr_nodes.insert({15, {1,3}});
1739 side_nbr_nodes.insert({18, {2,3}});
1740 side_nbr_nodes.insert({11, {0,4}});
1741 side_nbr_nodes.insert({16, {1,5}});
1742 side_nbr_nodes.insert({21, {3,7}});
1743 side_nbr_nodes.insert({20, {2,6}});
1744 side_nbr_nodes.insert({22, {4,5}});
1745 side_nbr_nodes.insert({24, {4,6}});
1746 side_nbr_nodes.insert({25, {5,7}});
1747 side_nbr_nodes.insert({26, {6,7}});
1749 face_nbr_nodes.insert({12, {0,1,4,5}});
1750 face_nbr_nodes.insert({9 , {0,1,2,3}});
1751 face_nbr_nodes.insert({14, {0,2,4,6}});
1752 face_nbr_nodes.insert({17, {1,3,5,7}});
1753 face_nbr_nodes.insert({19, {2,3,6,7}});
1754 face_nbr_nodes.insert({23, {4,5,6,7}});
1756 int_nbr_nodes.insert({13, {0,1,2,3,4,5,6,7}});
1758 else if (elem_type == Utility::string_to_enum<ElemType>(
"TET4"))
1760 coarse_nodes.insert({0,1,2,3});
1763 side_nbr_nodes.insert({4, {0,1}});
1764 side_nbr_nodes.insert({5, {0,2}});
1765 side_nbr_nodes.insert({6, {0,3}});
1766 side_nbr_nodes.insert({7, {1,2}});
1767 side_nbr_nodes.insert({8, {1,3}});
1768 side_nbr_nodes.insert({9, {2,3}});
1772 int n_old_dofs = sys.
n_dofs();
1775 std::map <dof_id_type, dof_id_type> node2dof_c;
1776 for (
const auto & node :
mesh.node_ptr_range() )
1779 node2dof_c.insert( std::pair<dof_id_type,dof_id_type>( node->id() , cdof_id) );
1788 std::map <dof_id_type, dof_id_type> node2dof_f;
1789 for (
const auto & node :
mesh.local_node_ptr_range() )
1792 node2dof_f.insert( std::pair<dof_id_type,dof_id_type>(node->id() , fdof_id) );
1796 int n_new_dofs = sys.
n_dofs();
1800 int n_old_dofs_local = ndofs_old_end - ndofs_old_first;
1803 std::unique_ptr<SparseMatrix<Number> > proj_mat_ptr =
1806 proj_mat.
init(n_new_dofs, n_old_dofs, n_new_dofs_local, n_old_dofs_local);
1811 std::unique_ptr<SparseMatrix<Number> > gold_mat_ptr =
1814 gold_mat.
init(n_new_dofs, n_old_dofs, n_new_dofs_local, n_old_dofs_local);
1817 for (
const auto & node :
mesh.local_node_ptr_range() )
1820 dof_id_type fdof_id = (node2dof_f.find(node_id))->second;
1822 if (coarse_nodes.find(node_id) != coarse_nodes.end() )
1826 auto cdof_id = node2dof_c.find(node_id);
1827 gold_mat.
set(fdof_id, cdof_id->second, 1.0);
1830 else if ( side_nbr_nodes.find(node_id) != side_nbr_nodes.end() )
1834 auto node_nbrs = side_nbr_nodes.find(node_id);
1835 for (
auto nbr : node_nbrs->second)
1837 auto nbr_dof = node2dof_c.find(nbr);
1838 gold_mat.
set(fdof_id, nbr_dof->second, 0.5);
1842 else if ( face_nbr_nodes.find(node_id) != face_nbr_nodes.end() )
1846 auto node_nbrs = face_nbr_nodes.find(node_id);
1847 for (
auto nbr : node_nbrs->second)
1849 auto nbr_dof = node2dof_c.find(nbr);
1850 gold_mat.
set(fdof_id, nbr_dof->second, 0.25);
1858 auto node_nbrs = int_nbr_nodes.find(node_id);
1859 for (
auto nbr : node_nbrs->second)
1861 auto nbr_dof = node2dof_c.find(nbr);
1862 gold_mat.
set(fdof_id, nbr_dof->second, 0.125);
1871 proj_mat.
add(-1.0, gold_mat);
1875 #endif // LIBMESH_HAVE_PETSC 1876 #endif // LIBMESH_HAVE_METAPHYSICL 1877 #endif // LIBMESH_ENABLE_AMR 1899 #ifdef LIBMESH_ENABLE_AMR 1900 #ifdef LIBMESH_HAVE_METAPHYSICL 1901 #ifdef LIBMESH_HAVE_PETSC 1908 #endif // LIBMESH_HAVE_PETSC 1909 #endif // LIBMESH_HAVE_METAPHYSICL 1910 #endif // LIBMESH_ENABLE_AMR unsigned int add_variables(const std::vector< std::string > &vars, 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.
void test3DProjectVectorFETet14()
void test2DProjectVectorFETri7()
static const Order type_to_default_order_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the default approximation order of...
Number cubic_test(const Point &p, const Parameters &, const std::string &, const std::string &)
void local_dof_indices(const unsigned int var, std::set< dof_id_type > &var_indices) const
Fills the std::set with the degrees of freedom on the local processor corresponding the the variable ...
void testAddVectorTypeChange()
ElemType
Defines an enum for geometric element types.
void testProjectMatrixQuad4()
void allgather(const T &send_data, std::vector< T, A > &recv_data) const
This is the EquationSystems class.
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
const DenseMatrix< Number > & get_elem_jacobian() const
Const accessor for element Jacobian.
virtual Node *& set_node(const unsigned int i)
A Node is like a Point, but with more information.
This abstract base class defines the interface by which library code and user code can report associa...
void tripleValueTest(const Point &p, const TransientExplicitSystem &sys, const PointLocatorBase &locator, std::set< subdomain_id_type > &u_subdomains, std::set< subdomain_id_type > &v_subdomains, std::set< subdomain_id_type > &w_subdomains, const Parameters ¶m)
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for edge/face (2D/3D) finite element object for variable var for the largest dimension in th...
virtual void pre_fe_reinit(const System &, const Elem *e)
Reinitializes local data vectors/matrices on the current geometric element.
bool has_boundary_id(const Node *const node, const boundary_id_type id) const
std::unique_ptr< PointLocatorBase > sub_point_locator() const
void testProjectHierarchicTri6()
ConstFunction that simply returns 0.
This class provides the ability to map between arbitrary, user-defined strings and several data types...
void allow_renumbering(bool allow)
If false is passed in then this mesh will no longer be renumbered when being prepared for use...
void neighbor_side_fe_reinit()
Initialize neighbor side data needed to assemble DG terms.
libMesh::Parallel::Communicator * TestCommWorld
void test3DProjectVectorFE(const ElemType elem_type)
The definition of the const_element_iterator struct.
std::size_t distribute_dofs(MeshBase &)
Distribute dofs on the current mesh.
static constexpr Real TOLERANCE
void local_variable_indices(T &idx, const MeshBase &mesh, unsigned int var_num) const
If T == dof_id_type, counts, if T == std::vector<dof_id_type>, fills an array of, those dof indices w...
dof_id_type end_old_dof(const processor_id_type proc) const
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and linear solvers ...
void testProjectMatrixHex8()
virtual void side_fe_reinit() override
Override side_fe_reinit to set a boolean flag so that by default DG terms are assumed to be inactive...
void resize(const unsigned int n)
Resize the vector.
virtual void add_vector(const T *v, const std::vector< numeric_index_type > &dof_indices)
Computes , where v is a pointer and each dof_indices[i] specifies where to add value v[i]...
const std::vector< dof_id_type > & get_neighbor_dof_indices() const
Accessor for neighbor dof indices.
void prepare_for_use(const bool skip_renumber_nodes_and_elements, const bool skip_find_neighbors)
Prepare a newly ecreated (or read) mesh for use.
virtual void mesh_reinit() override
Rebuild the cached _lower_to_upper map whenever our Mesh has changed.
static const unsigned int type_to_dim_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the geometric dimension of the ele...
void testAddVectorProjChange()
void projection_matrix(SparseMatrix< Number > &proj_mat) const
This method creates a projection matrix which corresponds to the operation of project_vector between ...
TripleFunction(Number _offset=0)
virtual std::unique_ptr< FunctionBase< Number > > clone() const
This is the base class from which all geometric element types are derived.
Number point_value(unsigned int var, const Point &p, const bool insist_on_success=true, const NumericVector< Number > *sol=nullptr) const
NumericVector< Number > * rhs
The system matrix.
void testSetSystemParameterOverEquationSystem()
const Parallel::Communicator & comm() const
Manages storage and variables for transient systems.
NumericVector< Number > & add_vector(std::string_view vec_name, const bool projections=true, const ParallelType type=PARALLEL)
Adds the additional vector vec_name to this system.
void get_all_variable_numbers(std::vector< unsigned int > &all_variable_numbers) const
Fills all_variable_numbers with all the variable numbers for the variables that have been added to th...
Number disc_thirds_test(const Point &p, const Parameters &, const std::string &, const std::string &)
void boundary_ids(const Node *node, std::vector< boundary_id_type > &vec_to_fill) const
Fills a user-provided std::vector with the boundary ids associated with Node node.
std::map< const Elem *, const CouplingMatrix *, CompareDofObjectsByPIDAndThenID > map_type
What elements do we care about and what variables do we care about on each element?
dof_id_type n_dofs(const unsigned int vn) const
void test2DProjectVectorFEQuad8()
virtual LinearSolver< Number > * get_linear_solver() const override
const DenseMatrix< Number > & get_neighbor_neighbor_jacobian() const
Const accessor for element-neighbor Jacobian.
The libMesh namespace provides an interface to certain functionality in the library.
void test2DProjectVectorFEQuad9()
dof_id_type n_local_dofs(const unsigned int vn) const
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
void test2DProjectVectorFEQuad4()
virtual void solve() override
Assembles & solves the linear system A*x=b.
const T_sys & get_system(std::string_view name) const
void test3DProjectVectorFETet10()
CPPUNIT_TEST_SUITE_REGISTRATION(SystemsTest)
unsigned char get_side() const
Accessor for current side of Elem object.
void testProjectMatrix3D(const ElemType elem_type)
void add_coupling_functor(GhostingFunctor &coupling_functor, bool to_mesh=true)
Adds a functor which can specify coupling requirements for creation of sparse matrices.
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)=0
Add a new Node at Point p to the end of the vertex array, with processor_id procid.
static std::unique_ptr< SparseMatrix< T > > build(const Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package(), const MatrixBuildType matrix_build_type=MatrixBuildType::AUTOMATIC)
Builds a SparseMatrix<T> using the linear solver package specified by solver_package.
void testPostInitAddVectorTypeChange()
NumericVector< Number > * old_local_solution
All the values I need to compute my contribution to the simulation at hand.
dof_id_type n_dofs() const
void test2DProjectVectorFETri3()
This is the MeshBase class.
virtual numeric_index_type row_stop() const =0
void assemble_matrix_and_rhs(EquationSystems &es, const std::string &)
virtual void set(const numeric_index_type i, const numeric_index_type j, const T value)=0
Set the element (i,j) to value.
virtual void elem_fe_reinit(const std::vector< Point > *const pts=nullptr)
Reinitializes interior FE objects on the current geometric element.
unsigned int variable_number(std::string_view var) const
virtual void add(const numeric_index_type i, const numeric_index_type j, const T value)=0
Add value to the element (i,j).
This class handles the numbering of degrees of freedom on a mesh.
NumericVector< Number > * older_local_solution
All the values I need to compute my contribution to the simulation at hand.
void project_solution(FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr) const
Projects arbitrary functions onto the current solution.
processor_id_type size() const
const std::vector< std::vector< OutputGradient > > & get_dphi() const
uint8_t processor_id_type
void add_node(const Node *node, const boundary_id_type id)
Add Node node with boundary id id to the boundary information data structures.
unsigned int number() const
virtual void add_matrix(const DenseMatrix< T > &dm, const std::vector< numeric_index_type > &rows, const std::vector< numeric_index_type > &cols)=0
Add the full matrix dm to the SparseMatrix.
void testBlockRestrictedVarNDofs()
void get_neighbor_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for neighbor edge/face (2D/3D) finite element object for variable var.
Implements (adaptive) mesh refinement algorithms for a MeshBase.
void set_neighbor(const Elem &neighbor)
Set the neighbor element which we will use to assemble DG terms.
The UnstructuredMesh class is derived from the MeshBase class.
Manages consistently variables, degrees of freedom, and coefficient vectors.
virtual Elem * add_elem(Elem *e)=0
Add elem e to the end of the element array.
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
void testProjectMatrixTri3()
virtual void reinit()
Handle any mesh changes and reinitialize all the systems on the updated mesh.
void test3DProjectVectorFEHex20()
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
void test2DProjectVectorFETri6()
Number new_linear_test(const Point &p, const Parameters &, const std::string &, const std::string &)
void testProjectHierarchicEdge3()
void set_preconditioner_type(const PreconditionerType pct)
Sets the type of preconditioner to use.
AugmentSparsityOnNodes(MeshBase &mesh)
Constructor.
std::unique_ptr< NumericVector< Number > > solution
Data structure to hold solution values.
This class extends FEMContext in order to provide extra data required to perform local element residu...
virtual void init() override
Override the FunctionBase::init() member function.
virtual_for_inffe const std::vector< Real > & get_JxW() const
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
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.
void testProjectSquare(const ElemType elem_type)
unsigned int n_points() const
void testProjectMatrixTet4()
This is the base class for point locators.
void set_solver_type(const SolverType st)
Sets the type of solver to use.
void attach_assemble_function(void fptr(EquationSystems &es, const std::string &name))
Register a user function to use in assembling the system matrix and RHS.
dof_id_type n_dofs_on_processor(const processor_id_type proc) const
void testProjectMatrix1D(const ElemType elem_type)
const DenseMatrix< Number > & get_elem_neighbor_jacobian() const
Const accessor for element-neighbor Jacobian.
void test2DProjectVectorFE(const ElemType elem_type)
virtual void solve()
Solves the system.
virtual void close()=0
Calls the NumericVector's internal assembly routines, ensuring that the values are consistent across ...
void testProjectCube(const ElemType elem_type)
virtual void redistribute() override
Update the cached _lower_to_upper map whenever our Mesh has been redistributed.
void testBoundaryProjectCube()
virtual const Elem * elem_ptr(const dof_id_type i) const =0
void test3DProjectVectorFEHex8()
const DenseMatrix< Number > & get_neighbor_elem_jacobian() const
Const accessor for element-neighbor Jacobian.
const Elem * neighbor_ptr(unsigned int i) const
const DenseVector< Number > & get_elem_residual() const
Const accessor for element residual.
virtual void close()=0
Calls the SparseMatrix's internal assembly routines, ensuring that the values are consistent across p...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
subdomain_id_type subdomain_id() const
MeshBase & _mesh
The Mesh we're calculating on.
unsigned char side
Current side for side_* to examine.
void max(const T &r, T &o, Request &req) const
virtual numeric_index_type row_start() const =0
const Node * node_ptr(const unsigned int i) const
void testDofCouplingWithVarGroups()
T & set(const std::string &)
static std::unique_ptr< Elem > build_with_id(const ElemType type, dof_id_type id)
Calls the build() method above with a nullptr parent, and additionally sets the newly-created Elem's ...
const MeshBase & get_mesh() const
virtual const Elem & elem_ref(const dof_id_type i) const
void resize(const unsigned int new_m, const unsigned int new_n)
Resizes the matrix to the specified size and calls zero().
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
void test3DProjectVectorFEHex27()
ExplicitSystem & simpleSetup(UnstructuredMesh &mesh, EquationSystems &es)
static std::unique_ptr< NumericVector< T > > build(const Parallel::Communicator &comm, SolverPackage solver_package=libMesh::default_solver_package(), ParallelType parallel_type=AUTOMATIC)
Builds a NumericVector on the processors in communicator comm using the linear solver package specifi...
Parameters parameters
Data structure holding arbitrary parameters.
virtual unsigned int size() const override final
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh...
virtual Real linfty_norm() const =0
void boundary_project_solution(const std::set< boundary_id_type > &b, const std::vector< unsigned int > &variables, FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr)
Projects arbitrary boundary functions onto a vector of degree of freedom values for the current syste...
virtual const Node & node_ref(const dof_id_type i) const
void testProjectHierarchicTri7()
const DenseMatrix< Number > & get_elem_elem_jacobian() const
Const accessor for element-element Jacobian.
virtual void init()
Initialize all the systems.
dof_id_type first_old_dof(const processor_id_type proc) const
This class provides function-like objects for data distributed over a mesh.
void testAssemblyWithDgFemContext()
void testProjectMatrix2D(const ElemType elem_type)
unsigned int n_vars() const
void testProjectMeshFunctionHex27()
virtual System & add_system(std::string_view system_type, std::string_view name)
Add the system of type system_type named name to the systems array.
virtual const Node * node_ptr(const dof_id_type i) const =0
void testProjectMatrixEdge2()
Base class for functors that can be evaluated at a point and (optionally) time.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
processor_id_type processor_id() const
void testProjectHierarchicHex27()
bool vector_preservation(std::string_view vec_name) const
void testProjectLine(const ElemType elem_type)
const DofMap & get_dof_map() const
processor_id_type processor_id() const
virtual ElemType type() const =0
Number component(unsigned int i, const Point &p, Real) override
void assembly_with_dg_fem_context(EquationSystems &es, const std::string &)
void testProjectCubeWithMeshFunction(const ElemType elem_type)
void testPostInitAddVector()
A Point defines a location in LIBMESH_DIM dimensional Real space.
void test3DProjectVectorFETet4()
const SparseMatrix< Number > & get_system_matrix() const
std::vector< dof_id_type > n_dofs_per_processor(const unsigned int vn) const
virtual dof_id_type n_nodes() const =0
This class forms the foundation from which generic finite elements may be derived.
const QBase & get_element_qrule() const
Accessor for element interior quadrature rule for the dimension of the current _elem.
Manages consistently variables, degrees of freedom, and coefficient vectors for explicit systems...
const QBase & get_side_qrule() const
Accessor for element side quadrature rule for the dimension of the current _elem. ...
void testProjectHierarchicQuad9()
void add_edge(const dof_id_type elem, const unsigned short int edge, const boundary_id_type id)
Add edge edge of element number elem with boundary id id to the boundary information data structure...
const std::vector< std::vector< OutputShape > > & get_phi() const
virtual void init(const numeric_index_type m, const numeric_index_type n, const numeric_index_type m_l, const numeric_index_type n_l, const numeric_index_type nnz=30, const numeric_index_type noz=10, const numeric_index_type blocksize=1)=0
Initialize SparseMatrix with the specified sizes.
void uniformly_refine(unsigned int n=1)
Uniformly refines the mesh n times.
This class defines a coupling matrix.
void set_union(T &data, const unsigned int root_id) const