10#ifdef MOOSE_KOKKOS_ENABLED
132#include "libmesh/exodusII_io.h"
133#include "libmesh/quadrature.h"
134#include "libmesh/coupling_matrix.h"
135#include "libmesh/nonlinear_solver.h"
136#include "libmesh/sparse_matrix.h"
137#include "libmesh/string_to_enum.h"
138#include "libmesh/fe_interface.h"
139#include "libmesh/enum_norm_type.h"
140#include "libmesh/petsc_solver_exception.h"
142#include "metaphysicl/dualnumber.h"
168 params.
addParam<
unsigned int>(
"null_space_dimension", 0,
"The dimension of the nullspace");
170 "transpose_null_space_dimension", 0,
"The dimension of the transpose nullspace");
172 "near_null_space_dimension", 0,
"The dimension of the near nullspace");
175 "Whether or not to actually solve the Nonlinear system. "
176 "This is handy in the case that all you want to do is "
177 "execute AuxKernels, Transfers, etc. without actually "
179 params.
addParam<
bool>(
"use_nonlinear",
181 "Determines whether to use a Nonlinear vs a "
182 "Eigenvalue system (Automatically determined based "
184 params.
addParam<
bool>(
"error_on_jacobian_nonzero_reallocation",
185 "This causes PETSc to error if it had to reallocate memory in the Jacobian "
186 "matrix due to not having enough nonzeros");
187 params.
addParam<
bool>(
"ignore_zeros_in_jacobian",
189 "Do not explicitly store zero values in "
190 "the Jacobian matrix if true");
191 params.
addParam<
bool>(
"force_restart",
193 "EXPERIMENTAL: If true, a sub_app may use a "
194 "restart file instead of using of using the master "
198 "True to skip additional data in equation system for restart.",
199 "This parameter is no longer used, as we do not load additional "
200 "vectors by default with restart");
201 params.
addParam<
bool>(
"skip_nl_system_check",
203 "True to skip the NonlinearSystem check for work to do (e.g. Make sure "
204 "that there are variables to solve for).");
205 params.
addParam<
bool>(
"allow_initial_conditions_with_restart",
207 "True to allow the user to specify initial conditions when restarting. "
208 "Initial conditions can override any restarted field");
210 auto coverage_check_description = [](std::string scope, std::string list_param_name)
212 return "Controls, if and how a " + scope +
213 " subdomain coverage check is performed. "
214 "With 'TRUE' or 'ON' all subdomains are checked (the default). Setting 'FALSE' or 'OFF' "
215 "will disable the check for all subdomains. "
216 "To exclude a predefined set of subdomains 'SKIP_LIST' is to "
217 "be used, while the subdomains to skip are to be defined in the parameter '" +
219 "'. To limit the check to a list of subdomains, 'ONLY_LIST' is to "
220 "be used (again, using the parameter '" +
221 list_param_name +
"').";
224 params.
addParam<std::vector<SubdomainName>>(
227 "List of subdomains for kernel coverage and material coverage checks. Setting this parameter "
228 "is equivalent to setting 'kernel_coverage_block_list' and 'material_coverage_block_list' as "
229 "well as using 'ONLY_LIST' as the coverage check mode.");
231 MooseEnum kernel_coverage_check_modes(
"FALSE TRUE OFF ON SKIP_LIST ONLY_LIST",
"TRUE");
233 kernel_coverage_check_modes,
234 coverage_check_description(
"kernel",
"kernel_coverage_block_list"));
235 params.
addParam<std::vector<SubdomainName>>(
236 "kernel_coverage_block_list",
238 "List of subdomains for kernel coverage check. The meaning of this list is controlled by the "
239 "parameter 'kernel_coverage_check' (whether this is the list of subdomains to be checked, "
240 "not to be checked or not taken into account).");
242 "boundary_restricted_node_integrity_check",
244 "Set to false to disable checking of boundary restricted nodal object variable dependencies, "
245 "e.g. are the variable dependencies defined on the selected boundaries?");
246 params.
addParam<
bool>(
"boundary_restricted_elem_integrity_check",
248 "Set to false to disable checking of boundary restricted elemental object "
249 "variable dependencies, e.g. are the variable dependencies defined on the "
250 "selected boundaries?");
252 "side_uo_interface_mat_prop_integrity_check",
254 "Set to false to disable checking that side user objects do not consume material "
255 "properties declared by interface materials on the same boundary.");
256 MooseEnum material_coverage_check_modes(
"FALSE TRUE OFF ON SKIP_LIST ONLY_LIST",
"TRUE");
258 "material_coverage_check",
259 material_coverage_check_modes,
260 coverage_check_description(
"material",
"material_coverage_block_list"));
261 params.
addParam<std::vector<SubdomainName>>(
262 "material_coverage_block_list",
264 "List of subdomains for material coverage check. The meaning of this list is controlled by "
265 "the parameter 'material_coverage_check' (whether this is the list of subdomains to be "
266 "checked, not to be checked or not taken into account).");
268 params.
addParam<
bool>(
"fv_bcs_integrity_check",
270 "Set to false to disable checking of overlapping Dirichlet and Flux BCs "
271 "and/or multiple DirichletBCs per sideset");
274 "fv_face_integrity_check",
276 "Set to false to disable checking that FV flux boundary conditions and FV interface "
277 "kernels are applied to faces with valid variable ownership and interface topology.");
280 "material_dependency_check",
true,
"Set to false to disable material dependency check");
281 params.
addParam<
bool>(
"parallel_barrier_messaging",
283 "Displays messaging from parallel "
284 "barrier notifications when executing "
285 "or transferring to/from Multiapps "
288 MooseEnum verbosity(
"false true extra",
"false");
291 "Set to 'true' to have the problem report on any object created. Set "
292 "to 'extra' to also display all parameters.");
293 params.
addParam<
bool>(
"verbose_multiapps",
295 "Set to True to enable verbose screen printing related to MultiApps");
299 "Set to True to enable verbose screen printing related to solution restoration");
301 params.
addParam<FileNameNoExtension>(
"restart_file_base",
302 "File base name used for restart (e.g. "
303 "<path>/<filebase> or <path>/LATEST to "
304 "grab the latest file available)");
306 params.
addParam<std::vector<std::vector<TagName>>>(
309 "Extra vectors to add to the system that can be filled by objects which compute residuals "
310 "and Jacobians (Kernels, BCs, etc.) by setting tags on them. The outer index is for which "
311 "nonlinear system the extra tag vectors should be added for");
313 params.
addParam<std::vector<std::vector<TagName>>>(
314 "not_zeroed_tag_vectors",
316 "Extra vector tags which the sytem will not zero when other vector tags are zeroed. "
317 "The outer index is for which nonlinear system the extra tag vectors should be added for");
319 params.
addParam<std::vector<std::vector<TagName>>>(
320 "extra_tag_matrices",
322 "Extra matrices to add to the system that can be filled "
323 "by objects which compute residuals and Jacobians "
324 "(Kernels, BCs, etc.) by setting tags on them. The outer index is for which "
325 "nonlinear system the extra tag vectors should be added for");
327 params.
addParam<std::vector<TagName>>(
328 "extra_tag_solutions",
330 "Extra solution vectors to add to the system that can be used by "
331 "objects for coupling variable values stored in them.");
333 params.
addParam<
bool>(
"previous_nl_solution_required",
335 "True to indicate that this calculation requires a solution vector for "
336 "storing the previous nonlinear iteration.");
338 params.
addParam<std::vector<NonlinearSystemName>>(
339 "nl_sys_names", std::vector<NonlinearSystemName>{
"nl0"},
"The nonlinear system names");
341 params.
addParam<std::vector<LinearSystemName>>(
"linear_sys_names", {},
"The linear system names");
343 params.
addParam<
bool>(
"check_uo_aux_state",
345 "True to turn on a check that no state presents during the evaluation of "
346 "user objects and aux kernels");
353 "allow_invalid_solution",
355 "Set to true to allow convergence even though the solution has been marked as 'invalid'");
356 params.
addParam<
bool>(
"show_invalid_solution_console",
358 "Set to true to show the invalid solution occurrence summary in console");
359 params.
addParam<
bool>(
"immediately_print_invalid_solution",
361 "Whether or not to report invalid solution warnings at the time the "
362 "warning is produced instead of after the calculation");
365 "identify_variable_groups_in_nl",
367 "Whether to identify variable groups in nonlinear systems. This affects dof ordering");
370 "regard_general_exceptions_as_errors",
372 "If we catch an exception during residual/Jacobian evaluaton for which we don't have "
373 "specific handling, immediately error instead of allowing the time step to be cut");
375 params.
addParam<
bool>(
"use_hash_table_matrix_assembly",
377 "Whether to assemble matrices using hash tables instead of preallocating "
378 "matrix memory. This can be a good option if the sparsity pattern changes "
379 "throughout the course of the simulation.");
381 "restore_original_nonzero_pattern",
382 "Whether we should reset matrix memory for every Jacobian evaluation. This option is useful "
383 "if the sparsity pattern is constantly changing and you are using hash table assembly or if "
384 "you wish to continually restore the matrix to the originally preallocated sparsity pattern "
385 "computed by relationship managers.");
388 "skip_nl_system_check kernel_coverage_check kernel_coverage_block_list "
389 "boundary_restricted_node_integrity_check "
390 "boundary_restricted_elem_integrity_check "
391 "side_uo_interface_mat_prop_integrity_check material_coverage_check "
392 "material_coverage_block_list fv_bcs_integrity_check fv_face_integrity_check "
393 "material_dependency_check check_uo_aux_state error_on_jacobian_nonzero_reallocation",
394 "Simulation checks");
396 "ignore_zeros_in_jacobian identify_variable_groups_in_nl "
397 "use_hash_table_matrix_assembly restore_original_nonzero_pattern",
398 "Nonlinear system(s)");
400 "restart_file_base force_restart allow_initial_conditions_with_restart",
"Restart");
402 "verbose_setup verbose_multiapps verbose_restore parallel_barrier_messaging",
"Verbosity");
404 "null_space_dimension transpose_null_space_dimension near_null_space_dimension",
405 "Null space removal");
407 "extra_tag_vectors extra_tag_matrices extra_tag_solutions not_zeroed_tag_vectors",
408 "Contribution to tagged field data");
410 "allow_invalid_solution show_invalid_solution_console immediately_print_invalid_solution",
411 "Solution validity control");
419 _mesh(*getCheckedPointerParam<
MooseMesh *>(
"mesh")),
421 "equation_systems", nullptr, _mesh)),
423 _solve(getParam<bool>(
"solve")),
425 _time(declareRestartableData<
Real>(
"time")),
426 _time_old(declareRestartableData<
Real>(
"time_old")),
427 _t_step(declareRecoverableData<
int>(
"t_step")),
428 _dt(declareRestartableData<
Real>(
"dt")),
429 _dt_old(declareRestartableData<
Real>(
"dt_old")),
430 _need_to_add_default_nonlinear_convergence(false),
431 _need_to_add_default_multiapp_fixed_point_convergence(false),
432 _need_to_add_default_steady_state_convergence(false),
433 _linear_sys_names(getParam<
std::vector<LinearSystemName>>(
"linear_sys_names")),
434 _num_linear_sys(_linear_sys_names.size()),
435 _linear_systems(_num_linear_sys, nullptr),
436 _current_linear_sys(nullptr),
437 _using_default_nl(!isParamSetByUser(
"nl_sys_names")),
438 _nl_sys_names(!_using_default_nl || (_using_default_nl && !_linear_sys_names.size())
439 ? getParam<
std::vector<NonlinearSystemName>>(
"nl_sys_names")
440 :
std::vector<NonlinearSystemName>()),
441 _num_nl_sys(_nl_sys_names.size()),
442 _nl(_num_nl_sys, nullptr),
443 _current_nl_sys(nullptr),
444 _solver_systems(_num_nl_sys + _num_linear_sys, nullptr),
446 _coupling(
Moose::COUPLING_DIAG),
447#ifdef MOOSE_KOKKOS_ENABLED
448 _kokkos_assembly(*this),
450 _mesh_divisions(true),
452 "material_props", &_mesh, _material_prop_registry, *this)),
454 "bnd_material_props", &_mesh, _material_prop_registry, *this)),
456 "neighbor_material_props", &_mesh, _material_prop_registry, *this)),
457#ifdef MOOSE_KOKKOS_ENABLED
458 _kokkos_material_props(
460 "kokkos_material_props", &_mesh, _material_prop_registry, *this)),
461 _kokkos_bnd_material_props(
463 "kokkos_bnd_material_props", &_mesh, _material_prop_registry, *this)),
464 _kokkos_neighbor_material_props(
466 "kokkos_neighbor_material_props", &_mesh, _material_prop_registry, *this)),
468 _reporter_data(_app),
469 _multi_apps(_app.getExecuteOnEnum()),
470 _transient_multi_apps(_app.getExecuteOnEnum()),
471 _transfers(_app.getExecuteOnEnum(), false),
472 _to_multi_app_transfers(_app.getExecuteOnEnum(), false),
473 _from_multi_app_transfers(_app.getExecuteOnEnum(), false),
474 _between_multi_app_transfers(_app.getExecuteOnEnum(), false),
475#ifdef LIBMESH_ENABLE_AMR
477 _cycles_completed(0),
479 _displaced_mesh(nullptr),
480 _geometric_search_data(*this, _mesh),
482 _reinit_displaced_elem(false),
483 _reinit_displaced_face(false),
484 _reinit_displaced_neighbor(false),
485 _input_file_saved(false),
487 _has_constraints(false),
488 _snesmf_reuse_base(true),
489 _skip_exception_check(false),
490 _snesmf_reuse_base_set_by_user(false),
491 _has_initialized_stateful(false),
492 _const_jacobian(false),
493 _has_jacobian(false),
494 _needs_old_newton_iter(false),
495 _previous_nl_solution_required(getParam<bool>(
"previous_nl_solution_required")),
496 _previous_multiapp_fp_nl_solution_required(_num_nl_sys + _num_linear_sys, false),
497 _previous_multiapp_fp_aux_solution_required(false),
498 _previous_multisystem_fp_nl_solution_required(_num_nl_sys + _num_linear_sys, false),
499 _previous_multisystem_fp_aux_solution_required(false),
500 _has_nonlocal_coupling(false),
501 _calculate_jacobian_in_uo(false),
502 _kernel_coverage_check(
504 _kernel_coverage_blocks(getParam<
std::vector<SubdomainName>>(
"kernel_coverage_block_list")),
505 _boundary_restricted_node_integrity_check(
506 getParam<bool>(
"boundary_restricted_node_integrity_check")),
507 _boundary_restricted_elem_integrity_check(
508 getParam<bool>(
"boundary_restricted_elem_integrity_check")),
509 _side_uo_interface_mat_prop_integrity_check(
510 getParam<bool>(
"side_uo_interface_mat_prop_integrity_check")),
511 _material_coverage_check(
513 _material_coverage_blocks(getParam<
std::vector<SubdomainName>>(
"material_coverage_block_list")),
514 _fv_bcs_integrity_check(getParam<bool>(
"fv_bcs_integrity_check")),
515 _fv_face_integrity_check(getParam<bool>(
"fv_face_integrity_check")),
516 _material_dependency_check(getParam<bool>(
"material_dependency_check")),
517 _uo_aux_state_check(getParam<bool>(
"check_uo_aux_state")),
519 _check_residual_for_nans(false),
521 _max_qps(
std::numeric_limits<unsigned
int>::max()),
523 _has_time_integrator(false),
524 _has_exception(false),
525 _parallel_barrier_messaging(getParam<bool>(
"parallel_barrier_messaging")),
526 _verbose_setup(getParam<
MooseEnum>(
"verbose_setup")),
527 _verbose_multiapps(getParam<bool>(
"verbose_multiapps")),
528 _verbose_restore(getParam<bool>(
"verbose_restore")),
530 _control_warehouse(_app.getExecuteOnEnum(), false),
531 _is_petsc_options_inserted(false),
532 _line_search(nullptr),
533 _using_ad_mat_props(false),
534 _current_ic_state(0),
535 _use_hash_table_matrix_assembly(getParam<bool>(
"use_hash_table_matrix_assembly")),
536 _error_on_jacobian_nonzero_reallocation(
537 isParamValid(
"error_on_jacobian_nonzero_reallocation")
538 ? getParam<bool>(
"error_on_jacobian_nonzero_reallocation")
539 : _app.errorOnJacobianNonzeroReallocation()),
540 _restore_original_nonzero_pattern(isParamValid(
"restore_original_nonzero_pattern")
541 ? getParam<bool>(
"restore_original_nonzero_pattern")
542 : _use_hash_table_matrix_assembly),
543 _ignore_zeros_in_jacobian(getParam<bool>(
"ignore_zeros_in_jacobian")),
544 _preserve_matrix_sparsity_pattern(true),
545 _force_restart(getParam<bool>(
"force_restart")),
546 _allow_ics_during_restart(getParam<bool>(
"allow_initial_conditions_with_restart")),
547 _skip_nl_system_check(getParam<bool>(
"skip_nl_system_check")),
548 _fail_next_system_convergence_check(false),
549 _allow_invalid_solution(getParam<bool>(
"allow_invalid_solution")),
550 _show_invalid_solution_console(getParam<bool>(
"show_invalid_solution_console")),
551 _immediately_print_invalid_solution(getParam<bool>(
"immediately_print_invalid_solution")),
552 _started_initial_setup(false),
553 _has_internal_edge_residual_objects(false),
554 _u_dot_requested(false),
555 _u_dotdot_requested(false),
556 _u_dot_old_requested(false),
557 _u_dotdot_old_requested(false),
560 _print_execution_on(),
561 _identify_variable_groups_in_nl(getParam<bool>(
"identify_variable_groups_in_nl")),
562 _regard_general_exceptions_as_errors(getParam<bool>(
"regard_general_exceptions_as_errors")),
563 _requires_nonlocal_coupling(false)
565 auto checkCoverageCheckConflict =
566 [
this](
const std::string & coverage_check,
568 const std::vector<SubdomainName> & coverage_blocks) ->
void
572 if (coverage_blocks.size() > 1)
573 if (std::find(coverage_blocks.begin(), coverage_blocks.end(),
"ANY_BLOCK_ID") !=
574 coverage_blocks.end())
576 "The list of blocks used for ",
578 " cannot contain 'ANY_BLOCK_ID' along with other blocks. ");
581 checkCoverageCheckConflict(
583 checkCoverageCheckConflict(
589 ADReal::do_derivatives =
true;
653 std::string restart_file_base = getParam<FileNameNoExtension>(
"restart_file_base");
660 if (restart_file_base.size())
678#if !PETSC_RELEASE_LESS_THAN(3, 12, 0)
697 mooseWarning(
"Displaced mesh was requested but the displaced problem does not exist. "
698 "Regular mesh will be returned");
706 mooseWarning(
"Displaced mesh was requested but the displaced problem does not exist. "
707 "Regular mesh will be returned");
715 auto & vectors = getParam<std::vector<std::vector<TagName>>>(
"extra_tag_vectors");
717 for (
auto & vector : vectors[sys_num])
723 auto & not_zeroed_vectors = getParam<std::vector<std::vector<TagName>>>(
"not_zeroed_tag_vectors");
724 for (
const auto sys_num :
index_range(not_zeroed_vectors))
725 for (
auto & vector : not_zeroed_vectors[sys_num])
736 auto & matrices = getParam<std::vector<std::vector<TagName>>>(
"extra_tag_matrices");
738 for (
auto & matrix : matrices[sys_num])
745 sys->sizeVariableMatrixData();
746 _aux->sizeVariableMatrixData();
752 for (
auto & vector : getParam<std::vector<TagName>>(
"extra_tag_solutions"))
771 sys->associateVectorToTag(*sys->system().current_local_solution.get(), tag);
772 _aux->associateVectorToTag(*
_aux->system().current_local_solution.get(), tag);
779 sys->needSolutionState(state, iteration_type);
780 _aux->needSolutionState(state, iteration_type);
787 bool has_solution_state =
false;
789 has_solution_state |= sys->hasSolutionState(state, iteration_type);
790 has_solution_state |=
_aux->hasSolutionState(state, iteration_type);
791 return has_solution_state;
802 _assembly[i].resize(solver_systems.size());
804 _assembly[i][j] = std::make_unique<Assembly>(*solver_systems[j], i);
810 std::vector<std::shared_ptr<NonlinearSystemBase>> & nls)
812 TIME_SECTION(
"initNullSpaceVectors", 5,
"Initializing Null Space Vectors");
814 unsigned int dimNullSpace =
parameters.
get<
unsigned int>(
"null_space_dimension");
815 unsigned int dimTransposeNullSpace =
816 parameters.
get<
unsigned int>(
"transpose_null_space_dimension");
817 unsigned int dimNearNullSpace =
parameters.
get<
unsigned int>(
"near_null_space_dimension");
818 for (
unsigned int i = 0; i < dimNullSpace; ++i)
820 std::ostringstream oss;
824 for (
auto & nl : nls)
828 for (
unsigned int i = 0; i < dimTransposeNullSpace; ++i)
830 std::ostringstream oss;
834 for (
auto & nl : nls)
838 for (
unsigned int i = 0; i < dimNearNullSpace; ++i)
840 std::ostringstream oss;
844 for (
auto & nl : nls)
859 for (
unsigned int i = 0; i <
n_threads; i++)
875#if !PETSC_RELEASE_LESS_THAN(3, 12, 0)
880 CHKERRABORT(this->
comm().get(), ierr);
889 TIME_SECTION(
"setCoordSystem", 5,
"Setting Coordinate System");
904 std::vector<const DofMap *> dof_maps(
es().n_systems());
908 dof_maps[i] = &sys.get_dof_map();
911 std::make_unique<ConstElemRange>(
_mesh.
getMesh().multi_evaluable_elements_begin(dof_maps),
912 _mesh.
getMesh().multi_evaluable_elements_end(dof_maps));
922 std::vector<const DofMap *> dof_maps(
_nl.size());
924 dof_maps[i] = &
_nl[i]->dofMap();
926 std::make_unique<ConstElemRange>(
_mesh.
getMesh().multi_evaluable_elements_begin(dof_maps),
927 _mesh.
getMesh().multi_evaluable_elements_end(dof_maps));
936 TIME_SECTION(
"initialSetup", 2,
"Performing Initial Setup");
941 mooseError(
"Checkpoint recovery and restart and exodus restart are all mutually exclusive.");
944 mooseWarning(
"MOOSE may fail to catch an exception when the \"skip_exception_check\" parameter "
945 "is used. If you receive a terse MPI error during execution, remove this "
946 "parameter and rerun your simulation");
961 _aux->initSolutionState();
974 TIME_SECTION(
"computingMaxDofs", 3,
"Computing Max Dofs Per Element");
978 max_var_n_dofs_per_elem = mvndpe.
max();
983 max_var_n_dofs_per_node = mvndpn.
max();
985 global_max_var_n_dofs_per_elem =
986 std::max(global_max_var_n_dofs_per_elem, max_var_n_dofs_per_elem);
990 TIME_SECTION(
"assignMaxDofs", 5,
"Assigning Maximum Dofs Per Elem");
992 sys.assignMaxVarNDofsPerElem(max_var_n_dofs_per_elem);
995 displaced_problem->solverSys(i).assignMaxVarNDofsPerElem(max_var_n_dofs_per_elem);
997 sys.assignMaxVarNDofsPerNode(max_var_n_dofs_per_node);
999 displaced_problem->solverSys(i).assignMaxVarNDofsPerNode(max_var_n_dofs_per_node);
1004 TIME_SECTION(
"resizingVarValues", 5,
"Resizing Variable Values");
1008 _phi_zero[tid].resize(global_max_var_n_dofs_per_elem, std::vector<Real>(
getMaxQps(), 0.));
1029 props->setRecovering();
1031#ifdef MOOSE_KOKKOS_ENABLED
1034 props->setRecovering();
1038 TIME_SECTION(
"restore", 3,
"Restoring from backup");
1065 TIME_SECTION(
"copyingFromExodus", 3,
"Copying Variables From Exodus");
1068 sys->copyVars(*reader);
1069 _aux->copyVars(*reader);
1074 mooseError(
"Need Exodus reader to restart variables but the reader is not available\n"
1075 "Use either FileMesh with an Exodus mesh file or FileMeshGenerator with an "
1076 "Exodus mesh file and with use_for_exodus_restart equal to true");
1092 mooseError(
"Stateful neighbor material properties do not work with mesh adaptivity");
1108 "Doing extra refinements when restarting is NOT supported for sub-apps of a MultiApp");
1118 TIME_SECTION(
"convergenceInitialSetup", 5,
"Initializing Convergence objects");
1126 std::set<std::string> depend_objects_aux =
_aux->getDependObjects();
1128 std::map<int, std::vector<UserObjectBase *>> group_userobjs;
1132 std::vector<UserObjectBase *> userobjs;
1137 for (
auto obj : userobjs)
1138 group_userobjs[obj->
getParam<
int>(
"execution_order_group")].push_back(obj);
1140#ifdef MOOSE_KOKKOS_ENABLED
1144 std::vector<UserObjectBase *> userobjs;
1149 for (
auto obj : userobjs)
1150 group_userobjs[obj->
getParam<
int>(
"execution_order_group")].push_back(obj);
1154 for (
auto & [group, objs] : group_userobjs)
1155 for (auto obj : objs)
1168 TIME_SECTION(
"initializingFunctions", 5,
"Initializing Functions");
1178#ifdef MOOSE_KOKKOS_ENABLED
1184 TIME_SECTION(
"initializingRandomObjects", 5,
"Initializing Random Objects");
1196 TIME_SECTION(
"ICinitialSetup", 5,
"Setting Up Initial Conditions");
1213 TIME_SECTION(
"materialInitialSetup", 3,
"Setting Up Materials");
1234#ifdef MOOSE_KOKKOS_ENABLED
1239 TIME_SECTION(
"computingInitialStatefulProps", 3,
"Computing Initial Material Values");
1246#ifdef MOOSE_KOKKOS_ENABLED
1261 props->setRestartInPlace();
1262 props->setRecovering();
1273#ifdef LIBMESH_ENABLE_AMR
1279 mooseError(
"Cannot perform initial adaptivity during restart on sub-apps of a MultiApp!");
1295 unsigned short ic_state_max = 0;
1297 auto findMax = [&ic_state_max](
const auto & obj_list)
1299 for (
auto ic : obj_list.getActiveObjects())
1300 ic_state_max =
std::
max(ic_state_max, ic->getState());
1307 if (ic_state_max > 0)
1311 std::vector<std::unique_ptr<NumericVector<Real>>> state0_sys_buffers(
_solver_systems.size());
1312 std::unique_ptr<NumericVector<Real>> state0_aux_buffer;
1318 state0_aux_buffer =
_aux->solutionState(0).clone();
1339 _aux->solutionState(0) = *state0_aux_buffer;
1340 _aux->solutionState(0).close();
1356 _aux->initialSetup();
1363 sys->setSolution(*(sys->system().current_local_solution.
get()));
1393 const auto & tis = sys->getTimeIntegrators();
1396 TIME_SECTION(
"timeIntegratorInitialSetup", 5,
"Initializing Time Integrator");
1397 for (
auto & ti : tis)
1408 TIME_SECTION(
"initialSetupMultiApps", 2,
"Initializing MultiApps",
false);
1414 TIME_SECTION(
"initialSetupTransfers", 2,
"Initializing Transfers");
1420 for (
const auto & transfer : to_multi_app_objects)
1423 transfer->initialSetup();
1428 for (
const auto & transfer : from_multi_app_objects)
1431 transfer->initialSetup();
1436 for (
const auto & transfer : between_multi_app_objects)
1439 transfer->initialSetup();
1445 TIME_SECTION(
"BoundaryRestrictedNodeIntegrityCheck", 5);
1453 for (
auto & nl :
_nl)
1455 const auto & nodal_bcs = nl->getNodalBCWarehouse();
1456 if (!nodal_bcs.hasBoundaryObjects())
1459 for (
const auto & bnode : bnd_nodes)
1461 const auto boundary_id = bnode->_bnd_id;
1462 const Node *
const node = bnode->_node;
1470 if (!nodal_bcs.hasBoundaryObjects(boundary_id))
1473 const auto & bnd_objects = nodal_bcs.getBoundaryObjects(boundary_id);
1474 for (
const auto & bnd_object : bnd_objects)
1476 const auto & bnd_variable = bnd_object->variable();
1481 if (!bnd_object->requiresGeometricSearch() &&
1482 bnd_object->checkVariableBoundaryIntegrity() &&
1483 node->
n_dofs(nl->number(), bnd_variable.number()))
1485 std::set<MooseVariableFieldBase *> vars_to_omit = {
1486 &cast_ref<MooseVariableFieldBase &>(
const_cast<MooseVariableBase &
>(bnd_variable))};
1489 *bnd_object, bnd_object->checkAllVariables(*node, vars_to_omit), bnd_name);
1498 TIME_SECTION(
"BoundaryRestrictedElemIntegrityCheck", 5);
1508 TIME_SECTION(
"FVFaceIntegrityCheck", 5);
1510 auto check_fv_face_integrity = [
this](
MooseMesh & fv_mesh,
const bool on_displaced)
1515 .condition<AttribDisplaced>(on_displaced)
1522 .condition<AttribDisplaced>(on_displaced)
1525 interface_kernel_base_query);
1527 std::vector<FVFluxBC *> flux_bcs;
1528 std::vector<FVInterfaceKernel *> interface_kernels;
1535 for (
const auto boundary_id : fi.boundaryIDs())
1537 auto boundary_key = std::make_tuple(boundary_id,
false);
1539 flux_bc_query.queryInto(flux_bcs, boundary_key);
1540 for (
const auto *
const flux_bc : flux_bcs)
1541 if (flux_bc->checkVariableBoundaryIntegrity())
1542 flux_bc->checkFaceIntegrity(fi);
1544 interface_kernel_query.queryInto(interface_kernels, boundary_key);
1545 for (
const auto *
const interface_kernel : interface_kernels)
1546 interface_kernel->checkFaceIntegrity(fi);
1552 check_fv_face_integrity(
mesh(),
false);
1562 mooseError(
"failed to converge initial MultiApp");
1595 TIME_SECTION(
"computeMaterials", 2,
"Computing Initial Material Properties");
1599#ifdef MOOSE_KOKKOS_ENABLED
1604 TIME_SECTION(
"computeMaterials", 2,
"Computing Initial Material Properties");
1616 for (
unsigned int tid = 0; tid <
n_threads; tid++)
1634 TIME_SECTION(
"lineSearchInitialSetup", 5,
"Initializing Line Search");
1656 "\" has the same name as a scalar variable in the system.");
1667 std::unique_ptr<libMesh::MeshRefinement> displaced_mesh_refinement(
nullptr);
1669 displaced_mesh_refinement = std::make_unique<libMesh::MeshRefinement>(*
_displaced_mesh);
1685 displaced_mesh_refinement->uniformly_coarsen();
1734#ifdef MOOSE_KOKKOS_ENABLED
1738 _aux->timestepSetup();
1740 sys->timestepSetup();
1753 std::vector<UserObject *> userobjs;
1755 for (
auto obj : userobjs)
1756 obj->timestepSetup();
1758#ifdef MOOSE_KOKKOS_ENABLED
1760 std::vector<UserObjectBase *> userobjs;
1762 for (
auto obj : userobjs)
1763 obj->timestepSetup();
1778 if (
_max_qps == std::numeric_limits<unsigned int>::max())
1792 TIME_SECTION(
"checkNonlocalCoupling", 5,
"Checking Nonlocal Coupling");
1795 for (
auto & nl :
_nl)
1797 const auto & all_kernels = nl->getKernelWarehouse();
1798 const auto & kernels = all_kernels.getObjects(tid);
1799 for (
const auto & kernel : kernels)
1801 std::shared_ptr<NonlocalKernel> nonlocal_kernel =
1802 std::dynamic_pointer_cast<NonlocalKernel>(kernel);
1803 if (nonlocal_kernel)
1811 nl->getIntegratedBCWarehouse();
1812 const auto & integrated_bcs = all_integrated_bcs.
getObjects(tid);
1813 for (
const auto & integrated_bc : integrated_bcs)
1815 std::shared_ptr<NonlocalIntegratedBC> nonlocal_integrated_bc =
1816 std::dynamic_pointer_cast<NonlocalIntegratedBC>(integrated_bc);
1817 if (nonlocal_integrated_bc)
1830 std::set<const MooseVariableFEBase *> uo_jacobian_moose_vars;
1832 std::vector<ShapeElementUserObject *> objs;
1836 .condition<AttribThread>(tid)
1839 for (
const auto & uo : objs)
1842 const auto & mv_deps = uo->jacobianMooseVariables();
1843 uo_jacobian_moose_vars.insert(mv_deps.begin(), mv_deps.end());
1847 std::vector<ShapeSideUserObject *> objs;
1851 .condition<AttribThread>(tid)
1853 for (
const auto & uo : objs)
1856 const auto & mv_deps = uo->jacobianMooseVariables();
1857 uo_jacobian_moose_vars.insert(mv_deps.begin(), mv_deps.end());
1869 for (
unsigned int i = 0; i < moose_vars.size(); ++i)
1871 VariableName var_name = moose_vars[i]->name();
1873 sys->setVariableGlobalDoFs(var_name);
1891 _assembly[tid][i]->prepareJacobianBlock();
1914 for (
auto & nl :
_nl)
1915 nl->prepareFace(tid,
true);
1916 _aux->prepareFace(tid,
false);
1926 const std::vector<dof_id_type> & dof_indices,
1932 _nl[i]->prepare(tid);
1937 _assembly[tid][current_nl_sys_num]->prepareBlock(ivar, jvar, dof_indices);
1942 _assembly[tid][current_nl_sys_num]->prepareBlockNonlocal(
1964 _assembly[tid][i]->setCurrentSubdomainID(did);
1977 _assembly[tid][i]->setCurrentNeighborSubdomainID(did);
1990 _assembly[tid][i]->setCurrentNeighborSubdomainID(did);
2094 std::vector<VectorTag> extra_residual_vector_tags;
2099 if (vector_tag._id != time_tag && vector_tag._id != non_time_tag)
2100 extra_residual_vector_tags.push_back(vector_tag);
2107 extra_residual_vector_tags);
2217 std::vector<dof_id_type> & dof_indices,
2218 const std::set<TagID> & tags,
2241 _displaced_problem->addJacobianBlockTags(jacobian, ivar, jvar, dof_map, dof_indices, tags, tid);
2247 jacobian, ivar, jvar, dof_map, dof_indices, jv.
allDofIndices(), tags, tid);
2257 std::vector<dof_id_type> & dof_indices,
2258 std::vector<dof_id_type> & neighbor_dof_indices,
2259 const std::set<TagID> & tags,
2267 neighbor_dof_indices,
2272 jacobian, ivar, jvar, dof_map, dof_indices, neighbor_dof_indices, tags, tid);
2311 TIME_SECTION(
"ghostGhostedBoundaries", 3,
"Ghosting Ghosted Boundaries");
2323 "This function is deprecated and no longer performs any function. Please do not call it."));
2331 unsigned int n_points = points.size();
2348 _zero[tid].resize(max_qpts, 0);
2358 _assembly[tid][i]->reinitAtPhysical(elem, points);
2359 _nl[i]->prepare(tid);
2370 bool have_points = n_points > 0;
2385 sys->reinitElem(elem, tid);
2386 _aux->reinitElem(elem, tid);
2394 const std::vector<Point> & phys_points_in_elem,
2398 "Are you calling this method with a displaced mesh element?");
2402 _assembly[tid][i]->reinitAtPhysical(elem, phys_points_in_elem);
2415 const unsigned int side,
2420 "reinitElemFace with a BoundaryID argument is deprecated because the boundary id was never "
2421 "used. Please call reinitElemFace without the BoundaryID argument instead");
2434 _aux->reinitElemFace(elem, side, tid);
2443 const std::vector<Point> *
const pts,
2444 const std::vector<Real> *
const weights)
2462 _nl[i]->reinitNode(node, tid);
2464 _aux->reinitNode(node, tid);
2476 _nl[i]->reinitNodeFace(node, bnd_id, tid);
2478 _aux->reinitNodeFace(node, bnd_id, tid);
2484 TIME_SECTION(
"reinitScalars", 3,
"Reinitializing Scalar Variables");
2489 for (
auto & nl :
_nl)
2490 nl->reinitScalars(tid, reinit_for_derivative_reordering);
2491 _aux->reinitScalars(tid, reinit_for_derivative_reordering);
2516 _assembly[tid][i]->reinitElemAndNeighbor(elem, side, neighbor, neighbor_side);
2517 _nl[i]->prepareNeighbor(tid);
2521 _aux->prepareNeighbor(tid);
2523 for (
auto & nl :
_nl)
2525 nl->reinitElemFace(elem, side, tid);
2526 nl->reinitNeighborFace(neighbor, neighbor_side, tid);
2528 _aux->reinitElemFace(elem, side, tid);
2529 _aux->reinitNeighborFace(neighbor, neighbor_side, tid);
2538 const auto & displaced_ref_pts =
_assembly[tid][0]->qRuleNeighbor()->get_points();
2558 auto & neighbor =
_assembly[tid][0]->neighbor();
2559 auto & neighbor_side =
_assembly[tid][0]->neighborSide();
2561 if (lower_d_elem_neighbor &&
2564 auto qps =
_assembly[tid][0]->qPointsFaceNeighbor().stdVector();
2565 std::vector<Point> reference_points;
2567 lower_d_elem_neighbor->
dim(), lower_d_elem_neighbor, qps, reference_points);
2579 unsigned int neighbor_side,
2580 const std::vector<Point> & physical_points,
2584 "Are you calling this method with a displaced mesh element?");
2589 _assembly[tid][i]->reinitNeighborAtPhysical(neighbor, neighbor_side, physical_points);
2592 _nl[i]->prepareNeighbor(tid);
2594 _aux->prepareNeighbor(tid);
2600 for (
auto & nl :
_nl)
2601 nl->reinitNeighborFace(neighbor, neighbor_side, tid);
2602 _aux->reinitNeighborFace(neighbor, neighbor_side, tid);
2607 const std::vector<Point> & physical_points,
2611 "Are you calling this method with a displaced mesh element?");
2616 _assembly[tid][i]->reinitNeighborAtPhysical(neighbor, physical_points);
2619 _nl[i]->prepareNeighbor(tid);
2621 _aux->prepareNeighbor(tid);
2627 for (
auto & nl :
_nl)
2628 nl->reinitNeighbor(neighbor, tid);
2629 _aux->reinitNeighbor(neighbor, tid);
2640 std::set<const Elem *> displaced_elements;
2645 for (
const auto & elem : displaced_elements)
2668 for (
auto & nl :
_nl)
2669 nl->subdomainSetup(subdomain, tid);
2683 const std::string & name,
2686 parallel_object_only();
2703 mooseError(
"Unrecognized function functor type");
2709 const std::string & name,
2712 parallel_object_only();
2724 const std::string class_name =
"DefaultNonlinearConvergence";
2728 params.
set<
bool>(
"added_as_default") =
true;
2736 const std::string class_name =
"DefaultMultiAppFixedPointConvergence";
2740 params.
set<
bool>(
"added_as_default") =
true;
2747 const std::string class_name =
"DefaultSteadyStateConvergence";
2751 params.
set<
bool>(
"added_as_default") =
true;
2771 std::istringstream ss(
name);
2775 if (ss >> real_value && ss.eof())
2778 params.
set<
Real>(
"value") = real_value;
2779 addFunction(
"ConstantFunction", ss.str(), params);
2784 std::string
vars =
"x,y,z,t,NaN,pi,e";
2789 params.
set<std::string>(
"expression") =
name;
2797 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_function"),
2798 "getFunction() was called before Functions have been constructed. The requested "
2800 name +
"' may exist in the input file, but Functions are not available yet.");
2824 mooseError(
"The Convergence object '",
name,
"' does not exist.");
2829const std::vector<std::shared_ptr<Convergence>> &
2837 const std::string & name,
2840 parallel_object_only();
2855 mooseError(
"No MeshDivision object named ",
name,
" of appropriate type");
2868 mooseDeprecated(
"FEProblemBase::getNonlinearSystem() is deprecated, please use "
2869 "FEProblemBase::getNonlinearSystemBase() \n");
2871 mooseAssert(sys_num <
_nl.size(),
"System number greater than the number of nonlinear systems");
2872 auto nl_sys = std::dynamic_pointer_cast<NonlinearSystem>(
_nl[sys_num]);
2882 const std::string & name,
2892 std::vector<Distribution *> objs;
2896 .condition<AttribName>(
name)
2898 return !objs.empty();
2904 std::vector<Distribution *> objs;
2908 .condition<AttribName>(
name)
2912 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_distribution"),
2913 "A Distribution getter was called before Distributions have been constructed. "
2914 "If you are attempting to access this object in the constructor of another object "
2915 "then make sure that the Distribution is constructed before the object using it.");
2916 mooseError(
"Unable to find Distribution with name '" +
name +
"'");
2923 const std::string & name,
2927 for (
auto & sampler : samplers)
2934 std::vector<Sampler *> objs;
2938 .condition<AttribThread>(tid)
2943 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_sampler"),
2944 "A Sampler getter was called before Samplers have been constructed. "
2945 "If you are attempting to access this object in the constructor of another object "
2946 "then make sure that the Sampler is constructed before the object using it.");
2949 "Unable to find Sampler with name '" +
name +
2950 "', if you are attempting to access this object in the constructor of another object then "
2951 "make sure that the Sampler is constructed before the object using it.");
2960 const std::set<SubdomainID> *
const active_subdomains)
2962 std::set<SubdomainID> subdomainIDs;
2963 if (active_subdomains->size() == 0)
2966 subdomainIDs.insert(subdomains.begin(), subdomains.end());
2969 subdomainIDs.insert(active_subdomains->begin(), active_subdomains->end());
2975 std::string error_prefix =
"";
2978 curr_sys_ptr =
_aux.get();
2979 other_sys_ptr = sys.get();
2980 error_prefix =
"aux";
2984 mooseError(
"Cannot have an auxiliary variable and a solver variable with the same name: ",
2995 const auto stringifyType = [](
FEType t)
2998 mooseError(
"Mismatching types are specified for ",
3000 "variable with name '",
3003 stringifyType(var.
type()),
3005 stringifyType(
type),
3013 std::set<SubdomainID> varSubdomainIDs;
3014 if (varActiveSubdomains.size() == 0)
3017 varSubdomainIDs.insert(subdomains.begin(), subdomains.end());
3020 varSubdomainIDs.insert(varActiveSubdomains.begin(), varActiveSubdomains.end());
3024 const auto isSubset = std::includes(varSubdomainIDs.begin(),
3025 varSubdomainIDs.end(),
3026 subdomainIDs.begin(),
3027 subdomainIDs.end());
3032 const auto stringifySubdomains = [
this](std::set<SubdomainID> subdomainIDs)
3034 std::stringstream s;
3035 for (
auto const i : subdomainIDs)
3043 if (subdomainName.empty())
3046 s << subdomainName <<
" (" << i <<
")";
3051 const std::string msg =
"Mismatching block-restrictions are specified for " +
3052 error_prefix +
"variable with name '" + var_name +
"': {" +
3053 stringifySubdomains(varSubdomainIDs) +
"} and {" +
3054 stringifySubdomains(subdomainIDs) +
"}";
3069 const std::string & var_name,
3072 parallel_object_only();
3074 const auto order = Utility::string_to_enum<Order>(params.
get<
MooseEnum>(
"order"));
3075 const auto family = Utility::string_to_enum<FEFamily>(params.
get<
MooseEnum>(
"family"));
3076 const auto fe_type =
FEType(order, family);
3078 const auto active_subdomains_vector =
3080 const std::set<SubdomainID> active_subdomains(active_subdomains_vector.begin(),
3081 active_subdomains_vector.end());
3088 SolverSystemName sys_name = params.
get<SolverSystemName>(
"solver_sys");
3090 const auto solver_system_number =
solverSysNum(sys_name);
3091 logAdd(
"Variable", var_name, var_type, params);
3092 _solver_systems[solver_system_number]->addVariable(var_type, var_name, params);
3104std::pair<bool, unsigned int>
3106 const bool error_if_not_found)
const
3113 "If the variable is in our FEProblem solver system map, then it must be in the "
3114 "solver system we expect");
3115 else if (error_if_not_found)
3117 if (
_aux->hasVariable(var_name) ||
_aux->hasScalarVariable(var_name))
3120 " found. Did you specify an auxiliary variable when you meant to specify a "
3121 "solver variable?");
3125 "'. It does not exist in the solver system(s) or auxiliary system");
3133 const std::string & name,
3135 const unsigned int nl_sys_num,
3136 const std::string & base_name,
3137 bool & reinit_displaced)
3143 reinit_displaced =
true;
3166 const std::string & name,
3168 const std::string & base_name)
3175 if (!
parameters.
get<std::vector<BoundaryName>>(
"boundary").empty())
3202 const std::string & name,
3205 parallel_object_only();
3208 mooseError(
"You are trying to add a Kernel to a linear variable/system, which is not "
3209 "supported at the moment!");
3218 const std::string & name,
3221 parallel_object_only();
3224 mooseError(
"You are trying to add a HDGKernel to a linear variable/system, which is not "
3225 "supported at the moment!");
3234 const std::string & name,
3237 parallel_object_only();
3267 const std::string & name,
3270 parallel_object_only();
3274 mooseError(
"You are trying to add a ScalarKernel to a linear variable/system, which is not "
3275 "supported at the moment!");
3304 const std::string & name,
3307 parallel_object_only();
3312 "You are trying to add a BoundaryCondition to a linear variable/system, which is not "
3313 "supported at the moment!");
3322 const std::string & name,
3325 parallel_object_only();
3329 auto determine_var_param_name = [&
parameters,
this]()
3338 if (!has_secondary_var && !has_primary_var)
3340 "Either a 'secondary_variable' or 'primary_variable' parameter must be supplied for '",
3343 return has_secondary_var ?
"secondary_variable" :
"primary_variable";
3347 const auto nl_sys_num =
3350 mooseError(
"You are trying to add a Constraint to a linear variable/system, which is not "
3351 "supported at the moment!");
3375 const std::string & var_name,
3378 parallel_object_only();
3380 const auto order = Utility::string_to_enum<Order>(params.
get<
MooseEnum>(
"order"));
3381 const auto family = Utility::string_to_enum<FEFamily>(params.
get<
MooseEnum>(
"family"));
3382 const auto fe_type =
FEType(order, family);
3384 const auto active_subdomains_vector =
3386 const std::set<SubdomainID> active_subdomains(active_subdomains_vector.begin(),
3387 active_subdomains_vector.end());
3395 logAdd(
"AuxVariable", var_name, var_type, params);
3396 _aux->addVariable(var_type, var_name, params);
3408 const std::string & var_name,
3417 const std::set<SubdomainID> *
const active_subdomains)
3419 parallel_object_only();
3421 mooseDeprecated(
"Please use the addAuxVariable(var_type, var_name, params) API instead");
3426 std::string var_type;
3428 var_type =
"MooseVariableConstMonomial";
3430 var_type =
"MooseVariableScalar";
3432 var_type =
"VectorMooseVariable";
3434 var_type =
"MooseVariable";
3442 if (active_subdomains)
3446 logAdd(
"AuxVariable", var_name, var_type, params);
3447 _aux->addVariable(var_type, var_name, params);
3459 unsigned int components,
3460 const std::set<SubdomainID> *
const active_subdomains)
3462 parallel_object_only();
3464 mooseDeprecated(
"Please use the addAuxVariable(var_type, var_name, params) API instead");
3474 params.
set<
unsigned int>(
"components") = components;
3476 if (active_subdomains)
3480 logAdd(
"Variable", var_name,
"ArrayMooseVariable", params);
3481 _aux->addVariable(
"ArrayMooseVariable", var_name, params);
3494 const std::set<SubdomainID> *
const active_subdomains)
3496 parallel_object_only();
3498 mooseDeprecated(
"Please use the addAuxVariable(var_type, var_name, params) API instead");
3513 params.
set<std::vector<Real>>(
"scaling") = std::vector<Real>{1};
3514 if (active_subdomains)
3518 logAdd(
"ScalarVariable", var_name,
"MooseVariableScalar", params);
3519 _aux->addVariable(
"MooseVariableScalar", var_name, params);
3526 const std::string & name,
3529 parallel_object_only();
3538 const std::string & name,
3541 parallel_object_only();
3570 const std::string & name,
3573 parallel_object_only();
3577 mooseError(
"You are trying to add a DiracKernel to a linear variable/system, which is not "
3578 "supported at the moment!");
3610 const std::string & name,
3613 parallel_object_only();
3617 mooseError(
"You are trying to add a DGKernel to a linear variable/system, which is not "
3618 "supported at the moment!");
3650 const std::string & name,
3664 const std::string & name,
3672 const std::string & name,
3677 addObject<FVInterfaceKernel>(
3683 const std::string & name,
3691 const std::string & name,
3701 const std::string & name,
3704 parallel_object_only();
3708 mooseError(
"You are trying to add a InterfaceKernel to a linear variable/system, which is not "
3709 "supported at the moment!");
3741 const std::string & name,
3742 const VariableName & var_name)
3746 std::string restart_method =
"";
3749 "a checkpoint restart, by IC object '" + ic_name +
"' for variable '" +
name +
"'";
3755 restarted_vars.insert(restarted_vars.end(), nodal_vars.begin(), nodal_vars.end());
3756 restarted_vars.insert(restarted_vars.end(), global_vars.begin(), global_vars.end());
3758 if (std::find(restarted_vars.begin(), restarted_vars.end(), var_name) != restarted_vars.end())
3759 restart_method =
"an Exodus restart, by IC object '" + ic_name +
"' for variable '" +
name +
3760 "' that is also being restarted";
3762 if (!restart_method.empty())
3764 "Initial conditions have been specified during ",
3766 ".\nThis is only allowed if you specify 'allow_initial_conditions_with_restart' to "
3767 "the [Problem], as initial conditions can override restarted fields");
3773 const std::string & name,
3776 parallel_object_only();
3780 const std::string & var_name =
parameters.
get<VariableName>(
"variable");
3795 std::shared_ptr<InitialConditionBase> ic;
3807 mooseError(
"Your FE variable in initial condition ",
3809 " must be either of scalar or vector type");
3820 std::shared_ptr<ScalarInitialCondition> ic =
3828 "Variable '", var_name,
"' requested in initial condition '",
name,
"' does not exist.");
3833 const std::string & name,
3836 parallel_object_only();
3840 const std::string & var_name =
parameters.
get<VariableName>(
"variable");
3855 std::shared_ptr<FVInitialConditionBase> ic;
3860 "Your variable for an FVInitialCondition needs to be an a finite volume variable!");
3867 "' requested in finite volume initial condition '",
3869 "' does not exist.");
3875 TIME_SECTION(
"projectSolution", 2,
"Projecting Initial Solutions")
3892 for (
auto & nl :
_nl)
3893 nl->solution().close();
3894 _aux->solution().close();
3900 for (
auto & nl :
_nl)
3901 nl->solution().close();
3902 _aux->solution().close();
3910 for (
const auto & ic : ics)
3918 const unsigned int n_scalar_dofs = var.
dofIndices().size();
3919 for (
unsigned int i = 0; i < n_scalar_dofs; i++)
3921 const auto global_index = var.
dofIndices()[i];
3930 sys->solution().close();
3931 sys->solution().localize(*sys->system().current_local_solution, sys->dofMap().get_send_list());
3934 _aux->solution().close();
3935 _aux->solution().localize(*
_aux->sys().current_local_solution,
_aux->dofMap().get_send_list());
3942 const std::optional<std::set<VariableName>> & target_vars)
3956 for (
auto & nl :
_nl)
3957 nl->solution().close();
3958 _aux->solution().close();
3971 for (
auto & nl :
_nl)
3972 nl->solution().close();
3973 _aux->solution().close();
3981 for (
const auto & ic : ics)
3985 if (target_vars && !target_vars->count(var.
name()))
3993 const unsigned int n_scalar_dofs = var.
dofIndices().size();
3994 for (
unsigned int i = 0; i < n_scalar_dofs; i++)
3996 const auto global_index = var.
dofIndices()[i];
4003 for (
auto & nl :
_nl)
4005 nl->solution().close();
4006 nl->solution().localize(*nl->system().current_local_solution, nl->dofMap().get_send_list());
4009 _aux->solution().close();
4010 _aux->solution().localize(*
_aux->sys().current_local_solution,
_aux->dofMap().get_send_list());
4017 const std::string &,
4018 const std::string &),
4021 const std::string &,
4022 const std::string &),
4024 const std::vector<VariableName> & target_vars)
4027 "We're performing a projection based on data from just the thread 0 variable, so any "
4028 "modifications to the variable solution must have been thread joined already");
4030 std::unordered_map<unsigned int, std::vector<unsigned int>> sys_to_var_nums;
4032 for (
const auto & target_var : target_vars)
4036 sys_to_var_nums[sn].push_back(var.number());
4039 for (
const auto & [sys_num, var_nums] : sys_to_var_nums)
4042 libmesh_sys.
project_solution(func, func_grad, params, elem_range, var_nums);
4046std::shared_ptr<MaterialBase>
4055 name +=
"_neighbor";
4068 "), but its compute flag is set to true. This indicates that MOOSE is "
4069 "computing this property which may not be desired and produce un-expected "
4098 mooseError(
"FEProblemBase::getMaterialData(): Invalid MaterialDataType ",
type);
4101const std::set<const MooseObject *> &
4116 mooseError(
"FEProblemBase::getMaterialPropertyStorageConsumers(): Invalid MaterialDataType ",
4125 "ignore_zeros_in_jacobian",
4126 "We likely cannot preserve the sparsity pattern if ignoring zeros in the Jacobian, which "
4127 "leads to removing those entries from the Jacobian sparsity pattern");
4140 const std::string & name,
4143 parallel_object_only();
4145 auto add_functor_materials = [&](
const auto &
parameters,
const auto &
name)
4150 std::shared_ptr<MaterialBase> material =
4164 add_functor_materials(disp_params,
name +
"_displaced");
4170 const std::string & name,
4178 const std::string & name,
4186 const std::string & mat_name,
4187 const std::string & name,
4190 parallel_object_only();
4214#ifdef MOOSE_KOKKOS_ENABLED
4222 std::shared_ptr<MaterialBase> material =
4225 bool discrete = !material->getParam<
bool>(
"compute");
4229 if (material->boundaryRestricted() ||
dynamic_cast<FunctorMaterial *
>(material.get()))
4235 for (
auto && warehouse : warehouses)
4236 warehouse->addObject(material, tid);
4248 std::string object_name;
4257 object_name =
name +
"_face";
4258 std::shared_ptr<MaterialBase> face_material =
4264 current_parameters.
set<
bool>(
"_neighbor") =
true;
4265 object_name =
name +
"_neighbor";
4266 std::shared_ptr<MaterialBase> neighbor_material =
4275 for (
auto && warehouse : warehouses)
4276 warehouse->addObjects(material, neighbor_material, face_material, tid);
4281 const auto param_names =
4286 for (
const auto & p_name : param_names)
4289 p_name.parameter());
4291 p_name.parameter());
4293 p_name.parameter());
4295 primary_name, face_name,
false);
4297 primary_name, neighbor_name,
false);
4308 std::set<MooseVariableFEBase *> needed_moose_vars;
4309 std::unordered_set<unsigned int> needed_mat_props;
4318 for (
const auto id : ids)
4325 needed_moose_vars.insert(current_active_elemental_moose_variables.begin(),
4326 current_active_elemental_moose_variables.end());
4328 needed_mat_props.insert(consumer_needed_mat_props.begin(), consumer_needed_mat_props.end());
4339 auto && elem =
_assembly[tid][0]->elem();
4340 unsigned int n_points =
_assembly[tid][0]->qRule()->n_points();
4343 material_data.
resize(n_points);
4347 material_data.swap(*elem);
4360 const bool swap_stateful,
4361 const std::deque<MaterialBase *> *
const reinit_mats)
4367 auto && elem =
_assembly[tid][0]->elem();
4368 unsigned int side =
_assembly[tid][0]->side();
4369 unsigned int n_points =
_assembly[tid][0]->qRuleFace()->n_points();
4372 bnd_material_data.
resize(n_points);
4374 if (swap_stateful && !bnd_material_data.isSwapped())
4375 bnd_material_data.swap(*elem, side);
4378 bnd_material_data.reset(
4382 bnd_material_data.reinit(*reinit_mats);
4384 bnd_material_data.reinit(
4393 const bool swap_stateful,
4394 const std::deque<MaterialBase *> *
const reinit_mats)
4400 const auto *
const elem =
_assembly[tid][0]->elem();
4401 unsigned int side =
_assembly[tid][0]->side();
4402 unsigned int n_points =
_assembly[tid][0]->qRuleFace()->n_points();
4405 bnd_material_data.
resize(n_points);
4407 if (swap_stateful && !bnd_material_data.isSwapped())
4408 bnd_material_data.swap(*elem, side);
4411 bnd_material_data.reset(
4415 bnd_material_data.reinit(*reinit_mats);
4417 bnd_material_data.reinit(
4427 const bool swap_stateful,
4428 const std::deque<MaterialBase *> *
const reinit_mats)
4442 const bool swap_stateful,
4443 const std::deque<MaterialBase *> *
const reinit_mats)
4453 mooseAssert(neighbor,
"neighbor should be non-null");
4455 "The provided blk_id " << blk_id <<
" and neighbor subdomain ID "
4458 unsigned int n_points =
_assembly[tid][0]->qRuleNeighbor()->n_points();
4461 neighbor_material_data.
resize(n_points);
4465 neighbor_material_data.swap(*neighbor, neighbor_side);
4468 neighbor_material_data.reset(
4472 neighbor_material_data.reinit(*reinit_mats);
4474 neighbor_material_data.reinit(
4482 const bool swap_stateful,
4483 const std::deque<MaterialBase *> *
const reinit_mats)
4487 auto && elem =
_assembly[tid][0]->elem();
4488 unsigned int side =
_assembly[tid][0]->side();
4489 unsigned int n_points =
_assembly[tid][0]->qRuleFace()->n_points();
4492 bnd_material_data.
resize(n_points);
4494 if (swap_stateful && !bnd_material_data.isSwapped())
4495 bnd_material_data.swap(*elem, side);
4501 bnd_material_data.reinit(*reinit_mats);
4515 unsigned int side =
_assembly[tid][0]->side();
4516 unsigned int n_points =
_assembly[tid][0]->qRuleFace()->n_points();
4519 bnd_material_data.
resize(n_points);
4521 if (swap_stateful && !bnd_material_data.isSwapped())
4522 bnd_material_data.swap(*elem, side);
4532 auto && elem =
_assembly[tid][0]->elem();
4539 auto && elem =
_assembly[tid][0]->elem();
4540 unsigned int side =
_assembly[tid][0]->side();
4549 unsigned int neighbor_side =
4563 neighbor_side =
_assembly[tid][0]->side();
4564 mooseAssert(neighbor,
"We should have an appropriate value for elem coming from Assembly");
4575 const std::string & name,
4576 const std::string & type,
4580 _console <<
"[DBG] Adding " << system <<
" '" <<
name <<
"' of type " <<
type << std::endl;
4587 const std::string & object_name,
4588 const std::string & var_param_name)
4594 unsigned int sys_num = 0;
4603 const auto var_sys_num = sys_num;
4606 mooseError(
"We dont support setting 'variable' to a variable that is not set to the same "
4607 "system as the 'solver_sys' parameter");
4614 if (sys_num ==
_aux->number())
4630 if (sys_num ==
_aux->number())
4639 const std::string & type)
const
4644 " already exists. You may not add a ",
4646 " by the same name.");
4648#ifdef MOOSE_KOKKOS_ENABLED
4652 " already exists. You may not add a ",
4654 " by the same name.");
4660 const std::string & name,
4670 const std::string & name,
4680 const std::string & name,
4688std::vector<std::shared_ptr<UserObject>>
4690 const std::string & name,
4693 parallel_object_only();
4695 std::vector<std::shared_ptr<UserObject>> uos;
4703 std::shared_ptr<UserObject> user_object =
4706 uos.push_back(user_object);
4709 user_object->setPrimaryThreadCopy(uos[0].get());
4714 auto euo = std::dynamic_pointer_cast<ElementUserObject>(user_object);
4715 auto suo = std::dynamic_pointer_cast<SideUserObject>(user_object);
4716 auto isuo = std::dynamic_pointer_cast<InternalSideUserObject>(user_object);
4717 auto iuo = std::dynamic_pointer_cast<InterfaceUserObjectBase>(user_object);
4718 auto nuo = std::dynamic_pointer_cast<NodalUserObject>(user_object);
4719 auto duo = std::dynamic_pointer_cast<DomainUserObject>(user_object);
4720 auto guo = std::dynamic_pointer_cast<GeneralUserObject>(user_object);
4721 auto tguo = std::dynamic_pointer_cast<ThreadedGeneralUserObject>(user_object);
4722 auto muo = std::dynamic_pointer_cast<MortarUserObject>(user_object);
4735 if (euo || nuo || duo)
4737 if (suo || duo || isuo || iuo)
4739 if (iuo || duo || isuo)
4744 if ((guo && !tguo) || muo)
4753 const decltype(uos)::size_type uo_index = uos.front()->needThreadedCopy() ? tid : 0;
4767 const std::string & name,
4770 parallel_object_only();
4784 const std::string & name,
4787 parallel_object_only();
4802 std::vector<UserObject *> objs;
4806 .condition<AttribThread>(tid)
4811 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_user_object"),
4812 "A UserObject getter was called before UserObjects have been constructed. The "
4813 "requested UserObject '" +
4814 name +
"' may exist in the input file, but UserObjects are not available yet.");
4816 mooseError(
"Unable to find user object with name '" +
name +
"'");
4818 mooseAssert(objs.size() == 1,
"Should only find one UO");
4825 std::vector<Positions *> objs;
4829 .condition<AttribName>(
name)
4832 mooseError(
"Unable to find Positions object with name '" +
name +
"'");
4833 mooseAssert(objs.size() == 1,
"Should only find one Positions");
4840 std::vector<UserObject *> objs;
4844 .condition<AttribThread>(0)
4847 return !objs.empty();
4853 std::vector<FVGradientMethod *> methods;
4857 .condition<AttribThread>(tid)
4859 .queryInto(methods);
4861 if (methods.empty())
4862 mooseError(
"Unable to find FVGradientMethod with name '",
name,
"'");
4864 mooseAssert(methods.size() == 1,
"Expected a single FVGradientMethod per thread");
4865 return *(methods[0]);
4871 std::vector<FVGradientMethod *> methods;
4875 .condition<AttribThread>(0)
4877 .queryInto(methods);
4878 return !methods.empty();
4885 std::vector<FVInterpolationMethod *> methods;
4889 .condition<AttribThread>(tid)
4891 .queryInto(methods);
4893 if (methods.empty())
4895 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_interpolation_method"),
4896 "An FVInterpolationMethod getter was called before FVInterpolationMethods have "
4897 "been constructed. If you are attempting to access this object in the constructor "
4898 "of another object then make sure that the FVInterpolationMethod is constructed "
4899 "before the object using it.");
4901 mooseError(
"Unable to find FVInterpolationMethod with name '",
name,
"'");
4904 mooseAssert(methods.size() == 1,
"Expected a single FVInterpolationMethod per thread");
4905 return *(methods[0]);
4920 ") is not a scalar face interpolation method.");
4922 return *face_method;
4932 if (!advected_method)
4937 ") is not an advected interpolation method.");
4939 return *advected_method;
4945 std::vector<FVInterpolationMethod *> methods;
4949 .condition<AttribThread>(0)
4951 .queryInto(methods);
4952 return !methods.empty();
4965 std::vector<Postprocessor *> objs;
4969 .condition<AttribThread>(tid)
4974 mooseError(
"Unable to find Postprocessor with name '", object_name,
"'");
4975 mooseAssert(objs.size() == 1,
4976 "We shouldn't find more than one postprocessor object for a given name");
4982 std::size_t t_index)
const
4991 std::size_t t_index)
5000 mooseDeprecated(
"FEProblemBase::hasPostprocssor is being removed; use "
5001 "hasPostprocessorValueByName instead.");
5007 const std::string & vector_name,
5008 std::size_t t_index)
const
5016 const std::string & vector_name,
5018 std::size_t t_index)
5028 std::vector<VectorPostprocessor *> objs;
5032 .condition<AttribThread>(tid)
5039 getMooseApp().actionWarehouse().isTaskComplete(
"add_vector_postprocessor"),
5040 "A VectorPostprocessor getter was called before VectorPostprocessors have been "
5041 "constructed. The requested VectorPostprocessor '" +
5043 "' may exist in the input file, but VectorPostprocessors are not available yet.");
5045 mooseError(
"Unable to find VectorPostprocessor with name '", object_name,
"'");
5047 mooseAssert(objs.size() == 1,
5048 "We shouldn't find more than one vector postprocessor object for a given name");
5057 const auto & objects = it.second.getActiveObjects();
5058 for (
const auto & obj : objects)
5059 obj->parentOutputPositionChanged();
5076 TIME_SECTION(
"computeIndicators", 1,
"Computing Indicators");
5080 const auto old_do_derivatives = ADReal::do_derivatives;
5081 ADReal::do_derivatives =
false;
5083 std::vector<std::string>
fields;
5087 for (
const auto & indicator : indicators)
5088 fields.push_back(indicator->name());
5092 for (
const auto & internal_indicator : internal_indicators)
5093 fields.push_back(internal_indicator->name());
5100 _aux->solution().close();
5105 _aux->solution().close();
5108 ADReal::do_derivatives = old_do_derivatives;
5117 TIME_SECTION(
"computeMarkers", 1,
"Computing Markers");
5119 std::vector<std::string>
fields;
5123 for (
const auto & marker : markers)
5124 fields.push_back(marker->name());
5133 for (
const auto & marker : markers)
5134 marker->markerSetup();
5140 _aux->solution().close();
5177#ifdef MOOSE_KOKKOS_ENABLED
5181 _aux->customSetup(exec_type);
5182 for (
auto & nl :
_nl)
5183 nl->customSetup(exec_type);
5195 std::vector<UserObject *> userobjs;
5197 for (
auto obj : userobjs)
5198 obj->customSetup(exec_type);
5200#ifdef MOOSE_KOKKOS_ENABLED
5202 std::vector<UserObjectBase *> userobjs;
5204 for (
auto obj : userobjs)
5205 obj->customSetup(exec_type);
5253 std::unique_ptr<NumericVector<Number>> x =
_aux->currentSolution()->clone();
5261 const Real check_tol = 1e-8;
5263 const Real xnorm = x->l2_norm();
5264 *x -= *
_aux->currentSolution();
5265 if (x->l2_norm() > check_tol * xnorm)
5267 const auto & sys =
_aux->system();
5268 const unsigned int n_vars = sys.n_vars();
5269 std::multimap<Real, std::string, std::greater<Real>> ordered_map;
5273 ordered_map.emplace(vnorm, sys.variable_name(i));
5276 std::ostringstream oss;
5277 for (
const auto & [error_norm, var_name] : ordered_map)
5278 oss <<
" {" << var_name <<
", " << error_norm <<
"},\n";
5280 mooseError(
"Aux kernels, user objects appear to have states for aux variables on ",
5282 ".\nVariable error norms in descending order:\n",
5287 if (pp_values.
size() != new_pp_values.
size())
5288 mooseError(
"Second execution for uo/aux state check should not change the number of "
5289 "real reporter values");
5292 pp_values -= new_pp_values;
5293 if (pp_values.
l2_norm() > check_tol * ppnorm)
5296 std::multimap<Real, std::string, std::greater<Real>> ordered_map;
5298 ordered_map.emplace(std::abs(pp_values(i)), pp_names[i]);
5300 std::ostringstream oss;
5301 for (
const auto & [error_norm, pp_name] : ordered_map)
5302 oss <<
" {" << pp_name <<
", " << error_norm <<
"},\n";
5304 mooseError(
"Aux kernels, user objects appear to have states for real reporter values on ",
5306 ".\nErrors of real reporter values in descending order:\n",
5316 std::vector<UserObject *> objs;
5317 query.queryInto(objs);
5322 for (
auto obj : objs)
5323 if (obj->primaryThreadCopy())
5324 obj->primaryThreadCopy()->threadJoin(*obj);
5330 for (
auto obj : objs)
5338 _console <<
"[DBG] Initializing, executing & finalizing general UO '" << obj->name()
5363 auto reporter =
dynamic_cast<Reporter *
>(obj);
5389 std::set<int> & execution_groups)
const
5391 std::vector<UserObjectBase *> uos;
5392 query.queryIntoUnsorted(uos);
5393 for (
const auto & uo : uos)
5394 execution_groups.insert(uo->getParam<
int>(
"execution_order_group"));
5400 const std::string & name)
5405 std::set<int> execution_groups;
5407#ifdef MOOSE_KOKKOS_ENABLED
5416 for (
const auto execution_group : execution_groups)
5418#ifdef MOOSE_KOKKOS_ENABLED
5433 std::set<int> execution_groups;
5435#ifdef MOOSE_KOKKOS_ENABLED
5443 for (
const auto execution_group : execution_groups)
5445#ifdef MOOSE_KOKKOS_ENABLED
5460 TIME_SECTION(
"computeUserObjects", 1,
"Computing User Objects");
5462 std::vector<GeneralUserObject *> genobjs;
5465 std::vector<UserObject *> userobjs;
5470 .queryInto(userobjs);
5472 std::vector<UserObject *> tgobjs;
5477 std::vector<UserObject *> nodal;
5480 std::vector<MortarUserObject *> mortar;
5483 if (userobjs.empty() && genobjs.empty() && tgobjs.empty() && nodal.empty() && mortar.empty())
5492 for (
auto obj : userobjs)
5493 obj->residualSetup();
5494 for (
auto obj : nodal)
5495 obj->residualSetup();
5496 for (
auto obj : mortar)
5497 obj->residualSetup();
5498 for (
auto obj : tgobjs)
5499 obj->residualSetup();
5500 for (
auto obj : genobjs)
5501 obj->residualSetup();
5505 for (
auto obj : userobjs)
5506 obj->jacobianSetup();
5507 for (
auto obj : nodal)
5508 obj->jacobianSetup();
5509 for (
auto obj : mortar)
5510 obj->jacobianSetup();
5511 for (
auto obj : tgobjs)
5512 obj->jacobianSetup();
5513 for (
auto obj : genobjs)
5514 obj->jacobianSetup();
5517 for (
auto obj : userobjs)
5521 if (!userobjs.empty())
5540 for (
const auto & uo : userobjs)
5544 _aux->solution().close();
5545 _aux->system().update();
5553 for (
auto obj : nodal)
5563 for (
const auto & uo : nodal)
5567 _aux->solution().close();
5568 _aux->system().update();
5574 for (
auto obj : mortar)
5576 if (!mortar.empty())
5578 auto create_and_run_mortar_functors = [
this,
type, &mortar](
const bool displaced)
5582 for (
const auto & [primary_secondary_boundary_pair, interface_config] : mortar_interfaces)
5584 auto mortar_uos_to_execute =
5586 primary_secondary_boundary_pair.second,
5590 auto *
const subproblem = displaced ? cast_ptr<SubProblem *>(
_displaced_problem.get())
5591 : cast_ptr<SubProblem *>(
this);
5593 *interface_config.amg,
5597 subproblem->assembly(0, 0));
5603 create_and_run_mortar_functors(
false);
5605 create_and_run_mortar_functors(
true);
5607 for (
auto obj : mortar)
5612 for (
auto obj : tgobjs)
5614 std::vector<GeneralUserObject *> tguos_zero;
5618 .queryInto(tguos_zero);
5619 for (
auto obj : tguos_zero)
5621 std::vector<GeneralUserObject *> tguos;
5622 auto q =
query.clone()
5651 TIME_SECTION(
"executeControls", 1,
"Executing Controls");
5657 for (
const auto & it : controls_wh.getActiveObjects())
5662 std::vector<std::string> & dependent_controls = it->getDependencies();
5663 for (
const auto & depend_name : dependent_controls)
5665 if (controls_wh.hasActiveObject(depend_name))
5667 auto dep_control = controls_wh.getActiveObject(depend_name);
5668 resolver.
addEdge(dep_control, it);
5673 "\" was not created, did you make a "
5674 "spelling mistake or forget to include it "
5675 "in your input file?");
5681 if (!ordered_controls.empty())
5688 for (
const auto & control : ordered_controls)
5701 std::vector<Sampler *> objects;
5705 .condition<AttribThread>(tid)
5707 .queryInto(objects);
5709 if (!objects.empty())
5711 TIME_SECTION(
"executeSamplers", 1,
"Executing Samplers");
5712 FEProblemBase::objectSetupHelper<Sampler>(objects, exec_type);
5713 FEProblemBase::objectExecuteHelper<Sampler>(objects);
5721 TIME_SECTION(
"updateActiveObjects", 5,
"Updating Active Objects");
5725 for (
auto & nl :
_nl)
5726 nl->updateActive(tid);
5727 _aux->updateActive(tid);
5744#ifdef MOOSE_KOKKOS_ENABLED
5758 TIME_SECTION(
"reinitBecauseOfGhostingOrNewGeomObjects",
5760 "Reinitializing Because of Geometric Search Objects");
5769 (
_mortar_data->hasDisplacedObjects() && mortar_changed)));
5784 const std::string & name,
5787 parallel_object_only();
5789 const auto nl_sys_num =
5795 mooseError(
"You are trying to add a DGKernel to a linear variable/system, which is not "
5796 "supported at the moment!");
5809 for (
auto & nl :
_nl)
5815 const std::string & name,
5818 parallel_object_only();
5844 std::shared_ptr<Indicator> indicator =
5847 std::shared_ptr<InternalSideIndicatorBase> isi =
5848 std::dynamic_pointer_cast<InternalSideIndicatorBase>(indicator);
5858 const std::string & name,
5861 parallel_object_only();
5895 const std::string & name,
5898 parallel_object_only();
5926 multi_app->setupPositions();
5931 std::shared_ptr<TransientMultiApp> trans_multi_app =
5932 std::dynamic_pointer_cast<TransientMultiApp>(multi_app);
5933 if (trans_multi_app)
5949std::shared_ptr<MultiApp>
5953 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_multi_app"),
5954 "A MultiApp getter was called before MultiApps have been constructed. "
5955 "If you are attempting to access this object in the constructor of another object "
5956 "then make sure that the MultiApp is constructed before the object using it.");
5964 const MultiAppName & source_app)
5967 bool is_executing_a_transfer =
false;
5972 std::string string_direction;
5973 std::string additional_source_info =
"";
5975 string_direction =
" To ";
5976 else if (from_multiapp)
5977 string_direction =
" From ";
5979 string_direction =
" Between ";
5980 if (!source_app.empty())
5981 additional_source_info =
" from app '" + source_app +
"'";
5984 auto executeThisTransfer = [
this, &direction, &source_app, &
type](
auto & transfer)
5986 mooseAssert(transfer->getExecuteOnEnum().contains(
type),
"Should execute on this schedule");
5992 if (transfer->getFromName() == source_app && transfer->executeAfterSiblingSourceApp())
5995 mooseAssert(this->
getMultiApp(transfer->getFromName())->getExecuteOnEnum().contains(
type),
5996 "from_multiapp should also execute on this schedule");
6002 if ((source_app.empty() && (!transfer->executeAfterSiblingSourceApp() ||
6003 !transfer->getFromMultiApp()->getExecuteOnEnum().contains(
type))) ||
6004 (transfer->getFromName() == source_app && transfer->executeAfterSiblingSourceApp()))
6015 TIME_SECTION(
"execMultiAppTransfers", 1,
"Executing Transfers");
6022 {
"Name",
"Type",
"From",
"To"});
6025 for (
const auto & transfer : transfers)
6030 if (!executeThisTransfer(multiapp_transfer))
6033 is_executing_a_transfer =
true;
6034 table.addRow(multiapp_transfer->name(),
6035 multiapp_transfer->type(),
6036 multiapp_transfer->getFromName(),
6037 multiapp_transfer->getToName());
6041 if (is_executing_a_transfer)
6044 <<
"MultiApps" << additional_source_info << COLOR_DEFAULT <<
":" << std::endl;
6050 for (
const auto & transfer : transfers)
6052 auto multiapp_transfer = libMesh::cast_ptr<MultiAppTransfer *>(transfer.get());
6053 if (!executeThisTransfer(multiapp_transfer))
6056 transfer->setCurrentDirection(direction);
6057 transfer->execute();
6064 << COLOR_DEFAULT << std::endl;
6070 << COLOR_DEFAULT << std::endl;
6073std::vector<std::shared_ptr<Transfer>>
6084std::vector<std::shared_ptr<Transfer>>
6110 const std::vector<MooseSharedPointer<MultiApp>> & multi_apps =
6114 for (
const auto & multi_app : multi_apps)
6115 multi_app->preTransfer(
_dt,
_time);
6128 std::map<unsigned int, std::vector<MooseSharedPointer<MultiApp>>> ordered_multi_apps;
6130 for (
const auto & multi_app : multi_apps)
6131 ordered_multi_apps[multi_app->getParam<
unsigned int>(
"execution_order_group")].push_back(
6135 if (multi_apps.size())
6137 TIME_SECTION(
"execMultiApps", 1,
"Executing MultiApps",
false);
6141 << COLOR_DEFAULT << std::endl;
6143 bool success =
true;
6145 for (
const auto & [group, multi_app_group] : ordered_multi_apps)
6148 _console << COLOR_CYAN <<
"\nExecuting MultiApps from group " << group << COLOR_DEFAULT
6151 for (
const auto & multi_app : multi_app_group)
6153 success = multi_app->solveStep(
_dt,
_time, auto_advance);
6160 for (
const auto & multi_app : multi_app_group)
6173 << COLOR_DEFAULT << std::endl;
6188 for (
const auto & multi_app : multi_apps)
6189 multi_app->finalize();
6197 for (
const auto & multi_app : multi_apps)
6198 multi_app->postExecute();
6206 if (multi_apps.size())
6207 for (
const auto & multi_app : multi_apps)
6208 multi_app->incrementTStep(
_time);
6216 if (multi_apps.size())
6219 _console << COLOR_CYAN <<
"\nAdvancing MultiApps on " <<
type.name() << COLOR_DEFAULT
6222 for (
const auto & multi_app : multi_apps)
6223 multi_app->finishStep(recurse_through_multiapp_levels);
6228 _console << COLOR_CYAN <<
"Finished Advancing MultiApps on " <<
type.name() <<
"\n"
6229 << COLOR_DEFAULT << std::endl;
6238 if (multi_apps.size())
6240 TIME_SECTION(
"backupMultiApps", 5,
"Backing Up MultiApp");
6243 _console << COLOR_CYAN <<
"\nBacking Up MultiApps on " <<
type.name() << COLOR_DEFAULT
6246 for (
const auto & multi_app : multi_apps)
6247 multi_app->backup();
6252 _console << COLOR_CYAN <<
"Finished Backing Up MultiApps on " <<
type.name() <<
"\n"
6253 << COLOR_DEFAULT << std::endl;
6262 if (multi_apps.size())
6267 _console << COLOR_CYAN <<
"\nRestoring Multiapps on " <<
type.name()
6268 <<
" because of solve failure!" << COLOR_DEFAULT << std::endl;
6270 _console << COLOR_CYAN <<
"\nRestoring MultiApps on " <<
type.name() << COLOR_DEFAULT
6274 for (
const auto & multi_app : multi_apps)
6275 multi_app->restore(force);
6280 _console << COLOR_CYAN <<
"Finished Restoring MultiApps on " <<
type.name() <<
"\n"
6281 << COLOR_DEFAULT << std::endl;
6290 Real smallest_dt = std::numeric_limits<Real>::max();
6292 for (
const auto & multi_app : multi_apps)
6293 smallest_dt = std::min(smallest_dt, multi_app->computeDT());
6300 const std::string & name,
6303 parallel_object_only();
6334 std::shared_ptr<MultiApp> multiapp;
6347 exec_enum = multiapp->getParam<
ExecFlagEnum>(
"execute_on");
6355 std::shared_ptr<MultiAppTransfer> multi_app_transfer =
6356 std::dynamic_pointer_cast<MultiAppTransfer>(transfer);
6357 if (multi_app_transfer)
6374 if (sys->hasVariable(var_name))
6376 if (
_aux->hasVariable(var_name))
6386 if (sys->hasVariable(var_name))
6394 const std::string & var_name,
6406 if (sys->hasVariable(var_name))
6407 return sys->getFieldVariable<
Real>(tid, var_name);
6408 if (
_aux->hasVariable(var_name))
6409 return _aux->getFieldVariable<
Real>(tid, var_name);
6418 if (sys->hasVariable(var_name))
6419 return sys->getActualFieldVariable<
Real>(tid, var_name);
6420 if (
_aux->hasVariable(var_name))
6421 return _aux->getActualFieldVariable<
Real>(tid, var_name);
6430 if (sys->hasVariable(var_name))
6432 if (
_aux->hasVariable(var_name))
6442 if (sys->hasVariable(var_name))
6444 if (
_aux->hasVariable(var_name))
6454 if (sys->hasScalarVariable(var_name))
6456 if (
_aux->hasScalarVariable(var_name))
6466 if (sys->hasScalarVariable(var_name))
6467 return sys->getScalarVariable(tid, var_name);
6468 if (
_aux->hasScalarVariable(var_name))
6469 return _aux->getScalarVariable(tid, var_name);
6480 else if (
_aux->hasVariable(var_name) ||
_aux->hasScalarVariable(var_name))
6481 return _aux->system();
6483 mooseError(
"Unable to find a system containing the variable " + var_name);
6591 mat->setActiveProperties(mat_prop_ids);
6593 mat->setActiveProperties(mat_prop_ids);
6595 mat->setActiveProperties(mat_prop_ids);
6615#ifdef LIBMESH_ENABLE_AMR
6625 const std::string & redistributer_name,
6626 const bool use_displaced_mesh)
6630 redistribute_params.
set<std::string>(
"for_whom") = this->
name();
6634 redistribute_params.
set<
bool>(
"use_displaced_mesh") = use_displaced_mesh;
6637 std::shared_ptr<RedistributeProperties> redistributer =
6639 "RedistributeProperties", redistributer_name, redistribute_params);
6653 add_redistributer(
_mesh,
"mesh_property_redistributer",
false);
6655 add_redistributer(
_displaced_problem->mesh(),
"displaced_mesh_property_redistributer",
true);
6677 mooseError(
"Max quadrature points per element assumptions made in some code (e.g. Coupleable ",
6678 "and MaterialPropertyInterface classes) have been violated.\n",
6679 "Complain to Moose developers to have constMaxQpsPerElem increased from ",
6687 _zero[tid].resize(max_qpts, 0);
6730 const bool allow_negative_qweights)
6739 if (order < _aux->getMinQuadratureOrder())
6740 order =
_aux->getMinQuadratureOrder();
6744 volume_order = order;
6752 type, order, volume_order, face_order, block, allow_negative_qweights);
6756 type, order, volume_order, face_order, block, allow_negative_qweights);
6767 mooseError(
"Someone told us (the FEProblemBase) to trust the user coupling matrix, but we "
6768 "haven't been provided a coupling matrix!");
6789 _cm[i] = std::move(cm);
6796 mooseError(
"Someone told us (the FEProblemBase) to trust the user coupling matrix, but we "
6797 "haven't been provided a coupling matrix!");
6805 TIME_SECTION(
"setNonlocalCouplingMatrix", 5,
"Setting Nonlocal Coupling Matrix");
6808 mooseError(
"Nonlocal kernels are weirdly stored on the FEProblem so we don't currently support "
6809 "multiple nonlinear systems with nonlocal kernels.");
6813 auto & nl =
_nl[nl_sys_num];
6815 unsigned int n_vars = nl->nVariables();
6816 nonlocal_cm.resize(
n_vars);
6817 const auto &
vars = nl->getVariables(0);
6820 for (
const auto & ivar :
vars)
6822 for (
const auto & kernel : nonlocal_kernel)
6824 for (
unsigned int i = ivar->number(); i < ivar->number() + ivar->count(); ++i)
6825 if (i == kernel->variable().number())
6826 for (
const auto & jvar :
vars)
6831 unsigned int j = jvar->number();
6832 nonlocal_cm(i, j) = 1;
6836 for (
const auto & integrated_bc : nonlocal_integrated_bc)
6838 for (
unsigned int i = ivar->number(); i < ivar->number() + ivar->count(); ++i)
6839 if (i == integrated_bc->variable().number())
6840 for (
const auto & jvar :
vars)
6845 unsigned int j = jvar->number();
6846 nonlocal_cm(i, j) = 1;
6856 const unsigned int jvar,
6857 const unsigned int nl_sys)
const
6859 return (*
_cm[nl_sys])(ivar, jvar);
6862std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
6865 return _assembly[tid][nl_sys]->couplingEntries();
6868std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
6871 return _assembly[tid][nl_sys]->nonlocalCouplingEntries();
6880 TIME_SECTION(
"init", 2,
"Initializing");
6896 unsigned int n_vars = nl->nVariables();
6898 TIME_SECTION(
"fillCouplingMatrix", 3,
"Filling Coupling Matrix");
6903 cm = std::make_unique<CouplingMatrix>(
n_vars);
6904 for (
unsigned int i = 0; i <
n_vars; i++)
6910 cm = std::make_unique<CouplingMatrix>(
n_vars);
6911 for (
unsigned int i = 0; i <
n_vars; i++)
6912 for (
unsigned int j = 0; j <
n_vars; j++)
6922 nl->dofMap()._dof_coupling = cm.get();
6928 nl->dofMap()._dof_coupling =
nullptr;
6930 nl->dofMap().attach_extra_sparsity_function(&
extraSparsity, nl.get());
6931 nl->dofMap().attach_extra_send_list_function(&
extraSendList, nl.get());
6935 mooseError(
"No variables specified in nonlinear system '", nl->name(),
"'.");
6957 for (
auto & nl :
_nl)
6959 nl->turnOffJacobian();
6977 TIME_SECTION(
"EquationSystems::Init", 2,
"Initializing Equation Systems");
6999 "Coupling matrix not set for system "
7001 <<
". This should only happen if a preconditioner was not setup for this system");
7008#ifdef MOOSE_KOKKOS_ENABLED
7019 std::istringstream ss(nl_sys_name);
7020 unsigned int nl_sys_num;
7021 if (!(ss >> nl_sys_num) || !ss.eof())
7030 std::istringstream ss(linear_sys_name);
7031 unsigned int linear_sys_num;
7032 if (!(ss >> linear_sys_num) || !ss.eof())
7035 return linear_sys_num;
7041 std::istringstream ss(solver_sys_name);
7042 unsigned int solver_sys_num;
7043 if (!(ss >> solver_sys_num) || !ss.eof())
7047 mooseError(
"The solver system number was requested for system '" + solver_sys_name,
7048 "' but this system does not exist in the Problem. Systems can be added to the "
7049 "problem using the 'nl_sys_names'/'linear_sys_names' parameter.\nSystems in the "
7052 solver_sys_num = search->second;
7055 return solver_sys_num;
7062 if (solver_sys->hasVariable(variable_name))
7063 return solver_sys->number();
7064 mooseAssert(
_aux,
"Should have an auxiliary system");
7065 if (
_aux->hasVariable(variable_name))
7066 return _aux->number();
7070 "' was not found in any solver (nonlinear/linear) or auxiliary system");
7076 TIME_SECTION(
"solve", 1,
"Solving",
false);
7090#if PETSC_RELEASE_LESS_THAN(3, 12, 0)
7129#if !PETSC_RELEASE_LESS_THAN(3, 12, 0)
7131 LibmeshPetscCall(PetscOptionsPop());
7148 TIME_SECTION(
"checkExceptionAndStopSolve", 5);
7169 <<
"To recover, the solution will fail and then be re-attempted with a reduced time "
7184 _aux->solution().close();
7198 mooseError(
"The following parallel-communicated exception was detected during " +
7201 "\nBecause this did not occur during residual evaluation, there"
7202 " is no way to handle this, so the solution is aborting.\n");
7210 ADReal::do_derivatives =
true;
7235 TIME_SECTION(
"solve", 1,
"Solving",
false);
7245#if PETSC_RELEASE_LESS_THAN(3, 12, 0)
7247 options, solver_params));
7265#if !PETSC_RELEASE_LESS_THAN(3, 12, 0)
7267 LibmeshPetscCall(PetscOptionsPop());
7283 return _nl[nl_sys_num]->nNonlinearIterations();
7289 return _nl[nl_sys_num]->nLinearIterations();
7295 return _nl[nl_sys_num]->finalNonlinearResidual();
7301 return _nl[nl_sys_num]->computingPreSMOResidual();
7307 TIME_SECTION(
"copySolutionsBackwards", 3,
"Copying Solutions Backward");
7310 sys->copySolutionsBackwards();
7311 _aux->copySolutionsBackwards();
7318 sys->skipNextSolutionToOldCopy();
7319 _aux->skipNextSolutionToOldCopy();
7325 TIME_SECTION(
"advanceState", 5,
"Advancing State");
7328 sys->copyOldSolutions();
7329 _aux->copyOldSolutions();
7351#ifdef MOOSE_KOKKOS_ENABLED
7366 TIME_SECTION(
"restoreSolutions", 5,
"Restoring Solutions");
7370 "There is currently no way to restore not-zeroed vectors.");
7375 _console <<
"Restoring solutions on system " << sys->name() <<
"..." << std::endl;
7376 sys->restoreSolutions();
7380 _console <<
"Restoring solutions on Auxiliary system..." << std::endl;
7381 _aux->restoreSolutions();
7384 _console <<
"Restoring postprocessor, vector-postprocessor, and reporter data..." << std::endl;
7394 TIME_SECTION(
"saveOldSolutions", 5,
"Saving Old Solutions");
7397 sys->saveOldSolutions();
7398 _aux->saveOldSolutions();
7404 TIME_SECTION(
"restoreOldSolutions", 5,
"Restoring Old Solutions");
7407 sys->restoreOldSolutions();
7408 _aux->restoreOldSolutions();
7414 TIME_SECTION(
"outputStep", 1,
"Outputting");
7451 TIME_SECTION(
"onTimestepBegin", 2);
7453 for (
auto & nl :
_nl)
7454 nl->onTimestepBegin();
7470 switch (state.
state)
7479 mooseError(
"Unhandled state ", state.
state,
" in FEProblemBase::getTimeFromStateArg");
7485 const std::string & name,
7488 parallel_object_only();
7500 _aux->addDotVectors();
7501 for (
auto & nl :
_nl)
7503 nl->addDotVectors();
7505 auto tag_udot = nl->getTimeIntegrators()[0]->uDotFactorTag();
7506 if (!nl->hasVector(tag_udot))
7507 nl->associateVectorToTag(*nl->solutionUDot(), tag_udot);
7508 auto tag_udotdot = nl->getTimeIntegrators()[0]->uDotDotFactorTag();
7510 nl->associateVectorToTag(*nl->solutionUDotDot(), tag_udotdot);
7520 const std::string & name,
7523 parallel_object_only();
7526 mooseError(
"Vector bounds cannot be used with LinearSystems!");
7532 for (
auto & nl :
_nl)
7533 nl->setPredictor(predictor);
7557 residual->scale(-1.0);
7559 return residual->l2_norm();
7565 TIME_SECTION(
"computeResidualL2Norm", 2,
"Computing L2 Norm of Residual");
7569 for (
auto sys :
_nl)
7572 l2_norm += norm * norm;
7578 l2_norm += norm * norm;
7581 return std::sqrt(l2_norm);
7589 parallel_object_only();
7591 TIME_SECTION(
"computeResidualSys", 5);
7611 const unsigned int nl_sys_num)
7620 mooseAssert(
_fe_vector_tags.empty(),
"This should be empty indicating a clean starting state");
7643 "This should be empty indicating a clean starting state");
7655 for (
auto & tag : tags)
7673 for (
auto index :
make_range(matrix.row_start(), matrix.row_stop()))
7674 matrix.add(index, index, 0);
7677 _aux->zeroVariablesForResidual();
7699 for (
unsigned int tid = 0; tid <
n_threads; tid++)
7704 _aux->residualSetup();
7720#ifdef MOOSE_KOKKOS_ENABLED
7785 mooseError(
"An unhandled MooseException was raised during residual computation. Please "
7786 "contact the MOOSE team for assistance.");
7793 const std::set<TagID> & tags)
7795 parallel_object_only();
7797 TIME_SECTION(
"computeResidualInternal", 1);
7818 mooseError(
"An unhandled MooseException was raised during residual computation. Please "
7819 "contact the MOOSE team for assistance.");
7828 TIME_SECTION(
"computeResidualType", 5);
7849 mooseError(
"An unhandled MooseException was raised during residual computation. Please "
7850 "contact the MOOSE team for assistance.");
7857 auto create_exception_message =
7858 [&calling_method](
const std::string & exception_type,
const auto & exception)
7860 return std::string(
"A " + exception_type +
" was raised during FEProblemBase::" +
7861 calling_method +
"\n" + std::string(exception.what()));
7870 setException(create_exception_message(
"MooseException", e));
7872 catch (
const MetaPhysicL::LogicError & e)
7888 mooseError(create_exception_message(
"libMesh::PetscSolverException", e));
7890 catch (
const std::exception & e)
7893 if (strstr(e.
what(),
"Jacobian") || strstr(e.
what(),
"singular") ||
7894 strstr(e.
what(),
"det != 0"))
7895 setException(create_exception_message(
"libMesh DegenerateMap", e));
7898 const auto message = create_exception_message(
"std::exception", e);
7912 parallel_object_only();
7918 TIME_SECTION(
"computeResidualTags", 5,
"Computing Residual");
7920 ADReal::do_derivatives =
false;
7924 _aux->zeroVariablesForResidual();
7936 for (
unsigned int tid = 0; tid <
n_threads; tid++)
7941 _aux->residualSetup();
7957#ifdef MOOSE_KOKKOS_ENABLED
8018 const unsigned int nl_sys_num)
8025 for (
auto & tag : tags)
8034 const std::set<TagID> & tags)
8036 TIME_SECTION(
"computeJacobianInternal", 1);
8056 TIME_SECTION(
"computeJacobianTags", 5,
"Computing Jacobian");
8058 for (
auto tag : tags)
8070 for (
auto index :
make_range(matrix.row_start(), matrix.row_stop()))
8071 matrix.add(index, index, 0);
8074 _aux->zeroVariablesForJacobian();
8089 for (
unsigned int tid = 0; tid <
n_threads; tid++)
8094 _aux->jacobianSetup();
8109 for (
unsigned int tid = 0; tid <
n_threads; tid++)
8115#ifdef MOOSE_KOKKOS_ENABLED
8160 const unsigned int nl_sys_num)
8162 TIME_SECTION(
"computeTransientImplicitJacobian", 2);
8184 JacobianBlock jac_block(precond_system, jacobian, ivar, jvar);
8185 std::vector<JacobianBlock *>
blocks = {&jac_block};
8200 "I expect these system numbers to be the same");
8205 TIME_SECTION(
"computeBounds", 1,
"Computing Bounds");
8214 _aux->residualSetup();
8238 const bool compute_gradients)
8240 TIME_SECTION(
"computeLinearSystemSys", 5);
8273 const std::set<TagID> & vector_tags,
8274 const std::set<TagID> & matrix_tags,
8275 const bool compute_gradients)
8277 TIME_SECTION(
"computeLinearSystemTags", 5,
"Computing Linear System");
8281 for (
auto tag : matrix_tags)
8299 _aux->jacobianSetup();
8306#ifdef MOOSE_KOKKOS_ENABLED
8316 _console <<
"\nA MooseException was raised during Auxiliary variable computation.\n"
8317 <<
"The next solve will fail, the timestep will be reduced, and we will try again.\n"
8347 "I expect these system numbers to be the same");
8350 for (
unsigned int i = 0; i <
subspaceDim(
"NearNullSpace"); ++i)
8352 std::stringstream postfix;
8353 postfix <<
"_" << i;
8354 std::string modename =
"NearNullSpace" + postfix.str();
8364 "I expect these system numbers to be the same");
8366 for (
unsigned int i = 0; i <
subspaceDim(
"NullSpace"); ++i)
8368 std::stringstream postfix;
8369 postfix <<
"_" << i;
8379 "I expect these system numbers to be the same");
8381 for (
unsigned int i = 0; i <
subspaceDim(
"TransposeNullSpace"); ++i)
8383 std::stringstream postfix;
8384 postfix <<
"_" << i;
8394 bool & changed_search_direction,
8395 bool & changed_new_soln)
8398 "I expect these system numbers to be the same");
8409 TIME_SECTION(
"computePostCheck", 2,
"Computing Post Check");
8424 std::unique_ptr<NumericVector<Number>> ghosted_solution =
8426 ghosted_search_direction =
8430 *ghosted_solution = new_soln;
8431 *ghosted_search_direction = search_direction;
8442 new_soln = old_soln;
8443 new_soln.
add(-damping, search_direction);
8444 changed_new_soln =
true;
8451 if (changed_new_soln)
8452 *ghosted_solution = new_soln;
8454 bool updated_solution =
updateSolution(new_soln, *ghosted_solution);
8455 if (updated_solution)
8456 changed_new_soln =
true;
8463 _aux->copyCurrentIntoPreviousNL();
8467 changed_search_direction =
false;
8481 TIME_SECTION(
"computeDamping", 1,
"Computing Damping");
8522 parallel_object_only();
8531 TIME_SECTION(
"updateGeometricSearch", 3,
"Updating Geometric Search");
8542 TIME_SECTION(
"updateMortarMesh", 5,
"Updating Mortar Mesh");
8551 const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
8552 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
8556 const bool correct_edge_dropping,
8557 const Real minimum_projection_angle,
8558 const Mortar3DSubpatchPlane mortar_3d_subpatch_plane,
8560 const bool triangulate_triangles,
8561 const Mortar3DQuadraturePointMapping mortar_3d_qp_mapping)
8566 return _mortar_data->createMortarInterface(primary_secondary_boundary_pair,
8567 primary_secondary_subdomain_pair,
8572 correct_edge_dropping,
8573 minimum_projection_angle,
8574 mortar_3d_subpatch_plane,
8576 triangulate_triangles,
8577 mortar_3d_qp_mapping);
8579 return _mortar_data->createMortarInterface(primary_secondary_boundary_pair,
8580 primary_secondary_subdomain_pair,
8585 correct_edge_dropping,
8586 minimum_projection_angle,
8587 mortar_3d_subpatch_plane,
8589 triangulate_triangles,
8590 mortar_3d_qp_mapping);
8595 const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
8596 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
8597 bool on_displaced)
const
8600 primary_secondary_boundary_pair, primary_secondary_subdomain_pair, on_displaced);
8605 const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
8606 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
8610 primary_secondary_boundary_pair, primary_secondary_subdomain_pair, on_displaced);
8618 TIME_SECTION(
"possiblyRebuildGeomSearchPatches", 5,
"Rebuilding Geometric Search Patches");
8652 libmesh_fallthrough();
8658 _console <<
"\n\nUpdating geometric search patches\n" << std::endl;
8674#ifdef LIBMESH_ENABLE_AMR
8683 mooseError(
"HFEM does not support mesh adaptivity currently.");
8685 TIME_SECTION(
"initialAdaptMesh", 2,
"Performing Initial Adaptivity");
8687 for (
unsigned int i = 0; i < n; i++)
8704 _console <<
"Mesh unchanged, skipping remaining steps..." << std::endl;
8720 TIME_SECTION(
"adaptMesh", 3,
"Adapting Mesh");
8724 bool mesh_changed =
false;
8726 for (
unsigned int i = 0; i < cycles_per_step; ++i)
8729 mooseError(
"HFEM does not support mesh adaptivity currently.");
8735 bool mesh_changed_this_step;
8738 if (mesh_changed_this_step)
8740 mesh_changed =
true;
8753 _console <<
"Mesh unchanged, skipping remaining steps..." << std::endl;
8769 return mesh_changed;
8785 data[tid] = &storage.getMaterialData(tid);
8792 for (
unsigned int i = 0; i <
n_threads; ++i)
8804 TIME_SECTION(
"updateMeshXFEM", 5,
"Updating XFEM");
8806 bool updated =
false;
8809 if (
_xfem->updateHeal())
8814 false,
true,
false);
8820 false,
true,
false);
8823 _console <<
"\nXFEM update complete: Mesh modified" << std::endl;
8826 _console <<
"\nXFEM update complete: Mesh not modified" << std::endl;
8833 const bool contract_mesh,
8834 const bool clean_refinement_flags)
8836 TIME_SECTION(
"meshChanged", 3,
"Handling Mesh Changes");
8856 if (intermediate_change)
8864 if (clean_refinement_flags)
8872 if (!intermediate_change)
8922 for (
auto & nl_sys :
_nl)
8923 nl_sys->reinitMortarFunctors();
8948 for (
const auto & elem : range)
8965 for (
const auto & elem : range)
8968 for (
auto && child : coarsened_children)
9004 mdi->meshDisplaced();
9015 cmt(elem_range,
true);
9017#ifdef MOOSE_KOKKOS_ENABLED
9026 TIME_SECTION(
"checkProblemIntegrity", 5);
9029 const auto & subdomain_names = getParam<std::vector<SubdomainName>>(
"block");
9031 std::set<SubdomainID> mesh_subdomains(mesh_subdomains_vec.begin(), mesh_subdomains_vec.end());
9037 std::set<SubdomainID>
blocks;
9040 blocks = mesh_subdomains;
9043 blocks = mesh_subdomains;
9051 "\" not found in mesh.");
9063 "\" not found in mesh.");
9067 for (
auto & nl :
_nl)
9068 nl->checkKernelCoverage(
blocks);
9073#ifdef LIBMESH_ENABLE_AMR
9078 _console <<
"Using EXPERIMENTAL Stateful Material Property projection with Adaptivity!\n"
9083 std::set<SubdomainID> local_mesh_subs(mesh_subdomains);
9092 bool check_material_coverage =
false;
9094 for (
const auto &
id : ids)
9096 local_mesh_subs.erase(
id);
9097 check_material_coverage =
true;
9108 "Subdomain \"" + subdomain_name +
"\" not found in mesh.");
9109 local_mesh_subs.erase(
id);
9114 std::set<SubdomainID>
blocks(local_mesh_subs);
9120 "Subdomain \"" + subdomain_name +
"\" not found in mesh.");
9123 for (
const auto id :
blocks)
9124 local_mesh_subs.erase(
id);
9128 auto && mortar_subdomain_ids =
_mortar_data->getMortarSubdomainIDs();
9129 for (
auto subdomain_id : mortar_subdomain_ids)
9130 local_mesh_subs.erase(subdomain_id);
9133 if (check_material_coverage && !local_mesh_subs.empty())
9135 std::stringstream extra_subdomain_ids;
9137 std::copy(local_mesh_subs.begin(),
9138 local_mesh_subs.end(),
9139 std::ostream_iterator<unsigned int>(extra_subdomain_ids,
" "));
9141 std::vector<SubdomainID> local_mesh_subs_vec(local_mesh_subs.begin(),
9142 local_mesh_subs.end());
9144 mooseError(
"The following blocks from your input mesh do not contain an active material: " +
9145 extra_subdomain_ids.str() +
9147 ")\nWhen ANY mesh block contains a Material object, "
9148 "all blocks must contain a Material object.\n");
9158 for (
const auto & material : materials)
9159 material->checkStatefulSanity();
9179 mooseError(
"Coordinate transformation parameters, listed below, are only to be used in the "
9180 "context of application to application field transfers at this time. The mesh is "
9181 "not modified by these parameters within an application.\n"
9182 "You should likely use a 'TransformGenerator' in the [Mesh] block to achieve the "
9183 "desired mesh modification.\n\n",
9200 bool mesh_has_second_order_elements =
false;
9206 mesh_has_second_order_elements =
true;
9216 if (mesh_has_second_order_elements)
9218 const std::vector<std::string> & displacement_variables =
9221 for (
const auto & var_name : displacement_variables)
9229 mooseError(
"Error: mesh has SECOND order elements, so all displacement variables must be "
9241 std::set<SubdomainID> user_objects_blocks;
9245 std::set<std::string> names;
9247 std::vector<UserObjectBase *> objects;
9250 for (
const auto & obj : objects)
9251 names.insert(obj->name());
9254 std::set<SubdomainID> difference;
9255 std::set_difference(user_objects_blocks.begin(),
9256 user_objects_blocks.end(),
9257 mesh_subdomains.begin(),
9258 mesh_subdomains.end(),
9259 std::inserter(difference, difference.end()));
9261 if (!difference.empty())
9263 std::ostringstream oss;
9264 oss <<
"One or more UserObjects is referencing a nonexistent block:\n";
9265 for (
const auto &
id : difference)
9273 const std::map<
SubdomainID, std::vector<std::shared_ptr<MaterialBase>>> & materials_map)
9275 for (
const auto & it : materials_map)
9278 std::set<std::string> block_depend_props, block_supplied_props;
9280 for (
const auto & mat1 : it.second)
9282 auto & alldeps = mat1->getMatPropDependencies();
9283 for (
auto & dep : alldeps)
9287 for (
const auto & mat2 : it.second)
9289 const std::set<std::string> & supplied_props = mat2->MaterialBase::getSuppliedItems();
9290 block_supplied_props.insert(supplied_props.begin(), supplied_props.end());
9299 std::set<std::string> difference;
9300 std::set_difference(block_depend_props.begin(),
9301 block_depend_props.end(),
9302 block_supplied_props.begin(),
9303 block_supplied_props.end(),
9304 std::inserter(difference, difference.end()));
9306 if (!difference.empty())
9308 std::ostringstream oss;
9309 oss <<
"One or more Material Properties were not supplied on block ";
9311 if (subdomain_name.length() > 0)
9312 oss << subdomain_name <<
" (" << it.first <<
")";
9316 for (
const auto &
name : difference)
9317 oss <<
name <<
"\n";
9323 for (
const auto & it : materials_map)
9325 const auto & materials = it.second;
9326 std::set<std::string> inner_supplied, outer_supplied;
9328 for (
const auto & outer_mat : materials)
9331 outer_supplied = outer_mat->getSuppliedItems();
9332 inner_supplied.clear();
9335 std::map<std::string, std::set<std::string>> prop_to_mat;
9336 for (
const auto &
name : outer_supplied)
9337 prop_to_mat[
name].insert(outer_mat->name());
9339 for (
const auto & inner_mat : materials)
9341 if (outer_mat == inner_mat)
9345 auto outer_mat_type = outer_mat->type();
9346 auto inner_mat_type = inner_mat->type();
9351 if (outer_mat_type == inner_mat_type && outer_mat_type != outer_mat->type() &&
9352 inner_mat_type != inner_mat->type())
9355 inner_supplied.insert(inner_mat->getSuppliedItems().begin(),
9356 inner_mat->getSuppliedItems().end());
9358 for (
const auto & inner_supplied_name : inner_supplied)
9359 prop_to_mat[inner_supplied_name].insert(inner_mat->name());
9363 std::set<std::string> intersection;
9364 std::set_intersection(outer_supplied.begin(),
9365 outer_supplied.end(),
9366 inner_supplied.begin(),
9367 inner_supplied.end(),
9368 std::inserter(intersection, intersection.end()));
9370 if (!intersection.empty())
9372 std::ostringstream oss;
9373 oss <<
"The following material properties are declared on block " << it.first
9374 <<
" by multiple materials:\n";
9376 <<
"Material Objects\n";
9377 for (
const auto & outer_name : intersection)
9380 for (
const auto & inner_name : prop_to_mat[outer_name])
9381 oss << inner_name <<
" ";
9403 mooseInfo(
"Restart file ", file_name,
" is NOT being used since we are performing recovery.");
9409 mooseInfo(
"Using ", file_name,
" for restart.");
9413std::vector<VariableName>
9416 std::vector<VariableName> names;
9420 const std::vector<VariableName> & var_names = sys->getVariableNames();
9421 names.insert(names.end(), var_names.begin(), var_names.end());
9424 const std::vector<VariableName> & aux_var_names =
_aux->getVariableNames();
9425 names.insert(names.end(), aux_var_names.begin(), aux_var_names.end());
9434 "Solver system number '" << solver_sys_num <<
"' is out of bounds. We have '"
9451 auto random_data_ptr = insert_pair.first->second.get();
9461 bnd_mat_side_cache =
false;
9464 if (
_aux->needMaterialOnSide(bnd_id))
9466 bnd_mat_side_cache =
true;
9469 for (
auto & nl :
_nl)
9470 if (nl->needBoundaryMaterialOnSide(bnd_id, tid))
9472 bnd_mat_side_cache =
true;
9486 bnd_mat_side_cache =
true;
9500 interface_mat_side_cache =
false;
9503 for (
auto & nl :
_nl)
9504 if (nl->needInterfaceMaterialOnSide(bnd_id, tid))
9506 interface_mat_side_cache =
true;
9519 interface_mat_side_cache =
true;
9524 interface_mat_side_cache =
true;
9538 for (
auto & nl :
_nl)
9539 if (nl->needInternalNeighborSideMaterial(subdomain_id, tid))
9572 mooseError(
"Previous nonlinear solution is required but not added through "
9573 "Problem/previous_nl_solution_required=true");
9578 const unsigned int solver_sys_num)
9585 const unsigned int solver_sys_num)
const
9604 bool needed,
const unsigned int solver_sys_num)
9611 const unsigned int solver_sys_num)
const
9642 const std::string & object_name,
9645 parallel_object_only();
9652 mooseError(
"The name '", object_name,
"' is a reserved name for output objects");
9656 if (output_warehouse.
hasOutput(object_name))
9657 mooseError(
"An output object named '", object_name,
"' already exists");
9663 if (object_type ==
"Console" &&
_app.
getParam<
bool>(
"show_input") &&
9674 if (object_type ==
"XDR")
9676 else if (object_type ==
"XDA")
9680 if (object_name ==
"auto_recovery_checkpoint")
9712 else if (sys_name ==
"aux0")
9715 mooseError(
"System '" + sys_name +
"' was requested from problem but does not exist.");
9730 mooseAssert(sys_num <
_nl.size(),
"System number greater than the number of nonlinear systems");
9731 return *
_nl[sys_num];
9737 mooseAssert(sys_num <
_nl.size(),
"System number greater than the number of nonlinear systems");
9738 return *
_nl[sys_num];
9745 "System number greater than the number of linear systems");
9753 "System number greater than the number of linear systems");
9761 "System number greater than the number of solver systems");
9769 "System number greater than the number of solver systems");
9788 parallel_object_only();
9832 const std::vector<Point> *
const pts,
9833 const std::vector<Real> *
const weights,
9845 unsigned int neighbor_side,
9847 const std::vector<Point> *
const pts,
9848 const std::vector<Real> *
const weights,
9861 std::vector<std::shared_ptr<MaterialBase>> & face_materials,
9862 std::vector<std::shared_ptr<MaterialBase>> & neighbor_materials,
9863 std::set<MooseVariableFieldBase *> & variables,
9868 auto & this_face_mats =
9870 for (std::shared_ptr<MaterialBase> face_mat : this_face_mats)
9871 if (face_mat->ghostable())
9873 face_materials.push_back(face_mat);
9874 auto & var_deps = face_mat->getMooseVariableDependencies();
9875 for (
auto * var : var_deps)
9879 "Ghostable materials should only have finite volume variables coupled into them.");
9880 else if (face_mat->hasStatefulProperties())
9881 mooseError(
"Finite volume materials do not currently support stateful properties.");
9882 variables.insert(var);
9889 auto & this_neighbor_mats =
9891 for (std::shared_ptr<MaterialBase> neighbor_mat : this_neighbor_mats)
9892 if (neighbor_mat->ghostable())
9894 neighbor_materials.push_back(neighbor_mat);
9896 auto & var_deps = neighbor_mat->getMooseVariableDependencies();
9897 for (
auto * var : var_deps)
9901 "Ghostable materials should only have finite volume variables coupled into them.");
9902 else if (neighbor_mat->hasStatefulProperties())
9903 mooseError(
"Finite volume materials do not currently support stateful properties.");
9904 auto pr = variables.insert(var);
9905 mooseAssert(!pr.second,
9906 "We should not have inserted any new variables dependencies from our "
9907 "neighbor materials that didn't exist for our face materials");
9916 const unsigned int nqp,
9927 "There must be one convergence object per nonlinear system");
9932 _nl[i]->setConvergenceName(convergence_names[i]);
9947const std::vector<ConvergenceName> &
9952 mooseError(
"The nonlinear system convergence name(s) have not been set.");
9967 paramError(
"linear_convergence",
"There must be one convergence object per linear system");
9971const std::vector<ConvergenceName> &
9976 mooseError(
"The linear convergence name(s) have not been set.");
9979const ConvergenceName &
9985 mooseError(
"The fixed point convergence name has not been set.");
9988const ConvergenceName &
9994 mooseError(
"The steady convergence name has not been set.");
10039 return current_nl_sys_num;
10050 return current_linear_sys_num;
10067std::vector<MortarUserObject *>
10070 const bool displaced,
10071 const std::vector<MortarUserObject *> & mortar_uo_superset)
10073 std::vector<MortarUserObject *> mortar_uos;
10074 auto *
const subproblem =
10075 displaced ? cast_ptr<SubProblem *>(
_displaced_problem.get()) : cast_ptr<SubProblem *>(
this);
10076 for (
auto *
const obj : mortar_uo_superset)
10077 if (obj->onInterface(primary_boundary_id, secondary_boundary_id) &&
10078 (&obj->getSubProblem() == subproblem))
10079 mortar_uos.push_back(obj);
10084std::vector<MortarUserObject *>
10087 const bool displaced)
10089 std::vector<MortarUserObject *> mortar_uos;
10093 .queryInto(mortar_uos);
10094 return getMortarUserObjects(primary_boundary_id, secondary_boundary_id, displaced, mortar_uos);
10100 const bool displaced)
10102 const auto mortar_uos =
10104 for (
auto *
const mortar_uo : mortar_uos)
10106 mortar_uo->setNormals();
10107 mortar_uo->reinit();
10139 mooseAssert(nl_sys_num <
_nl.size(),
10140 "System number greater than the number of nonlinear systems");
10149 "System number greater than the number of linear systems");
10244 return solver_params;
10262 return _mortar_data->getMortarInterfaces(on_displaced);
@ ThreadedGeneralUserObject
boundary_id_type BoundaryID
void boundaryIntegrityCheckError(const MooseObject &object, const std::set< MooseVariableFieldBase * > &variables, const BoundaryName &boundary_name)
Compose boundary restricted error message for the provided object, variables, and boundary_name if th...
StoredRange< std::vector< GeneralUserObject * >::iterator, GeneralUserObject * > GeneralUserObjectRange
void groupUserObjects(TheWarehouse &w, AuxiliarySystem &aux, const ExecFlagEnum &execute_flags, const std::vector< T * > &objs, const std::set< std::string > &ic_deps)
Threads::spin_mutex get_function_mutex
void mooseInfo(Args &&... args)
Emit an informational message with the given stringified, concatenated args.
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
libMesh::TensorValue< ADReal > ADRealTensorValue
Real PostprocessorValue
various MOOSE typedefs
std::vector< Real > VectorPostprocessorValue
ADRealVectorValue ADRealGradient
void removeSubstring(std::string &main, const std::string &sub)
const ExecFlagType EXEC_SUBDOMAIN
const ExecFlagType EXEC_TIMESTEP_BEGIN
const ExecFlagType EXEC_SAME_AS_MULTIAPP
const ExecFlagType EXEC_POSTCHECK
const ExecFlagType EXEC_ALWAYS
const ExecFlagType EXEC_POST_ADAPTIVITY
std::pair< typename M::iterator, bool > moose_try_emplace(M &m, const typename M::key_type &k, Args &&... args)
Function to mirror the behavior of the C++17 std::map::try_emplace() method (no hint).
const ExecFlagType EXEC_INITIAL
const ExecFlagType EXEC_LINEAR
const ExecFlagType EXEC_NONLINEAR
const ExecFlagType EXEC_NONE
const ExecFlagType EXEC_PRE_DISPLACE
std::shared_ptr< DisplacedProblem > displaced_problem
for(PetscInt i=0;i< nvars;++i)
void extraSendList(std::vector< dof_id_type > &send_list, void *context)
///< Type of coordinate system
void extraSparsity(libMesh::SparsityPattern::Graph &sparsity, std::vector< dof_id_type > &n_nz, std::vector< dof_id_type > &n_oz, void *context)
Free function used for a libMesh callback.
void ErrorVector unsigned int
unsigned int getCyclesPerStep() const
Pull out the number of cycles_per_step previously set through the AdaptivityAction.
bool initialAdaptMesh()
Used during initial adaptivity.
void uniformRefineWithProjection()
Performs uniform refinement on the meshes in the current object.
static void uniformRefine(MooseMesh *mesh, unsigned int level=libMesh::invalid_uint)
Performs uniform refinement of the passed Mesh object.
bool getRecomputeMarkersFlag() const
Pull out the _recompute_markers_during_cycles flag previously set through the AdaptivityAction.
bool adaptMesh(std::string marker_name=std::string())
Adapts the mesh based on the error estimator used.
bool isAdaptivityDue()
Query if an adaptivity step should be performed at the current time / time step.
bool isOn()
Is adaptivity on?
void updateErrorVectors()
Update the ErrorVectors that have been requested through calls to getErrorVector().
unsigned int getInitialSteps() const
Pull out the number of initial steps previously set by calling init()
Key structure for APIs manipulating global vectors/matrices.
AttribBoundaries tracks all boundary IDs associated with an object.
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
This class is a container/interface for the objects involved in automatic generation of mortar spaces...
void copyValuesBack()
Copies current chain control data values into old values.
Thread to compute threaded general user objects.
Class for threaded computation of UserObjects.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
Base class for convergence criteria.
bool hasWritableCoupledVariables() const
Checks whether the object has any writable coupled variables.
Class that represents the dependecy as a graph.
void addItem(const T &value)
Add an independent item to the set.
const std::vector< T > & getSortedValues()
This function also returns dependency resolved values but with a simpler single vector interface.
void addEdge(const T &a, const T &b)
Add an edge between nodes 'a' and 'b'.
void clearPoints()
Remove all of the current points and elements.
std::set< const Elem * > & getElements()
Returns a writeable reference to the _elements container.
MultiPointMap & getPoints()
Returns a writeable reference to the _points container.
void updatePointLocator(const MooseMesh &mesh)
Called during FEProblemBase::meshChanged() to update the PointLocator object used by the DiracKernels...
All Distributions should inherit from this class.
A MultiMooseEnum object to hold "execute_on" flags.
A class for storing MooseObjects based on execution flag.
void updateActive(THREAD_ID tid=0) override
Updates the active objects storage.
void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.
void setup(const ExecFlagType &exec_flag, THREAD_ID tid=0) const
virtual void preProblemInit()
Perform initializations during executing actions right before init_problem task.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual void addJacobianScalar(const THREAD_ID tid=0)
virtual bool reinitDirac(const Elem *elem, const THREAD_ID tid) override
Returns true if the Problem has Dirac kernels it needs to compute on elem.
virtual void addJacobianLowerD(const THREAD_ID tid) override
const FVInterpolationMethod & getFVInterpolationMethod(const InterpolationMethodName &name, const THREAD_ID tid=0) const
Retrieve an FV interpolation method.
MaterialData & getMaterialData(Moose::MaterialDataType type, const THREAD_ID tid=0, const MooseObject *object=nullptr) const
std::unique_ptr< libMesh::ConstElemRange > _nl_evaluable_local_elem_range
bool _previous_nl_solution_required
Indicates we need to save the previous NL iteration variable values.
std::shared_ptr< AuxiliarySystem > _aux
The auxiliary system.
std::vector< SubdomainName > _material_coverage_blocks
bool hasLinearConvergenceObjects() const
Whether we have linear convergence objects.
bool hasPostprocessor(const std::string &name) const
Deprecated.
std::vector< VariablePhiSecond > _second_phi_zero
unsigned int subspaceDim(const std::string &prefix) const
Dimension of the subspace spanned by vectors with a given prefix.
MooseObjectWarehouse< IntegratedBCBase > _nonlocal_integrated_bcs
nonlocal integrated_bcs
virtual void clearDiracInfo() override
Gets called before Dirac Kernels are asked to add the points they are supposed to be evaluated in.
MaterialWarehouse _materials
virtual void addJacobianBlockTags(libMesh::SparseMatrix< libMesh::Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, std::vector< dof_id_type > &dof_indices, const std::set< TagID > &tags, const THREAD_ID tid)
LinearSystem * _current_linear_sys
The current linear system that we are solving.
std::set< TagID > _fe_vector_tags
std::vector< VariablePhiGradient > _grad_phi_zero
virtual void computeJacobian(const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian, const unsigned int nl_sys_num)
Form a Jacobian matrix with the default tag (system).
virtual void computeNearNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > * > &sp)
ExecuteMooseObjectWarehouse< Transfer > _between_multi_app_transfers
Transfers executed just before MultiApps to transfer data between them.
bool _trust_user_coupling_matrix
Whether to trust the user coupling matrix no matter what.
virtual Sampler & getSampler(const std::string &name, const THREAD_ID tid=0)
virtual void reinitElemPhys(const Elem *elem, const std::vector< Point > &phys_points_in_elem, const THREAD_ID tid) override
virtual void init() override
virtual const std::vector< std::shared_ptr< Convergence > > & getConvergenceObjects(const THREAD_ID tid=0) const
Gets the Convergence objects.
SolverSystem * _current_solver_sys
The current solver system.
void needSolutionState(unsigned int oldest_needed, Moose::SolutionIterationType iteration_type)
Declare that we need up to old (1) or older (2) solution states for a given type of iteration.
virtual void cacheResidual(const THREAD_ID tid) override
void checkDependMaterialsHelper(const std::map< SubdomainID, std::vector< std::shared_ptr< MaterialBase > > > &materials_map)
Helper method for checking Material object dependency.
virtual void addMaterialHelper(std::vector< MaterialWarehouse * > warehouse, const std::string &material_name, const std::string &name, InputParameters ¶meters)
const std::vector< ConvergenceName > & getNonlinearConvergenceNames() const
Gets the nonlinear system convergence object name(s).
void resizeMaterialData(Moose::MaterialDataType data_type, unsigned int nqp, const THREAD_ID tid)
Resize material data.
bool needsPreviousMultiAppFixedPointIterationAuxiliary() const
Check to see whether we need to compute the variable values of the previous multiapp fixed point iter...
virtual void checkProblemIntegrity()
Method called to perform a series of sanity checks before a simulation is run.
void setCouplingMatrix(std::unique_ptr< libMesh::CouplingMatrix > cm, const unsigned int nl_sys_num)
Set custom coupling matrix.
unsigned int getMaxQps() const
void setLinearConvergenceNames(const std::vector< ConvergenceName > &convergence_names)
Sets the linear convergence object name(s) if there is one.
std::string _exception_message
The error message to go with an exception.
std::vector< MooseArray< ADRealVectorValue > > _ad_grad_zero
bool hasJacobian() const
Returns _has_jacobian.
virtual void onTimestepEnd() override
const bool _skip_nl_system_check
std::vector< std::unordered_map< SubdomainID, bool > > _block_mat_side_cache
Cache for calculating materials on side.
std::vector< SolverParams > _solver_params
virtual NonlinearSystem & getNonlinearSystem(const unsigned int sys_num)
ScalarInitialConditionWarehouse _scalar_ics
virtual void addJacobianNeighbor(const THREAD_ID tid) override
virtual ArrayMooseVariable & getArrayVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested ArrayMooseVariable which may be in any system.
void createTagVectors()
Create extra tagged vectors and matrices.
bool hasKokkosUserObject(const std::string &name) const
Check if there if a Kokkos user object of given name.
virtual void addResidualLower(const THREAD_ID tid) override
virtual void lineSearch()
execute MOOSE line search
bool _verbose_multiapps
Whether or not to be verbose with multiapps.
TheWarehouse::Query getUOQuery(const std::string &system, const ExecFlagType &type, const Moose::AuxGroup &group) const
virtual void reinitNeighborPhys(const Elem *neighbor, unsigned int neighbor_side, const std::vector< Point > &physical_points, const THREAD_ID tid) override
virtual void addPredictor(const std::string &type, const std::string &name, InputParameters ¶meters)
const VectorPostprocessor & getVectorPostprocessorObjectByName(const std::string &object_name, const THREAD_ID tid=0) const
Return the VPP object given the name.
void clearCurrentJacobianMatrixTags()
Clear the current Jacobian matrix tag data structure ... if someone creates it.
virtual void addDistribution(const std::string &type, const std::string &name, InputParameters ¶meters)
The following functions will enable MOOSE to have the capability to import distributions.
virtual void setActiveScalarVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid) override
const AutomaticMortarGeneration & getMortarInterface(const std::pair< BoundaryID, BoundaryID > &primary_secondary_boundary_pair, const std::pair< SubdomainID, SubdomainID > &primary_secondary_subdomain_pair, bool on_displaced) const
Return the undisplaced or displaced mortar generation object associated with the provided boundaries ...
const bool & _solve
Whether or not to actually solve the nonlinear system.
bool _parallel_barrier_messaging
Whether or not information about how many transfers have completed is printed.
virtual bool hasScalarVariable(const std::string &var_name) const override
Returns a Boolean indicating whether any system contains a variable with the name provided.
void skipNextForwardSolutionCopyToOld()
Prevents the copy of the solution vector to the old solution vector in each system.
MaterialWarehouse _interface_materials
void addObjectParamsHelper(InputParameters ¶ms, const std::string &object_name, const std::string &var_param_name="variable")
Helper for setting the "_subproblem" and "_sys" parameters in addObject() and in addUserObject().
const Postprocessor & getPostprocessorObjectByName(const PostprocessorName &object_name, const THREAD_ID tid=0) const
Return the Postprocessor object registered under the supplied object name.
void reportMooseObjectDependency(MooseObject *a, MooseObject *b)
Register a MOOSE object dependency so we can either order operations properly or report when we canno...
void checkDisplacementOrders()
Verify that SECOND order mesh uses SECOND order displacements.
std::unique_ptr< MortarInterfaceWarehouse > _mortar_data
void customSetup(const ExecFlagType &exec_type) override
virtual void computeResidualTags(const std::set< TagID > &tags)
Form multiple residual vectors and each is associated with one tag.
virtual void reinitElemFaceRef(const Elem *elem, unsigned int side, Real tolerance, const std::vector< Point > *const pts, const std::vector< Real > *const weights=nullptr, const THREAD_ID tid=0) override
reinitialize FE objects on a given element on a given side at a given set of reference points and the...
bool _has_dampers
Whether or not this system has any Dampers associated with it.
virtual void computeUserObjects(const ExecFlagType &type, const Moose::AuxGroup &group)
Call compute methods on UserObjects.
std::shared_ptr< MultiApp > getMultiApp(const std::string &multi_app_name) const
Get a MultiApp object by name.
bool _checking_uo_aux_state
Flag used to indicate whether we are doing the uo/aux state check in execute.
bool needInternalNeighborSideMaterial(SubdomainID subdomain_id, const THREAD_ID tid)
virtual MooseVariable & getStandardVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested MooseVariable which may be in any system.
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters ¶meters)
virtual bool hasDistribution(const std::string &name) const
virtual std::size_t numLinearSystems() const override
void createTagMatrices(CreateTaggedMatrixKey)
bool hasFVInterpolationMethod(const InterpolationMethodName &name) const
Check if an FV interpolation method with a given name exists.
virtual bool haveFV() const override
returns true if this problem includes/needs finite volume functionality.
Moose::Kokkos::MaterialPropertyStorage & _kokkos_neighbor_material_props
libMesh::Order getMaxScalarOrder() const
void reinitMaterialsFace(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true, const std::deque< MaterialBase * > *reinit_mats=nullptr)
reinit materials on element faces
virtual void addSampler(const std::string &type, const std::string &name, InputParameters ¶meters)
The following functions will enable MOOSE to have the capability to import Samplers.
void notifyWhenMeshDisplaces(MeshDisplacedInterface *mdi)
Register an object that derives from MeshDisplacedInterface to be notified when the displaced mesh ge...
void jacobianSetup() override
virtual bool updateMeshXFEM()
Update the mesh due to changing XFEM cuts.
virtual void prepareFaceShapes(unsigned int var, const THREAD_ID tid) override
virtual void resetState()
Reset state of this object in preparation for the next evaluation.
virtual unsigned int currentLinearSysNum() const override
bool areCoupled(const unsigned int ivar, const unsigned int jvar, const unsigned int nl_sys_num) const
virtual void addResidual(const THREAD_ID tid) override
virtual void addInterfaceMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters)
virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the scalar variable reference from whichever system contains it.
MooseObjectWarehouse< KernelBase > _nonlocal_kernels
nonlocal kernels
ReporterData _reporter_data
const ConvergenceName & getSteadyStateConvergenceName() const
Gets the steady-state detection convergence object name.
std::vector< VariableGradient > _grad_zero
virtual void addConvergence(const std::string &type, const std::string &name, InputParameters ¶meters)
Adds a Convergence object.
virtual libMesh::EquationSystems & es() override
bool needInterfaceMaterialOnSide(BoundaryID bnd_id, const THREAD_ID tid)
void setCurrentAlgebraicNodeRange(libMesh::ConstNodeRange *range)
ExecuteMooseObjectWarehouse< MultiApp > _multi_apps
MultiApp Warehouse.
std::vector< bool > _previous_multisystem_fp_nl_solution_required
Indicates we need to save the previous multi-system fixed-point iteration solver variable values.
const FVFaceInterpolationMethod & getFVFaceInterpolationMethod(const InterpolationMethodName &name, const THREAD_ID tid=0) const
Retrieve a scalar face interpolation method.
virtual void setCurrentBoundaryID(BoundaryID bid, const THREAD_ID tid) override
sets the current boundary ID in assembly
virtual void addResidualScalar(const THREAD_ID tid=0)
void projectInitialConditionOnCustomRange(libMesh::ConstElemRange &elem_range, ConstBndNodeRange &bnd_node_range, const std::optional< std::set< VariableName > > &target_vars=std::nullopt)
Project initial conditions for custom elem_range and bnd_node_range This is needed when elements/boun...
const bool _boundary_restricted_node_integrity_check
whether to perform checking of boundary restricted nodal object variable dependencies,...
virtual void addHDGKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
std::shared_ptr< LineSearch > _line_search
virtual void prepareShapes(unsigned int var, const THREAD_ID tid) override
std::vector< VariableSecond > _second_zero
virtual void addCachedResidual(const THREAD_ID tid) override
AuxiliarySystem & getAuxiliarySystem()
MaterialPropertyStorage & _material_props
void trustUserCouplingMatrix()
Whether to trust the user coupling matrix even if we want to do things like be paranoid and create a ...
void joinAndFinalize(TheWarehouse::Query query, bool isgen=false)
void setAxisymmetricCoordAxis(const MooseEnum &rz_coord_axis)
virtual void reinitScalars(const THREAD_ID tid, bool reinit_for_derivative_reordering=false) override
fills the VariableValue arrays for scalar variables from the solution vector
virtual void neighborSubdomainSetup(SubdomainID subdomain, const THREAD_ID tid)
virtual const libMesh::CouplingMatrix & nonlocalCouplingMatrix(const unsigned i) const override
const RestartableEquationSystems & getRestartableEquationSystems() const
Get the RestartableEquationSystems object.
void setNonlinearConvergenceNames(const std::vector< ConvergenceName > &convergence_names)
Sets the nonlinear convergence object name(s) if there is one.
bool haveXFEM()
Find out whether the current analysis is using XFEM.
virtual std::size_t numSolverSystems() const override
bool needsPreviousNewtonIteration() const
Check to see whether we need to compute the variable values of the previous Newton iterate.
bool _reinit_displaced_neighbor
Whether to call DisplacedProblem::reinitNeighbor when this->reinitNeighbor is called.
virtual void cacheJacobianNeighbor(const THREAD_ID tid) override
virtual void addResidualNeighbor(const THREAD_ID tid) override
virtual const SystemBase & systemBaseAuxiliary() const override
Return the auxiliary system object as a base class reference.
std::vector< libMesh::CouplingMatrix > _nonlocal_cm
nonlocal coupling matrix
unsigned int systemNumForVariable(const VariableName &variable_name) const
virtual void sizeZeroes(unsigned int size, const THREAD_ID tid)
MaterialPropertyStorage & _neighbor_material_props
virtual void addCachedJacobian(const THREAD_ID tid) override
virtual const SystemBase & systemBaseLinear(unsigned int sys_num) const override
Get a constant base class reference to a linear system.
virtual void addGhostedElem(dof_id_type elem_id) override
Will make sure that all dofs connected to elem_id are ghosted to this processor.
virtual void reinitOffDiagScalars(const THREAD_ID tid) override
virtual bool shouldUpdateSolution()
Check to see whether the problem should update the solution.
virtual void setException(const std::string &message)
Set an exception, which is stored at this point by toggling a member variable in this class,...
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & nonlocalCouplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num)
virtual void addTimeIntegrator(const std::string &type, const std::string &name, InputParameters ¶meters)
virtual std::size_t numNonlinearSystems() const override
unsigned short getCurrentICState()
Retrieves the current initial condition state.
std::vector< std::shared_ptr< LinearSystem > > _linear_systems
The vector of linear systems.
ExecuteMooseObjectWarehouse< Transfer > _to_multi_app_transfers
Transfers executed just before MultiApps to transfer data to them.
std::optional< ConvergenceName > _multiapp_fixed_point_convergence_name
MultiApp fixed point convergence name.
void addAnyRedistributers()
void initElementStatefulProps(const libMesh::ConstElemRange &elem_range, const bool threaded)
Initialize stateful properties for elements in a specific elem_range This is needed when elements/bou...
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
ExecuteMooseObjectWarehouse< Transfer > _transfers
Normal Transfers.
virtual const std::vector< VectorTag > & currentResidualVectorTags() const override
Return the residual vector tags we are currently computing.
void setRestartFile(const std::string &file_name)
Communicate to the Resurector the name of the restart filer.
MooseVariableFieldBase & getActualFieldVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested MooseVariableField which may be in any system.
virtual void computeResidualInternal(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, const std::set< TagID > &tags)
Form a residual vector for a set of tags.
virtual void updateActiveObjects()
Update the active objects in the warehouses.
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters)
virtual VectorMooseVariable & getVectorVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested VectorMooseVariable which may be in any system.
void computeSystems(const ExecFlagType &type)
Do generic system computations.
void incrementMultiAppTStep(ExecFlagType type)
Advance the MultiApps t_step (incrementStepOrReject) associated with the ExecFlagType.
virtual void computeLinearSystemSys(libMesh::LinearImplicitSystem &sys, libMesh::SparseMatrix< libMesh::Number > &system_matrix, NumericVector< libMesh::Number > &rhs, const bool compute_gradients=true)
Assemble both the right hand side and the system matrix of a given linear system.
std::unique_ptr< libMesh::ConstElemRange > _current_algebraic_elem_range
virtual void addElementalFieldVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
Add an elemental field variable for use in the adaptivity system.
virtual void clearActiveFEVariableCoupleableVectorTags(const THREAD_ID tid) override
void setCurrentAlgebraicElementRange(libMesh::ConstElemRange *range)
These functions allow setting custom ranges for the algebraic elements, nodes, and boundary nodes tha...
virtual void computeJacobianSys(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian)
Form a Jacobian matrix.
std::map< NonlinearSystemName, unsigned int > _nl_sys_name_to_num
Map from nonlinear system name to number.
bool _has_kokkos_objects
Whether we have any Kokkos objects.
std::vector< std::unique_ptr< libMesh::CouplingMatrix > > _cm
Coupling matrix for variables.
virtual void reinitElem(const Elem *elem, const THREAD_ID tid) override
virtual void cacheJacobian(const THREAD_ID tid) override
virtual void swapBackMaterialsFace(const THREAD_ID tid)
const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName &name, std::size_t t_index=0) const
Get a read-only reference to the value associated with a Postprocessor that exists.
virtual void addJacobian(const THREAD_ID tid) override
std::vector< VectorVariableValue > _vector_zero
void checkNonlocalCoupling()
virtual void possiblyRebuildGeomSearchPatches()
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
Canonical method for adding a non-linear variable.
const FVGradientMethod & getFVGradientMethod(const GradientMethodName &name, const THREAD_ID tid=0) const
Retrieve an FV gradient method.
LinearSystem & currentLinearSystem()
Get a non-constant reference to the current linear system.
virtual void addJacobianOffDiagScalar(unsigned int ivar, const THREAD_ID tid=0)
ExecuteMooseObjectWarehouse< Control > _control_warehouse
The control logic warehouse.
virtual void addFunction(const std::string &type, const std::string &name, InputParameters ¶meters)
void residualSetup() override
virtual void setActiveFEVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid) override
void setSteadyStateConvergenceName(const ConvergenceName &convergence_name)
Sets the steady-state detection convergence object name if there is one.
bool _preserve_matrix_sparsity_pattern
Whether to preserve the system matrix / Jacobian sparsity pattern, using 0-valued entries usually.
virtual Real computeDamping(const NumericVector< libMesh::Number > &soln, const NumericVector< libMesh::Number > &update)
virtual bool updateSolution(NumericVector< libMesh::Number > &vec_solution, NumericVector< libMesh::Number > &ghosted_solution)
Update the solution.
std::vector< VariablePhiValue > _phi_zero
bool acceptInvalidSolution() const
Whether or not to accept the solution based on its invalidity.
libMesh::Order _max_scalar_order
Maximum scalar variable order.
bool hasPostprocessorValueByName(const PostprocessorName &name) const
Whether or not a Postprocessor value exists by a given name.
CoverageCheckMode _kernel_coverage_check
Determines whether and which subdomains are to be checked to ensure that they have an active kernel.
std::set< TagID > _linear_vector_tags
Temporary storage for filtered vector tags for linear systems.
GeometricSearchData _geometric_search_data
virtual void reinitNodeFace(const Node *node, BoundaryID bnd_id, const THREAD_ID tid) override
ExecFlagType _current_execute_on_flag
Current execute_on flag.
void setCoordSystem(const std::vector< SubdomainName > &blocks, const MultiMooseEnum &coord_sys)
ExecuteMooseObjectWarehouse< TransientMultiApp > _transient_multi_apps
Storage for TransientMultiApps (only needed for calling 'computeDT')
const ExecuteMooseObjectWarehouse< Transfer > & getMultiAppTransferWarehouse(Transfer::DIRECTION direction) const
Return the complete warehouse for MultiAppTransfer object for the given direction.
Moose::Kokkos::MaterialPropertyStorage & _kokkos_bnd_material_props
void bumpVolumeQRuleOrder(libMesh::Order order, SubdomainID block)
Increases the element/volume quadrature order for the specified mesh block if and only if the current...
void clearCurrentResidualVectorTags()
Clear the current residual vector tag data structure.
virtual void addInitialCondition(const std::string &ic_name, const std::string &name, InputParameters ¶meters)
virtual std::shared_ptr< const DisplacedProblem > getDisplacedProblem() const
virtual void computeUserObjectByName(const ExecFlagType &type, const Moose::AuxGroup &group, const std::string &name)
Compute an user object with the given name.
virtual void addFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters ¶meters)
virtual void addTransfer(const std::string &transfer_name, const std::string &name, InputParameters ¶meters)
Add a Transfer to the problem.
std::shared_ptr< MaterialBase > getMaterial(std::string name, Moose::MaterialDataType type, const THREAD_ID tid=0, bool no_warn=false)
Return a pointer to a MaterialBase object.
virtual void addFVGradientMethod(const std::string &method_type, const std::string &name, InputParameters ¶meters)
Add an FV gradient method.
virtual void setCurrentSubdomainID(const Elem *elem, const THREAD_ID tid) override
virtual void restoreOldSolutions()
Restore old solutions from the backup vectors and deallocate them.
std::map< std::string, unsigned int > _subspace_dim
Dimension of the subspace spanned by the vectors with a given prefix.
virtual void predictorCleanup(NumericVector< libMesh::Number > &ghosted_solution)
Perform cleanup tasks after application of predictor to solution vector.
virtual void getDiracElements(std::set< const Elem * > &elems) override
Fills "elems" with the elements that should be looped over for Dirac Kernels.
bool _ignore_zeros_in_jacobian
Whether to ignore zeros in the Jacobian, thereby leading to a reduced sparsity pattern.
unsigned int _num_grid_steps
Number of steps in a grid sequence.
std::shared_ptr< XFEMInterface > _xfem
Pointer to XFEM controller.
void checkUserObjectNameCollision(const std::string &name, const std::string &type) const
Check for name collision between different user objects.
const ReporterData & getReporterData() const
Provides const access the ReporterData object.
void registerRandomInterface(RandomInterface &random_interface, const std::string &name)
virtual void addVectorPostprocessor(const std::string &pp_name, const std::string &name, InputParameters ¶meters)
void reinitBecauseOfGhostingOrNewGeomObjects(bool mortar_changed=false)
Call when it is possible that the needs for ghosted elements has changed.
MooseObjectWarehouse< Indicator > _indicators
void setCoupling(Moose::CouplingType type)
Set the coupling between variables TODO: allow user-defined coupling.
std::map< SolverSystemName, unsigned int > _solver_sys_name_to_num
Map connecting solver system names with their respective systems.
void setAuxKernelParamsAndLog(const std::string &ak_name, const std::string &name, InputParameters ¶meters, const std::string &base_name)
Set the subproblem and system parameters for auxiliary kernels and log their addition.
virtual void addBoundaryCondition(const std::string &bc_name, const std::string &name, InputParameters ¶meters)
std::map< std::string, std::unique_ptr< RandomData > > _random_data_objects
A map of objects that consume random numbers.
void reinitMaterials(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true)
void parentOutputPositionChanged()
Calls parentOutputPositionChanged() on all sub apps.
bool hasSolverVariable(const std::string &var_name) const
virtual void newAssemblyArray(std::vector< std::shared_ptr< SolverSystem > > &solver_systems)
bool hasSolutionState(unsigned int state, Moose::SolutionIterationType iteration_type) const
Whether we need up to old (1) or older (2) solution states for a given type of iteration.
bool isSolverSystemNonlinear(const unsigned int sys_num)
Check if the solver system is nonlinear.
std::set< TagID > _fe_matrix_tags
std::vector< MeshDisplacedInterface * > _notify_when_mesh_displaces
Objects to be notified when the mesh displaces.
bool _has_nonlocal_coupling
Indicates if nonlocal coupling is required/exists.
virtual bool solverSystemConverged(const unsigned int solver_sys_num) override
bool hasFVGradientMethod(const GradientMethodName &name) const
Check if an FV gradient method with a given name exists.
virtual void addAuxScalarVariable(const std::string &var_name, libMesh::Order order, Real scale_factor=1., const std::set< SubdomainID > *const active_subdomains=NULL)
virtual void addJacobianNeighborLowerD(const THREAD_ID tid) override
bool needsPreviousMultiSystemFixedPointIterationAuxiliary() const
Check to see whether we need to compute the variable values of the previous multi-system fixed point ...
void getFVMatsAndDependencies(SubdomainID block_id, std::vector< std::shared_ptr< MaterialBase > > &face_materials, std::vector< std::shared_ptr< MaterialBase > > &neighbor_materials, std::set< MooseVariableFieldBase * > &variables, const THREAD_ID tid)
Get the materials and variables potentially needed for FV.
Restartable::ManagedValue< RestartableEquationSystems > _req
The EquationSystems object, wrapped for restart.
const bool _force_restart
virtual void advanceState()
Advance all of the state holding vectors / datastructures so that we can move to the next timestep.
virtual bool uDotDotRequested()
Get boolean flag to check whether solution second time derivative needs to be stored.
virtual void restoreSolutions()
virtual void solveLinearSystem(const unsigned int linear_sys_num, const Moose::PetscSupport::PetscOptions *po=nullptr)
Build and solve a linear system.
virtual void prepareAssembly(const THREAD_ID tid) override
virtual void addFVInterpolationMethod(const std::string &method_type, const std::string &name, InputParameters ¶meters)
Add an FV interpolation method.
const bool _material_dependency_check
Determines whether a check to verify material dependencies on every subdomain.
const Positions & getPositionsObject(const std::string &name) const
Get the Positions object by its name.
virtual void executeAllObjects(const ExecFlagType &exec_type)
void executeControls(const ExecFlagType &exec_type)
Performs setup and execute calls for Control objects.
virtual void postExecute()
Method called at the end of the simulation.
virtual void addNodalKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
void setVerboseProblem(bool verbose)
Make the problem be verbose.
const bool _regard_general_exceptions_as_errors
If we catch an exception during residual/Jacobian evaluaton for which we don't have specific handling...
std::vector< std::shared_ptr< Transfer > > getTransfers(ExecFlagType type, Transfer::DIRECTION direction) const
Get Transfers by ExecFlagType and direction.
bool hasMultiApps() const
Returns whether or not the current simulation has any multiapps.
void setCurrentNonlinearSystem(const unsigned int nl_sys_num)
void addOutput(const std::string &, const std::string &, InputParameters &)
Adds an Output object.
const std::vector< LinearSystemName > _linear_sys_names
The linear system names.
MaterialWarehouse _discrete_materials
virtual void computeJacobianBlock(libMesh::SparseMatrix< libMesh::Number > &jacobian, libMesh::System &precond_system, unsigned int ivar, unsigned int jvar)
Really not a good idea to use this.
Real computeMultiAppsDT(ExecFlagType type)
Find the smallest timestep over all MultiApps.
bool _skip_exception_check
If or not skip 'exception and stop solve'.
const ConstBndNodeRange & getCurrentAlgebraicBndNodeRange()
SolverParams & solverParams(unsigned int solver_sys_num=0)
Get the solver parameters.
void setCurrentLinearSystem(unsigned int sys_num)
Set the current linear system pointer.
std::vector< std::vector< std::unique_ptr< Assembly > > > _assembly
The Assembly objects.
unsigned short _current_ic_state
std::map< LinearSystemName, unsigned int > _linear_sys_name_to_num
Map from linear system name to number.
virtual Convergence & getConvergence(const std::string &name, const THREAD_ID tid=0) const
Gets a Convergence object.
virtual void computeNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > * > &sp)
virtual void reinitElemNeighborAndLowerD(const Elem *elem, unsigned int side, const THREAD_ID tid) override
virtual void prepare(const Elem *elem, const THREAD_ID tid) override
void computeLinearSystemTags(const NumericVector< libMesh::Number > &soln, const std::set< TagID > &vector_tags, const std::set< TagID > &matrix_tags, const bool compute_gradients=true)
Assemble the current linear system given a set of vector and matrix tags.
const std::size_t _num_linear_sys
The number of linear systems.
void handleException(const std::string &calling_method)
Handle exceptions.
virtual void addPostprocessor(const std::string &pp_name, const std::string &name, InputParameters ¶meters)
void setNonlocalCouplingMatrix()
Set custom coupling matrix for variables requiring nonlocal contribution.
unsigned int solverSysNum(const SolverSystemName &solver_sys_name) const override
Moose::Kokkos::MaterialPropertyStorage & _kokkos_material_props
const libMesh::ConstElemRange & getCurrentAlgebraicElementRange()
These are the element and nodes that contribute to the jacobian and residual for this local processor...
std::map< SolverVariableName, unsigned int > _solver_var_to_sys_num
Map connecting variable names with their respective solver systems.
virtual void setActiveScalarVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid) override
MooseObjectWarehouse< InternalSideIndicatorBase > _internal_side_indicators
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const override
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
bool _requires_nonlocal_coupling
nonlocal coupling requirement flag
const bool _restore_original_nonzero_pattern
Whether we should restore the original nonzero pattern for every Jacobian evaluation.
void reinitMaterialsNeighbor(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true, const std::deque< MaterialBase * > *reinit_mats=nullptr)
reinit materials on the neighboring element face
const VectorPostprocessorValue & getVectorPostprocessorValueByName(const std::string &object_name, const std::string &vector_name, std::size_t t_index=0) const
Get a read-only reference to the vector value associated with the VectorPostprocessor.
virtual void swapBackMaterialsNeighbor(const THREAD_ID tid)
void clearActiveMaterialProperties(const THREAD_ID tid)
Clear the active material properties.
virtual void clearActiveElementalMooseVariables(const THREAD_ID tid) override
Clear the active elemental MooseVariableFEBase.
void setMultiAppFixedPointConvergenceName(const ConvergenceName &convergence_name)
Sets the MultiApp fixed point convergence object name if there is one.
bool _fail_next_system_convergence_check
bool hasUserObject(const std::string &name) const
Check if there if a user object of given name.
bool _reinit_displaced_elem
Whether to call DisplacedProblem::reinitElem when this->reinitElem is called.
std::vector< VariableValue > _scalar_zero
unsigned int linearSysNum(const LinearSystemName &linear_sys_name) const override
bool _const_jacobian
true if the Jacobian is constant
virtual bool hasVariable(const std::string &var_name) const override
Whether or not this problem has the variable.
virtual void reinitNode(const Node *node, const THREAD_ID tid) override
void createMortarInterface(const std::pair< BoundaryID, BoundaryID > &primary_secondary_boundary_pair, const std::pair< SubdomainID, SubdomainID > &primary_secondary_subdomain_pair, bool on_displaced, bool periodic, const bool debug, const bool correct_edge_dropping, const Real minimum_projection_angle, const Mortar3DSubpatchPlane mortar_3d_subpatch_plane, const MooseEnum &triangulation, const bool triangulate_triangles, const Mortar3DQuadraturePointMapping mortar_3d_qp_mapping=Mortar3DQuadraturePointMapping::NORMAL_PROJECTION)
bool _has_internal_edge_residual_objects
Whether the problem has dgkernels or interface kernels.
virtual void addGhostedBoundary(BoundaryID boundary_id) override
Will make sure that all necessary elements from boundary_id are ghosted to this processor.
virtual void addKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
const libMesh::ConstElemRange & getEvaluableElementRange()
In general, {evaluable elements} >= {local elements} U {algebraic ghosting elements}.
virtual void addAuxScalarKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
std::unique_ptr< libMesh::ConstNodeRange > _current_algebraic_node_range
virtual void addDGKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
void setCurrentAlgebraicBndNodeRange(ConstBndNodeRange *range)
virtual void prepareFace(const Elem *elem, const THREAD_ID tid) override
const FVAdvectedInterpolationMethod & getFVAdvectedInterpolationMethod(const InterpolationMethodName &name, const THREAD_ID tid=0) const
Retrieve an advected interpolation method.
void prepareMaterials(const std::unordered_set< unsigned int > &consumer_needed_mat_props, const SubdomainID blk_id, const THREAD_ID tid)
Add the MooseVariables and the material properties that the current materials depend on to the depend...
void checkCoordinateSystems()
Verify that there are no element type/coordinate type conflicts.
MaterialPropertyStorage & _bnd_material_props
void logAdd(const std::string &system, const std::string &name, const std::string &type, const InputParameters ¶ms) const
Output information about the object just added to the problem.
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
void initKokkos()
Construct Kokkos assembly and systems and allocate Kokkos material property storages.
virtual void initNullSpaceVectors(const InputParameters ¶meters, std::vector< std::shared_ptr< NonlinearSystemBase > > &nl)
void reinitElemFace(const Elem *elem, unsigned int side, BoundaryID, const THREAD_ID tid)
unsigned int _max_qps
Maximum number of quadrature points used in the problem.
void checkDuplicatePostprocessorVariableNames()
virtual void reinitLowerDElem(const Elem *lower_d_elem, const THREAD_ID tid, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr) override
virtual void addDiracKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
void forceOutput()
Indicates that the next call to outputStep should be forced.
virtual void solve(const unsigned int nl_sys_num)
std::optional< ConvergenceName > _steady_state_convergence_name
Steady-state detection convergence name.
virtual void addDefaultNonlinearConvergence(const InputParameters ¶ms)
Adds the default nonlinear Convergence associated with the problem.
const std::unordered_map< std::pair< BoundaryID, BoundaryID >, MortarInterfaceConfig > & getMortarInterfaces(bool on_displaced) const
void setVariableAllDoFMap(const std::vector< const MooseVariableFEBase * > &moose_vars)
FEProblemBase(const InputParameters ¶meters)
void projectFunctionOnCustomRange(ConstElemRange &elem_range, Number(*func)(const Point &, const libMesh::Parameters &, const std::string &, const std::string &), Gradient(*func_grad)(const Point &, const libMesh::Parameters &, const std::string &, const std::string &), const libMesh::Parameters ¶ms, const std::vector< VariableName > &target_vars)
Project a function onto a range of elements for a given variable.
InitialConditionWarehouse _ics
virtual void checkExceptionAndStopSolve(bool print_message=true)
Check to see if an exception has occurred on any processor and, if possible, force the solve to fail,...
NonlinearSystemBase & currentNonlinearSystem()
const ExecFlagType & getCurrentExecuteOnFlag() const
Return/set the current execution flag.
void checkUserObjectJacobianRequirement(THREAD_ID tid)
bool duplicateVariableCheck(const std::string &var_name, const libMesh::FEType &type, bool is_aux, const std::set< SubdomainID > *const active_subdomains)
Helper to check for duplicate variable names across systems or within a single system.
void restoreMultiApps(ExecFlagType type, bool force=false)
Restore the MultiApps associated with the ExecFlagType.
void needsPreviousMultiAppFixedPointIterationSolution(bool needed, const unsigned int solver_sys_num)
Set a flag that indicated that user required values for the previous multiapp fixed point iterate for...
virtual unsigned int currentNlSysNum() const override
bool execMultiApps(ExecFlagType type, bool auto_advance=true)
Execute the MultiApps associated with the ExecFlagType.
void setPostprocessorValueByName(const PostprocessorName &name, const PostprocessorValue &value, std::size_t t_index=0)
Set the value of a PostprocessorValue.
void computeResidual(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual)
This function is called by Libmesh to form a residual.
virtual Real & timeOld() const
virtual void computeBounds(libMesh::NonlinearImplicitSystem &sys, NumericVector< libMesh::Number > &lower, NumericVector< libMesh::Number > &upper)
MaterialWarehouse _all_materials
void setVectorPostprocessorValueByName(const std::string &object_name, const std::string &vector_name, const VectorPostprocessorValue &value, std::size_t t_index=0)
Set the value of a VectorPostprocessor vector.
virtual unsigned int nlSysNum(const NonlinearSystemName &nl_sys_name) const override
const libMesh::ConstElemRange & getNonlinearEvaluableElementRange()
PetscOptions _petsc_option_data_base
virtual unsigned int nNonlinearIterations(const unsigned int nl_sys_num) const override
void setPreserveMatrixSparsityPattern(bool preserve)
Set whether the sparsity pattern of the matrices being formed during the solve (usually the Jacobian)...
bool _has_time_integrator
Indicates whether or not this executioner has a time integrator (during setup)
void computeResidualAndJacobian(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, libMesh::SparseMatrix< libMesh::Number > &jacobian)
Form a residual and Jacobian with default tags.
void timestepSetup() override
virtual void computeIndicators()
virtual void onTimestepBegin() override
virtual MooseMesh & mesh() override
MaterialWarehouse _kokkos_materials
virtual void setResidualNeighbor(NumericVector< libMesh::Number > &residual, const THREAD_ID tid) override
void setCurrentResidualVectorTags(const std::set< TagID > &vector_tags)
Set the current residual vector tag data structure based on the passed in tag IDs.
virtual void addIndicator(const std::string &indicator_name, const std::string &name, InputParameters ¶meters)
bool _previous_multiapp_fp_aux_solution_required
Indicates we need to save the previous multiapp fixed-point iteration auxiliary variable values.
std::set< TagID > _linear_matrix_tags
Temporary storage for filtered matrix tags for linear systems.
std::vector< std::unordered_map< BoundaryID, bool > > _interface_mat_side_cache
Cache for calculating materials on interface.
virtual void createQRules(libMesh::QuadratureType type, libMesh::Order order, libMesh::Order volume_order=libMesh::INVALID_ORDER, libMesh::Order face_order=libMesh::INVALID_ORDER, SubdomainID block=Moose::ANY_BLOCK_ID, bool allow_negative_qweights=true)
MooseObjectWarehouse< MeshDivision > _mesh_divisions
Warehouse to store mesh divisions NOTE: this could probably be moved to the MooseMesh instead of the ...
virtual void computePostCheck(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &old_soln, NumericVector< libMesh::Number > &search_direction, NumericVector< libMesh::Number > &new_soln, bool &changed_search_direction, bool &changed_new_soln)
Real getTimeFromStateArg(const Moose::StateArg &state) const
Returns the time associated with the requested state.
void setActiveMaterialProperties(const std::unordered_set< unsigned int > &mat_prop_ids, const THREAD_ID tid)
Record and set the material properties required by the current computing thread.
const UserObject & getUserObjectBase(const std::string &name, const THREAD_ID tid=0) const
Get the user object by its name.
std::optional< std::vector< ConvergenceName > > _linear_convergence_names
Linear system(s) convergence name(s) (if any)
MooseObjectWarehouse< Moose::FunctionBase > _kokkos_functions
MooseEnum _verbose_setup
Whether or not to be verbose during setup.
void addDefaultSteadyStateConvergence(const InputParameters ¶ms)
Adds the default steady-state detection Convergence.
virtual void reinitNeighborFaceRef(const Elem *neighbor_elem, unsigned int neighbor_side, Real tolerance, const std::vector< Point > *const pts, const std::vector< Real > *const weights=nullptr, const THREAD_ID tid=0) override
reinitialize FE objects on a given neighbor element on a given side at a given set of reference point...
FVInitialConditionWarehouse _fv_ics
virtual void addDisplacedProblem(std::shared_ptr< DisplacedProblem > displaced_problem)
const bool _boundary_restricted_elem_integrity_check
whether to perform checking of boundary restricted elemental object variable dependencies,...
virtual void updateMortarMesh()
virtual bool hasFunction(const std::string &name, const THREAD_ID tid=0)
bool computingNonlinearResid() const
Returns true if the problem is in the process of computing the nonlinear residual.
virtual void computeResidualTag(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, TagID tag)
Form a residual vector for a given tag.
std::vector< std::unordered_map< BoundaryID, bool > > _bnd_mat_side_cache
Cache for calculating materials on side.
void reinitMaterialsFaceOnBoundary(const BoundaryID boundary_id, const SubdomainID blk_id, const THREAD_ID tid, const bool swap_stateful=true, const std::deque< MaterialBase * > *const reinit_mats=nullptr)
reinit materials on element faces on a boundary (internal or external) This specific routine helps us...
NonlinearSystemBase * _current_nl_sys
The current nonlinear system that we are solving.
const bool _uo_aux_state_check
Whether or not checking the state of uo/aux evaluation.
bool _started_initial_setup
At or beyond initialSteup stage.
std::vector< SolverSystemName > _solver_sys_names
The union of nonlinear and linear system names.
void reinitMaterialsBoundary(BoundaryID boundary_id, const THREAD_ID tid, bool swap_stateful=true, const std::deque< MaterialBase * > *reinit_mats=nullptr)
reinit materials on a boundary
virtual void addLinearFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters ¶meters)
virtual void saveOldSolutions()
Allocate vectors and save old solutions into them.
const std::vector< ConvergenceName > & getLinearConvergenceNames() const
Gets the linear convergence object name(s).
void checkICRestartError(const std::string &ic_name, const std::string &name, const VariableName &var_name)
Checks if the variable of the initial condition is getting restarted and errors for specific cases.
std::vector< MeshChangedInterface * > _notify_when_mesh_changes
Objects to be notified when the mesh changes.
virtual void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
Canonical method for adding an auxiliary variable.
std::shared_ptr< DisplacedProblem > _displaced_problem
void computeUserObjectsInternal(const ExecFlagType &type, TheWarehouse::Query &query)
virtual void setActiveElementalMooseVariables(const std::set< MooseVariableFEBase * > &moose_vars, const THREAD_ID tid) override
Set the MOOSE variables to be reinited on each element.
bool _verbose_restore
Whether or not to be verbose on solution restoration post a failed time step.
virtual void computeJacobianBlocks(std::vector< JacobianBlock * > &blocks, const unsigned int nl_sys_num)
Computes several Jacobian blocks simultaneously, summing their contributions into smaller preconditio...
void reinitMortarUserObjects(BoundaryID primary_boundary_id, BoundaryID secondary_boundary_id, bool displaced)
Call reinit on mortar user objects with matching primary boundary ID, secondary boundary ID,...
bool haveADObjects() const
Method for reading wehther we have any ad objects.
virtual void swapBackMaterials(const THREAD_ID tid)
virtual void initialAdaptMesh()
void executeSamplers(const ExecFlagType &exec_type)
Performs setup and execute calls for Sampler objects.
void backupMultiApps(ExecFlagType type)
Backup the MultiApps associated with the ExecFlagType.
const std::size_t _num_nl_sys
The number of nonlinear systems.
virtual std::string solverTypeString(unsigned int solver_sys_num=0)
Return solver type as a human readable string.
virtual void clearActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid) override
std::vector< VectorVariableCurl > _vector_curl_zero
virtual bool checkNonlocalCouplingRequirement() const override
void setCurrentExecuteOnFlag(const ExecFlagType &)
virtual void setActiveFEVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid) override
bool shouldPrintExecution(const THREAD_ID tid) const
Check whether the problem should output execution orders at this time.
bool _has_mortar
Whether the simulation requires mortar coupling.
std::vector< bool > _previous_multiapp_fp_nl_solution_required
Indicates we need to save the previous multiapp fixed-point iteration solver variable values.
virtual void addAuxArrayVariable(const std::string &var_name, const libMesh::FEType &type, unsigned int components, const std::set< SubdomainID > *const active_subdomains=NULL)
void setCurrentlyComputingResidual(bool currently_computing_residual) final
Set whether or not the problem is in the process of computing the residual.
virtual std::vector< VariableName > getVariableNames()
Returns a list of all the variables in the problem (both from the NL and Aux systems.
virtual void updateGeomSearch(GeometricSearchData::GeometricSearchType type=GeometricSearchData::ALL) override
Update this object's geometric search data as well as the displaced problem's if it exists.
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) override
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num)
bool _calculate_jacobian_in_uo
MeshDivision & getMeshDivision(const std::string &name, const THREAD_ID tid=0) const
Get a MeshDivision.
virtual void execute(const ExecFlagType &exec_type)
Convenience function for performing execution of MOOSE systems.
bool _reinit_displaced_face
Whether to call DisplacedProblem::reinitElemFace when this->reinitElemFace is called.
bool _has_initialized_stateful
Whether nor not stateful materials have been initialized.
bool _has_constraints
Whether or not this system has any Constraints.
std::vector< MortarUserObject * > getMortarUserObjects(BoundaryID primary_boundary_id, BoundaryID secondary_boundary_id, bool displaced, const std::vector< MortarUserObject * > &mortar_uo_superset)
Helper for getting mortar objects corresponding to primary boundary ID, secondary boundary ID,...
std::vector< std::shared_ptr< NonlinearSystemBase > > _nl
The nonlinear systems.
void finishMultiAppStep(ExecFlagType type, bool recurse_through_multiapp_levels=false)
Finish the MultiApp time step (endStep, postStep) associated with the ExecFlagType.
virtual void computeJacobianTags(const std::set< TagID > &tags)
Form multiple matrices, and each is associated with a tag.
Moose::PetscSupport::PetscOptions _petsc_options
PETSc option storage.
virtual void addMultiApp(const std::string &multi_app_name, const std::string &name, InputParameters ¶meters)
Add a MultiApp to the problem.
void setResidualObjectParamsAndLog(const std::string &ro_name, const std::string &name, InputParameters ¶meters, const unsigned int nl_sys_num, const std::string &base_name, bool &reinit_displaced)
Set the subproblem and system parameters for residual objects and log their addition.
virtual void addMarker(const std::string &marker_name, const std::string &name, InputParameters ¶meters)
bool needBoundaryMaterialOnSide(BoundaryID bnd_id, const THREAD_ID tid)
These methods are used to determine whether stateful material properties need to be stored on interna...
virtual Distribution & getDistribution(const std::string &name)
TheWarehouse & theWarehouse() const
virtual void addScalarKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
virtual Real finalNonlinearResidual(const unsigned int nl_sys_num) const override
MooseObjectWarehouse< Convergence > _convergences
convergence warehouse
virtual bool hasConvergence(const std::string &name, const THREAD_ID tid=0) const
Returns true if the problem has a Convergence object of the given name.
virtual Real & time() const
bool _has_jacobian
Indicates if the Jacobian was computed.
virtual const SystemBase & systemBaseSolver(const unsigned int sys_num) const override
Return the solver system object as a base class reference given the system number.
virtual void subdomainSetup(SubdomainID subdomain, const THREAD_ID tid)
virtual void addFVInterfaceKernel(const std::string &fv_ik_name, const std::string &name, InputParameters ¶meters)
void bumpAllQRuleOrder(libMesh::Order order, SubdomainID block)
virtual void addFVInitialCondition(const std::string &ic_name, const std::string &name, InputParameters ¶meters)
Add an initial condition for a finite volume variables.
std::vector< std::vector< const MooseVariableFEBase * > > _uo_jacobian_moose_vars
Adaptivity & adaptivity()
virtual void computeResidualType(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, TagID tag)
Form a residual vector for a given tag and "residual" tag.
void reinitMaterialsNeighborOnBoundary(const BoundaryID boundary_id, const SubdomainID blk_id, const THREAD_ID tid, const bool swap_stateful=true, const std::deque< MaterialBase * > *const reinit_mats=nullptr)
reinit materials on neighbor element (usually faces) on a boundary (internal or external) This specif...
virtual void addInterfaceKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
virtual void addReporter(const std::string &type, const std::string &name, InputParameters ¶meters)
Add a Reporter object to the simulation.
const libMesh::ConstNodeRange & getCurrentAlgebraicNodeRange()
std::vector< unsigned char > _has_active_material_properties
Whether there are active material properties on each thread.
void execMultiAppTransfers(ExecFlagType type, Transfer::DIRECTION direction, const MultiAppName &source_app="")
Execute MultiAppTransfers associated with execution flag and direction.
Moose::CouplingType _coupling
Type of variable coupling.
bool _has_exception
Whether or not an exception has occurred.
MooseAppCoordTransform & coordTransform()
virtual void copySolutionsBackwards()
std::vector< Real > _real_zero
Convenience zeros.
void reinitMaterialsInterface(BoundaryID boundary_id, const THREAD_ID tid, bool swap_stateful=true)
virtual void addConstraint(const std::string &c_name, const std::string &name, InputParameters ¶meters)
virtual void setCurrentLowerDElem(const Elem *const lower_d_elem, const THREAD_ID tid) override
Set the current lower dimensional element.
virtual void initPetscOutputAndSomeSolverSettings()
Reinitialize PETSc output for proper linear/nonlinear iteration display.
void allowOutput(bool state)
Ability to enable/disable all output calls.
void computeKokkosUserObjectsInternal(const ExecFlagType &type, TheWarehouse::Query &query)
bool hasMultiApp(const std::string &name) const
virtual void meshDisplaced()
Update data after a mesh displaced.
std::unique_ptr< libMesh::ConstElemRange > _evaluable_local_elem_range
std::vector< MooseArray< ADRealTensorValue > > _ad_second_zero
virtual void setResidual(NumericVector< libMesh::Number > &residual, const THREAD_ID tid) override
void initKokkosStatefulProps()
virtual bool isTransient() const override
virtual void addCachedResidualDirectly(NumericVector< libMesh::Number > &residual, const THREAD_ID tid)
Allows for all the residual contributions that are currently cached to be added directly into the vec...
virtual void addFunctorMaterial(const std::string &functor_material_name, const std::string &name, InputParameters ¶meters)
virtual void addDamper(const std::string &damper_name, const std::string &name, InputParameters ¶meters)
virtual void computeMarkers()
const ConvergenceName & getMultiAppFixedPointConvergenceName() const
Gets the MultiApp fixed point convergence object name.
static SolverParams makeLinearSolverParams()
Make basic solver params for linear solves.
virtual Function & getFunction(const std::string &name, const THREAD_ID tid=0)
unsigned int _cycles_completed
ExecFlagEnum _print_execution_on
When to print the execution of loops.
virtual void clearActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid) override
std::vector< Point > _point_zero
std::vector< MooseArray< ADReal > > _ad_zero
virtual void computeJacobianTag(const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian, TagID tag)
Form a Jacobian matrix for a given tag.
void createTagSolutions()
Create extra tagged solution vectors.
virtual void prepareAssemblyNeighbor(const THREAD_ID tid)
Begin a fresh neighbor accumulation phase by sizing and zeroing the neighbor blocks.
MooseObjectWarehouse< Function > _functions
functions
virtual const SystemBase & systemBaseNonlinear(const unsigned int sys_num) const override
Return the nonlinear system object as a base class reference given the system number.
CoverageCheckMode _material_coverage_check
Determines whether and which subdomains are to be checked to ensure that they have an active material...
const std::set< const MooseObject * > & getMaterialPropertyStorageConsumers(Moose::MaterialDataType type) const
virtual void clearActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) override
virtual const SystemBase & getSystemBase(const unsigned int sys_num) const
Get constant reference to a system in this problem.
bool allowInvalidSolution() const
Whether to accept / allow an invalid solution.
void needsPreviousMultiSystemFixedPointIterationSolution(bool needed, const unsigned int solver_sys_num)
Set a flag that indicates that user requires values for the previous multi-system fixed point iterate...
void addDefaultMultiAppFixedPointConvergence(const InputParameters ¶ms)
Adds the default fixed point Convergence associated with the problem.
bool hasActiveMaterialProperties(const THREAD_ID tid) const
Method to check whether or not a list of active material roperties has been set.
virtual unsigned int nLinearIterations(const unsigned int nl_sys_num) const override
std::optional< std::vector< ConvergenceName > > _nonlinear_convergence_names
Nonlinear system(s) convergence name(s)
virtual Real computeResidualL2Norm()
Computes the residual using whatever is sitting in the current solution vector then returns the L2 no...
std::unique_ptr< ConstBndNodeRange > _current_algebraic_bnd_node_range
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
virtual void computeTransposeNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > * > &sp)
void initialSetup() override
bool _previous_multisystem_fp_aux_solution_required
Indicates we need to save the previous multi-system fixed-point iteration auxiliary variable values.
std::vector< VariableValue > _zero
virtual void outputStep(ExecFlagType type)
Output the current step.
MooseObjectWarehouse< Marker > _markers
std::vector< std::shared_ptr< SolverSystem > > _solver_systems
Combined container to base pointer of every solver system.
void getUOExecutionGroups(TheWarehouse::Query &query, std::set< int > &execution_groups) const
bool _is_petsc_options_inserted
If or not PETSc options have been added to database.
void notifyWhenMeshChanges(MeshChangedInterface *mci)
Register an object that derives from MeshChangedInterface to be notified when the mesh changes.
virtual void ghostGhostedBoundaries() override
Causes the boundaries added using addGhostedBoundary to actually be ghosted.
virtual void computeJacobianInternal(const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian, const std::set< TagID > &tags)
Form a Jacobian matrix for multiple tags.
virtual void cacheResidualNeighbor(const THREAD_ID tid) override
virtual void computeResidualSys(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual)
This function is called by Libmesh to form a residual.
virtual void computeIndicatorsAndMarkers()
virtual void reinitNeighbor(const Elem *elem, unsigned int side, const THREAD_ID tid) override
const std::vector< NonlinearSystemName > _nl_sys_names
The nonlinear system names.
virtual void setNeighborSubdomainID(const Elem *elem, unsigned int side, const THREAD_ID tid) override
const bool _fv_face_integrity_check
Whether to check FV boundary and interface objects against the faces on which they execute.
virtual void meshChanged()
Deprecated.
virtual std::pair< bool, unsigned int > determineSolverSystem(const std::string &var_name, bool error_if_not_found=false) const override
Determine what solver system the provided variable name lies in.
virtual libMesh::System & getSystem(const std::string &var_name) override
Returns the equation system containing the variable provided.
void uniformRefine()
uniformly refine the problem mesh(es).
MooseMesh * _displaced_mesh
ExecuteMooseObjectWarehouse< Transfer > _from_multi_app_transfers
Transfers executed just after MultiApps to transfer data from them.
void initXFEM(std::shared_ptr< XFEMInterface > xfem)
Create XFEM controller object.
std::vector< SubdomainName > _kernel_coverage_blocks
static InputParameters validParams()
MaterialPropertyRegistry _material_prop_registry
virtual bool computingPreSMOResidual(const unsigned int nl_sys_num) const override
Returns true if the problem is in the process of computing it's initial residual.
bool automaticScaling() const
Automatic scaling getter.
bool constJacobian() const
Returns _const_jacobian (whether a MOOSE object has specified that the Jacobian is the same as the pr...
virtual void addMeshDivision(const std::string &type, const std::string &name, InputParameters ¶ms)
Add a MeshDivision.
virtual void prepareNeighborShapes(unsigned int var, const THREAD_ID tid) override
const bool _allow_ics_during_restart
Interface for interpolation methods that provide matrix and RHS contributions for advected face value...
Abstract base class for interpolation methods that produce a scalar face value from adjacent cell val...
Base class for linear finite-volume cell-gradient methods.
This is a template class that implements the workhorse compute and computeNodal methods.
void initialSetup(THREAD_ID tid)
Initial setup.
void addObject(std::shared_ptr< FVInitialConditionBase > object, THREAD_ID tid, bool recurse=true)
Add object to the warehouse.
Registered base class for linear FV interpolation objects.
This data structure is used to store geometric and variable related metadata about each cell face in ...
Scope guard for starting and stopping Floating Point Exception Trapping.
Base class for function objects.
FunctorMaterials compute functor material properties.
void reinit()
Completely redo all geometric search objects.
GeometricSearchType
Used to select groups of geometric search objects to update.
std::map< std::pair< BoundaryID, BoundaryID >, NearestNodeLocator * > _nearest_node_locators
void clearNearestNodeLocators()
Clear out the Penetration Locators so they will redo the search.
void updateGhostedElems()
Updates the list of ghosted elements at the start of each time step for the nonlinear iteration patch...
void update(GeometricSearchType type=ALL)
Update all of the search objects.
This is a template class that implements the workhorse compute and computeNodal methods.
std::set< std::string > getDependObjects() const
Get a list of dependent UserObjects for this exec type.
void addObject(std::shared_ptr< InitialConditionBase > object, THREAD_ID tid, bool recurse=true)
Add object to the warehouse.
void initialSetup(THREAD_ID tid)
Initial setup.
Helper class for holding the preconditioning blocks to fill.
Linear system to be solved.
virtual void stopSolve(const ExecFlagType &exec_flag, const std::set< TagID > &vector_tags_to_close) override
Quit the current solve as soon as possible.
TagID rightHandSideVectorTag() const
virtual TagID systemMatrixTag() const override
Return the Matrix Tag ID for System.
NumericVector< Number > & getRightHandSideVector()
Fetching the right hand side vector from the libmesh system.
SparseMatrix< Number > & getSystemMatrix()
Fetching the system matrix from the libmesh system.
libMesh::LinearImplicitSystem & linearImplicitSystem()
Return a reference to the stored linear implicit system.
void computeLinearSystemTags(const std::set< TagID > &vector_tags, const std::set< TagID > &matrix_tags, const bool compute_gradients=true)
Compute the right hand side and the system matrix of the system for given tags.
virtual void compute(ExecFlagType type) override
Compute time derivatives, auxiliary variables, etc.
virtual void solve() override
Solve the system (using libMesh magic)
MaterialBases compute MaterialProperties.
Proxy for accessing MaterialPropertyStorage.
void resize(unsigned int n_qpoints)
Resize the data to hold properties for n_qpoints quadrature points.
void swapBack(const Elem &elem, unsigned int side=0)
material properties for given element (and possible side)
const std::string & getName(const unsigned int id) const
Stores the stateful material properties computed by materials.
bool hasStatefulProperties() const
const std::set< const MooseObject * > & getConsumers(Moose::MaterialDataType type) const
void eraseProperty(const Elem *elem)
Remove the property storage and element pointer from internal data structures Use this when elements ...
void shift()
Shift the material properties in time.
void addConsumer(Moose::MaterialDataType type, const MooseObject *object)
Add object as the consumer of storage of type type.
const MaterialData & getMaterialData(const THREAD_ID tid) const
virtual void jacobianSetup(THREAD_ID tid=0) const override
void addObjects(std::shared_ptr< MaterialBase > block, std::shared_ptr< MaterialBase > neighbor, std::shared_ptr< MaterialBase > face, THREAD_ID tid=0)
A special method unique to this class for adding Block, Neighbor, and Face material objects.
virtual void updateActive(THREAD_ID tid=0) override
Update the active status of Kernels.
void sort(THREAD_ID tid=0, bool sort_all_objects=false)
By default, this method only sorts block and boundary-wise object storages that are used by the MOOSE...
virtual void subdomainSetup(THREAD_ID tid=0) const override
virtual void neighborSubdomainSetup(THREAD_ID tid=0) const
virtual void residualSetup(THREAD_ID tid=0) const override
virtual void timestepSetup(THREAD_ID tid=0) const override
virtual void initialSetup(THREAD_ID tid=0) const override
Convenience methods for calling object setup methods that handle the extra neighbor and face objects.
This class determines the maximum number of Quadrature Points and Shape Functions used for a given si...
Interface for notifications that the mesh has changed.
Interface for objects acting when the mesh has been displaced.
Base class for MeshDivision objects.
Base class for MOOSE-based applications.
bool restoredInitialBackupMesh() const
Whether this app has restored mesh topology from its initial Backup object.
void restoreFromInitialBackup(const bool for_restart)
Restores from a "initial" backup, that is, one set in _initial_backup.
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
bool hasStartTime() const
void setRestart(bool value)
Sets the restart/recover flags.
bool isRestarting() const
Whether or not this is a "restart" calculation.
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
ChainControlDataSystem & getChainControlDataSystem()
Gets the system that manages the ChainControls.
std::unique_ptr< Backup > finalizeRestore()
Finalizes (closes) the restoration process done in restore().
void setRestartRecoverFileBase(const std::string &file_base)
mutator for recover_base (set by RecoverBaseAction)
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
void restore(const std::filesystem::path &folder_base, const bool for_restart)
Restore an application from file.
std::string getRestartRecoverFileBase() const
The file_base for the recovery file.
const ExecFlagEnum & getExecuteOnEnum() const
Return the app level ExecFlagEnum, this contains all the available flags for the app.
bool getExodusFileRestart() const
Whether or not we need to use a separate Exodus reader to read the mesh BEFORE we create the mesh.
bool isRecovering() const
Whether or not this is a "recover" calculation.
libMesh::ExodusII_IO * getExReaderForRestart() const
Get the Exodus reader to restart variables from an Exodus mesh file.
bool hasInitialBackup() const
Real getStartTime() const
std::filesystem::path restartFolderBase(const std::filesystem::path &folder_base) const
The file suffix for restartable data.
SolutionInvalidity & solutionInvalidity()
Get the SolutionInvalidity for this app.
void markMeshChangedForBackup()
Mark this app as requiring mesh topology data in its next Backup object.
InputParameterWarehouse & getInputParameterWarehouse()
Get the InputParameterWarehouse for MooseObjects.
const InputParameters & parameters() const
Get the parameters of the object.
const std::string & type() const
Get the type of this class.
std::string typeAndName() const
Get the class's combined type and name; useful in error handling.
const std::string & name() const
Get the name of the class.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
const std::string & _type
The type of this class.
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
static const std::string app_param
The name of the parameter that contains the MooseApp.
Class for containing MooseEnum item information.
const std::string & name() const
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Provides a way for users to bail out of the current solve.
virtual const char * what() const
Get out the error message.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
const Moose::PatchUpdateType & getPatchUpdateStrategy() const
Get the current patch update strategy.
void setupFiniteVolumeMeshData() const
Sets up the additional data needed for finite volume computations.
const std::set< BoundaryID > & getSubdomainBoundaryIds(const SubdomainID subdomain_id) const
Get the list of boundary ids associated with the given subdomain id.
const Elem * getLowerDElem(const Elem *, unsigned short int) const
Returns a const pointer to a lower dimensional element that corresponds to a side of a higher dimensi...
face_info_iterator ownedFaceInfoEnd()
void meshChanged()
Declares that the MooseMesh has changed, invalidates cached data and rebuilds caches.
virtual const Node & nodeRef(const dof_id_type i) const
const std::vector< const Elem * > & coarsenedElementChildren(const Elem *elem) const
Get the newly removed children element ids for an element that was just coarsened.
unsigned int uniformRefineLevel() const
Returns the level of uniform refinement requested (zero if AMR is disabled).
elem_info_iterator ownedElemInfoEnd()
virtual Elem * elemPtr(const dof_id_type i)
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
void buildRefinementAndCoarseningMaps(Assembly *assembly)
Create the refinement and coarsening maps necessary for projection of stateful material properties wh...
std::vector< SubdomainName > getSubdomainNames(const std::vector< SubdomainID > &subdomain_ids) const
Get the associated subdomainNames for the subdomain ids that are passed in.
const std::string & getBoundaryName(const BoundaryID boundary_id) const
Return the name of the boundary given the id.
MooseAppCoordTransform & coordTransform()
void addGhostedBoundary(BoundaryID boundary_id)
This will add the boundary ids to be ghosted to this processor.
ConstElemPointerRange * refinedElementRange() const
Return a range that is suitable for threaded execution over elements that were just refined.
SubdomainID getSubdomainID(const SubdomainName &subdomain_name) const
Get the associated subdomain ID for the subdomain name.
face_info_iterator ownedFaceInfoBegin()
Iterators to owned faceInfo objects.
libMesh::ConstNodeRange * getLocalNodeRange()
elem_info_iterator ownedElemInfoBegin()
Iterators to owned faceInfo objects.
void ghostGhostedBoundaries()
Actually do the ghosting of boundaries that need to be ghosted to this processor.
void updateActiveSemiLocalNodeRange(std::set< dof_id_type > &ghosted_elems)
Clears the "semi-local" node list and rebuilds it.
void checkCoordinateSystems()
Performs a sanity check for every element in the mesh.
bool isFiniteVolumeInfoDirty() const
virtual Elem * queryElemPtr(const dof_id_type i)
void cacheChangedLists()
Cache information about what elements were refined and coarsened in the previous step.
const std::set< SubdomainID > & interiorLowerDBlocks() const
std::vector< SubdomainID > getSubdomainIDs(const std::vector< SubdomainName > &subdomain_names) const
Get the associated subdomainIDs for the subdomain names that are passed in.
ConstElemPointerRange * coarsenedElementRange() const
Return a range that is suitable for threaded execution over elements that were just coarsened.
const std::string & getSubdomainName(SubdomainID subdomain_id) const
Return the name of a block given an id.
libMesh::StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > * getBoundaryNodeRange()
const std::set< SubdomainID > & meshSubdomains() const
Returns a read-only reference to the set of subdomains currently present in the Mesh.
void setCoordSystem(const std::vector< SubdomainName > &blocks, const MultiMooseEnum &coord_sys)
Set the coordinate system for the provided blocks to coord_sys.
const MeshBase::element_iterator activeLocalElementsEnd()
void doingPRefinement(bool doing_p_refinement)
Indicate whether the kind of adaptivity we're doing includes p-refinement.
void setAxisymmetricCoordAxis(const MooseEnum &rz_coord_axis)
For axisymmetric simulations, set the symmetry coordinate axis.
const libMesh::ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems,...
const std::set< SubdomainID > & boundaryLowerDBlocks() const
libMesh::StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > * getBoundaryElementRange()
MeshBase::element_iterator activeLocalElementsBegin()
Calls active_local_nodes_begin/end() on the underlying libMesh mesh object.
void buildPRefinementAndCoarseningMaps(Assembly *assembly)
A class for storing the names of MooseObject by tag and object name.
A class for storing an input parameter name.
void updateVariableDependency(std::set< MooseVariableFieldBase * > &needed_moose_vars, THREAD_ID tid=0) const
Update variable dependency vector.
std::shared_ptr< T > getActiveObject(const std::string &name, THREAD_ID tid=0) const
std::set< SubdomainID > getActiveBlocks(THREAD_ID tid=0) const
Return a set of active SubdomainsIDs.
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
const std::vector< std::shared_ptr< T > > & getObjects(THREAD_ID tid=0) const
Retrieve complete vector to the all/block/boundary restricted objects for a given thread.
bool hasActiveObject(const std::string &name, THREAD_ID tid=0) const
Convenience functions for checking/getting specific objects.
void sort(THREAD_ID tid=0)
Sort the objects using the DependencyResolver.
void updateBlockMatPropDependency(SubdomainID id, std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0, const bool producer_only=false) const
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.
void updateBoundaryVariableDependency(std::set< MooseVariableFieldBase * > &needed_moose_vars, THREAD_ID tid=0) const
bool hasActiveObjects(THREAD_ID tid=0) const
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const
bool hasActiveBlockObjects(THREAD_ID tid=0) const
void updateBoundaryMatPropDependency(std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0, const bool producer_only=false) const
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
bool hasObjects(THREAD_ID tid=0) const
Convenience functions for determining if objects exist.
const std::vector< std::shared_ptr< T > > & getActiveObjects(THREAD_ID tid=0) const
Retrieve complete vector to the active all/block/boundary restricted objects for a given thread.
std::shared_ptr< T > getObject(const std::string &name, THREAD_ID tid=0) const
A storage container for MooseObjects that inherit from SetupInterface.
virtual void timestepSetup(THREAD_ID tid=0) const
virtual void customSetup(const ExecFlagType &exec_type, THREAD_ID tid=0) const
virtual void initialSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods.
virtual void residualSetup(THREAD_ID tid=0) const
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.
virtual void updateActive(THREAD_ID tid=0) override
Update the active status of Kernels.
virtual void jacobianSetup(THREAD_ID tid=0) const
Every object that can be built by the factory should be derived from this class.
MooseApp & _app
The MOOSE application this is associated with.
virtual const std::vector< dof_id_type > & dofIndices() const
Get local DoF indices.
SystemBase & sys()
Get the system this variable is part of.
const std::vector< dof_id_type > & allDofIndices() const
Get all global dofindices for the variable.
libMesh::Order order() const
Get the order of this variable Note: Order enum can be implicitly converted to unsigned int.
unsigned int number() const
Get variable number coming from libMesh.
This class provides an interface for common operations on field variables of both FE and FV types wit...
virtual void insert(libMesh::NumericVector< libMesh::Number > &vector)=0
Insert the currently cached degree of freedom values into the provided vector.
virtual void prepare()=0
Prepare the elemental degrees of freedom.
Class for scalar variables (they are different).
void setValue(unsigned int i, Number value)
Set the nodal value for this variable (to keep everything up to date.
void reinit(bool reinit_for_derivative_reordering=false)
Fill out the VariableValue arrays from the system solution vector.
Base class template for functor objects.
void shift()
Shift current, old, and older material property data storages.
A struct for storing the various types of petsc options and values.
Base class for all MultiAppTransfer objects.
A MultiApp represents one or more MOOSE applications that are running simultaneously.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type.
bool isValueSet(const std::string &value) const
Methods for seeing if a value is set in the MultiMooseEnum.
A user object that runs over all the nodes and does an aggregation step to compute a single value.
Nonlinear system to be solved.
TagID timeVectorTag() const override
Ideally, we should not need this API.
void computeResidualTags(const std::set< TagID > &tags)
Form multiple tag-associated residual vectors for all the given tags.
Real computeDamping(const NumericVector< Number > &solution, const NumericVector< Number > &update)
Compute damping.
TagID systemMatrixTag() const override
Return the Matrix Tag ID for System.
virtual NumericVector< Number > & RHS()=0
virtual void setPreviousNewtonSolution(const NumericVector< Number > &soln)
void computeJacobianBlocks(std::vector< JacobianBlock * > &blocks)
Computes several Jacobian blocks simultaneously, summing their contributions into smaller preconditio...
virtual void solve() override=0
Solve the system (using libMesh magic)
void computeJacobianTags(const std::set< TagID > &tags)
Computes multiple (tag associated) Jacobian matricese.
TagID nonTimeVectorTag() const override
virtual libMesh::System & system() override
Get the reference to the libMesh system.
void setupDM()
Setup the PETSc DM object (when appropriate)
void computeResidualAndJacobianTags(const std::set< TagID > &vector_tags, const std::set< TagID > &matrix_tags)
Form possibly multiple tag-associated vectors and matrices.
TagID residualVectorTag() const override
Nonlinear system to be solved.
Class for storing and utilizing output objects.
const InputParameters * getCommonParameters() const
Get a reference to the common output parameters.
bool isReservedName(const std::string &name)
Test if the given name is reserved.
void solveSetup()
Calls the timestepSetup function for each of the output objects.
void jacobianSetup()
Calls the jacobianSetup function for each of the output objects.
void forceOutput()
Indicates that the next call to outputStep should be forced This is private, users should utilize FEP...
void timestepSetup()
Calls the timestepSetup function for each of the output objects.
void initialSetup()
Calls the initialSetup function for each of the output objects.
void customSetup(const ExecFlagType &exec_type)
Calls the setup function for each of the output objects.
bool hasOutput(const std::string &name) const
Returns true if the output object exists.
void subdomainSetup()
Calls the subdomainSetup function for each of the output objects.
void mooseConsole()
Send current output buffer to Console output objects.
void residualSetup()
Calls the residualSetup function for each of the output objects.
void outputStep(ExecFlagType type)
Calls the outputStep method for each output object.
void allowOutput(bool state)
Ability to enable/disable output calls This is private, users should utilize FEProblemBase::allowOutp...
void addOutput(std::shared_ptr< Output > output)
Adds an existing output object to the warehouse.
Based class for output objects.
Positions objects are under the hood Reporters.
A ReporterName that represents a Postprocessor.
Base class for all Postprocessors.
Base class for predictors.
Interface for objects that need parallel consistent random numbers without patterns over the course o...
void setRandomDataPointer(RandomData *random_data)
RedistributeProperties is used for its redistribute() callback, which ensures that any stateful prope...
static InputParameters validParams()
void addMaterialPropertyStorage(MaterialPropertyStorage &mat_props)
Pushes the given pair ( mat_data , mat_props ) onto our list of _materials data to redistribute each ...
std::vector< std::string > getAllRealReporterFullNames() const
Get full names of all real reporter values Note: For a postprocessor, the full name is the postproces...
DenseVector< Real > getAllRealReporterValues() const
Get all real reporter values including postprocessor and vector postprocessor values into a dense vec...
void check() const
Perform integrity check for get/declare calls.
void copyValuesBack()
At the end of a timestep this method is called to copy the values back in time in preparation for the...
bool hasReporterValue(const ReporterName &reporter_name) const
Return True if a Reporter value with the given type and name have been created.
void setReporterValue(const ReporterName &reporter_name, const T &value, const std::size_t time_index=0)
Method for setting Reporter values that already exist.
void restoreState(bool verbose=false)
When a time step fails, this method is called to revert the current reporter values to their old stat...
const T & getReporterValue(const ReporterName &reporter_name, const MooseObject &consumer, const ReporterMode &mode, const std::size_t time_index=0) const
Method for returning read only references to Reporter values.
std::set< std::string > getPostprocessorNames() const
Return a list of all postprocessor names.
void finalize(const std::string &object_name)
Helper function for performing post calculation actions via the ReporterContext objects.
Reporter objects allow for the declaration of arbitrary data types that are aggregate values for a si...
Wrapper class that owns a libMesh EquationSystem and adds advanced restart capability to it.
void setLoadAllVectors(const bool load_all_vectors)
Sets whether or not all vectors are to be loaded.
const T & get() const
Get the restartable value.
A class for creating restricted objects.
This is the base class for Samplers as used within the Stochastic Tools module.
void initialSetup()
Initial setup.
InitialConditions are objects that set the initial value of variables.
void paramWarning(const std::string ¶m, Args... args) const
bool hasInvalidSolutionError() const
Whether or not an invalid solution was encountered that was an error.
void resetIterationOccurences()
Reset the number of solution invalid occurrences back to zero.
Moose::LineSearchType _line_search
virtual void stopSolve(const ExecFlagType &exec_flag, const std::set< TagID > &vector_tags_to_close)=0
Quit the current solve as soon as possible.
void setSolution(const NumericVector< Number > &soln)
Set the solution to a given vector.
virtual const NumericVector< Number > *const & currentSolution() const override final
The solution vector that is currently being operated on.
Generic class for solving transient nonlinear problems.
bool _safe_access_tagged_vectors
Is it safe to retrieve data from tagged vectors.
virtual void clearActiveFEVariableCoupleableVectorTags(const THREAD_ID tid)
bool havePRefinement() const
Query whether p-refinement has been requested at any point during the simulation.
virtual void checkBoundaryMatProps()
Checks boundary material properties integrity.
virtual void cacheJacobianNeighbor(const THREAD_ID tid)
const bool & currentlyComputingJacobian() const
Returns true if the problem is in the process of computing the Jacobian.
virtual void checkBlockMatProps()
Checks block material properties integrity.
virtual void clearActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid)
bool _currently_computing_residual
Whether the residual is being evaluated.
bool _computing_nonlinear_residual
Whether the non-linear residual is being evaluated.
void clearAllDofIndices()
Clear dof indices from variables in nl and aux systems.
virtual void reinitElemFaceRef(const Elem *elem, unsigned int side, Real tolerance, const std::vector< Point > *const pts, const std::vector< Real > *const weights=nullptr, const THREAD_ID tid=0)
reinitialize FE objects on a given element on a given side at a given set of reference points and the...
virtual const VectorTag & getVectorTag(const TagID tag_id) const
Get a VectorTag from a TagID.
virtual const std::set< MooseVariableFieldBase * > & getActiveElementalMooseVariables(const THREAD_ID tid) const
Get the MOOSE variables to be reinited on each element.
std::map< std::string, std::vector< dof_id_type > > _var_dof_map
virtual void customSetup(const ExecFlagType &exec_type)
virtual void setCurrentBoundaryID(BoundaryID bid, const THREAD_ID tid)
sets the current boundary ID in assembly
virtual void cacheResidual(const THREAD_ID tid)
virtual void jacobianSetup()
virtual void initialSetup()
virtual void cacheJacobian(const THREAD_ID tid)
Factory & _factory
The Factory for building objects.
std::vector< VectorTag > getVectorTags(const std::set< TagID > &tag_ids) const
bool doingPRefinement() const
void setCurrentlyComputingJacobian(const bool currently_computing_jacobian)
Set whether or not the problem is in the process of computing the Jacobian.
void preparePRefinement()
Prepare DofMap and Assembly classes with our p-refinement information.
static InputParameters validParams()
virtual void setActiveScalarVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid)
virtual void reinitNeighborFaceRef(const Elem *neighbor_elem, unsigned int neighbor_side, Real tolerance, const std::vector< Point > *const pts, const std::vector< Real > *const weights=nullptr, const THREAD_ID tid=0)
reinitialize FE objects on a given neighbor element on a given side at a given set of reference point...
std::map< SubdomainID, std::set< MaterialPropertyName > > _zero_block_material_props
Set of properties returned as zero properties.
void addNotZeroedVectorTag(const TagID tag)
Adds a vector tag to the list of vectors that will not be zeroed when other tagged vectors are.
void markFamilyPRefinement(const InputParameters ¶ms)
Mark a variable family for either disabling or enabling p-refinement with valid parameters of a varia...
DiracKernelInfo _dirac_kernel_info
bool _safe_access_tagged_matrices
Is it safe to retrieve data from tagged matrices.
virtual void setActiveFEVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid)
virtual TagID addVectorTag(const TagName &tag_name, const Moose::VectorTagType type=Moose::VECTOR_TAG_RESIDUAL)
Create a Tag.
std::unordered_set< TagID > _not_zeroed_tagged_vectors
the list of vector tags that will not be zeroed when all other tags are
static void selectVectorTagsFromSystem(const SystemBase &system, const std::vector< VectorTag > &input_vector_tags, std::set< TagID > &selected_tags)
Select the vector tags which belong to a specific system.
virtual void setActiveScalarVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid)
virtual void clearActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid)
std::set< dof_id_type > _ghosted_elems
Elements that should have Dofs ghosted to the local processor.
virtual void setActiveFEVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid)
virtual void clearActiveElementalMooseVariables(const THREAD_ID tid)
Clear the active elemental MooseVariableFieldBase.
static void selectMatrixTagsFromSystem(const SystemBase &system, const std::map< TagName, TagID > &input_matrix_tags, std::set< TagID > &selected_tags)
Select the matrix tags which belong to a specific system.
virtual bool converged(const unsigned int sys_num)
Eventually we want to convert this virtual over to taking a solver system number argument.
virtual void clearActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid)
virtual void setCurrentLowerDElem(const Elem *const lower_d_elem, const THREAD_ID tid)
Set the current lower dimensional element.
void setCurrentlyComputingResidualAndJacobian(bool currently_computing_residual_and_jacobian)
Set whether or not the problem is in the process of computing the Jacobian.
MooseVariableFieldBase & getVariableHelper(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type, Moose::VarFieldType expected_var_field_type, const std::vector< T > &nls, const SystemBase &aux) const
Helper function called by getVariable that handles the logic for checking whether Variables of the re...
virtual void addCachedResidual(const THREAD_ID tid)
virtual void addCachedJacobian(const THREAD_ID tid)
virtual TagID addMatrixTag(TagName tag_name)
Create a Tag.
bool _currently_computing_jacobian
Flag to determine whether the problem is currently computing Jacobian.
virtual std::map< TagName, TagID > & getMatrixTags()
Return all matrix tags in the system, where a tag is represented by a map from name to ID.
virtual void setActiveElementalMooseVariables(const std::set< MooseVariableFieldBase * > &moose_vars, const THREAD_ID tid)
Set the MOOSE variables to be reinited on each element.
virtual void timestepSetup()
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
virtual void cacheResidualNeighbor(const THREAD_ID tid)
void addFunctor(const std::string &name, const Moose::FunctorBase< T > &functor, const THREAD_ID tid)
add a functor to the problem functor container
virtual void residualSetup()
bool _have_ad_objects
AD flag indicating whether any AD objects have been added.
bool automaticScaling() const
Automatic scaling getter.
virtual void reinitLowerDElem(const Elem *lower_d_elem, const THREAD_ID tid, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr)
Base class for a system (of equations)
virtual libMesh::SparseMatrix< Number > & getMatrix(TagID tag)
Get a raw SparseMatrix.
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
MooseVariableFieldBase & getVariable(THREAD_ID tid, const std::string &var_name) const
Gets a reference to a variable of with specified name.
unsigned int number() const
Gets the number of this system.
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
virtual void disassociateMatrixFromTag(libMesh::SparseMatrix< Number > &matrix, TagID tag)
Disassociate a matrix from a tag.
virtual void associateVectorToTag(NumericVector< Number > &vec, TagID tag)
Associate a vector for a given tag.
bool computingScalingJacobian() const
Whether we are computing an initial Jacobian for automatic variable scaling.
virtual void disassociateVectorFromTag(NumericVector< Number > &vec, TagID tag)
Disassociate a given vector from a given tag.
virtual bool hasVariable(const std::string &var_name) const
Query a system for a variable.
virtual void associateMatrixToTag(libMesh::SparseMatrix< Number > &matrix, TagID tag)
Associate a matrix to a tag.
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
NumericVector< Number > & solution()
void update()
Update the system (doing libMesh magic)
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
void max(const T &r, T &o, Request &req) const
void maxloc(T &r, unsigned int &max_id) const
processor_id_type rank() const
void min(const T &r, T &o, Request &req) const
void broadcast(T &data, const unsigned int root_id=0, const bool identical_sizes=false) const
QueryCache is a convenient way to construct and pass around (possible partially constructed) warehous...
QueryCache & condition(Args &&... args)
Adds a new condition to the query.
QueryCache clone() const
clone creates and returns an independent copy of the query in its current state.
std::vector< T * > & queryInto(std::vector< T * > &results, Args &&... args)
queryInto executes the query and stores the results in the given vector.
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse.
void add(std::shared_ptr< MooseObject > obj)
add adds a new object to the warehouse and stores attributes/metadata about it for running queries/fi...
An instance of this object type has one copy per thread that runs on each thread.
Base class for all Transfer objects.
Base class for user-specific data.
A class for "pretty printing" a table of data.
A ReporterName that represents a VectorPostprocessor.
Base class for Postprocessors that produce a vector of values.
virtual unsigned int size() const override final
processor_id_type processor_id() const
unsigned int n_dofs(const unsigned int s, const unsigned int var=libMesh::invalid_uint) const
unsigned int which_neighbor_am_i(const Elem *e) const
virtual Order default_order() const=0
virtual unsigned short dim() const=0
subdomain_id_type subdomain_id() const
const Elem * neighbor_ptr(unsigned int i) const
virtual void reinit_systems()
const T_sys & get_system(std::string_view name) const
void disable_refine_in_reinit()
const std::vector< std::string > & get_global_var_names()
const std::vector< std::string > & get_elem_var_names()
const std::vector< std::string > & get_nodal_var_names()
NumericVector< Number > * rhs
static FEFieldType field_type(const FEType &fe_type)
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)
virtual std::unique_ptr< Base > create()=0
SparseMatrix< Number > * matrix
virtual bool contract()=0
void add_ghosting_functor(GhostingFunctor &ghosting_functor)
void uniformly_coarsen(unsigned int n=1)
void clean_refinement_flags()
virtual void set(const numeric_index_type i, const T value)=0
virtual void swap(NumericVector< T > &v)
virtual Real l2_norm() const=0
virtual std::unique_ptr< NumericVector< T > > clone() const=0
virtual void add(const numeric_index_type i, const T value)=0
const Parallel::Communicator & _communicator
processor_id_type processor_id() const
const Parallel::Communicator & comm() const
processor_id_type n_processors() const
T & set(const std::string &)
virtual void restore_original_nonzero_pattern()
const std::string & name() const
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
std::unique_ptr< NumericVector< Number > > current_local_solution
const Variable & variable(unsigned int var) const
unsigned int variable_number(std::string_view var) const
bool has_static_condensation() const
unsigned int number() const
const std::set< subdomain_id_type > & active_subdomains() const
const FEType & type() const
void fill_data(std::map< processor_id_type, std::vector< std::set< unsigned int > > > &data, int M)
auto max(const L &left, const R &right)
std::string indent(unsigned int spaces)
Create empty string for indenting.
std::vector< subdomain_id_type > getSubdomainIDs(const libMesh::MeshBase &mesh, const std::vector< SubdomainName > &subdomain_name)
Get the associated subdomainIDs for the subdomain names that are passed in.
std::string convertLatestCheckpoint(std::string orig)
void parallelBarrierNotify(const Parallel::Communicator &comm, bool messaging)
void petscSetOptions(const PetscOptions &po, const SolverParams &solver_params, FEProblemBase *const problem=nullptr)
A function for setting the PETSc options in PETSc from the options supplied to MOOSE.
void petscSetDefaults(FEProblemBase &problem)
Sets the default options for PETSc.
void setSinglePetscOption(const std::string &name, const std::string &value="", FEProblemBase *const problem=nullptr)
A wrapper function for dealing with different versions of PetscOptionsSetValue.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
@ ST_LINEAR
Solving a linear problem.
@ ST_JFNK
Jacobian-Free Newton Krylov.
AuxGroup
Flag for AuxKernel related execution type.
constexpr std::size_t constMaxQpsPerElem
This is used for places where we initialize some qp-sized data structures that would end up being siz...
const TagName PREVIOUS_NL_SOLUTION_TAG
std::string stringify(const T &t)
conversion to string
RelationshipManagerType
Main types of Relationship Managers.
MaterialDataType
MaterialData types.
@ INTERFACE_MATERIAL_DATA
VarKindType
Framework-wide stuff.
const SubdomainID INVALID_BLOCK_ID
bool globalADIndexing()
Whether we are using global AD indexing.
const TagName SOLUTION_TAG
const Elem & get(const ElemType type_in)
void parallel_reduce(const Range &range, Body &body, unsigned int n_threads=libMesh::n_threads())
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
auto index_range(const T &sizable)
void libmesh_ignore(const Args &...)
const unsigned int invalid_uint
RealTensorValue RealTensor
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
PetscErrorCode PetscInt const PetscInt fields[]
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
void translateMetaPhysicLError(const MetaPhysicL::LogicError &)
emit a relatively clear error message when we catch a MetaPhysicL logic error
State argument for evaluating functors.
SolutionIterationType iteration_type
The solution iteration type, e.g. time or nonlinear.
unsigned int state
The state.
Per-mortar-interface configuration.