21 #include "libmesh/dof_map.h" 22 #include "libmesh/equation_systems.h" 23 #include "libmesh/int_range.h" 24 #include "libmesh/libmesh_logging.h" 25 #include "libmesh/mesh_base.h" 26 #include "libmesh/numeric_vector.h" 27 #include "libmesh/parameter_vector.h" 28 #include "libmesh/point.h" 29 #include "libmesh/point_locator_base.h" 30 #include "libmesh/qoi_set.h" 31 #include "libmesh/enum_to_string.h" 32 #include "libmesh/sparse_matrix.h" 33 #include "libmesh/system.h" 34 #include "libmesh/system_norm.h" 35 #include "libmesh/utility.h" 36 #include "libmesh/elem.h" 37 #include "libmesh/fe_type.h" 38 #include "libmesh/fe_interface.h" 39 #include "libmesh/fe_compute_data.h" 40 #include "libmesh/static_condensation.h" 41 #include "libmesh/static_condensation_dof_map.h" 44 #include "libmesh/fe_base.h" 45 #include "libmesh/fe_interface.h" 46 #include "libmesh/parallel.h" 47 #include "libmesh/parallel_algebra.h" 48 #include "libmesh/quadrature.h" 49 #include "libmesh/tensor_value.h" 50 #include "libmesh/vector_value.h" 51 #include "libmesh/tensor_tools.h" 52 #include "libmesh/enum_norm_type.h" 53 #include "libmesh/enum_fe_family.h" 65 const std::string & name_in,
66 const unsigned int number_in) :
69 assemble_before_solve (true),
70 use_fixed_solution (false),
71 extra_quadrature_order (0),
75 _init_system_function (nullptr),
76 _init_system_object (nullptr),
77 _assemble_system_function (nullptr),
78 _assemble_system_object (nullptr),
79 _constrain_system_function (nullptr),
80 _constrain_system_object (nullptr),
81 _qoi_evaluate_function (nullptr),
82 _qoi_evaluate_object (nullptr),
83 _qoi_evaluate_derivative_function (nullptr),
84 _qoi_evaluate_derivative_object (nullptr),
85 _dof_map (
std::make_unique<
DofMap>(number_in, es.get_mesh())),
86 _equation_systems (es),
87 _mesh (es.get_mesh()),
89 _sys_number (number_in),
91 _matrices_initialized (false),
92 _solution_projection (true),
93 _basic_system_only (false),
95 _additional_data_written (false),
96 adjoint_already_solved (false),
98 project_with_constraints (true),
99 _prefer_hash_table_matrix_assembly(false),
100 _require_sparsity_pattern (false),
101 _prefix_with_name (false)
127 #ifdef LIBMESH_ENABLE_CONSTRAINTS 129 return _dof_map->n_constrained_dofs();
142 #ifdef LIBMESH_ENABLE_CONSTRAINTS 144 return _dof_map->n_local_constrained_dofs();
165 libmesh_assert_less (global_dof_number,
_dof_map->n_dofs());
209 parallel_object_only();
218 auto max_allowed_id =
solution->max_allowed_id();
219 libmesh_error_msg_if(total_dofs > max_allowed_id,
220 "Cannot allocate a NumericVector with " << total_dofs <<
" degrees of freedom. " 221 "The vector can only index up to " << max_allowed_id <<
" entries.");
232 _dof_map->reinit_static_condensation();
238 #ifdef LIBMESH_ENABLE_GHOSTED 251 for (
auto & [vec_name, vec] :
_vectors)
258 #ifdef LIBMESH_ENABLE_GHOSTED 263 libmesh_error_msg(
"Cannot initialize ghosted vectors when they are not enabled.");
268 vec->init (this->
n_dofs(),
false, type);
272 libmesh_assert_equal_to(type,
PARALLEL);
291 parallel_object_only();
313 parallel_object_only();
328 if (
_matrices.begin()->second->initialized())
349 const bool use_hash =
350 pr.second->use_hash_table() ||
352 pr.second->use_hash_table(use_hash);
354 if (pr.second->require_sparsity_pattern())
376 parallel_object_only();
378 #ifdef LIBMESH_ENABLE_AMR 380 for (
auto & [vec_name, vec] :
_vectors)
394 #ifdef LIBMESH_ENABLE_GHOSTED 399 libmesh_error_msg(
"Cannot initialize ghosted vectors when they are not enabled.");
407 const std::vector<dof_id_type> & send_list =
_dof_map->get_send_list ();
416 #ifdef LIBMESH_ENABLE_GHOSTED 427 #endif // LIBMESH_ENABLE_AMR 434 #ifdef LIBMESH_ENABLE_AMR 444 parallel_object_only();
485 parallel_object_only();
487 #ifdef LIBMESH_ENABLE_CONSTRAINTS 500 parallel_object_only();
504 const std::vector<dof_id_type> & send_list =
_dof_map->get_send_list ();
510 libmesh_assert_less_equal (send_list.size(),
solution->size());
523 parallel_object_only();
536 libmesh_assert_less_equal (send_list.size(),
solution->size());
548 if (subset !=
nullptr)
549 libmesh_not_implemented();
557 LOG_SCOPE(
"assemble()",
"System");
568 LOG_SCOPE(
"assemble_qoi()",
"System");
577 bool include_liftfunc,
578 bool apply_constraints)
581 LOG_SCOPE(
"assemble_qoi_derivative()",
"System");
595 if (qoi_indices.
size(*
this) > parameters_vec.
size())
607 const Real threshold,
608 const bool verbose)
const 617 libMesh::out <<
" comparing matrices not supported." << std::endl;
622 const int name_result =
_sys_name.compare(other_system.
name());
625 if (name_result == 0)
639 if (solu_result == -1)
640 libMesh::out <<
" identical up to threshold." << std::endl;
642 libMesh::out <<
" first difference occurred at index = " 643 << solu_result <<
"." << std::endl;
649 std::vector<int> ov_result;
655 libMesh::out <<
" Fatal difference. This system handles " 656 << this->
n_vectors() <<
" add'l vectors," << std::endl
657 <<
" while the other system handles " 659 <<
" add'l vectors." << std::endl
660 <<
" Aborting comparison." << std::endl;
672 for (
auto & [vec_name, vec] :
_vectors)
676 << vec_name <<
"\" ...";
682 ov_result.push_back(vec->compare(other_system_vector, threshold));
686 if (ov_result[ov_result.size()-1] == -1)
687 libMesh::out <<
" identical up to threshold." << std::endl;
689 libMesh::out <<
" first difference occurred at" << std::endl
690 <<
" index = " << ov_result[ov_result.size()-1] <<
"." << std::endl;
699 if ((name_result==0) && (solu_result==-1))
701 if (ov_result.size()==0)
702 overall_result =
true;
709 ov_identical = (ov_result[n]==-1);
712 while (ov_identical && n<ov_result.size());
713 overall_result = ov_identical;
717 overall_result =
false;
723 libMesh::out <<
"found no differences." << std::endl << std::endl;
725 libMesh::out <<
"found differences." << std::endl << std::endl;
728 return overall_result;
735 parallel_object_only();
737 global_soln.resize (
solution->size());
747 parallel_object_only();
749 global_soln.resize (
solution->size());
751 solution->localize_to_one (global_soln, dest_proc);
757 const bool projections,
760 parallel_object_only();
767 if (
auto it = this->
_vectors.find(vec_name);
784 libmesh_assert_equal_to(type ==
SERIAL,
802 #ifdef LIBMESH_ENABLE_GHOSTED 807 libmesh_error_msg(
"Cannot initialize ghosted vectors when they are not enabled.");
835 auto buf = pr.first->second.get();
846 #ifdef LIBMESH_ENABLE_GHOSTED 851 libmesh_error_msg(
"Cannot initialize ghosted vectors when they are not enabled.");
863 parallel_object_only();
865 if (
const auto pos =
_vectors.find(vec_name);
881 if (
const auto pos =
_vectors.find(vec_name);
883 return pos->second.
get();
893 if (
auto pos =
_vectors.find(vec_name);
895 return pos->second.
get();
911 std::advance(it, vec_num);
912 return it->second.get();
925 std::advance(it, vec_num);
926 return it->second.get();
933 return *(libmesh_map_find(
_vectors, vec_name));
940 return *(libmesh_map_find(
_vectors, vec_name));
948 libmesh_assert_less(vec_num,
_vectors.size());
952 std::advance(it, vec_num);
953 return *(it->second);
961 libmesh_assert_less(vec_num,
_vectors.size());
965 std::advance(it, vec_num);
966 return *(it->second);
974 libmesh_assert_less(vec_num,
_vectors.size());
978 std::advance(it, vec_num);
986 [&vec_reference](
const decltype(
_vectors)::value_type & pr)
987 {
return &vec_reference == pr.second.
get(); });
1002 parallel_object_only();
1009 if (
auto it = this->
_matrices.find(mat_name);
1019 "We do not currently support static condensation of the diagonal matrix type");
1020 matrix = std::make_unique<StaticCondensation>(this->
get_mesh(),
1027 auto & mat = *matrix;
1029 _matrices.emplace(mat_name, std::move(matrix));
1045 parallel_object_only();
1047 const std::string namestr{mat_name};
1078 parallel_object_only();
1080 if (
const auto pos =
_matrices.find(mat_name);
1089 if (
const auto pos =
_matrices.find(mat_name);
1091 return pos->second.get();
1101 if (
auto pos =
_matrices.find(mat_name);
1103 return pos->second.get();
1113 return *libmesh_map_find(
_matrices, mat_name);
1120 return *libmesh_map_find(
_matrices, mat_name);
1128 parallel_object_only();
1150 parallel_object_only();
1154 libmesh_assert_greater_equal(qoi_num, -2);
1171 std::ostringstream sensitivity_name;
1172 sensitivity_name <<
"sensitivity_solution" << i;
1174 return this->
add_vector(sensitivity_name.str());
1181 std::ostringstream sensitivity_name;
1182 sensitivity_name <<
"sensitivity_solution" << i;
1184 return this->
get_vector(sensitivity_name.str());
1191 std::ostringstream sensitivity_name;
1192 sensitivity_name <<
"sensitivity_solution" << i;
1194 return this->
get_vector(sensitivity_name.str());
1201 return this->
add_vector(
"weighted_sensitivity_solution");
1208 return this->
get_vector(
"weighted_sensitivity_solution");
1215 return this->
get_vector(
"weighted_sensitivity_solution");
1222 std::ostringstream adjoint_name;
1223 adjoint_name <<
"adjoint_solution" << i;
1234 std::ostringstream adjoint_name;
1235 adjoint_name <<
"adjoint_solution" << i;
1244 std::ostringstream adjoint_name;
1245 adjoint_name <<
"adjoint_solution" << i;
1254 std::ostringstream adjoint_name;
1255 adjoint_name <<
"weighted_sensitivity_adjoint_solution" << i;
1266 std::ostringstream adjoint_name;
1267 adjoint_name <<
"weighted_sensitivity_adjoint_solution" << i;
1276 std::ostringstream adjoint_name;
1277 adjoint_name <<
"weighted_sensitivity_adjoint_solution" << i;
1286 std::ostringstream adjoint_rhs_name;
1287 adjoint_rhs_name <<
"adjoint_rhs" << i;
1289 return this->
add_vector(adjoint_rhs_name.str(),
false);
1296 std::ostringstream adjoint_rhs_name;
1297 adjoint_rhs_name <<
"adjoint_rhs" << i;
1299 return this->
get_vector(adjoint_rhs_name.str());
1306 std::ostringstream adjoint_rhs_name;
1307 adjoint_rhs_name <<
"adjoint_rhs" << i;
1309 return this->
get_vector(adjoint_rhs_name.str());
1316 std::ostringstream sensitivity_rhs_name;
1317 sensitivity_rhs_name <<
"sensitivity_rhs" << i;
1319 return this->
add_vector(sensitivity_rhs_name.str(),
false);
1326 std::ostringstream sensitivity_rhs_name;
1327 sensitivity_rhs_name <<
"sensitivity_rhs" << i;
1329 return this->
get_vector(sensitivity_rhs_name.str());
1336 std::ostringstream sensitivity_rhs_name;
1337 sensitivity_rhs_name <<
"sensitivity_rhs" << i;
1339 return this->
get_vector(sensitivity_rhs_name.str());
1346 const std::set<subdomain_id_type> *
const active_subdomains)
1356 const std::set<subdomain_id_type> *
const active_subdomains,
1357 const bool p_refinement)
1360 FEType(order, family).set_p_refinement(p_refinement),
1368 const std::set<subdomain_id_type> *
const active_subdomains)
1378 const std::set<subdomain_id_type> *
const active_subdomains,
1379 const bool p_refinement)
1382 FEType(order, family).set_p_refinement(p_refinement),
1388 const std::set<subdomain_id_type> *
const active_subdomains)
1410 std::set<dof_id_type> & var_indices)
const 1413 var_indices.clear();
1415 std::vector<dof_id_type> dof_indices;
1422 for (
const auto & elem : this->
get_mesh().active_local_element_ptr_range())
1428 if (first_local <= dof && dof < end_local)
1429 var_indices.insert(dof);
1438 for (
const auto & node : this->
get_mesh().local_node_ptr_range())
1442 for (
auto dof : dof_indices)
1443 if (first_local <= dof && dof < end_local)
1444 var_indices.insert(dof);
1451 unsigned int var_num)
const 1454 libmesh_assert_less (var_num, this->
n_vars());
1460 const unsigned int sys_num = this->
number();
1463 for (
const auto & node :
mesh.local_node_ptr_range())
1465 unsigned int n_comp = node->n_comp(sys_num,var_num);
1466 for (
unsigned int i=0; i<n_comp; i++)
1468 const dof_id_type index = node->dof_number(sys_num,var_num,i);
1475 (
mesh.active_local_element_stored_range(),
1478 for (
const Elem * elem : range)
1480 unsigned int n_comp = elem->n_comp(sys_num,var_num);
1481 for (
unsigned int i=0; i<n_comp; i++)
1483 const dof_id_type index = elem->dof_number(sys_num,var_num,i);
1496 std::set<dof_id_type> var_indices;
1514 std::set<unsigned int> * skip_dimensions)
const 1523 std::vector<FEMNormType> norms(this->
n_vars(),
L2);
1524 std::vector<Real> weights(this->
n_vars(), 0.0);
1525 norms[var] = norm_type;
1535 std::set<unsigned int> * skip_dimensions)
const 1538 parallel_object_only();
1540 LOG_SCOPE (
"calculate_norm()",
"System");
1545 if (
norm.is_discrete())
1549 unsigned int check_var = 0, check_end = this->
n_vars();
1550 for (; check_var != check_end; ++check_var)
1551 if ((
norm.weight(check_var) != 1.0) || (
norm.type(check_var) != norm_type0))
1555 if (check_var == this->
n_vars())
1570 if (norm.
weight(var) == 0.0)
1589 bool using_hilbert_norm =
true,
1590 using_nonhilbert_norm =
true;
1596 Real norm_weight_sq =
norm.weight_sq(var);
1597 if (norm_weight_sq == 0.0)
1599 Real norm_weight =
norm.weight(var);
1603 if ((norm_type==
H1) ||
1609 if (!using_hilbert_norm)
1610 libmesh_not_implemented();
1611 using_nonhilbert_norm =
false;
1613 else if ((norm_type==
L1) ||
1614 (norm_type==
L_INF) ||
1618 if (!using_nonhilbert_norm)
1619 libmesh_not_implemented();
1620 using_hilbert_norm =
false;
1623 libmesh_not_implemented();
1629 std::vector<std::unique_ptr<FEBase>> fe_ptrs(4);
1630 std::vector<std::unique_ptr<FEVectorBase>> vec_fe_ptrs(4);
1631 std::vector<std::unique_ptr<QBase>> q_rules(4);
1636 for (
const auto &
dim : elem_dims)
1638 if (skip_dimensions && skip_dimensions->find(
dim) != skip_dimensions->end())
1648 fe_ptrs[
dim]->attach_quadrature_rule (q_rules[
dim].
get());
1653 vec_fe_ptrs[
dim]->attach_quadrature_rule (q_rules[
dim].
get());
1659 std::vector<dof_id_type> dof_indices;
1662 for (
const auto & elem : this->
get_mesh().active_local_element_ptr_range())
1664 const unsigned int dim = elem->dim();
1669 if (elem->infinite() )
1670 libmesh_not_implemented();
1672 if (skip_dimensions && skip_dimensions->find(
dim) != skip_dimensions->end())
1675 QBase * qrule = q_rules[
dim].get();
1680 auto element_calculation = [&dof_indices, &elem,
1681 norm_type, norm_weight, norm_weight_sq, &qrule,
1682 &local_v, &v_norm](
auto & fe) {
1683 typedef typename std::remove_reference<decltype(fe)>::type::OutputShape OutputShape;
1685 typedef typename std::remove_reference<decltype(fe)>::type::OutputGradient OutputGradient;
1688 const std::vector<Real> & JxW = fe.get_JxW();
1689 const std::vector<std::vector<OutputShape>> * phi =
nullptr;
1690 if (norm_type ==
H1 ||
1695 phi = &(fe.get_phi());
1697 const std::vector<std::vector<OutputGradient>> * dphi =
nullptr;
1698 if (norm_type ==
H1 ||
1702 dphi = &(fe.get_dphi());
1704 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 1705 typedef typename std::remove_reference<decltype(fe)>::type::OutputTensor OutputTensor;
1707 const std::vector<std::vector<OutputTensor>> * d2phi =
nullptr;
1708 if (norm_type ==
H2 ||
1711 d2phi = &(fe.get_d2phi());
1716 const unsigned int n_qp = qrule->n_points();
1718 const unsigned int n_sf = cast_int<unsigned int>
1719 (dof_indices.size());
1722 for (
unsigned int qp=0; qp<n_qp; qp++)
1724 if (norm_type ==
L1)
1726 OutputNumberShape u_h = 0.;
1727 for (
unsigned int i=0; i != n_sf; ++i)
1728 u_h += (*phi)[i][qp] * (*local_v)(dof_indices[i]);
1729 v_norm += norm_weight *
1733 if (norm_type ==
L_INF)
1735 OutputNumberShape u_h = 0.;
1736 for (
unsigned int i=0; i != n_sf; ++i)
1737 u_h += (*phi)[i][qp] * (*local_v)(dof_indices[i]);
1741 if (norm_type ==
H1 ||
1745 OutputNumberShape u_h = 0.;
1746 for (
unsigned int i=0; i != n_sf; ++i)
1747 u_h += (*phi)[i][qp] * (*local_v)(dof_indices[i]);
1748 v_norm += norm_weight_sq *
1752 if (norm_type ==
H1 ||
1756 OutputNumberGradient grad_u_h;
1757 for (
unsigned int i=0; i != n_sf; ++i)
1758 grad_u_h.add_scaled((*dphi)[i][qp], (*local_v)(dof_indices[i]));
1759 v_norm += norm_weight_sq *
1760 JxW[qp] * grad_u_h.norm_sq();
1765 OutputNumberGradient grad_u_h;
1766 for (
unsigned int i=0; i != n_sf; ++i)
1767 grad_u_h.add_scaled((*dphi)[i][qp], (*local_v)(dof_indices[i]));
1768 v_norm = std::max(v_norm, norm_weight * grad_u_h.norm());
1771 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 1774 if (norm_type ==
H2 ||
1777 OutputNumberTensor hess_u_h;
1778 for (
unsigned int i=0; i != n_sf; ++i)
1779 hess_u_h.add_scaled((*d2phi)[i][qp], (*local_v)(dof_indices[i]));
1780 v_norm += norm_weight_sq *
1781 JxW[qp] * hess_u_h.norm_sq();
1786 OutputNumberTensor hess_u_h;
1787 for (
unsigned int i=0; i != n_sf; ++i)
1788 hess_u_h.add_scaled((*d2phi)[i][qp], (*local_v)(dof_indices[i]));
1789 v_norm = std::max(v_norm, norm_weight * hess_u_h.norm());
1795 FEBase * scalar_fe = fe_ptrs[
dim].get();
1801 element_calculation(*scalar_fe);
1807 element_calculation(*vec_fe);
1812 if (using_hilbert_norm)
1815 v_norm = std::sqrt(v_norm);
1829 std::ostringstream oss;
1832 const std::string & sys_name = this->
name();
1834 oss <<
" System #" << this->
number() <<
", \"" << sys_name <<
"\"\n" 1842 if (vg_description.
n_variables() > 1) oss <<
"{ ";
1844 oss <<
"\"" << vg_description.
name(vn) <<
"\" ";
1845 if (vg_description.
n_variables() > 1) oss <<
"} ";
1850 oss <<
" Finite Element Types=";
1851 #ifndef LIBMESH_ENABLE_INFINITE_ELEMENTS 1866 oss <<
'\n' <<
" Infinite Element Mapping=";
1875 oss <<
" Approximation Orders=";
1878 #ifndef LIBMESH_ENABLE_INFINITE_ELEMENTS 1895 oss <<
" n_dofs()=" << this->
n_dofs() <<
'\n';
1897 oss <<
" n_local_dofs()=" << local_dofs <<
'\n';
1899 oss <<
" max(n_local_dofs())=" << local_dofs <<
'\n';
1900 #ifdef LIBMESH_ENABLE_CONSTRAINTS 1906 this->
comm().
max(local_unconstrained_dofs);
1907 oss <<
" max(local unconstrained dofs)=" << local_unconstrained_dofs <<
'\n';
1911 oss <<
" n uncondensed dofs=" 1915 oss <<
" (still uninitialized)\n";
1917 oss <<
" " <<
"n_vectors()=" << this->
n_vectors() <<
'\n';
1918 oss <<
" " <<
"n_matrices()=" << this->
n_matrices() <<
'\n';
1929 const std::string &
name))
1935 libmesh_warning(
"WARNING: Cannot specify both initialization function and object!");
1949 libmesh_warning(
"WARNING: Cannot specify both initialization object and function!");
1960 const std::string &
name))
1966 libmesh_warning(
"WARNING: Cannot specify both assembly function and object!");
1980 libmesh_warning(
"WARNING: Cannot specify both assembly object and function!");
1991 const std::string &
name))
1997 libmesh_warning(
"WARNING: Cannot specify both constraint function and object!");
2011 libmesh_warning(
"WARNING: Cannot specify both constraint object and function!");
2033 const std::string &,
2040 libmesh_warning(
"WARNING: Cannot specify both QOI function and object!");
2054 libmesh_warning(
"WARNING: Cannot specify both QOI object and function!");
2065 const QoISet &,
bool,
bool))
2071 libmesh_warning(
"WARNING: Cannot specify both QOI derivative function and object!");
2085 libmesh_warning(
"WARNING: Cannot specify both QOI derivative object and function!");
2152 bool include_liftfunc,
2153 bool apply_constraints)
2165 (qoi_indices, include_liftfunc, apply_constraints);
2180 _qoi[qoi_index] = qoi_value;
2187 return _qoi[qoi_index];
2199 libmesh_assert_equal_to(this->
_qoi.size(), new_qoi.size());
2200 this->
_qoi = std::move(new_qoi);
2221 const bool insist_on_success,
2226 parallel_object_only();
2244 std::unique_ptr<PointLocatorBase> locator_ptr =
mesh.sub_point_locator();
2247 if (!insist_on_success || !
mesh.is_serial())
2252 const std::set<subdomain_id_type> & raw_subdomains =
2254 const std::set<subdomain_id_type> * implicit_subdomains =
2255 raw_subdomains.empty() ? nullptr : &raw_subdomains;
2256 const Elem * e = locator(p, implicit_subdomains);
2260 if (e && this->
get_dof_map().is_evaluable(*e, var))
2267 this->
comm().
min(lowest_owner);
2300 std::vector<dof_id_type> dof_indices;
2306 const unsigned int num_dofs = cast_int<unsigned int>
2307 (dof_indices.size());
2322 for (
unsigned int l=0; l<num_dofs; l++)
2324 u += fe_data.shape[l] * (*sol)(dof_indices[l]);
2350 const bool insist_on_success,
2355 parallel_object_only();
2373 std::unique_ptr<PointLocatorBase> locator_ptr =
mesh.sub_point_locator();
2376 if (!insist_on_success || !
mesh.is_serial())
2381 const std::set<subdomain_id_type> & raw_subdomains =
2383 const std::set<subdomain_id_type> * implicit_subdomains =
2384 raw_subdomains.empty() ? nullptr : &raw_subdomains;
2385 const Elem * e = locator(p, implicit_subdomains);
2389 if (e && this->
get_dof_map().is_evaluable(*e, var))
2396 this->
comm().
min(lowest_owner);
2427 const unsigned int dim = e.
dim();
2433 std::vector<dof_id_type> dof_indices;
2439 const unsigned int num_dofs = cast_int<unsigned int>
2440 (dof_indices.size());
2456 for (
unsigned int l=0; l<num_dofs; l++)
2460 for (std::size_t v=0; v<
dim; v++)
2461 for (std::size_t xyz=0; xyz<LIBMESH_DIM; xyz++)
2466 * (*sol)(dof_indices[l]);
2491 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 2494 const bool insist_on_success,
2499 parallel_object_only();
2517 std::unique_ptr<PointLocatorBase> locator_ptr =
mesh.sub_point_locator();
2520 if (!insist_on_success || !
mesh.is_serial())
2525 const std::set<subdomain_id_type> & raw_subdomains =
2527 const std::set<subdomain_id_type> * implicit_subdomains =
2528 raw_subdomains.empty() ? nullptr : &raw_subdomains;
2529 const Elem * e = locator(p, implicit_subdomains);
2533 if (e && this->
get_dof_map().is_evaluable(*e, var))
2540 this->
comm().
min(lowest_owner);
2567 libmesh_not_implemented();
2576 std::vector<dof_id_type> dof_indices;
2582 const unsigned int num_dofs = cast_int<unsigned int>
2583 (dof_indices.size());
2595 const std::vector<std::vector<RealTensor>> & d2phi = fe->get_d2phi();
2598 fe->reinit (&e, &coor);
2603 for (
unsigned int l=0; l<num_dofs; l++)
2605 hess_u.
add_scaled (d2phi[l][0], (*sol)(dof_indices[l]));
2631 libmesh_error_msg(
"We can only accumulate a hessian with --enable-second");
2640 libmesh_error_msg(
"We can only accumulate a hessian with --enable-second");
2648 libmesh_error_msg(
"We can only accumulate a hessian with --enable-second");
2656 libmesh_error_msg(
"We can only accumulate a hessian with --enable-second");
2662 #endif // LIBMESH_ENABLE_SECOND_DERIVATIVES 2716 unsigned int component)
const void set_vector_as_adjoint(const std::string &vec_name, int qoi_num)
Allows one to set the QoI index controlling whether the vector identified by vec_name represents a so...
std::string name(const ElemQuality q)
This function returns a string containing some name for q.
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
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.
vectors_iterator vectors_end()
End of vectors container.
virtual bool initialized() const
bool is_initialized() const
FEFamily family
The type of finite element.
void parallel_for(const Range &range, const Body &body, unsigned int n_threads=libMesh::n_threads())
Execute the provided function object in parallel on the specified range.
Real time
For time-dependent problems, this is the time t at the beginning of the current timestep.
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 ...
bool closed()
Checks that the library has been closed.
unsigned int n_variable_groups() const
dof_id_type end_dof(const processor_id_type proc) const
virtual Real subset_l2_norm(const std::set< numeric_index_type > &indices) const
This is the EquationSystems class.
unsigned int variable_scalar_number(std::string_view var, unsigned int component) const
virtual void clear()
Clear all the data structures associated with the system.
Order
defines an enum for polynomial orders.
virtual void create_static_condensation()
Request that static condensation be performed for this system.
void update_global_solution(std::vector< Number > &global_soln) const
Fill the input vector global_soln so that it contains the global solution on all processors.
Abstract base class to be used for system initialization.
const Variable & variable(unsigned int var) const
Return a constant reference to Variable var.
Assembly * _assemble_system_object
Object that assembles the system.
Gradient point_gradient(unsigned int var, const Point &p, const bool insist_on_success=true, const NumericVector< Number > *sol=nullptr) const
bool _basic_system_only
Holds true if the components of more advanced system types (e.g.
virtual void init_matrices()
Initializes the matrices associated with this system.
bool _is_initialized
true when additional vectors and variables do not require immediate initialization, false otherwise.
void(* _constrain_system_function)(EquationSystems &es, const std::string &name)
Function to impose constraints.
NumericVector< Number > & add_adjoint_solution(unsigned int i=0)
virtual void forward_qoi_parameter_sensitivity(const QoISet &qoi_indices, const ParameterVector ¶meters, SensitivityData &sensitivities)
Solves for parameter sensitivities using the forward method.
virtual void get(const std::vector< numeric_index_type > &index, T *values) const
Access multiple components at once.
Data structure for specifying which Parameters should be independent variables in a parameter sensiti...
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
dof_id_type n_dofs() const
Data structure for specifying which Quantities of Interest should be calculated in an adjoint or a pa...
Number get_qoi_value(unsigned int qoi_index) const
virtual void reinit()
Reinitializes degrees of freedom and other required data on the current mesh.
bool has_variable(std::string_view var) const
static Point inverse_map(const unsigned int dim, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true, const bool extra_checks=true)
class FEComputeData hides arbitrary data to be passed to and from children of FEBase through the FEIn...
unsigned int n_qois() const
Number of currently active quantities of interest.
unsigned int n_components() const
virtual bool initialized() const
virtual void initialize()=0
Initialization function.
virtual numeric_index_type size() const =0
NumericVector< Number > & get_sensitivity_solution(unsigned int i=0)
OrderWrapper radial_order
The approximation order in radial direction of the infinite element.
unsigned int n_components(const MeshBase &mesh) const
virtual void assemble_qoi_derivative(const QoISet &qoi_indices=QoISet(), bool include_liftfunc=true, bool apply_constraints=true)
Calls user qoi derivative function.
NumericVector< Number > & get_sensitivity_rhs(unsigned int i=0)
int vector_is_adjoint(std::string_view vec_name) const
virtual void assemble()=0
Assembly function.
unsigned int add_variables(System &sys, 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.
Constraint * _constrain_system_object
Object that constrains the system.
const EquationSystems & get_equation_systems() const
unsigned int n_variable_groups() const
bool is_attached(SparseMatrix< Number > &matrix)
Matrices should not be attached more than once.
virtual void assemble()
Prepares matrix and _dof_map for matrix assembly.
void attach_matrix(SparseMatrix< Number > &matrix)
Additional matrices may be attached to this DofMap.
unsigned int add_variable_array(const std::vector< std::string > &vars, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
Adds variables vars to the list of variables for this system.
virtual void init_data()
Initializes the data for the system.
This is the base class from which all geometric element types are derived.
static FEFieldType field_type(const FEType &fe_type)
FEMNormType
defines an enum for norms defined on vectors of finite element coefficients
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...
void init_qois(unsigned int n_qois)
Accessors for qoi and qoi_error_estimates vectors.
Number point_value(unsigned int var, const Point &p, const bool insist_on_success=true, const NumericVector< Number > *sol=nullptr) const
std::unique_ptr< DofMap > _dof_map
Data structure describing the relationship between nodes, variables, etc...
virtual void user_initialization()
Calls user's attached initialization function, or is overridden by the user in derived classes...
Provides a uniform interface to vector storage schemes for different linear algebra libraries...
std::vector< Gradient > dshape
Storage for the computed shape derivative values.
const Parallel::Communicator & comm() const
std::map< std::string, std::unique_ptr< NumericVector< Number > >, std::less<> > _vectors
Some systems need an arbitrary number of vectors.
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...
OrderWrapper order
The approximation order of the element (at 0 p-refinement level).
This class defines a norm/seminorm to be applied to a NumericVector which contains coefficients in a ...
const std::string & name(unsigned int v) const
NumericVector< Number > & add_sensitivity_rhs(unsigned int i=0)
void reinit_static_condensation()
Calls reinit on the static condensation map if it exists.
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
The StoredRange class defines a contiguous, divisible set of objects.
std::vector< std::vector< Real > > local_transform
Storage for local to global mapping at p.
bool has_static_condensation() const
The libMesh namespace provides an interface to certain functionality in the library.
vectors_iterator vectors_begin()
Beginning of vectors container.
virtual Real subset_linfty_norm(const std::set< numeric_index_type > &indices) const
void attach_QOI_derivative_object(QOIDerivative &qoi_derivative)
Register a user object for evaluating derivatives of a quantity of interest with respect to test func...
virtual void adjoint_qoi_parameter_sensitivity(const QoISet &qoi_indices, const ParameterVector ¶meters, SensitivityData &sensitivities)
Solves for parameter sensitivities using the adjoint method.
dof_id_type n_local_dofs() const
Abstract base class to be used for system assembly.
NumericVector< Number > & add_weighted_sensitivity_solution()
void(* _qoi_evaluate_function)(EquationSystems &es, const std::string &name, const QoISet &qoi_indices)
Function to evaluate quantity of interest.
const SparseMatrix< Number > * request_matrix(std::string_view mat_name) const
void init()
Initializes degrees of freedom on the current mesh.
const MeshBase & get_mesh() const
NumericVector< Number > & get_weighted_sensitivity_solution()
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 Real subset_l1_norm(const std::set< numeric_index_type > &indices) const
std::string get_info() const
Gets summary info about the sparsity bandwidth and constraints.
dof_id_type n_dofs() const
uint8_t processor_id_type
This is the MeshBase class.
virtual void prolong_vectors()
Prolong vectors after the mesh has refined.
const Variable & variable(const unsigned int c) const override
virtual void user_QOI(const QoISet &qoi_indices)
Calls user's attached quantity of interest function, or is overridden by the user in derived classes...
Number current_solution(const dof_id_type global_dof_number) const
Number fptr(const Point &p, const Parameters &, const std::string &libmesh_dbg_var(sys_name), const std::string &unknown_name)
unsigned int variable_number(std::string_view var) const
std::map< std::string, std::unique_ptr< SparseMatrix< Number > >, std::less<> > _matrices
Some systems need an arbitrary number of matrices.
QOIDerivative * _qoi_evaluate_derivative_object
Object to compute derivatives of quantities of interest.
NumericVector< Number > & add_weighted_sensitivity_adjoint_solution(unsigned int i=0)
virtual void qoi_derivative(const QoISet &qoi_indices, bool include_liftfunc, bool apply_constraints)=0
Quantity of interest derivative function.
virtual void qoi_parameter_sensitivity(const QoISet &qoi_indices, const ParameterVector ¶meters, SensitivityData &sensitivities)
Solves for the derivative of each of the system's quantities of interest q in qoi[qoi_indices] with r...
void attach_constraint_object(Constraint &constrain)
Register a user object for imposing constraints.
SolverPackage default_solver_package()
This class handles the numbering of degrees of freedom on a mesh.
std::unique_ptr< QBase > default_quadrature_rule(const unsigned int dim, const int extraorder=0) const
void attach_init_object(Initialization &init)
Register a user class to use to initialize the system.
unsigned int variable_scalar_number(unsigned int var_num, unsigned int component) const
bool has_variable(std::string_view var) const
processor_id_type n_processors() const
void libmesh_ignore(const Args &...)
bool identify_variable_groups() const
unsigned int number() const
std::vector< Number > _qoi
Values of the quantities of interest.
void remove_vector(std::string_view vec_name)
Removes the additional vector vec_name from this system.
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
This class defines the notion of a variable in the system.
const std::set< subdomain_id_type > & active_subdomains() const
bool has_static_condensation() const
Checks whether we have static condensation.
virtual Real l2_norm() const =0
std::map< std::string, int, std::less<> > _vector_is_adjoint
Holds non-negative if a vector by that name should be projected using adjoint constraints/BCs, -1 if primal.
unsigned int add_variable(System &sys, 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.
Constraint & get_constraint_object()
Return the user object for imposing constraints.
void min(const T &r, T &o, Request &req) const
Data structure for holding completed parameter sensitivity calculations.
bool _is_initialized
Flag that tells if init() has been called.
StaticCondensationDofMap & get_static_condensation()
unsigned int n_variables() const
void remove_matrix(std::string_view mat_name)
Removes the additional matrix mat_name from this system.
This is a base class for classes which represent subsets of the dofs of a System. ...
unsigned int n_vectors() const
Manages consistently variables, degrees of freedom, and coefficient vectors.
void zero_variable(NumericVector< Number > &v, unsigned int var_num) const
Zeroes all dofs in v that correspond to variable number var_num.
bool _prefer_hash_table_matrix_assembly
Whether to use hash table matrix assembly if the matrix sub-classes support it.
virtual void add_matrices()
Insertion point for adding matrices in derived classes before init_matrices() is called.
static void compute_data(const unsigned int dim, const FEType &fe_t, const Elem *elem, FEComputeData &data)
Lets the appropriate child of FEBase compute the requested data for the input specified in data...
bool has_constraint_object() const
std::string get_info() const
virtual void qoi(const QoISet &qoi_indices)=0
Quantity of interest function.
std::unique_ptr< NumericVector< Number > > solution
Data structure to hold solution values.
void attach_QOI_derivative(void fptr(EquationSystems &es, const std::string &name, const QoISet &qoi_indices, bool include_liftfunc, bool apply_constraints))
Register a user function for evaluating derivatives of a quantity of interest with respect to test fu...
Real calculate_norm(const NumericVector< Number > &v, unsigned int var, FEMNormType norm_type, std::set< unsigned int > *skip_dimensions=nullptr) const
void print_dof_constraints(std::ostream &os=libMesh::out, bool print_nonlocal=false) const
Prints (from processor 0) all DoF and Node constraints.
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
QOI * _qoi_evaluate_object
Object to compute quantities of interest.
Initialization * _init_system_object
Object that initializes the system.
const FEType & variable_type(const unsigned int i) const
void attach_QOI_function(void fptr(EquationSystems &es, const std::string &name, const QoISet &qoi_indices))
Register a user function for evaluating the quantities of interest, whose values should be placed in ...
const VariableGroup & variable_group(const unsigned int c) const
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.
const std::string & variable_name(const unsigned int i) const
InfMapType inf_map
The coordinate mapping type of the infinite element.
void(* _init_system_function)(EquationSystems &es, const std::string &name)
Function that initializes the system.
const std::set< unsigned char > & elem_dimensions() const
std::map< std::string, ParallelType, std::less<> > _matrix_types
Holds the types of the matrices.
This is the base class for point locators.
virtual void restrict_vectors()
Restrict vectors after the mesh has coarsened.
const std::string & variable_name(const unsigned int i) const
void create_static_condensation(MeshBase &mesh, System &system)
Add a static condensation class.
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 n_matrices() const
An object whose state is distributed along a set of processors.
This class defines a logically grouped set of variables in the system.
std::size_t size(const System &sys) const
void add_scaled(const TypeTensor< T2 > &, const T &)
Add a scaled tensor to this tensor without creating a temporary.
NumericVector< Number > & add_adjoint_rhs(unsigned int i=0)
virtual Real l1_norm() const =0
virtual void restrict_solve_to(const SystemSubset *subset, const SubsetSolveMode subset_solve_mode=SUBSET_ZERO)
After calling this method, any solve will be restricted to the given subdomain.
virtual void user_QOI_derivative(const QoISet &qoi_indices=QoISet(), bool include_liftfunc=true, bool apply_constraints=true)
Calls user's attached quantity of interest derivative function, or is overridden by the user in deriv...
void broadcast(T &data, const unsigned int root_id=0, const bool identical_sizes=false) const
virtual void reinit_constraints()
Reinitializes the constraints for this system.
bool identify_variable_groups() const
virtual void close()=0
Calls the NumericVector's internal assembly routines, ensuring that the values are consistent across ...
virtual void reinit_mesh()
Reinitializes the system with a new mesh.
const NumericVector< Number > * request_vector(std::string_view vec_name) const
void attach_assemble_object(Assembly &assemble)
Register a user object to use in assembling the system matrix and RHS.
FEFamily radial_family
The type of approximation in radial direction.
bool _solution_projection
Holds true if the solution vector should be projected onto a changed grid, false if it should be zero...
EquationSystems & _equation_systems
Constant reference to the EquationSystems object used for the simulation.
std::string enum_to_string(const T e)
virtual bool closed() const
unsigned int n_vars() const
virtual std::string system_type() const
virtual void constrain()=0
Constraint function.
const std::string & vector_name(const unsigned int vec_num) const
void attach_QOI_object(QOI &qoi)
Register a user object for evaluating the quantities of interest, whose values should be placed in Sy...
virtual void user_assembly()
Calls user's attached assembly function, or is overridden by the user in derived classes.
ParallelType type() const
virtual void update()
Update the local values to reflect the solution on neighboring processors.
Real weight(unsigned int var) const
const FEType & variable_type(const unsigned int i) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void set_vector_preservation(const std::string &vec_name, bool preserve)
Allows one to set the boolean controlling whether the vector identified by vec_name should be "preser...
void process_constraints(MeshBase &)
Postprocesses any constrained degrees of freedom to be constrained only in terms of unconstrained dof...
void set_qoi_error_estimate(unsigned int qoi_index, Number qoi_error_estimate)
virtual void swap(NumericVector< T > &v)
Swaps the contents of this with v.
void max(const T &r, T &o, Request &req) const
virtual unsigned short dim() const =0
bool _matrices_initialized
false when additional matrices being added require initialization, true otherwise.
unsigned int add_variable_array(System &sys, const std::vector< std::string > &vars, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
Adds variables vars to the list of variables for this system.
bool _require_sparsity_pattern
Whether any of our matrices require an initial sparsity pattern computation in order to determine pre...
const std::string _sys_name
A name associated with this system.
virtual numeric_index_type local_size() const =0
Tensor point_hessian(unsigned int var, const Point &p, const bool insist_on_success=true, const NumericVector< Number > *sol=nullptr) const
std::vector< Number > _qoi_error_estimates
Vector to hold error estimates for qois, either from a steady state calculation, or from a single uns...
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...
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...
void clear_sparsity()
Clears the sparsity pattern.
NumericVector< Number > & get_adjoint_solution(unsigned int i=0)
virtual void re_update()
Re-update the local values when the mesh has changed.
unsigned int variable_number(std::string_view var) const
Abstract base class to be used for system constraints.
std::unique_ptr< NumericVector< Number > > current_local_solution
All the values I need to compute my contribution to the simulation at hand.
virtual bool compare(const System &other_system, const Real threshold, const bool verbose) const
void set_qoi(unsigned int qoi_index, Number qoi_value)
dof_id_type n_local_constrained_dofs() const
void create_dof_constraints(const MeshBase &, Real time=0)
Rebuilds the raw degree of freedom and DofObject constraints, based on attached DirichletBoundary obj...
virtual void set(const numeric_index_type i, const T value)=0
Sets v(i) = value.
void prepare_send_list()
Takes the _send_list vector (which may have duplicate entries) and sorts it.
bool on_command_line(std::string arg)
virtual bool infinite() const =0
const std::string & name() const
void attach_constraint_function(void fptr(EquationSystems &es, const std::string &name))
Register a user function for imposing constraints.
virtual void user_constrain()
Calls user's attached constraint function, or is overridden by the user in derived classes...
Real discrete_var_norm(const NumericVector< Number > &v, unsigned int var, FEMNormType norm_type) const
Finds the discrete norm for the entries in the vector corresponding to Dofs associated with var...
dof_id_type first_dof(const processor_id_type proc) const
Number get_qoi_error_estimate_value(unsigned int qoi_index) const
virtual void assemble_qoi(const QoISet &qoi_indices=QoISet())
Calls user qoi function.
NumericVector< Number > & add_sensitivity_solution(unsigned int i=0)
FEFamily
defines an enum for finite element families.
unsigned int n_vars() const
void(* _assemble_system_function)(EquationSystems &es, const std::string &name)
Function that assembles the system.
MatrixBuildType
Defines an enum for matrix build types.
void compute_sparsity(const MeshBase &)
Computes the sparsity pattern for the matrices corresponding to proc_id and sends that data to Linear...
virtual void enable_out_of_mesh_mode()=0
Enables out-of-mesh mode.
processor_id_type processor_id() const
System(EquationSystems &es, const std::string &name, const unsigned int number)
Constructor.
void enable_derivative()
Enable the computation of shape gradients (dshape).
bool vector_preservation(std::string_view vec_name) const
SparseMatrix< Number > & add_matrix(std::string_view mat_name, ParallelType type=PARALLEL, MatrixBuildType mat_build_type=MatrixBuildType::AUTOMATIC)
Adds the additional matrix mat_name to this system.
SubsetSolveMode
defines an enum for the question what happens to the dofs outside the given subset when a system is s...
const DofMap & get_dof_map() const
processor_id_type processor_id() const
void late_matrix_init(SparseMatrix< Number > &mat, ParallelType type)
Helper function to keep DofMap forward declarable in system.h.
const SparseMatrix< Number > & get_matrix(std::string_view mat_name) const
A Point defines a location in LIBMESH_DIM dimensional Real space.
MeshBase & _mesh
Constant reference to the mesh data structure used for the simulation.
template class LIBMESH_EXPORT NumericVector< Number >
void project_vector(NumericVector< Number > &new_vector, FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr, int is_adjoint=-1, std::optional< ConstElemRange > active_local_range=std::nullopt, std::optional< std::vector< unsigned int >> variable_numbers=std::nullopt) const
Projects arbitrary functions onto a vector of degree of freedom values for the current system...
The QBase class provides the basic functionality from which various quadrature rules can be derived...
virtual Real linfty_norm() const =0
const VariableGroup & variable_group(unsigned int vg) const
Return a constant reference to VariableGroup vg.
const std::vector< dof_id_type > & get_send_list() const
void attach_init_function(void fptr(EquationSystems &es, const std::string &name))
Register a user function to use in initializing the system.
void set_type(ParallelType t)
Allow the user to change the ParallelType of the NumericVector under some circumstances.
std::map< std::string, bool, std::less<> > _vector_projections
Holds true if a vector by that name should be projected onto a changed grid, false if it should be ze...
This class forms the foundation from which generic finite elements may be derived.
Abstract base class to be used for quantities of interest.
bool is_evaluable(const DofObjectSubclass &obj, unsigned int var_num=libMesh::invalid_uint) const
const NumericVector< Number > & get_vector(std::string_view vec_name) const
NumericVector< Number > & get_weighted_sensitivity_adjoint_solution(unsigned int i=0)
This class defines a tensor in LIBMESH_DIM dimensional Real or Complex space.
dof_id_type n_constrained_dofs() const
std::vector< Number > get_qoi_values() const
Returns a copy of qoi, not a reference.
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.
const FEType & type() const
void(* _qoi_evaluate_derivative_function)(EquationSystems &es, const std::string &name, const QoISet &qoi_indices, bool include_liftfunc, bool apply_constraints)
Function to evaluate quantity of interest derivative.
ParallelType
Defines an enum for parallel data structure types.
Abstract base class to be used for derivatives of quantities of interest.
NumericVector< Number > & get_adjoint_rhs(unsigned int i=0)
bool prefix_with_name() const
virtual void localize(std::vector< T > &v_local) const =0
Creates a copy of the global vector in the local vector v_local.
FEFieldType
defines an enum for finite element field types - i.e.