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>
65 virtual std::unique_ptr<GhostingFunctor>
clone ()
const override
67 return std::make_unique<AugmentSparsityOnNodes>(
_mesh);
76 map_type & coupled_elements)
override
83 for (
const auto & elem :
as_range(range_begin, range_end))
85 if (elem->id() == node_elem_id_1)
87 if (elem->processor_id() != p)
89 coupled_elements.emplace(elem, null_mat);
93 coupled_elements.emplace(neighbor, null_mat);
96 if (elem->id() == node_elem_id_2)
98 if (elem->processor_id() != p)
100 coupled_elements.emplace(elem, null_mat);
104 coupled_elements.emplace(neighbor, null_mat);
138 std::vector<dof_id_type> dof_indices;
145 for ( ; el != end_el; ++el)
147 const Elem* elem = *el;
154 dof_map.dof_indices (elem, dof_indices);
155 const unsigned int n_dofs = dof_indices.size();
157 Ke.
resize (n_dofs, n_dofs);
160 for(
unsigned int i=0; i<n_dofs; i++)
174 dof_indices.resize(6);
189 const unsigned int n_dofs = dof_indices.size();
190 Ke.
resize (n_dofs, n_dofs);
193 for(
unsigned int i=0; i<n_dofs; i++)
217 std::vector<dof_id_type> dof_indices;
236 FEBase* neighbor_side_fe = NULL;
241 for (
const auto & elem :
mesh.active_local_element_ptr_range())
251 const std::vector<Real> &JxW = elem_fe->
get_JxW();
252 const std::vector<std::vector<Real> >& phi = elem_fe->
get_phi();
253 const std::vector<std::vector<RealGradient> >& dphi = elem_fe->
get_dphi();
258 for (
unsigned int qp=0; qp != n_qpoints; qp++)
259 for (
unsigned int i=0; i != n_dofs; i++)
260 for (
unsigned int j=0; j != n_dofs; j++)
263 for (
unsigned int qp=0; qp != n_qpoints; qp++)
264 for (
unsigned int i=0; i != n_dofs; i++)
272 for (context.
side = 0; context.
side != elem->n_sides(); ++context.
side)
289 const std::vector<Real> &JxW_face = side_fe->
get_JxW();
290 const std::vector<std::vector<Real> >& phi_face = side_fe->
get_phi();
292 FEBase* neighbor_side_fe = NULL;
297 const std::vector<std::vector<Real> >& phi_neighbor_face =
304 for (
unsigned int qp=0; qp<n_sidepoints; qp++)
306 for (
unsigned int i=0; i<n_dofs; i++)
307 for (
unsigned int j=0; j<n_dofs; j++)
310 JxW_face[qp] * phi_face[i][qp] * phi_face[j][qp];
313 for (
unsigned int i=0; i<n_dofs; i++)
314 for (
unsigned int j=0; j<n_neighbor_dofs; j++)
317 JxW_face[qp] * phi_face[i][qp] * phi_neighbor_face[j][qp];
320 for (
unsigned int i=0; i<n_neighbor_dofs; i++)
321 for (
unsigned int j=0; j<n_neighbor_dofs; j++)
324 JxW_face[qp] * phi_neighbor_face[i][qp] * phi_neighbor_face[j][qp];
327 for (
unsigned int i=0; i<n_neighbor_dofs; i++)
328 for (
unsigned int j=0; j<n_dofs; j++)
331 JxW_face[qp] * phi_neighbor_face[i][qp] * phi_face[j][qp];
361 const Real & x = p(0);
362 const Real & y = LIBMESH_DIM > 1 ? p(1) : 0;
363 const Real & z = LIBMESH_DIM > 2 ? p(2) : 0;
365 return x*(1-x)*(1-x) + x*x*(1-y) + x*(1-y)*(1-z) + y*(1-y)*z + z*(1-z)*(1-z);
374 const Real & x = p(0);
375 const Real & y = LIBMESH_DIM > 1 ? p(1) : 0;
376 const Real & z = LIBMESH_DIM > 2 ? p(2) : 0;
378 return x + 2*y + 3*z - 1;
387 const Real & x = p(0);
388 const Real & y = LIBMESH_DIM > 1 ? p(1) : 0;
389 const Real & z = LIBMESH_DIM > 2 ? p(2) : 0;
391 return (3*x < 1) + (3*y < 2) + (3*z > 2);
399 virtual std::unique_ptr<FunctionBase<Number>>
clone ()
const
400 {
return std::make_unique<TripleFunction>(
offset); }
404 const Real = 0.)
override
411 libmesh_assert_greater(output.
size(), 0);
414 if (output.
size() > 0)
416 if (output.
size() > 1)
466#ifdef LIBMESH_HAVE_SOLVER
481#ifdef LIBMESH_HAVE_SOLVER
486#ifdef LIBMESH_HAVE_SOLVER
490#ifdef LIBMESH_ENABLE_AMR
493#ifdef LIBMESH_HAVE_METAPHYSICL
494#ifdef LIBMESH_HAVE_PETSC
514 std::set<subdomain_id_type> & u_subdomains,
515 std::set<subdomain_id_type> & v_subdomains,
516 std::set<subdomain_id_type> & w_subdomains,
519 const Elem * elem = locator(p);
523 if (u_subdomains.count(sbd_id))
525 LIBMESH_ASSERT_NUMBERS_EQUAL(
cubic_test(p,param,
"",
""),
526 sys.point_value(0,p),
528 LIBMESH_ASSERT_NUMBERS_EQUAL
532 LIBMESH_ASSERT_NUMBERS_EQUAL
537 if (v_subdomains.count(sbd_id))
539 LIBMESH_ASSERT_NUMBERS_EQUAL
542 LIBMESH_ASSERT_NUMBERS_EQUAL
546 LIBMESH_ASSERT_NUMBERS_EQUAL
551 if (w_subdomains.count(sbd_id))
553 LIBMESH_ASSERT_NUMBERS_EQUAL
556 LIBMESH_ASSERT_NUMBERS_EQUAL
560 LIBMESH_ASSERT_NUMBERS_EQUAL
598 0., 1., 0., 1., 0., 1.,
606 const std::string names[3] = {
"u",
"v",
"w"};
607 const unsigned int var_nums[3] =
614 for (
unsigned int i : {0, 1, 2})
617 CPPUNIT_ASSERT_EQUAL(i, var_nums[i]);
620 CPPUNIT_ASSERT_EQUAL(var.system(), &sys);
621 CPPUNIT_ASSERT_EQUAL(var.name(), names[i]);
622 CPPUNIT_ASSERT_EQUAL(var.number(), i);
623 CPPUNIT_ASSERT_EQUAL(var.first_scalar_number(), i*3);
624 CPPUNIT_ASSERT_EQUAL(var.type().family, types[i]);
625 CPPUNIT_ASSERT_EQUAL(
Order(var.type().order), orders[i]);
626 CPPUNIT_ASSERT_EQUAL(var.n_components(
mesh), 3u);
646 std::vector<std::string> var_names(n_dofs);
648 var_names[i] = std::to_string(i);
659 CPPUNIT_ASSERT_EQUAL(sys.
n_dofs(), n_dofs*5);
660 for (
const Node * node :
mesh.node_ptr_range())
661 CPPUNIT_ASSERT_EQUAL(
dof_id_type(node->n_vars(0)), n_dofs);
676 CPPUNIT_ASSERT (info.find(
"uninitialized") != std::string::npos);
692 CPPUNIT_ASSERT_EQUAL(late_vec.size(),
dof_id_type(11));
693 CPPUNIT_ASSERT_EQUAL(late_vec.local_size(), sys.
solution->local_size());
722 CPPUNIT_ASSERT_EQUAL(late_vec.type(),
PARALLEL);
728 CPPUNIT_ASSERT_EQUAL(late_vec.type(),
GHOSTED);
734 CPPUNIT_ASSERT_EQUAL(late_vec.type(),
GHOSTED);
750 CPPUNIT_ASSERT_EQUAL(late_vec.type(),
PARALLEL);
761 late_vec.set(i, 2.0*i);
765 CPPUNIT_ASSERT_EQUAL(late_vec.type(),
GHOSTED);
767 std::vector<dof_id_type> dof_indices;
768 for (
auto & elem :
mesh.active_local_element_ptr_range())
770 dof_map.dof_indices (elem, dof_indices);
772 for (
auto d : dof_indices)
773 CPPUNIT_ASSERT_EQUAL(late_vec(d),
Number(2.0*d));
787 std::set<subdomain_id_type> u_subdomains {0, 1, 4, 5},
788 v_subdomains {1, 2, 3, 4},
789 w_subdomains {0, 1, 2, 3, 4};
800 for (
auto & elem :
mesh.element_ptr_range())
801 elem->subdomain_id() = elem->id();
805 sys.project_solution(&tfunc);
812 locator->enable_out_of_mesh_mode();
813 for (
Real x = 0.1; x < 1; x += 0.2)
815 u_subdomains, v_subdomains, w_subdomains,
818#ifdef LIBMESH_ENABLE_AMR
819 for (
auto & elem :
mesh.element_ptr_range())
820 if ((elem->id()/2)%2)
825 locator->enable_out_of_mesh_mode();
826 for (
Real x = 0.1; x < 1; x += 0.2)
828 u_subdomains, v_subdomains, w_subdomains,
833#ifdef LIBMESH_ENABLE_AMR
847 for (
auto & elem :
mesh.active_element_ptr_range())
857 const unsigned int scalar_var =
862 std::vector<dof_id_type> scalar_dofs;
864 CPPUNIT_ASSERT_EQUAL(std::size_t(1), scalar_dofs.size());
870 solution.
set(scalar_dof, 7.25);
873 for (
auto & elem :
mesh.active_element_ptr_range())
880 CPPUNIT_ASSERT_EQUAL(std::size_t(1), scalar_dofs.size());
882 std::unique_ptr<NumericVector<Number>> localized_solution =
885 sys.
solution->localize(*localized_solution);
887 LIBMESH_ASSERT_NUMBERS_EQUAL((*localized_solution)(scalar_dofs[0]),
912 for (
const auto & node :
mesh.local_node_ptr_range())
916 auto dof_index = node->dof_number(sys.number(), u_var, i);
917 sys.solution->set(dof_index, (*node)(i));
922 sys.solution->close();
925#ifdef LIBMESH_ENABLE_AMR
926 for (
auto & elem :
mesh.element_ptr_range())
931 for (
const auto & node :
mesh.local_node_ptr_range())
936 auto dof_index = node->dof_number(sys.number(), u_var, i);
937 auto value = (*sys.solution)(dof_index);
951 auto u_var = sys.add_variable
956 0., 1., 0., 1., 0., 1.,
963 for (
const auto & node :
mesh.local_node_ptr_range())
967 auto dof_index = node->dof_number(sys.number(), u_var, i);
968 sys.solution->set(dof_index, (*node)(i));
973 sys.solution->close();
976#ifdef LIBMESH_ENABLE_AMR
977 for (
auto & elem :
mesh.element_ptr_range())
982 for (
const auto & node :
mesh.local_node_ptr_range())
986 auto dof_index = node->dof_number(sys.number(), u_var, i);
987 auto value = (*sys.solution)(dof_index);
1001 std::set<subdomain_id_type> u_subdomains {0, 1, 4, 5},
1002 v_subdomains {1, 2, 3, 4},
1003 w_subdomains {0, 1, 2, 3, 4};
1014 for (
auto & elem :
mesh.element_ptr_range())
1015 elem->subdomain_id() = elem->id()/2;
1019 sys.project_solution(&tfunc);
1026 locator->enable_out_of_mesh_mode();
1027 for (
Real x = 0.1; x < 1; x += 0.2)
1028 for (
Real y = 0.1; y < 1; y += 0.2)
1030 u_subdomains, v_subdomains, w_subdomains,
1033#ifdef LIBMESH_ENABLE_AMR
1034 for (
auto & elem :
mesh.element_ptr_range())
1035 if ((elem->id()/2)%2)
1040 locator->enable_out_of_mesh_mode();
1041 for (
Real x = 0.1; x < 1; x += 0.2)
1042 for (
Real y = 0.1; y < 1; y += 0.2)
1044 u_subdomains, v_subdomains, w_subdomains,
1057 std::set<subdomain_id_type> u_subdomains {0, 1, 4, 5},
1058 v_subdomains {1, 2, 3, 4},
1059 w_subdomains {0, 1, 2, 3, 4};
1067 0., 1., 0., 1., 0., 1.,
1070 for (
auto & elem :
mesh.element_ptr_range())
1071 elem->subdomain_id() = elem->id()/6;
1075 sys.project_solution(&tfunc);
1082 locator->enable_out_of_mesh_mode();
1083 for (
Real x = 0.1; x < 1; x += 0.2)
1084 for (
Real y = 0.1; y < 1; y += 0.2)
1085 for (
Real z = 0.1; z < 1; z += 0.2)
1087 u_subdomains, v_subdomains, w_subdomains,
1090 #ifdef LIBMESH_ENABLE_AMR
1091 for (
auto & elem :
mesh.element_ptr_range())
1092 if ((elem->id()/2)%2)
1097 locator->enable_out_of_mesh_mode();
1098 for (
Real x = 0.1; x < 1; x += 0.2)
1099 for (
Real y = 0.1; y < 1; y += 0.2)
1100 for (
Real z = 0.1; z < 1; z += 0.2)
1102 u_subdomains, v_subdomains, w_subdomains,
1119 0., 1., 0., 1., 0., 1.,
1125 std::vector<unsigned int> variables;
1127 std::sort(variables.begin(),variables.end());
1129 std::unique_ptr< NumericVector<Number> > mesh_function_vector =
1131 mesh_function_vector->init(sys.
n_dofs(),
false,
SERIAL);
1132 sys.
solution->localize( *mesh_function_vector );
1135 *mesh_function_vector,
1138 mesh_function.
init();
1151 0., 1., 0., 1., 0., 1.,
1157 for (
Real x = 0.1; x < 1; x += 0.2)
1158 for (
Real y = 0.1; y < 1; y += 0.2)
1159 for (
Real z = 0.1; z < 1; z += 0.2)
1162 LIBMESH_ASSERT_NUMBERS_EQUAL
1190 0., 1., 0., 1., 0., 1.,
1194 std::set<dof_id_type> projected_nodes_set;
1196 for (
const auto & elem :
mesh.element_ptr_range())
1198 for (
auto side : elem->side_index_range())
1200 std::vector<boundary_id_type> vec_to_fill;
1203 auto vec_it = std::find(vec_to_fill.begin(), vec_to_fill.end(), SIDE_BOUNDARY_ID);
1204 if (vec_it != vec_to_fill.end())
1206 for (
unsigned int node_index=0; node_index<elem->n_nodes(); node_index++)
1208 if( elem->is_node_on_side(node_index, side))
1210 projected_nodes_set.insert(elem->node_id(node_index));
1218 for (
const auto & elem :
mesh.element_ptr_range())
1221 side_max_x = 0, side_min_y = 0,
1222 side_max_y = 0, side_max_z = 0;
1225 found_side_max_x =
false, found_side_max_y =
false,
1226 found_side_min_y =
false, found_side_max_z =
false;
1228 for (
auto side : elem->side_index_range())
1233 found_side_max_x =
true;
1239 found_side_min_y =
true;
1245 found_side_max_y =
true;
1251 found_side_max_z =
true;
1258 if (found_side_max_x && found_side_max_y && found_side_max_z)
1259 for (
auto n : elem->node_index_range())
1260 if (elem->is_node_on_side(n, side_max_x) &&
1261 elem->is_node_on_side(n, side_max_y) &&
1262 elem->is_node_on_side(n, side_max_z))
1264 projected_nodes_set.insert(elem->node_id(n));
1271 if (found_side_max_x && found_side_min_y)
1272 for (
auto e : elem->edge_index_range())
1273 if (elem->is_edge_on_side(e, side_max_x) &&
1274 elem->is_edge_on_side(e, side_min_y))
1278 for (
unsigned int node_index=0; node_index<elem->n_nodes(); node_index++)
1280 if (elem->is_node_on_edge(node_index, e))
1282 projected_nodes_set.insert(elem->node_id(node_index));
1292 std::set<boundary_id_type> boundary_ids;
1293 boundary_ids.insert(NODE_BOUNDARY_ID);
1294 boundary_ids.insert(EDGE_BOUNDARY_ID);
1295 boundary_ids.insert(SIDE_BOUNDARY_ID);
1296 std::vector<unsigned int> variables;
1297 variables.push_back(u_var);
1328 Point new_point_a(2.);
1329 Point new_point_b(3.);
1333 new_edge_elem->
set_node(0, new_node_a);
1334 new_edge_elem->set_node(1, new_node_b);
1343 node_elem_2->
set_node(0, new_node_a);
1356 std::set<subdomain_id_type> theta_subdomains;
1357 theta_subdomains.insert(10);
1372 equation_systems.
init ();
1399 Point new_point_a(2.);
1400 Point new_point_b(3.);
1404 new_edge_elem->
set_node(0, new_node_a);
1405 new_edge_elem->set_node(1, new_node_b);
1416 equation_systems.
parameters.
set<
unsigned int>(
"linear solver maximum iterations") = 0;
1428 0., 1., 0., 1., 0., 1.,
1432 li_system.get_linear_solver()->set_solver_type(
GMRES);
1437 li_system.parameters.set<
unsigned int>(
"linear solver maximum iterations") = 5;
1438 li_system.parameters.set<
Real>(
"linear solver tolerance") = 1e-100;
1441 equation_systems.
init ();
1447 CPPUNIT_ASSERT_EQUAL(li_system.n_linear_iterations(), 5u);
1465 0., 1., 0., 1., 0., 1.,
1491 for (
const auto & elem :
mesh.element_ptr_range())
1493 Point c = elem->vertex_average();
1494 if (c(0) <= 0.5 && c(1) <= 0.5)
1495 elem->subdomain_id() = 0;
1497 elem->subdomain_id() = 1;
1507 std::set<subdomain_id_type> block0;
1508 std::set<subdomain_id_type> block1;
1513 equation_systems.
init();
1515 std::vector<dof_id_type> u0_dofs;
1517 std::vector<dof_id_type> u1_dofs;
1520 std::set<dof_id_type> sys_u0_dofs;
1522 std::set<dof_id_type> sys_u1_dofs;
1531 const std::size_t c9 = 9;
1532 const std::size_t c21 = 21;
1533 CPPUNIT_ASSERT_EQUAL(c9, u0_dofs.size());
1534 CPPUNIT_ASSERT_EQUAL(c21, u1_dofs.size());
1535 CPPUNIT_ASSERT_EQUAL(c9, sys_u0_dofs.size());
1536 CPPUNIT_ASSERT_EQUAL(c21, sys_u1_dofs.size());
1539#ifdef LIBMESH_ENABLE_AMR
1540#ifdef LIBMESH_HAVE_METAPHYSICL
1541#ifdef LIBMESH_HAVE_PETSC
1563 std::set<dof_id_type> coarse_nodes({0,1,2,3,4});
1564 std::vector<dof_id_type> node_order_f({0,5,1,6,2,7,3,8,4});
1567 int n_old_dofs = sys.
n_dofs();
1570 std::map <dof_id_type, dof_id_type> node2dof_c;
1571 for (
const auto & node :
mesh.node_ptr_range() )
1574 node2dof_c.insert( std::pair<dof_id_type,dof_id_type>( node->id() , cdof_id) );
1583 std::map <dof_id_type, dof_id_type> node2dof_f;
1584 for (
const auto & node :
mesh.local_node_ptr_range() )
1587 node2dof_f.insert( std::pair<dof_id_type,dof_id_type>(node->id() , fdof_id) );
1591 int n_new_dofs = sys.
n_dofs();
1595 int n_old_dofs_local = ndofs_old_end - ndofs_old_first;
1598 std::unique_ptr<SparseMatrix<Number> > proj_mat_ptr =
1601 proj_mat.
init(n_new_dofs, n_old_dofs, n_new_dofs_local, n_old_dofs_local);
1606 std::unique_ptr<SparseMatrix<Number> > gold_mat_ptr =
1609 gold_mat.
init(n_new_dofs, n_old_dofs, n_new_dofs_local, n_old_dofs_local);
1612 for (
const auto & node :
mesh.local_node_ptr_range() )
1615 dof_id_type fdof_id = (node2dof_f.find(node_id))->second;
1617 if (coarse_nodes.find(node_id) != coarse_nodes.end() )
1621 auto cdof_id = node2dof_c.find(node_id);
1622 gold_mat.
set(fdof_id, cdof_id->second, 1.0);
1629 auto node_loc = std::find(node_order_f.begin(), node_order_f.end(), node_id);
1630 auto node_n = *std::next(node_loc, 1);
1631 auto node_p = *std::prev(node_loc, 1);
1632 auto dof_p = node2dof_c.find(node_p);
1633 auto dof_n = node2dof_c.find(node_n);
1635 gold_mat.
set(fdof_id, dof_p->second, 0.5);
1636 gold_mat.
set(fdof_id, dof_n->second, 0.5);
1644 gold_mat.
add(-1.0, proj_mat);
1663 if (elem_type == Utility::string_to_enum<ElemType>(
"QUAD4"))
1668 else if (elem_type == Utility::string_to_enum<ElemType>(
"TRI3"))
1677 std::set<dof_id_type> coarse_nodes;
1678 std::map<dof_id_type, std::vector<dof_id_type>> side_nbr_nodes;
1679 std::map<dof_id_type, std::vector<dof_id_type>> int_nbr_nodes;
1682 if (elem_type == Utility::string_to_enum<ElemType>(
"QUAD4"))
1684 coarse_nodes.insert({0,1,2,3,4,5,6,7,8});
1686 side_nbr_nodes.insert({9, {0,1}});
1687 side_nbr_nodes.insert({14, {1,2}});
1688 side_nbr_nodes.insert({11, {0,3}});
1689 side_nbr_nodes.insert({12, {1,4}});
1690 side_nbr_nodes.insert({16, {2,5}});
1691 side_nbr_nodes.insert({13, {3,4}});
1692 side_nbr_nodes.insert({17, {4,5}});
1693 side_nbr_nodes.insert({19, {3,6}});
1694 side_nbr_nodes.insert({20, {4,7}});
1695 side_nbr_nodes.insert({23, {5,8}});
1696 side_nbr_nodes.insert({21, {6,7}});
1697 side_nbr_nodes.insert({24, {7,8}});
1699 int_nbr_nodes.insert({10, {0,1,3,4}});
1700 int_nbr_nodes.insert({15, {1,2,4,5}});
1701 int_nbr_nodes.insert({18, {3,4,6,7}});
1702 int_nbr_nodes.insert({22, {4,5,7,8}});
1704 else if (elem_type == Utility::string_to_enum<ElemType>(
"TRI3"))
1706 coarse_nodes.insert({0,1,2,3});
1708 side_nbr_nodes.insert({4, {0,1}});
1709 side_nbr_nodes.insert({5, {0,3}});
1710 side_nbr_nodes.insert({6, {1,3}});
1711 side_nbr_nodes.insert({7, {0,2}});
1712 side_nbr_nodes.insert({8, {2,3}});
1716 int n_old_dofs = sys.
n_dofs();
1719 std::map <dof_id_type, dof_id_type> node2dof_c;
1720 for (
const auto & node :
mesh.node_ptr_range() )
1723 node2dof_c.insert( std::pair<dof_id_type,dof_id_type>( node->id() , cdof_id) );
1732 std::map <dof_id_type, dof_id_type> node2dof_f;
1733 for (
const auto & node :
mesh.local_node_ptr_range() )
1736 node2dof_f.insert( std::pair<dof_id_type,dof_id_type>(node->id() , fdof_id) );
1740 int n_new_dofs = sys.
n_dofs();
1744 int n_old_dofs_local = ndofs_old_end - ndofs_old_first;
1747 std::unique_ptr<SparseMatrix<Number> > proj_mat_ptr =
1750 proj_mat.
init(n_new_dofs, n_old_dofs, n_new_dofs_local, n_old_dofs_local);
1755 std::unique_ptr<SparseMatrix<Number> > gold_mat_ptr =
1758 gold_mat.
init(n_new_dofs, n_old_dofs, n_new_dofs_local, n_old_dofs_local);
1761 for (
const auto & node :
mesh.local_node_ptr_range() )
1764 dof_id_type fdof_id = (node2dof_f.find(node_id))->second;
1766 if (coarse_nodes.find(node_id) != coarse_nodes.end() )
1770 auto cdof_id = node2dof_c.find(node_id);
1771 gold_mat.
set(fdof_id, cdof_id->second, 1.0);
1774 else if ( side_nbr_nodes.find(node_id) != side_nbr_nodes.end() )
1778 auto node_nbrs = side_nbr_nodes.find(node_id);
1779 for (
auto nbr : node_nbrs->second)
1781 auto nbr_dof = node2dof_c.find(nbr);
1782 gold_mat.
set(fdof_id, nbr_dof->second, 0.5);
1790 auto node_nbrs = int_nbr_nodes.find(node_id);
1791 for (
auto nbr : node_nbrs->second)
1793 auto nbr_dof = node2dof_c.find(nbr);
1794 gold_mat.
set(fdof_id, nbr_dof->second, 0.25);
1803 proj_mat.
add(-1.0, gold_mat);
1822 if (elem_type == Utility::string_to_enum<ElemType>(
"HEX8"))
1825 0., 1., 0., 1., 0., 1.,
1827 else if (elem_type == Utility::string_to_enum<ElemType>(
"TET4"))
1846 std::set<dof_id_type> coarse_nodes;
1847 std::map<dof_id_type, std::vector<dof_id_type>> side_nbr_nodes;
1848 std::map<dof_id_type, std::vector<dof_id_type>> face_nbr_nodes;
1849 std::map<dof_id_type, std::vector<dof_id_type>> int_nbr_nodes;
1851 if (elem_type == Utility::string_to_enum<ElemType>(
"HEX8"))
1853 coarse_nodes.insert({0,1,2,3,4,5,6,7});
1856 side_nbr_nodes.insert({8, {0,1}});
1857 side_nbr_nodes.insert({10, {0,2}});
1858 side_nbr_nodes.insert({15, {1,3}});
1859 side_nbr_nodes.insert({18, {2,3}});
1860 side_nbr_nodes.insert({11, {0,4}});
1861 side_nbr_nodes.insert({16, {1,5}});
1862 side_nbr_nodes.insert({21, {3,7}});
1863 side_nbr_nodes.insert({20, {2,6}});
1864 side_nbr_nodes.insert({22, {4,5}});
1865 side_nbr_nodes.insert({24, {4,6}});
1866 side_nbr_nodes.insert({25, {5,7}});
1867 side_nbr_nodes.insert({26, {6,7}});
1869 face_nbr_nodes.insert({12, {0,1,4,5}});
1870 face_nbr_nodes.insert({9 , {0,1,2,3}});
1871 face_nbr_nodes.insert({14, {0,2,4,6}});
1872 face_nbr_nodes.insert({17, {1,3,5,7}});
1873 face_nbr_nodes.insert({19, {2,3,6,7}});
1874 face_nbr_nodes.insert({23, {4,5,6,7}});
1876 int_nbr_nodes.insert({13, {0,1,2,3,4,5,6,7}});
1878 else if (elem_type == Utility::string_to_enum<ElemType>(
"TET4"))
1880 coarse_nodes.insert({0,1,2,3});
1883 side_nbr_nodes.insert({4, {0,1}});
1884 side_nbr_nodes.insert({5, {0,2}});
1885 side_nbr_nodes.insert({6, {0,3}});
1886 side_nbr_nodes.insert({7, {1,2}});
1887 side_nbr_nodes.insert({8, {1,3}});
1888 side_nbr_nodes.insert({9, {2,3}});
1892 int n_old_dofs = sys.
n_dofs();
1895 std::map <dof_id_type, dof_id_type> node2dof_c;
1896 for (
const auto & node :
mesh.node_ptr_range() )
1899 node2dof_c.insert( std::pair<dof_id_type,dof_id_type>( node->id() , cdof_id) );
1908 std::map <dof_id_type, dof_id_type> node2dof_f;
1909 for (
const auto & node :
mesh.local_node_ptr_range() )
1912 node2dof_f.insert( std::pair<dof_id_type,dof_id_type>(node->id() , fdof_id) );
1916 int n_new_dofs = sys.
n_dofs();
1920 int n_old_dofs_local = ndofs_old_end - ndofs_old_first;
1923 std::unique_ptr<SparseMatrix<Number> > proj_mat_ptr =
1926 proj_mat.
init(n_new_dofs, n_old_dofs, n_new_dofs_local, n_old_dofs_local);
1931 std::unique_ptr<SparseMatrix<Number> > gold_mat_ptr =
1934 gold_mat.
init(n_new_dofs, n_old_dofs, n_new_dofs_local, n_old_dofs_local);
1937 for (
const auto & node :
mesh.local_node_ptr_range() )
1940 dof_id_type fdof_id = (node2dof_f.find(node_id))->second;
1942 if (coarse_nodes.find(node_id) != coarse_nodes.end() )
1946 auto cdof_id = node2dof_c.find(node_id);
1947 gold_mat.
set(fdof_id, cdof_id->second, 1.0);
1950 else if ( side_nbr_nodes.find(node_id) != side_nbr_nodes.end() )
1954 auto node_nbrs = side_nbr_nodes.find(node_id);
1955 for (
auto nbr : node_nbrs->second)
1957 auto nbr_dof = node2dof_c.find(nbr);
1958 gold_mat.
set(fdof_id, nbr_dof->second, 0.5);
1962 else if ( face_nbr_nodes.find(node_id) != face_nbr_nodes.end() )
1966 auto node_nbrs = face_nbr_nodes.find(node_id);
1967 for (
auto nbr : node_nbrs->second)
1969 auto nbr_dof = node2dof_c.find(nbr);
1970 gold_mat.
set(fdof_id, nbr_dof->second, 0.25);
1978 auto node_nbrs = int_nbr_nodes.find(node_id);
1979 for (
auto nbr : node_nbrs->second)
1981 auto nbr_dof = node2dof_c.find(nbr);
1982 gold_mat.
set(fdof_id, nbr_dof->second, 0.125);
1991 proj_mat.
add(-1.0, gold_mat);
2019#ifdef LIBMESH_ENABLE_AMR
2020#ifdef LIBMESH_HAVE_METAPHYSICL
2021#ifdef LIBMESH_HAVE_PETSC
MeshBase & _mesh
The Mesh we're calculating on.
virtual void mesh_reinit() override
Rebuild the cached _lower_to_upper map whenever our Mesh has changed.
virtual std::unique_ptr< GhostingFunctor > clone() const override
A clone() is needed because GhostingFunctor can not be shared between different meshes.
virtual void operator()(const MeshBase::const_element_iterator &range_begin, const MeshBase::const_element_iterator &range_end, processor_id_type p, map_type &coupled_elements) override
User-defined function to augment the sparsity pattern.
AugmentSparsityOnNodes(MeshBase &mesh)
Constructor.
virtual void redistribute() override
Update the cached _lower_to_upper map whenever our Mesh has been redistributed.
void test3DProjectVectorFEHex20()
CPPUNIT_TEST(test3DProjectVectorFETet10)
void test2DProjectVectorFE(const ElemType elem_type)
CPPUNIT_TEST(testAddVectorProjChange)
void testProjectHierarchicEdge3()
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 testProjectMeshFunctionHex27()
CPPUNIT_TEST(test3DProjectVectorFETet14)
void testProjectScalarCoarsening()
CPPUNIT_TEST(testFirstScalarNumber)
CPPUNIT_TEST(testBoundaryProjectCube)
void testAddVectorProjChange()
void testProjectMatrixTri3()
void testAddVectorTypeChange()
void testProjectSquare(const ElemType elem_type)
CPPUNIT_TEST(test2DProjectVectorFETri3)
void testBlockRestrictedVarNDofs()
void testDofCouplingWithVarGroups()
CPPUNIT_TEST(test3DProjectVectorFETet4)
void testAssemblyWithDgFemContext()
void testProjectMatrix3D(const ElemType elem_type)
void testProjectHierarchicQuad9()
CPPUNIT_TEST(testAssemblyWithDgFemContext)
void testProjectMatrixQuad4()
CPPUNIT_TEST(testProjectMatrixTri3)
CPPUNIT_TEST(testProjectHierarchicHex27)
void testProjectCubeWithMeshFunction(const ElemType elem_type)
void testProjectMatrix2D(const ElemType elem_type)
void test3DProjectVectorFEHex27()
void testProjectMatrix1D(const ElemType elem_type)
CPPUNIT_TEST(testProjectMatrixEdge2)
ExplicitSystem & simpleSetup(UnstructuredMesh &mesh, EquationSystems &es)
CPPUNIT_TEST(test3DProjectVectorFEHex20)
void testFirstScalarNumber()
void test2DProjectVectorFETri6()
CPPUNIT_TEST(testBlockRestrictedVarNDofs)
void test3DProjectVectorFE(const ElemType elem_type)
CPPUNIT_TEST(test2DProjectVectorFEQuad8)
CPPUNIT_TEST(test3DProjectVectorFEHex8)
void testPostInitAddVectorTypeChange()
CPPUNIT_TEST(testProjectHierarchicQuad9)
void testProjectHierarchicTri6()
void testUninitializedInfo()
CPPUNIT_TEST(test2DProjectVectorFEQuad4)
CPPUNIT_TEST(testPostInitAddVectorTypeChange)
void testProjectLine(const ElemType elem_type)
CPPUNIT_TEST(test2DProjectVectorFEQuad9)
void test3DProjectVectorFETet10()
void testProjectHierarchicHex27()
LIBMESH_CPPUNIT_TEST_SUITE(SystemsTest)
CPPUNIT_TEST(testProjectMeshFunctionHex27)
CPPUNIT_TEST(testProjectMatrixHex8)
void test2DProjectVectorFEQuad4()
void testProjectMatrixHex8()
CPPUNIT_TEST(testPostInitAddVector)
CPPUNIT_TEST(testProjectScalarCoarsening)
void test3DProjectVectorFETet14()
CPPUNIT_TEST(testProjectHierarchicTri6)
CPPUNIT_TEST(testSetSystemParameterOverEquationSystem)
CPPUNIT_TEST(testAddVectorTypeChange)
CPPUNIT_TEST(test2DProjectVectorFETri6)
CPPUNIT_TEST(testProjectMatrixTet4)
void testBoundaryProjectCube()
void testProjectHierarchicTri7()
void test2DProjectVectorFETri3()
CPPUNIT_TEST(testProjectMatrixQuad4)
CPPUNIT_TEST(testUninitializedInfo)
CPPUNIT_TEST(testDofCouplingWithVarGroups)
void testSetSystemParameterOverEquationSystem()
void test2DProjectVectorFEQuad8()
void test3DProjectVectorFEHex8()
void test2DProjectVectorFEQuad9()
CPPUNIT_TEST(testProjectHierarchicEdge3)
void testProjectMatrixEdge2()
CPPUNIT_TEST(testProjectHierarchicTri7)
void testProjectMatrixTet4()
CPPUNIT_TEST(test2DProjectVectorFETri7)
CPPUNIT_TEST(test3DProjectVectorFEHex27)
void test2DProjectVectorFETri7()
CPPUNIT_TEST(test100KVariables)
void test3DProjectVectorFETet4()
void testPostInitAddVector()
void testProjectCube(const ElemType elem_type)
void set_union(T &data, const unsigned int root_id) const
void allgather(const T &send_data, std::vector< T, A > &recv_data) const
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.
bool has_boundary_id(const Node *const node, const boundary_id_type id) const
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.
void add_node(const Node *node, const boundary_id_type id)
Add Node node with boundary id id to the boundary information data structures.
This class defines a coupling matrix.
This class extends FEMContext in order to provide extra data required to perform local element residu...
void set_neighbor(const Elem &neighbor)
Set the neighbor element which we will use to assemble DG terms.
const std::vector< dof_id_type > & get_neighbor_dof_indices() const
Accessor for neighbor dof indices.
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 get_neighbor_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for neighbor edge/face (2D/3D) finite element object for variable var.
const DenseMatrix< Number > & get_neighbor_neighbor_jacobian() const
Const accessor for element-neighbor Jacobian.
const DenseMatrix< Number > & get_elem_elem_jacobian() const
Const accessor for element-element Jacobian.
void neighbor_side_fe_reinit()
Initialize neighbor side data needed to assemble DG terms.
const DenseMatrix< Number > & get_neighbor_elem_jacobian() const
Const accessor for element-neighbor Jacobian.
const DenseMatrix< Number > & get_elem_neighbor_jacobian() const
Const accessor for element-neighbor Jacobian.
Defines a dense matrix for use in Finite Element-type computations.
void resize(const unsigned int new_m, const unsigned int new_n)
Resizes the matrix to the specified size and calls zero().
Defines a dense vector for use in Finite Element-type computations.
void resize(const unsigned int n)
Resize the vector.
virtual unsigned int size() const override final
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
const DenseVector< Number > & get_elem_residual() const
Const accessor for element residual.
const DenseMatrix< Number > & get_elem_jacobian() const
Const accessor for element Jacobian.
dof_id_type n_dofs_on_processor(const processor_id_type proc) const
dof_id_type end_old_dof(const processor_id_type proc) const
dof_id_type first_old_dof(const processor_id_type proc) const
This class handles the numbering of degrees of freedom on a mesh.
std::size_t distribute_dofs(MeshBase &)
Distribute dofs on the current mesh.
std::vector< dof_id_type > n_dofs_per_processor(const unsigned int vn) const
dof_id_type n_local_dofs(const unsigned int vn) const
void SCALAR_dof_indices(std::vector< dof_id_type > &di, const unsigned int vn, const bool old_dofs=false) const
Fills the vector di with the global degree of freedom indices corresponding to the SCALAR variable vn...
dof_id_type n_dofs(const unsigned int vn) const
void add_coupling_functor(GhostingFunctor &coupling_functor, bool to_mesh=true)
Adds a functor which can specify coupling requirements for creation of sparse matrices.
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 dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
processor_id_type processor_id() const
This is the base class from which all geometric element types are derived.
virtual Node *& set_node(const unsigned int i)
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 ...
static std::unique_ptr< Elem > build(const ElemType type, Elem *p=nullptr)
subdomain_id_type subdomain_id() const
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...
const Node * node_ptr(const unsigned int i) const
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...
virtual ElemType type() const =0
const Elem * neighbor_ptr(unsigned int i) const
This is the EquationSystems class.
virtual void reinit()
Handle any mesh changes and reinitialize all the systems on the updated mesh.
const MeshBase & get_mesh() const
Parameters parameters
Data structure holding arbitrary parameters.
virtual void init()
Initialize all the systems.
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.
const T_sys & get_system(std::string_view name) const
Manages consistently variables, degrees of freedom, and coefficient vectors for explicit systems.
NumericVector< Number > * rhs
The system matrix.
virtual_for_inffe const std::vector< Real > & get_JxW() const
This class forms the foundation from which generic finite elements may be derived.
const std::vector< std::vector< OutputShape > > & get_phi() const
const std::vector< std::vector< OutputGradient > > & get_dphi() const
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.
unsigned char side
Current side for side_* to examine.
const QBase & get_element_qrule() const
Accessor for element interior quadrature rule for the dimension of the current _elem.
virtual void elem_fe_reinit(const std::vector< Point > *const pts=nullptr)
Reinitializes interior FE objects on the current geometric element.
unsigned char get_side() const
Accessor for current side of Elem object.
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.
const QBase & get_side_qrule() const
Accessor for element side quadrature rule for the dimension of the current _elem.
Base class for functors that can be evaluated at a point and (optionally) time.
This abstract base class defines the interface by which library code and user code can report associa...
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?
const SparseMatrix< Number > & get_system_matrix() const
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and linear solvers ...
virtual LinearSolver< Number > * get_linear_solver() const override
virtual void solve() override
Assembles & solves the linear system A*x=b.
void set_preconditioner_type(const PreconditionerType pct)
Sets the type of preconditioner to use.
void set_solver_type(const SolverType st)
Sets the type of solver to use.
This is the MeshBase class.
virtual const Node & node_ref(const dof_id_type i) const
const BoundaryInfo & get_boundary_info() const
The information about boundary ids on the mesh.
virtual const Node * node_ptr(const dof_id_type i) const =0
void allow_renumbering(bool allow)
If false is passed in then this mesh will no longer be renumbered when being prepared for use.
void prepare_for_use(const bool skip_renumber_nodes_and_elements, const bool skip_find_neighbors)
Prepare a newly created (or read) mesh for use.
virtual dof_id_type n_nodes() const =0
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.
virtual const Elem * elem_ptr(const dof_id_type i) const =0
virtual Elem * add_elem(Elem *e)=0
Add elem e to the end of the element array.
virtual const Elem & elem_ref(const dof_id_type i) const
std::unique_ptr< PointLocatorBase > sub_point_locator() const
This class provides function-like objects for data distributed over a mesh.
virtual void init() override
Override the FunctionBase::init() member function.
Implements (adaptive) mesh refinement algorithms for a MeshBase.
void uniformly_refine(unsigned int n=1)
Uniformly refines the mesh n times.
bool refine_elements()
Only refines the user-requested elements.
The Mesh class is a thin wrapper, around the ReplicatedMesh class by default.
A Node is like a Point, but with more information.
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
virtual void set(const numeric_index_type i, const T value)=0
Sets v(i) = value.
virtual numeric_index_type last_local_index() const =0
virtual void close()=0
Calls the NumericVector's internal assembly routines, ensuring that the values are consistent across ...
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].
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...
virtual numeric_index_type first_local_index() const =0
processor_id_type processor_id() const
const Parallel::Communicator & comm() const
This class provides the ability to map between arbitrary, user-defined strings and several data types...
T & set(const std::string &)
This is the base class for point locators.
A Point defines a location in LIBMESH_DIM dimensional Real space.
unsigned int n_points() const
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
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.
virtual void close()=0
Calls the SparseMatrix's internal assembly routines, ensuring that the values are consistent across p...
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.
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.
virtual numeric_index_type row_stop() const =0
virtual void add(const numeric_index_type i, const numeric_index_type j, const T value)=0
Add value to the element (i,j).
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 numeric_index_type row_start() const =0
virtual Real linfty_norm() const =0
Manages consistently variables, degrees of freedom, and coefficient vectors.
void project_solution(FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr, std::optional< ConstElemRange > active_local_range=std::nullopt, std::optional< std::vector< unsigned int > > variable_numbers=std::nullopt) const
Projects arbitrary functions onto the current solution.
const Variable & variable(unsigned int var) const
Return a constant reference to Variable var.
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...
std::string get_info() const
dof_id_type n_dofs() const
Number point_value(unsigned int var, const Point &p, const bool insist_on_success=true, const NumericVector< Number > *sol=nullptr) const
void boundary_project_solution(const std::set< boundary_id_type > &b, const std::vector< unsigned int > &variables, FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr, std::optional< ConstElemRange > active_local_range=std::nullopt)
Projects arbitrary boundary functions onto a vector of degree of freedom values for the current syste...
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.
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.
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 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 ...
std::unique_ptr< NumericVector< Number > > solution
Data structure to hold solution values.
virtual void solve()
Solves the system.
bool vector_preservation(std::string_view vec_name) const
unsigned int variable_number(std::string_view var) const
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 variables vars to the list of variables for this system.
void projection_matrix(SparseMatrix< Number > &proj_mat) const
This method creates a projection matrix which corresponds to the operation of project_vector between ...
unsigned int n_vars() const
const DofMap & get_dof_map() const
unsigned int number() const
Manages storage and variables for transient systems.
NumericVector< Number > * older_local_solution
All the values I need to compute my contribution to the simulation at hand.
NumericVector< Number > * old_local_solution
All the values I need to compute my contribution to the simulation at hand.
The UnstructuredMesh class is derived from the MeshBase class.
ConstFunction that simply returns 0.
Communicator * TestCommWorld
The libMesh namespace provides an interface to certain functionality in the library.
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Helper function that allows us to treat a homogenous pair as a range.
ElemType
Defines an enum for geometric element types.
static constexpr Real TOLERANCE
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
uint8_t processor_id_type
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...
virtual std::unique_ptr< FunctionBase< Number > > clone() const
Number component(unsigned int i, const Point &p, Real) override
TripleFunction(Number _offset=0)
virtual Number operator()(const Point &, const Real=0.) override
The definition of the const_element_iterator struct.
void assembly_with_dg_fem_context(EquationSystems &es, const std::string &)
Number disc_thirds_test(const Point &p, const Parameters &, const std::string &, const std::string &)
CPPUNIT_TEST_SUITE_REGISTRATION(SystemsTest)
void assemble_matrix_and_rhs(EquationSystems &es, const std::string &)
Number cubic_test(const Point &p, const Parameters &, const std::string &, const std::string &)
Number new_linear_test(const Point &p, const Parameters &, const std::string &, const std::string &)