62 const std::string & name_in,
63 const unsigned int number_in) :
66 assemble_before_solve (true),
67 use_fixed_solution (false),
68 extra_quadrature_order (0),
73 _init_system_function (nullptr),
74 _init_system_object (nullptr),
75 _assemble_system_function (nullptr),
76 _assemble_system_object (nullptr),
77 _constrain_system_function (nullptr),
78 _constrain_system_object (nullptr),
79 _qoi_evaluate_function (nullptr),
80 _qoi_evaluate_object (nullptr),
81 _qoi_evaluate_derivative_function (nullptr),
82 _qoi_evaluate_derivative_object (nullptr),
83 _dof_map (new
DofMap(number_in, es.get_mesh())),
84 _equation_systems (es),
85 _mesh (es.get_mesh()),
87 _sys_number (number_in),
89 _solution_projection (true),
90 _basic_system_only (false),
92 _identify_variable_groups (true),
93 _additional_data_written (false),
94 adjoint_already_solved (false),
105 _equation_systems(other._equation_systems),
107 _sys_number(other._sys_number)
109 libmesh_not_implemented();
116 libmesh_not_implemented();
159 #ifdef LIBMESH_ENABLE_CONSTRAINTS 161 return _dof_map->n_constrained_dofs();
174 #ifdef LIBMESH_ENABLE_CONSTRAINTS 176 return _dof_map->n_local_constrained_dofs();
197 libmesh_assert_less (global_dof_number,
_dof_map->n_dofs());
268 _dof_map->add_variable_group(this->variable_group(vg));
283 #ifdef LIBMESH_ENABLE_GHOSTED 302 #ifdef LIBMESH_ENABLE_GHOSTED 307 libmesh_error_msg(
"Cannot initialize ghosted vectors when they are not enabled.");
312 pr.second->init (this->
n_dofs(),
false, type);
316 libmesh_assert_equal_to(type,
PARALLEL);
326 #ifdef LIBMESH_ENABLE_AMR 342 #ifdef LIBMESH_ENABLE_GHOSTED 347 libmesh_error_msg(
"Cannot initialize ghosted vectors when they are not enabled.");
355 const std::vector<dof_id_type> & send_list =
_dof_map->get_send_list ();
364 #ifdef LIBMESH_ENABLE_GHOSTED 375 #endif // LIBMESH_ENABLE_AMR 382 #ifdef LIBMESH_ENABLE_AMR 399 #ifdef LIBMESH_ENABLE_CONSTRAINTS 412 const std::vector<dof_id_type> & send_list =
_dof_map->get_send_list ();
418 libmesh_assert_less_equal (send_list.size(),
solution->size());
431 parallel_object_only();
444 libmesh_assert_less_equal (send_list.size(),
solution->size());
456 if (subset !=
nullptr)
457 libmesh_not_implemented();
465 LOG_SCOPE(
"assemble()",
"System");
476 LOG_SCOPE(
"assemble_qoi()",
"System");
485 bool include_liftfunc,
486 bool apply_constraints)
489 LOG_SCOPE(
"assemble_qoi_derivative()",
"System");
503 if (qoi_indices.
size(*
this) > parameters.
size())
515 const Real threshold,
516 const bool verbose)
const 525 libMesh::out <<
" comparing matrices not supported." << std::endl;
530 const int name_result =
_sys_name.compare(other_system.
name());
533 if (name_result == 0)
547 if (solu_result == -1)
548 libMesh::out <<
" identical up to threshold." << std::endl;
550 libMesh::out <<
" first difference occurred at index = " 551 << solu_result <<
"." << std::endl;
557 std::vector<int> ov_result;
563 libMesh::out <<
" Fatal difference. This system handles " 564 << this->
n_vectors() <<
" add'l vectors," << std::endl
565 <<
" while the other system handles " 567 <<
" add'l vectors." << std::endl
568 <<
" Aborting comparison." << std::endl;
584 << pr.first <<
"\" ...";
590 ov_result.push_back(pr.second->compare (other_system_vector,
595 if (ov_result[ov_result.size()-1] == -1)
596 libMesh::out <<
" identical up to threshold." << std::endl;
598 libMesh::out <<
" first difference occurred at" << std::endl
599 <<
" index = " << ov_result[ov_result.size()-1] <<
"." << std::endl;
608 if ((name_result==0) && (solu_result==-1))
610 if (ov_result.size()==0)
611 overall_result =
true;
618 ov_identical = (ov_result[n]==-1);
621 while (ov_identical && n<ov_result.size());
622 overall_result = ov_identical;
626 overall_result =
false;
632 libMesh::out <<
"found no differences." << std::endl << std::endl;
634 libMesh::out <<
"found differences." << std::endl << std::endl;
637 return overall_result;
644 global_soln.resize (
solution->size());
654 global_soln.resize (
solution->size());
656 solution->localize_to_one (global_soln, dest_proc);
662 const bool projections,
671 _vectors.insert (std::make_pair (vec_name, buf));
684 #ifdef LIBMESH_ENABLE_GHOSTED 689 libmesh_error_msg(
"Cannot initialize ghosted vectors when they are not enabled.");
744 unsigned int num = 0;
745 while ((num<vec_num) && (v!=v_end))
761 unsigned int num = 0;
762 while ((num<vec_num) && (v!=v_end))
780 libmesh_error_msg(
"ERROR: vector " << vec_name <<
" does not exist in this system!");
782 return *(pos->second);
793 libmesh_error_msg(
"ERROR: vector " << vec_name <<
" does not exist in this system!");
795 return *(pos->second);
804 unsigned int num = 0;
805 while ((num<vec_num) && (v!=v_end))
810 libmesh_assert (v != v_end);
820 unsigned int num = 0;
821 while ((num<vec_num) && (v!=v_end))
826 libmesh_assert (v != v_end);
836 unsigned int num = 0;
837 while ((num<vec_num) && (v!=v_end))
842 libmesh_assert (v != v_end);
851 for (; v != v_end; ++v)
854 if (&vec_reference == v->second)
859 libmesh_assert (v != v_end);
890 libmesh_assert_greater_equal(qoi_num, -2);
908 std::ostringstream sensitivity_name;
909 sensitivity_name <<
"sensitivity_solution" << i;
911 return this->
add_vector(sensitivity_name.str());
918 std::ostringstream sensitivity_name;
919 sensitivity_name <<
"sensitivity_solution" << i;
921 return this->
get_vector(sensitivity_name.str());
928 std::ostringstream sensitivity_name;
929 sensitivity_name <<
"sensitivity_solution" << i;
931 return this->
get_vector(sensitivity_name.str());
938 return this->
add_vector(
"weighted_sensitivity_solution");
945 return this->
get_vector(
"weighted_sensitivity_solution");
952 return this->
get_vector(
"weighted_sensitivity_solution");
959 std::ostringstream adjoint_name;
960 adjoint_name <<
"adjoint_solution" << i;
971 std::ostringstream adjoint_name;
972 adjoint_name <<
"adjoint_solution" << i;
981 std::ostringstream adjoint_name;
982 adjoint_name <<
"adjoint_solution" << i;
991 std::ostringstream adjoint_name;
992 adjoint_name <<
"weighted_sensitivity_adjoint_solution" << i;
1003 std::ostringstream adjoint_name;
1004 adjoint_name <<
"weighted_sensitivity_adjoint_solution" << i;
1013 std::ostringstream adjoint_name;
1014 adjoint_name <<
"weighted_sensitivity_adjoint_solution" << i;
1023 std::ostringstream adjoint_rhs_name;
1024 adjoint_rhs_name <<
"adjoint_rhs" << i;
1026 return this->
add_vector(adjoint_rhs_name.str(),
false);
1033 std::ostringstream adjoint_rhs_name;
1034 adjoint_rhs_name <<
"adjoint_rhs" << i;
1036 return this->
get_vector(adjoint_rhs_name.str());
1043 std::ostringstream adjoint_rhs_name;
1044 adjoint_rhs_name <<
"adjoint_rhs" << i;
1046 return this->
get_vector(adjoint_rhs_name.str());
1053 std::ostringstream sensitivity_rhs_name;
1054 sensitivity_rhs_name <<
"sensitivity_rhs" << i;
1056 return this->
add_vector(sensitivity_rhs_name.str(),
false);
1063 std::ostringstream sensitivity_rhs_name;
1064 sensitivity_rhs_name <<
"sensitivity_rhs" << i;
1066 return this->
get_vector(sensitivity_rhs_name.str());
1073 std::ostringstream sensitivity_rhs_name;
1074 sensitivity_rhs_name <<
"sensitivity_rhs" << i;
1076 return this->
get_vector(sensitivity_rhs_name.str());
1083 const std::set<subdomain_id_type> *
const active_subdomains)
1089 for (
unsigned int v=0; v<this->
n_vars(); v++)
1095 libmesh_error_msg(
"ERROR: incompatible variable " << var <<
" has already been added for this system!");
1108 should_be_in_vg =
false;
1115 const std::set<subdomain_id_type> *
const 1116 their_active_subdomains (vg.implicitly_active() ?
1117 nullptr : &vg.active_subdomains());
1120 if (vg.type() != type)
1121 should_be_in_vg =
false;
1124 if (their_active_subdomains && !active_subdomains)
1125 should_be_in_vg =
false;
1128 if (!their_active_subdomains && active_subdomains)
1129 should_be_in_vg =
false;
1131 if (their_active_subdomains && active_subdomains)
1133 if (*their_active_subdomains != *active_subdomains)
1134 should_be_in_vg =
false;
1138 if (should_be_in_vg)
1140 const unsigned short curr_n_vars = cast_int<unsigned short>
1145 _variables.push_back(vg(vg.n_variables()-1));
1152 return this->
add_variables (std::vector<std::string>(1, var),
1162 const std::set<subdomain_id_type> *
const active_subdomains)
1173 const std::set<subdomain_id_type> *
const active_subdomains)
1179 for (std::size_t ov=0; ov<vars.size(); ov++)
1180 for (
unsigned int v=0; v<this->
n_vars(); v++)
1186 libmesh_error_msg(
"ERROR: incompatible variable " << vars[ov] <<
" has already been added for this system!");
1189 const unsigned short curr_n_vars = cast_int<unsigned short>
1192 const unsigned int next_first_component = this->
n_components();
1197 next_first_component, type) :
1199 next_first_component, type, *active_subdomains));
1211 libmesh_assert_equal_to ((curr_n_vars+vars.size()), this->
n_vars());
1219 return cast_int<unsigned int>(curr_n_vars+vars.size()-1);
1227 const std::set<subdomain_id_type> *
const active_subdomains)
1246 std::map<std::string, unsigned short int>::const_iterator
1250 libmesh_error_msg(
"ERROR: variable " << var <<
" does not exist in this system!");
1252 libmesh_assert_equal_to (
_variables[pos->second].name(), var);
1260 all_variable_numbers.resize(
n_vars());
1263 std::map<std::string, unsigned short int>::const_iterator
1265 std::map<std::string, unsigned short int>::const_iterator
1268 unsigned int count = 0;
1269 for ( ; it != it_end; ++it)
1271 all_variable_numbers[count] = it->second;
1278 std::set<dof_id_type> & var_indices)
const 1281 var_indices.clear();
1283 std::vector<dof_id_type> dof_indices;
1290 for (
const auto & elem : this->
get_mesh().active_local_element_ptr_range())
1294 for (std::size_t i=0; i<dof_indices.size(); i++)
1299 if (first_local <= dof && dof < end_local)
1300 var_indices.insert(dof_indices[i]);
1310 for (
const auto & node : this->
get_mesh().local_node_ptr_range())
1312 libmesh_assert(node);
1314 for (
auto dof : dof_indices)
1315 if (first_local <= dof && dof < end_local)
1316 var_indices.insert(dof);
1323 unsigned int var_num)
const 1326 libmesh_assert_less (var_num, this->
n_vars());
1332 const unsigned int sys_num = this->
number();
1335 for (
const auto & node :
mesh.local_node_ptr_range())
1337 unsigned int n_comp = node->n_comp(sys_num,var_num);
1338 for (
unsigned int i=0; i<n_comp; i++)
1340 const dof_id_type index = node->dof_number(sys_num,var_num,i);
1346 for (
const auto & elem :
mesh.active_local_element_ptr_range())
1348 unsigned int n_comp = elem->n_comp(sys_num,var_num);
1349 for (
unsigned int i=0; i<n_comp; i++)
1351 const dof_id_type index = elem->dof_number(sys_num,var_num,i);
1363 std::set<dof_id_type> var_indices;
1373 libmesh_error_msg(
"Invalid norm_type = " << norm_type);
1381 std::set<unsigned int> * skip_dimensions)
const 1390 std::vector<FEMNormType> norms(this->
n_vars(),
L2);
1391 std::vector<Real> weights(this->
n_vars(), 0.0);
1392 norms[var] = norm_type;
1402 std::set<unsigned int> * skip_dimensions)
const 1405 parallel_object_only();
1407 LOG_SCOPE (
"calculate_norm()",
"System");
1416 unsigned int check_var = 0;
1417 for (; check_var != this->
n_vars(); ++check_var)
1418 if ((norm.
weight(check_var) != 1.0) || (norm.
type(check_var) != norm_type0))
1422 if (check_var == this->
n_vars())
1431 libmesh_error_msg(
"Invalid norm_type0 = " << norm_type0);
1434 for (
unsigned int var=0; var != this->
n_vars(); ++var)
1437 if (norm.
weight(var) == 0.0)
1455 bool using_hilbert_norm =
true,
1456 using_nonhilbert_norm =
true;
1459 for (
unsigned int var=0; var != this->
n_vars(); ++var)
1463 if (norm_weight_sq == 0.0)
1469 if ((norm_type==
H1) ||
1475 if (!using_hilbert_norm)
1476 libmesh_not_implemented();
1477 using_nonhilbert_norm =
false;
1479 else if ((norm_type==
L1) ||
1480 (norm_type==
L_INF) ||
1484 if (!using_nonhilbert_norm)
1485 libmesh_not_implemented();
1486 using_hilbert_norm =
false;
1489 libmesh_not_implemented();
1494 std::vector<std::unique_ptr<FEBase>> fe_ptrs(4);
1495 std::vector<std::unique_ptr<QBase>> q_rules(4);
1500 for (
const auto & dim : elem_dims)
1502 if (skip_dimensions && skip_dimensions->find(dim) != skip_dimensions->end())
1510 fe_ptrs[dim]->attach_quadrature_rule (q_rules[dim].
get());
1513 std::vector<dof_id_type> dof_indices;
1516 for (
const auto & elem : this->
get_mesh().active_local_element_ptr_range())
1518 const unsigned int dim = elem->dim();
1520 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 1525 if (elem->infinite() )
1526 libmesh_not_implemented();
1530 if (skip_dimensions && skip_dimensions->find(dim) != skip_dimensions->end())
1533 FEBase * fe = fe_ptrs[dim].get();
1534 QBase * qrule = q_rules[dim].get();
1536 libmesh_assert(qrule);
1538 const std::vector<Real> & JxW = fe->
get_JxW();
1539 const std::vector<std::vector<Real>> * phi =
nullptr;
1540 if (norm_type ==
H1 ||
1547 const std::vector<std::vector<RealGradient>> * dphi =
nullptr;
1548 if (norm_type ==
H1 ||
1553 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 1554 const std::vector<std::vector<RealTensor>> * d2phi =
nullptr;
1555 if (norm_type ==
H2 ||
1565 const unsigned int n_qp = qrule->
n_points();
1567 const unsigned int n_sf = cast_int<unsigned int>
1568 (dof_indices.size());
1571 for (
unsigned int qp=0; qp<n_qp; qp++)
1573 if (norm_type ==
L1)
1576 for (
unsigned int i=0; i != n_sf; ++i)
1577 u_h += (*phi)[i][qp] * (*local_v)(dof_indices[i]);
1578 v_norm += norm_weight *
1582 if (norm_type ==
L_INF)
1585 for (
unsigned int i=0; i != n_sf; ++i)
1586 u_h += (*phi)[i][qp] * (*local_v)(dof_indices[i]);
1590 if (norm_type ==
H1 ||
1595 for (
unsigned int i=0; i != n_sf; ++i)
1596 u_h += (*phi)[i][qp] * (*local_v)(dof_indices[i]);
1597 v_norm += norm_weight_sq *
1601 if (norm_type ==
H1 ||
1606 for (
unsigned int i=0; i != n_sf; ++i)
1607 grad_u_h.
add_scaled((*dphi)[i][qp], (*local_v)(dof_indices[i]));
1608 v_norm += norm_weight_sq *
1615 for (
unsigned int i=0; i != n_sf; ++i)
1616 grad_u_h.
add_scaled((*dphi)[i][qp], (*local_v)(dof_indices[i]));
1617 v_norm =
std::max(v_norm, norm_weight * grad_u_h.
norm());
1620 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 1621 if (norm_type ==
H2 ||
1625 for (
unsigned int i=0; i != n_sf; ++i)
1626 hess_u_h.
add_scaled((*d2phi)[i][qp], (*local_v)(dof_indices[i]));
1627 v_norm += norm_weight_sq *
1634 for (
unsigned int i=0; i != n_sf; ++i)
1635 hess_u_h.
add_scaled((*d2phi)[i][qp], (*local_v)(dof_indices[i]));
1636 v_norm =
std::max(v_norm, norm_weight * hess_u_h.
norm());
1643 if (using_hilbert_norm)
1646 v_norm = std::sqrt(v_norm);
1660 std::ostringstream oss;
1663 const std::string & sys_name = this->
name();
1665 oss <<
" System #" << this->
number() <<
", \"" << sys_name <<
"\"\n" 1673 if (vg_description.
n_variables() > 1) oss <<
"{ ";
1674 for (
unsigned int vn=0; vn<vg_description.
n_variables(); vn++)
1675 oss <<
"\"" << vg_description.
name(vn) <<
"\" ";
1676 if (vg_description.
n_variables() > 1) oss <<
"} ";
1681 oss <<
" Finite Element Types=";
1682 #ifndef LIBMESH_ENABLE_INFINITE_ELEMENTS 1697 oss <<
'\n' <<
" Infinite Element Mapping=";
1706 oss <<
" Approximation Orders=";
1709 #ifndef LIBMESH_ENABLE_INFINITE_ELEMENTS 1724 oss <<
" n_dofs()=" << this->
n_dofs() <<
'\n';
1725 oss <<
" n_local_dofs()=" << this->
n_local_dofs() <<
'\n';
1726 #ifdef LIBMESH_ENABLE_CONSTRAINTS 1731 oss <<
" " <<
"n_vectors()=" << this->
n_vectors() <<
'\n';
1732 oss <<
" " <<
"n_matrices()=" << this->
n_matrices() <<
'\n';
1743 const std::string &
name))
1745 libmesh_assert(fptr);
1750 libMesh::out <<
"WARNING: Cannot specify both initialization function and object!" 1766 libMesh::out <<
"WARNING: Cannot specify both initialization object and function!" 1778 const std::string &
name))
1780 libmesh_assert(fptr);
1785 libMesh::out <<
"WARNING: Cannot specify both assembly function and object!" 1801 libMesh::out <<
"WARNING: Cannot specify both assembly object and function!" 1813 const std::string &
name))
1815 libmesh_assert(fptr);
1820 libMesh::out <<
"WARNING: Cannot specify both constraint function and object!" 1836 libMesh::out <<
"WARNING: Cannot specify both constraint object and function!" 1848 const std::string &,
1851 libmesh_assert(fptr);
1856 libMesh::out <<
"WARNING: Cannot specify both QOI function and object!" 1872 libMesh::out <<
"WARNING: Cannot specify both QOI object and function!" 1884 const QoISet &,
bool,
bool))
1886 libmesh_assert(fptr);
1891 libMesh::out <<
"WARNING: Cannot specify both QOI derivative function and object!" 1907 libMesh::out <<
"WARNING: Cannot specify both QOI derivative object and function!" 1975 bool include_liftfunc,
1976 bool apply_constraints)
1988 (qoi_indices, include_liftfunc, apply_constraints);
1997 parallel_object_only();
2002 libmesh_assert(this->
comm().verify(p(0)));
2004 libmesh_assert(this->
comm().verify(p(1)));
2007 libmesh_assert(this->
comm().verify(p(2)));
2015 std::unique_ptr<PointLocatorBase> locator_ptr =
mesh.sub_point_locator();
2018 if (!insist_on_success || !
mesh.is_serial())
2022 const Elem * e = locator(p);
2026 if (e && this->
get_dof_map().is_evaluable(*e, var))
2033 this->
comm().
min(lowest_owner);
2041 libmesh_assert(!insist_on_success);
2057 libmesh_assert (dof_map.is_evaluable(e, var));
2060 std::vector<dof_id_type> dof_indices;
2063 dof_map.dof_indices (&e, dof_indices, var);
2066 const unsigned int num_dofs = cast_int<unsigned int>
2067 (dof_indices.size());
2069 FEType fe_type = dof_map.variable_type(var);
2082 for (
unsigned int l=0; l<num_dofs; l++)
2104 parallel_object_only();
2109 libmesh_assert(this->
comm().verify(p(0)));
2111 libmesh_assert(this->
comm().verify(p(1)));
2114 libmesh_assert(this->
comm().verify(p(2)));
2122 std::unique_ptr<PointLocatorBase> locator_ptr =
mesh.sub_point_locator();
2125 if (!insist_on_success || !
mesh.is_serial())
2129 const Elem * e = locator(p);
2133 if (e && this->
get_dof_map().is_evaluable(*e, var))
2140 this->
comm().
min(lowest_owner);
2148 libmesh_assert(!insist_on_success);
2161 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 2163 libmesh_not_implemented();
2173 std::vector<dof_id_type> dof_indices;
2179 const unsigned int num_dofs = cast_int<unsigned int>
2180 (dof_indices.size());
2192 const std::vector<std::vector<RealGradient>> & dphi = fe->get_dphi();
2195 fe->reinit (&e, &coor);
2200 for (
unsigned int l=0; l<num_dofs; l++)
2219 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 2224 parallel_object_only();
2229 libmesh_assert(this->
comm().verify(p(0)));
2231 libmesh_assert(this->
comm().verify(p(1)));
2234 libmesh_assert(this->
comm().verify(p(2)));
2242 std::unique_ptr<PointLocatorBase> locator_ptr =
mesh.sub_point_locator();
2245 if (!insist_on_success || !
mesh.is_serial())
2249 const Elem * e = locator(p);
2253 if (e && this->
get_dof_map().is_evaluable(*e, var))
2260 this->
comm().
min(lowest_owner);
2268 libmesh_assert(!insist_on_success);
2280 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 2282 libmesh_not_implemented();
2292 std::vector<dof_id_type> dof_indices;
2298 const unsigned int num_dofs = cast_int<unsigned int>
2299 (dof_indices.size());
2311 const std::vector<std::vector<RealTensor>> & d2phi = fe->get_d2phi();
2314 fe->reinit (&e, &coor);
2319 for (
unsigned int l=0; l<num_dofs; l++)
2340 libmesh_error_msg(
"We can only accumulate a hessian with --enable-second");
2348 libmesh_error_msg(
"We can only accumulate a hessian with --enable-second");
2356 libmesh_error_msg(
"We can only accumulate a hessian with --enable-second");
2362 #endif // LIBMESH_ENABLE_SECOND_DERIVATIVES void set_vector_as_adjoint(const std::string &vec_name, int qoi_num)
std::string name(const ElemQuality q)
Manages the family, order, etc. parameters for a given FE.
unsigned int add_variables(const std::vector< std::string > &vars, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
vectors_iterator vectors_end()
void local_dof_indices(const unsigned int var, std::set< dof_id_type > &var_indices) const
std::map< std::string, unsigned short int > _variable_numbers
virtual Real subset_l2_norm(const std::set< numeric_index_type > &indices) const
Manages multiples systems of equations.
void update_global_solution(std::vector< Number > &global_soln) const
Assembly * _assemble_system_object
std::map< std::string, ParallelType > _vector_types
void(* _constrain_system_function)(EquationSystems &es, const std::string &name)
NumericVector< Number > & add_adjoint_solution(unsigned int i=0)
virtual void forward_qoi_parameter_sensitivity(const QoISet &qoi_indices, const ParameterVector ¶meters, SensitivityData &sensitivities)
Specifies parameters for parameter sensitivity calculations.
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
void add_scaled(const TypeTensor< T2 > &, const T)
void add_scaled(const TypeVector< T2 > &, const T)
Used to specify quantities of interest in a simulation.
Helper class used with FEInterface::compute_data().
unsigned int n_components() const
int vector_is_adjoint(const std::string &vec_name) const
virtual void initialize()=0
virtual numeric_index_type size() const =0
NumericVector< Number > & get_sensitivity_solution(unsigned int i=0)
OrderWrapper radial_order
const FEType & variable_type(const unsigned int c) const
virtual void assemble_qoi_derivative(const QoISet &qoi_indices=QoISet(), bool include_liftfunc=true, bool apply_constraints=true)
NumericVector< Number > & get_sensitivity_rhs(unsigned int i=0)
virtual void assemble()=0
Constraint * _constrain_system_object
const EquationSystems & get_equation_systems() const
unsigned int n_variable_groups() const
Gradient point_gradient(unsigned int var, const Point &p, const bool insist_on_success=true) const
The base class for all geometric element types.
uint8_t processor_id_type
std::unique_ptr< DofMap > _dof_map
std::map< std::string, NumericVector< Number > * >::const_iterator const_vectors_iterator
virtual void user_initialization()
Provides a uniform interface to vector storage schemes for different linear algebra libraries...
const Parallel::Communicator & comm() const
std::vector< Variable > _variables
void get_all_variable_numbers(std::vector< unsigned int > &all_variable_numbers) const
const std::string & name(unsigned int v) const
NumericVector< Number > & add_sensitivity_rhs(unsigned int i=0)
vectors_iterator vectors_begin()
virtual Real subset_linfty_norm(const std::set< numeric_index_type > &indices) const
void attach_QOI_derivative_object(QOIDerivative &qoi_derivative)
virtual void adjoint_qoi_parameter_sensitivity(const QoISet &qoi_indices, const ParameterVector ¶meters, SensitivityData &sensitivities)
dof_id_type n_local_dofs() const
NumericVector< Number > & add_weighted_sensitivity_solution()
void(* _qoi_evaluate_function)(EquationSystems &es, const std::string &name, const QoISet &qoi_indices)
long double max(long double a, double b)
const MeshBase & get_mesh() const
bool has_variable(const std::string &var) const
virtual void init(const numeric_index_type n, const numeric_index_type n_local, const bool fast=false, const ParallelType ptype=AUTOMATIC)=0
NumericVector< Number > & get_weighted_sensitivity_solution()
virtual Real subset_l1_norm(const std::set< numeric_index_type > &indices) const
std::string get_info() const
dof_id_type n_dofs() const
virtual void prolong_vectors()
Tensor point_hessian(unsigned int var, const Point &p, const bool insist_on_success=true) const
virtual void user_QOI(const QoISet &qoi_indices)
Number current_solution(const dof_id_type global_dof_number) const
QOIDerivative * _qoi_evaluate_derivative_object
void remove_vector(const std::string &vec_name)
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
virtual void qoi_parameter_sensitivity(const QoISet &qoi_indices, const ParameterVector ¶meters, SensitivityData &sensitivities)
void attach_constraint_object(Constraint &constrain)
Manages the degrees of freedom (DOFs) in a simulation.
std::unique_ptr< QBase > default_quadrature_rule(const unsigned int dim, const int extraorder=0) const
void attach_init_object(Initialization &init)
const std::vector< std::vector< OutputGradient > > & get_dphi() const
processor_id_type n_processors() const
unsigned int number() const
NumericVector< Number > & add_vector(const std::string &vec_name, const bool projections=true, const ParallelType type=PARALLEL)
virtual bool contains_point(const Point &p, Real tol=TOLERANCE) const
virtual Real l2_norm() const =0
Holds completed parameter sensitivity calculations.
unsigned int n_variables() const
std::vector< VariableGroup > _variable_groups
bool vector_preservation(const std::string &vec_name) const
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
unsigned short int variable_number(const std::string &var) const
const std::vector< Real > & get_JxW() const
static void compute_data(const unsigned int dim, const FEType &fe_t, const Elem *elem, FEComputeData &data)
FEMNormType type(unsigned int var) const
const NumericVector< Number > & get_vector(const std::string &vec_name) const
std::string get_info() const
virtual void qoi(const QoISet &qoi_indices)=0
std::unique_ptr< NumericVector< Number > > solution
void attach_QOI_derivative(void fptr(EquationSystems &es, const std::string &name, const QoISet &qoi_indices, bool include_liftfunc, bool apply_constraints))
Real calculate_norm(const NumericVector< Number > &v, unsigned int var, FEMNormType norm_type, std::set< unsigned int > *skip_dimensions=nullptr) const
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
QOI * _qoi_evaluate_object
Initialization * _init_system_object
System & operator=(const System &)
virtual void reinit(const Elem *elem, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr)=0
void attach_QOI_function(void fptr(EquationSystems &es, const std::string &name, const QoISet &qoi_indices))
const VariableGroup & variable_group(const unsigned int c) const
static Point inverse_map(const unsigned int dim, const FEType &fe_t, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true)
const std::string & variable_name(const unsigned int i) const
unsigned int n_points() const
void(* _init_system_function)(EquationSystems &es, const std::string &name)
const std::set< unsigned char > & elem_dimensions() const
virtual void restrict_vectors()
const std::vector< std::vector< OutputTensor > > & get_d2phi() const
void attach_assemble_function(void fptr(EquationSystems &es, const std::string &name))
void append(const std::string &var_name)
std::map< std::string, int > _vector_is_adjoint
virtual unsigned int n_matrices() const
An object whose state is distributed along a set of processors.
std::size_t size(const System &sys) const
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)
bool have_vector(const std::string &vec_name) const
virtual void user_QOI_derivative(const QoISet &qoi_indices=QoISet(), bool include_liftfunc=true, bool apply_constraints=true)
bool is_evaluable(const DofObjectSubclass &obj, unsigned int var_num=libMesh::invalid_uint) const
virtual void reinit_constraints()
bool identify_variable_groups() const
static std::unique_ptr< NumericVector< T > > build(const Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package())
void attach_assemble_object(Assembly &assemble)
std::map< std::string, NumericVector< Number > * >::iterator vectors_iterator
bool _solution_projection
EquationSystems & _equation_systems
virtual std::string system_type() const
virtual void constrain()=0
const std::string & vector_name(const unsigned int vec_num) const
void attach_QOI_object(QOI &qoi)
Real weight_sq(unsigned int var) const
virtual void user_assembly()
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)
void process_constraints(MeshBase &)
virtual unsigned short dim() const =0
std::map< std::string, NumericVector< Number > *> _vectors
const std::string _sys_name
const NumericVector< Number > * request_vector(const std::string &vec_name) const
NumericVector< Number > & get_adjoint_solution(unsigned int i=0)
std::map< std::string, bool > _vector_projections
std::unique_ptr< NumericVector< Number > > current_local_solution
void project_vector(NumericVector< Number > &new_vector, FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr, int is_adjoint=-1) const
virtual bool compare(const System &other_system, const Real threshold, const bool verbose) const
dof_id_type n_local_constrained_dofs() const
void create_dof_constraints(const MeshBase &, Real time=0)
virtual void set(const numeric_index_type i, const T value)=0
virtual bool infinite() const =0
Number point_value(unsigned int var, const Point &p, const bool insist_on_success=true) const
const std::string & name() const
void attach_constraint_function(void fptr(EquationSystems &es, const std::string &name))
virtual void user_constrain()
Real discrete_var_norm(const NumericVector< Number > &v, unsigned int var, FEMNormType norm_type) const
dof_id_type first_dof(const processor_id_type proc) const
virtual void assemble_qoi(const QoISet &qoi_indices=QoISet())
NumericVector< Number > & add_sensitivity_solution(unsigned int i=0)
unsigned int n_vars() const
unsigned int add_variable(const std::string &var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
dof_id_type end_dof(const processor_id_type proc) const
void(* _assemble_system_function)(EquationSystems &es, const std::string &name)
virtual void enable_out_of_mesh_mode()=0
processor_id_type processor_id() const
System(EquationSystems &es, const std::string &name, const unsigned int number)
OStreamProxy out(std::cout)
const DofMap & get_dof_map() const
processor_id_type processor_id() const
A geometric point in (x,y,z) space.
void broadcast(T &data, const unsigned int root_id=0) const
Base class for all quadrature families and orders.
virtual Real linfty_norm() const =0
const VariableGroup & variable_group(unsigned int vg) const
const std::vector< dof_id_type > & get_send_list() const
void attach_init_function(void fptr(EquationSystems &es, const std::string &name))
NumericVector< Number > & get_weighted_sensitivity_adjoint_solution(unsigned int i=0)
dof_id_type n_constrained_dofs() const
const std::vector< std::vector< OutputShape > > & get_phi() const
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)
NumericVector< Number > & get_adjoint_rhs(unsigned int i=0)
virtual void localize(std::vector< T > &v_local) const =0