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"
166 params.
addParam<
unsigned int>(
"null_space_dimension", 0,
"The dimension of the nullspace");
168 "transpose_null_space_dimension", 0,
"The dimension of the transpose nullspace");
170 "near_null_space_dimension", 0,
"The dimension of the near nullspace");
173 "Whether or not to actually solve the Nonlinear system. "
174 "This is handy in the case that all you want to do is "
175 "execute AuxKernels, Transfers, etc. without actually "
177 params.
addParam<
bool>(
"use_nonlinear",
179 "Determines whether to use a Nonlinear vs a "
180 "Eigenvalue system (Automatically determined based "
182 params.
addParam<
bool>(
"error_on_jacobian_nonzero_reallocation",
183 "This causes PETSc to error if it had to reallocate memory in the Jacobian "
184 "matrix due to not having enough nonzeros");
185 params.
addParam<
bool>(
"ignore_zeros_in_jacobian",
187 "Do not explicitly store zero values in "
188 "the Jacobian matrix if true");
189 params.
addParam<
bool>(
"force_restart",
191 "EXPERIMENTAL: If true, a sub_app may use a "
192 "restart file instead of using of using the master "
196 "True to skip additional data in equation system for restart.",
197 "This parameter is no longer used, as we do not load additional "
198 "vectors by default with restart");
199 params.
addParam<
bool>(
"skip_nl_system_check",
201 "True to skip the NonlinearSystem check for work to do (e.g. Make sure "
202 "that there are variables to solve for).");
203 params.
addParam<
bool>(
"allow_initial_conditions_with_restart",
205 "True to allow the user to specify initial conditions when restarting. "
206 "Initial conditions can override any restarted field");
208 auto coverage_check_description = [](std::string scope, std::string list_param_name)
210 return "Controls, if and how a " + scope +
211 " subdomain coverage check is performed. "
212 "With 'TRUE' or 'ON' all subdomains are checked (the default). Setting 'FALSE' or 'OFF' "
213 "will disable the check for all subdomains. "
214 "To exclude a predefined set of subdomains 'SKIP_LIST' is to "
215 "be used, while the subdomains to skip are to be defined in the parameter '" +
217 "'. To limit the check to a list of subdomains, 'ONLY_LIST' is to "
218 "be used (again, using the parameter '" +
219 list_param_name +
"').";
222 params.
addParam<std::vector<SubdomainName>>(
225 "List of subdomains for kernel coverage and material coverage checks. Setting this parameter "
226 "is equivalent to setting 'kernel_coverage_block_list' and 'material_coverage_block_list' as "
227 "well as using 'ONLY_LIST' as the coverage check mode.");
229 MooseEnum kernel_coverage_check_modes(
"FALSE TRUE OFF ON SKIP_LIST ONLY_LIST",
"TRUE");
231 kernel_coverage_check_modes,
232 coverage_check_description(
"kernel",
"kernel_coverage_block_list"));
233 params.
addParam<std::vector<SubdomainName>>(
234 "kernel_coverage_block_list",
236 "List of subdomains for kernel coverage check. The meaning of this list is controlled by the "
237 "parameter 'kernel_coverage_check' (whether this is the list of subdomains to be checked, "
238 "not to be checked or not taken into account).");
240 "boundary_restricted_node_integrity_check",
242 "Set to false to disable checking of boundary restricted nodal object variable dependencies, "
243 "e.g. are the variable dependencies defined on the selected boundaries?");
244 params.
addParam<
bool>(
"boundary_restricted_elem_integrity_check",
246 "Set to false to disable checking of boundary restricted elemental object "
247 "variable dependencies, e.g. are the variable dependencies defined on the "
248 "selected boundaries?");
250 "side_uo_interface_mat_prop_integrity_check",
252 "Set to false to disable checking that side user objects do not consume material "
253 "properties declared by interface materials on the same boundary.");
254 MooseEnum material_coverage_check_modes(
"FALSE TRUE OFF ON SKIP_LIST ONLY_LIST",
"TRUE");
256 "material_coverage_check",
257 material_coverage_check_modes,
258 coverage_check_description(
"material",
"material_coverage_block_list"));
259 params.
addParam<std::vector<SubdomainName>>(
260 "material_coverage_block_list",
262 "List of subdomains for material coverage check. The meaning of this list is controlled by "
263 "the parameter 'material_coverage_check' (whether this is the list of subdomains to be "
264 "checked, not to be checked or not taken into account).");
266 params.
addParam<
bool>(
"fv_bcs_integrity_check",
268 "Set to false to disable checking of overlapping Dirichlet and Flux BCs "
269 "and/or multiple DirichletBCs per sideset");
272 "fv_face_integrity_check",
274 "Set to false to disable checking that FV flux boundary conditions and FV interface "
275 "kernels are applied to faces with valid variable ownership and interface topology.");
278 "material_dependency_check",
true,
"Set to false to disable material dependency check");
279 params.
addParam<
bool>(
"parallel_barrier_messaging",
281 "Displays messaging from parallel "
282 "barrier notifications when executing "
283 "or transferring to/from Multiapps "
286 "num_concurrent_multiapps",
288 "Set greater than 1 to solve the multiapps sharing an 'execution_order_group' "
289 "concurrently. Each such multiapp is assigned a disjoint subset of the MPI ranks "
290 "(partitioned using their 'min_procs_per_app'/'max_procs_per_app', otherwise evenly), so "
291 "they solve at the same time on different ranks. The specific value only acts as an "
292 "on/off switch; the number that run at once is set by the ranks available.");
294 MooseEnum verbosity(
"false true extra",
"false");
297 "Set to 'true' to have the problem report on any object created. Set "
298 "to 'extra' to also display all parameters.");
299 params.
addParam<
bool>(
"verbose_multiapps",
301 "Set to True to enable verbose screen printing related to MultiApps");
305 "Set to True to enable verbose screen printing related to solution restoration");
307 params.
addParam<FileNameNoExtension>(
"restart_file_base",
308 "File base name used for restart (e.g. "
309 "<path>/<filebase> or <path>/LATEST to "
310 "grab the latest file available)");
312 params.
addParam<std::vector<std::vector<TagName>>>(
315 "Extra vectors to add to the system that can be filled by objects which compute residuals "
316 "and Jacobians (Kernels, BCs, etc.) by setting tags on them. The outer index is for which "
317 "nonlinear system the extra tag vectors should be added for");
319 params.
addParam<std::vector<std::vector<TagName>>>(
320 "not_zeroed_tag_vectors",
322 "Extra vector tags which the sytem will not zero when other vector tags are zeroed. "
323 "The outer index is for which nonlinear system the extra tag vectors should be added for");
325 params.
addParam<std::vector<std::vector<TagName>>>(
326 "extra_tag_matrices",
328 "Extra matrices to add to the system that can be filled "
329 "by objects which compute residuals and Jacobians "
330 "(Kernels, BCs, etc.) by setting tags on them. The outer index is for which "
331 "nonlinear system the extra tag vectors should be added for");
333 params.
addParam<std::vector<TagName>>(
334 "extra_tag_solutions",
336 "Extra solution vectors to add to the system that can be used by "
337 "objects for coupling variable values stored in them.");
339 params.
addParam<
bool>(
"previous_nl_solution_required",
341 "True to indicate that this calculation requires a solution vector for "
342 "storing the previous nonlinear iteration.");
344 params.
addParam<std::vector<NonlinearSystemName>>(
345 "nl_sys_names", std::vector<NonlinearSystemName>{
"nl0"},
"The nonlinear system names");
347 params.
addParam<std::vector<LinearSystemName>>(
"linear_sys_names", {},
"The linear system names");
349 params.
addParam<
bool>(
"check_uo_aux_state",
351 "True to turn on a check that no state presents during the evaluation of "
352 "user objects and aux kernels");
359 "allow_invalid_solution",
361 "Set to true to allow convergence even though the solution has been marked as 'invalid'");
362 params.
addParam<
bool>(
"show_invalid_solution_console",
364 "Set to true to show the invalid solution occurrence summary in console");
365 params.
addParam<
bool>(
"immediately_print_invalid_solution",
367 "Whether or not to report invalid solution warnings at the time the "
368 "warning is produced instead of after the calculation");
371 "identify_variable_groups_in_nl",
373 "Whether to identify variable groups in nonlinear systems. This affects dof ordering");
376 "regard_general_exceptions_as_errors",
378 "If we catch an exception during residual/Jacobian evaluaton for which we don't have "
379 "specific handling, immediately error instead of allowing the time step to be cut");
381 params.
addParam<
bool>(
"use_hash_table_matrix_assembly",
383 "Whether to assemble matrices using hash tables instead of preallocating "
384 "matrix memory. This can be a good option if the sparsity pattern changes "
385 "throughout the course of the simulation.");
387 "restore_original_nonzero_pattern",
388 "Whether we should reset matrix memory for every Jacobian evaluation. This option is useful "
389 "if the sparsity pattern is constantly changing and you are using hash table assembly or if "
390 "you wish to continually restore the matrix to the originally preallocated sparsity pattern "
391 "computed by relationship managers.");
394 "skip_nl_system_check kernel_coverage_check kernel_coverage_block_list "
395 "boundary_restricted_node_integrity_check "
396 "boundary_restricted_elem_integrity_check "
397 "side_uo_interface_mat_prop_integrity_check material_coverage_check "
398 "material_coverage_block_list fv_bcs_integrity_check fv_face_integrity_check "
399 "material_dependency_check check_uo_aux_state error_on_jacobian_nonzero_reallocation",
400 "Simulation checks");
402 "ignore_zeros_in_jacobian identify_variable_groups_in_nl "
403 "use_hash_table_matrix_assembly restore_original_nonzero_pattern",
404 "Nonlinear system(s)");
406 "restart_file_base force_restart allow_initial_conditions_with_restart",
"Restart");
408 "verbose_setup verbose_multiapps verbose_restore parallel_barrier_messaging",
"Verbosity");
410 "null_space_dimension transpose_null_space_dimension near_null_space_dimension",
411 "Null space removal");
413 "extra_tag_vectors extra_tag_matrices extra_tag_solutions not_zeroed_tag_vectors",
414 "Contribution to tagged field data");
416 "allow_invalid_solution show_invalid_solution_console immediately_print_invalid_solution",
417 "Solution validity control");
425 _mesh(*getCheckedPointerParam<
MooseMesh *>(
"mesh")),
427 "equation_systems", nullptr, _mesh)),
429 _solve(getParam<bool>(
"solve")),
431 _time(declareRestartableData<Real>(
"time")),
432 _time_old(declareRestartableData<Real>(
"time_old")),
433 _time_older(declareRestartableData<Real>(
"time_older")),
434 _t_step(declareRecoverableData<
int>(
"t_step")),
435 _dt(declareRestartableData<Real>(
"dt")),
436 _dt_old(declareRestartableData<Real>(
"dt_old")),
437 _need_to_add_default_nonlinear_convergence(false),
438 _need_to_add_default_multiapp_fixed_point_convergence(false),
439 _need_to_add_default_steady_state_convergence(false),
440 _linear_sys_names(getParam<
std::vector<LinearSystemName>>(
"linear_sys_names")),
441 _num_linear_sys(_linear_sys_names.size()),
442 _linear_systems(_num_linear_sys, nullptr),
443 _current_linear_sys(nullptr),
444 _using_default_nl(!isParamSetByUser(
"nl_sys_names")),
445 _nl_sys_names(!_using_default_nl || (_using_default_nl && !_linear_sys_names.size())
446 ? getParam<
std::vector<NonlinearSystemName>>(
"nl_sys_names")
447 :
std::vector<NonlinearSystemName>()),
448 _num_nl_sys(_nl_sys_names.size()),
449 _nl(_num_nl_sys, nullptr),
450 _current_nl_sys(nullptr),
451 _solver_systems(_num_nl_sys + _num_linear_sys, nullptr),
453 _coupling(
Moose::COUPLING_DIAG),
454#ifdef MOOSE_KOKKOS_ENABLED
455 _kokkos_assembly(*this),
457 _mesh_divisions(true),
459 "material_props", &_mesh, _material_prop_registry, *this)),
461 "bnd_material_props", &_mesh, _material_prop_registry, *this)),
463 "neighbor_material_props", &_mesh, _material_prop_registry, *this)),
464#ifdef MOOSE_KOKKOS_ENABLED
465 _kokkos_material_props(
467 "kokkos_material_props", &_mesh, _material_prop_registry, *this)),
468 _kokkos_bnd_material_props(
470 "kokkos_bnd_material_props", &_mesh, _material_prop_registry, *this)),
471 _kokkos_neighbor_material_props(
473 "kokkos_neighbor_material_props", &_mesh, _material_prop_registry, *this)),
475 _reporter_data(_app),
476 _multi_apps(_app.getExecuteOnEnum()),
477 _transient_multi_apps(_app.getExecuteOnEnum()),
478 _transfers(_app.getExecuteOnEnum(), false),
479 _to_multi_app_transfers(_app.getExecuteOnEnum(), false),
480 _from_multi_app_transfers(_app.getExecuteOnEnum(), false),
481 _between_multi_app_transfers(_app.getExecuteOnEnum(), false),
482 _num_concurrent_multiapps(getParam<unsigned
int>(
"num_concurrent_multiapps")),
483#ifdef LIBMESH_ENABLE_AMR
485 _cycles_completed(0),
487 _displaced_mesh(nullptr),
488 _geometric_search_data(*this, _mesh),
490 _reinit_displaced_elem(false),
491 _reinit_displaced_face(false),
492 _reinit_displaced_neighbor(false),
493 _input_file_saved(false),
495 _has_constraints(false),
496 _snesmf_reuse_base(true),
497 _skip_exception_check(false),
498 _snesmf_reuse_base_set_by_user(false),
499 _has_initialized_stateful(false),
500 _const_jacobian(false),
501 _has_jacobian(false),
502 _needs_old_newton_iter(false),
503 _previous_nl_solution_required(getParam<bool>(
"previous_nl_solution_required")),
504 _previous_multiapp_fp_nl_solution_required(_num_nl_sys + _num_linear_sys, false),
505 _previous_multiapp_fp_aux_solution_required(false),
506 _previous_multisystem_fp_nl_solution_required(_num_nl_sys + _num_linear_sys, false),
507 _previous_multisystem_fp_aux_solution_required(false),
508 _has_nonlocal_coupling(false),
509 _calculate_jacobian_in_uo(false),
510 _kernel_coverage_check(
512 _kernel_coverage_blocks(getParam<
std::vector<SubdomainName>>(
"kernel_coverage_block_list")),
513 _boundary_restricted_node_integrity_check(
514 getParam<bool>(
"boundary_restricted_node_integrity_check")),
515 _boundary_restricted_elem_integrity_check(
516 getParam<bool>(
"boundary_restricted_elem_integrity_check")),
517 _side_uo_interface_mat_prop_integrity_check(
518 getParam<bool>(
"side_uo_interface_mat_prop_integrity_check")),
519 _material_coverage_check(
521 _material_coverage_blocks(getParam<
std::vector<SubdomainName>>(
"material_coverage_block_list")),
522 _fv_bcs_integrity_check(getParam<bool>(
"fv_bcs_integrity_check")),
523 _fv_face_integrity_check(getParam<bool>(
"fv_face_integrity_check")),
524 _material_dependency_check(getParam<bool>(
"material_dependency_check")),
525 _uo_aux_state_check(getParam<bool>(
"check_uo_aux_state")),
527 _check_residual_for_nans(false),
529 _max_qps(
std::numeric_limits<unsigned
int>::max()),
530 _max_scalar_order(INVALID_ORDER),
531 _has_time_integrator(false),
532 _has_exception(false),
533 _parallel_barrier_messaging(getParam<bool>(
"parallel_barrier_messaging")),
534 _verbose_setup(getParam<
MooseEnum>(
"verbose_setup")),
535 _verbose_multiapps(getParam<bool>(
"verbose_multiapps")),
536 _verbose_restore(getParam<bool>(
"verbose_restore")),
538 _control_warehouse(_app.getExecuteOnEnum(), false),
539 _is_petsc_options_inserted(false),
540 _line_search(nullptr),
541 _using_ad_mat_props(false),
542 _current_ic_state(0),
543 _use_hash_table_matrix_assembly(getParam<bool>(
"use_hash_table_matrix_assembly")),
544 _error_on_jacobian_nonzero_reallocation(
545 isParamValid(
"error_on_jacobian_nonzero_reallocation")
546 ? getParam<bool>(
"error_on_jacobian_nonzero_reallocation")
547 : _app.errorOnJacobianNonzeroReallocation()),
548 _restore_original_nonzero_pattern(isParamValid(
"restore_original_nonzero_pattern")
549 ? getParam<bool>(
"restore_original_nonzero_pattern")
550 : _use_hash_table_matrix_assembly),
551 _ignore_zeros_in_jacobian(getParam<bool>(
"ignore_zeros_in_jacobian")),
552 _preserve_matrix_sparsity_pattern(true),
553 _force_restart(getParam<bool>(
"force_restart")),
554 _allow_ics_during_restart(getParam<bool>(
"allow_initial_conditions_with_restart")),
555 _skip_nl_system_check(getParam<bool>(
"skip_nl_system_check")),
556 _fail_next_system_convergence_check(false),
557 _allow_invalid_solution(getParam<bool>(
"allow_invalid_solution")),
558 _show_invalid_solution_console(getParam<bool>(
"show_invalid_solution_console")),
559 _immediately_print_invalid_solution(getParam<bool>(
"immediately_print_invalid_solution")),
560 _started_initial_setup(false),
561 _has_internal_edge_residual_objects(false),
562 _u_dot_requested(false),
563 _u_dotdot_requested(false),
564 _u_dot_old_requested(false),
565 _u_dotdot_old_requested(false),
568 _print_execution_on(),
569 _identify_variable_groups_in_nl(getParam<bool>(
"identify_variable_groups_in_nl")),
570 _regard_general_exceptions_as_errors(getParam<bool>(
"regard_general_exceptions_as_errors")),
571 _requires_nonlocal_coupling(false)
573 auto checkCoverageCheckConflict =
574 [
this](
const std::string & coverage_check,
576 const std::vector<SubdomainName> & coverage_blocks) ->
void
580 if (coverage_blocks.size() > 1)
581 if (std::find(coverage_blocks.begin(), coverage_blocks.end(),
"ANY_BLOCK_ID") !=
582 coverage_blocks.end())
584 "The list of blocks used for ",
586 " cannot contain 'ANY_BLOCK_ID' along with other blocks. ");
589 checkCoverageCheckConflict(
591 checkCoverageCheckConflict(
597 ADReal::do_derivatives =
true;
638 _zero.resize(n_threads);
662 std::string restart_file_base = getParam<FileNameNoExtension>(
"restart_file_base");
669 if (restart_file_base.size())
687#if !PETSC_RELEASE_LESS_THAN(3, 12, 0)
706 mooseWarning(
"Displaced mesh was requested but the displaced problem does not exist. "
707 "Regular mesh will be returned");
715 mooseWarning(
"Displaced mesh was requested but the displaced problem does not exist. "
716 "Regular mesh will be returned");
724 auto & vectors = getParam<std::vector<std::vector<TagName>>>(
"extra_tag_vectors");
725 for (
const auto sys_num : index_range(vectors))
726 for (
auto & vector : vectors[sys_num])
732 auto & not_zeroed_vectors = getParam<std::vector<std::vector<TagName>>>(
"not_zeroed_tag_vectors");
733 for (
const auto sys_num : index_range(not_zeroed_vectors))
734 for (
auto & vector : not_zeroed_vectors[sys_num])
745 auto & matrices = getParam<std::vector<std::vector<TagName>>>(
"extra_tag_matrices");
746 for (
const auto sys_num : index_range(matrices))
747 for (
auto & matrix : matrices[sys_num])
754 sys->sizeVariableMatrixData();
755 _aux->sizeVariableMatrixData();
761 for (
auto & vector : getParam<std::vector<TagName>>(
"extra_tag_solutions"))
780 sys->associateVectorToTag(*sys->system().current_local_solution.get(), tag);
781 _aux->associateVectorToTag(*
_aux->system().current_local_solution.get(), tag);
788 sys->needSolutionState(state, iteration_type);
789 _aux->needSolutionState(state, iteration_type);
796 bool has_solution_state =
false;
798 has_solution_state |= sys->hasSolutionState(state, iteration_type);
799 has_solution_state |=
_aux->hasSolutionState(state, iteration_type);
800 return has_solution_state;
809 for (
const auto i : make_range(n_threads))
811 _assembly[i].resize(solver_systems.size());
812 for (
const auto j : index_range(solver_systems))
813 _assembly[i][j] = std::make_unique<Assembly>(*solver_systems[j], i);
819 std::vector<std::shared_ptr<NonlinearSystemBase>> & nls)
821 TIME_SECTION(
"initNullSpaceVectors", 5,
"Initializing Null Space Vectors");
823 unsigned int dimNullSpace =
parameters.
get<
unsigned int>(
"null_space_dimension");
824 unsigned int dimTransposeNullSpace =
825 parameters.
get<
unsigned int>(
"transpose_null_space_dimension");
826 unsigned int dimNearNullSpace =
parameters.
get<
unsigned int>(
"near_null_space_dimension");
827 for (
unsigned int i = 0; i < dimNullSpace; ++i)
829 std::ostringstream oss;
833 for (
auto & nl : nls)
837 for (
unsigned int i = 0; i < dimTransposeNullSpace; ++i)
839 std::ostringstream oss;
843 for (
auto & nl : nls)
847 for (
unsigned int i = 0; i < dimNearNullSpace; ++i)
849 std::ostringstream oss;
853 for (
auto & nl : nls)
868 for (
unsigned int i = 0; i < n_threads; i++)
884#if !PETSC_RELEASE_LESS_THAN(3, 12, 0)
889 CHKERRABORT(this->
comm().get(), ierr);
898 TIME_SECTION(
"setCoordSystem", 5,
"Setting Coordinate System");
908const ConstElemRange &
913 std::vector<const DofMap *> dof_maps(
es().n_systems());
914 for (
const auto i : make_range(
es().n_systems()))
917 dof_maps[i] = &sys.get_dof_map();
920 std::make_unique<ConstElemRange>(
_mesh.
getMesh().multi_evaluable_elements_begin(dof_maps),
921 _mesh.
getMesh().multi_evaluable_elements_end(dof_maps));
926const ConstElemRange &
931 std::vector<const DofMap *> dof_maps(
_nl.size());
932 for (
const auto i : index_range(dof_maps))
933 dof_maps[i] = &
_nl[i]->dofMap();
935 std::make_unique<ConstElemRange>(
_mesh.
getMesh().multi_evaluable_elements_begin(dof_maps),
936 _mesh.
getMesh().multi_evaluable_elements_end(dof_maps));
945 TIME_SECTION(
"initialSetup", 2,
"Performing Initial Setup");
950 mooseError(
"Checkpoint recovery and restart and exodus restart are all mutually exclusive.");
953 mooseWarning(
"MOOSE may fail to catch an exception when the \"skip_exception_check\" parameter "
954 "is used. If you receive a terse MPI error during execution, remove this "
955 "parameter and rerun your simulation");
970 _aux->initSolutionState();
976 dof_id_type global_max_var_n_dofs_per_elem = 0;
980 dof_id_type max_var_n_dofs_per_elem;
981 dof_id_type max_var_n_dofs_per_node;
983 TIME_SECTION(
"computingMaxDofs", 3,
"Computing Max Dofs Per Element");
987 max_var_n_dofs_per_elem = mvndpe.
max();
992 max_var_n_dofs_per_node = mvndpn.
max();
994 global_max_var_n_dofs_per_elem =
995 std::max(global_max_var_n_dofs_per_elem, max_var_n_dofs_per_elem);
999 TIME_SECTION(
"assignMaxDofs", 5,
"Assigning Maximum Dofs Per Elem");
1001 sys.assignMaxVarNDofsPerElem(max_var_n_dofs_per_elem);
1004 displaced_problem->solverSys(i).assignMaxVarNDofsPerElem(max_var_n_dofs_per_elem);
1006 sys.assignMaxVarNDofsPerNode(max_var_n_dofs_per_node);
1008 displaced_problem->solverSys(i).assignMaxVarNDofsPerNode(max_var_n_dofs_per_node);
1013 TIME_SECTION(
"resizingVarValues", 5,
"Resizing Variable Values");
1017 _phi_zero[tid].resize(global_max_var_n_dofs_per_elem, std::vector<Real>(
getMaxQps(), 0.));
1038 props->setRecovering();
1040#ifdef MOOSE_KOKKOS_ENABLED
1043 props->setRecovering();
1047 TIME_SECTION(
"restore", 3,
"Restoring from backup");
1077 TIME_SECTION(
"copyingFromExodus", 3,
"Copying Variables From Exodus");
1080 sys->copyVars(*reader);
1081 _aux->copyVars(*reader);
1086 mooseError(
"Need Exodus reader to restart variables but the reader is not available\n"
1087 "Use either FileMesh with an Exodus mesh file or FileMeshGenerator with an "
1088 "Exodus mesh file and with use_for_exodus_restart equal to true");
1104 mooseError(
"Stateful neighbor material properties do not work with mesh adaptivity");
1120 "Doing extra refinements when restarting is NOT supported for sub-apps of a MultiApp");
1130 TIME_SECTION(
"convergenceInitialSetup", 5,
"Initializing Convergence objects");
1138 std::set<std::string> depend_objects_aux =
_aux->getDependObjects();
1140 std::map<int, std::vector<UserObjectBase *>> group_userobjs;
1144 std::vector<UserObjectBase *> userobjs;
1149 for (
auto obj : userobjs)
1150 group_userobjs[obj->
getParam<
int>(
"execution_order_group")].push_back(obj);
1152#ifdef MOOSE_KOKKOS_ENABLED
1156 std::vector<UserObjectBase *> userobjs;
1161 for (
auto obj : userobjs)
1162 group_userobjs[obj->
getParam<
int>(
"execution_order_group")].push_back(obj);
1166 for (
auto & [group, objs] : group_userobjs)
1167 for (auto obj : objs)
1180 TIME_SECTION(
"initializingFunctions", 5,
"Initializing Functions");
1190#ifdef MOOSE_KOKKOS_ENABLED
1196 TIME_SECTION(
"initializingRandomObjects", 5,
"Initializing Random Objects");
1208 TIME_SECTION(
"ICinitialSetup", 5,
"Setting Up Initial Conditions");
1225 TIME_SECTION(
"materialInitialSetup", 3,
"Setting Up Materials");
1246#ifdef MOOSE_KOKKOS_ENABLED
1251 TIME_SECTION(
"computingInitialStatefulProps", 3,
"Computing Initial Material Values");
1258#ifdef MOOSE_KOKKOS_ENABLED
1273 props->setRestartInPlace();
1274 props->setRecovering();
1285#ifdef LIBMESH_ENABLE_AMR
1291 mooseError(
"Cannot perform initial adaptivity during restart on sub-apps of a MultiApp!");
1307 unsigned short ic_state_max = 0;
1309 auto findMax = [&ic_state_max](
const auto & obj_list)
1311 for (
auto ic : obj_list.getActiveObjects())
1312 ic_state_max =
std::
max(ic_state_max, ic->getState());
1319 if (ic_state_max > 0)
1323 std::vector<std::unique_ptr<NumericVector<Real>>> state0_sys_buffers(
_solver_systems.size());
1324 std::unique_ptr<NumericVector<Real>> state0_aux_buffer;
1330 state0_aux_buffer =
_aux->solutionState(0).clone();
1351 _aux->solutionState(0) = *state0_aux_buffer;
1352 _aux->solutionState(0).close();
1368 _aux->initialSetup();
1375 sys->setSolution(*(sys->system().current_local_solution.
get()));
1405 const auto & tis = sys->getTimeIntegrators();
1408 TIME_SECTION(
"timeIntegratorInitialSetup", 5,
"Initializing Time Integrator");
1409 for (
auto & ti : tis)
1420 TIME_SECTION(
"initialSetupMultiApps", 2,
"Initializing MultiApps",
false);
1429 TIME_SECTION(
"initialSetupTransfers", 2,
"Initializing Transfers");
1435 for (
const auto & transfer : to_multi_app_objects)
1438 transfer->initialSetup();
1443 for (
const auto & transfer : from_multi_app_objects)
1446 transfer->initialSetup();
1451 for (
const auto & transfer : between_multi_app_objects)
1454 transfer->initialSetup();
1460 TIME_SECTION(
"BoundaryRestrictedNodeIntegrityCheck", 5);
1468 for (
auto & nl :
_nl)
1470 const auto & nodal_bcs = nl->getNodalBCWarehouse();
1471 if (!nodal_bcs.hasBoundaryObjects())
1474 for (
const auto & bnode : bnd_nodes)
1476 const auto boundary_id = bnode->_bnd_id;
1477 const Node *
const node = bnode->_node;
1479 if (node->processor_id() != this->processor_id())
1485 if (!nodal_bcs.hasBoundaryObjects(boundary_id))
1488 const auto & bnd_objects = nodal_bcs.getBoundaryObjects(boundary_id);
1489 for (
const auto & bnd_object : bnd_objects)
1491 const auto & bnd_variable = bnd_object->variable();
1496 if (!bnd_object->requiresGeometricSearch() &&
1497 bnd_object->checkVariableBoundaryIntegrity() &&
1498 node->n_dofs(nl->number(), bnd_variable.number()))
1500 std::set<MooseVariableFieldBase *> vars_to_omit = {
1501 &cast_ref<MooseVariableFieldBase &>(
const_cast<MooseVariableBase &
>(bnd_variable))};
1504 *bnd_object, bnd_object->checkAllVariables(*node, vars_to_omit), bnd_name);
1513 TIME_SECTION(
"BoundaryRestrictedElemIntegrityCheck", 5);
1523 TIME_SECTION(
"FVFaceIntegrityCheck", 5);
1525 auto check_fv_face_integrity = [
this](
MooseMesh & fv_mesh,
const bool on_displaced)
1530 .condition<AttribDisplaced>(on_displaced)
1537 .condition<AttribDisplaced>(on_displaced)
1540 interface_kernel_base_query);
1542 std::vector<FVFluxBC *> flux_bcs;
1543 std::vector<FVInterfaceKernel *> interface_kernels;
1550 for (
const auto boundary_id : fi.boundaryIDs())
1552 auto boundary_key = std::make_tuple(boundary_id,
false);
1554 flux_bc_query.queryInto(flux_bcs, boundary_key);
1555 for (
const auto *
const flux_bc : flux_bcs)
1556 if (flux_bc->checkVariableBoundaryIntegrity())
1557 flux_bc->checkFaceIntegrity(fi);
1559 interface_kernel_query.queryInto(interface_kernels, boundary_key);
1560 for (
const auto *
const interface_kernel : interface_kernels)
1561 interface_kernel->checkFaceIntegrity(fi);
1567 check_fv_face_integrity(
mesh(),
false);
1577 mooseError(
"failed to converge initial MultiApp");
1610 TIME_SECTION(
"computeMaterials", 2,
"Computing Initial Material Properties");
1614#ifdef MOOSE_KOKKOS_ENABLED
1619 TIME_SECTION(
"computeMaterials", 2,
"Computing Initial Material Properties");
1631 for (
unsigned int tid = 0; tid <
n_threads; tid++)
1649 TIME_SECTION(
"lineSearchInitialSetup", 5,
"Initializing Line Search");
1671 "\" has the same name as a scalar variable in the system.");
1682 std::unique_ptr<libMesh::MeshRefinement> displaced_mesh_refinement(
nullptr);
1684 displaced_mesh_refinement = std::make_unique<libMesh::MeshRefinement>(*
_displaced_mesh);
1700 displaced_mesh_refinement->uniformly_coarsen();
1743 for (
THREAD_ID tid = 0; tid < n_threads; tid++)
1749#ifdef MOOSE_KOKKOS_ENABLED
1753 _aux->timestepSetup();
1755 sys->timestepSetup();
1761 for (
THREAD_ID tid = 0; tid < n_threads; tid++)
1768 std::vector<UserObject *> userobjs;
1770 for (
auto obj : userobjs)
1771 obj->timestepSetup();
1773#ifdef MOOSE_KOKKOS_ENABLED
1775 std::vector<UserObjectBase *> userobjs;
1777 for (
auto obj : userobjs)
1778 obj->timestepSetup();
1793 if (
_max_qps == std::numeric_limits<unsigned int>::max())
1807 TIME_SECTION(
"checkNonlocalCoupling", 5,
"Checking Nonlocal Coupling");
1810 for (
auto & nl :
_nl)
1812 const auto & all_kernels = nl->getKernelWarehouse();
1813 const auto & kernels = all_kernels.getObjects(tid);
1814 for (
const auto & kernel : kernels)
1816 std::shared_ptr<NonlocalKernel> nonlocal_kernel =
1817 std::dynamic_pointer_cast<NonlocalKernel>(kernel);
1818 if (nonlocal_kernel)
1826 nl->getIntegratedBCWarehouse();
1827 const auto & integrated_bcs = all_integrated_bcs.
getObjects(tid);
1828 for (
const auto & integrated_bc : integrated_bcs)
1830 std::shared_ptr<NonlocalIntegratedBC> nonlocal_integrated_bc =
1831 std::dynamic_pointer_cast<NonlocalIntegratedBC>(integrated_bc);
1832 if (nonlocal_integrated_bc)
1845 std::set<const MooseVariableFEBase *> uo_jacobian_moose_vars;
1847 std::vector<ShapeElementUserObject *> objs;
1851 .condition<AttribThread>(tid)
1854 for (
const auto & uo : objs)
1857 const auto & mv_deps = uo->jacobianMooseVariables();
1858 uo_jacobian_moose_vars.insert(mv_deps.begin(), mv_deps.end());
1862 std::vector<ShapeSideUserObject *> objs;
1866 .condition<AttribThread>(tid)
1868 for (
const auto & uo : objs)
1871 const auto & mv_deps = uo->jacobianMooseVariables();
1872 uo_jacobian_moose_vars.insert(mv_deps.begin(), mv_deps.end());
1884 for (
unsigned int i = 0; i < moose_vars.size(); ++i)
1886 VariableName var_name = moose_vars[i]->name();
1888 sys->setVariableGlobalDoFs(var_name);
1906 _assembly[tid][i]->prepareJacobianBlock();
1929 for (
auto & nl :
_nl)
1930 nl->prepareFace(tid,
true);
1931 _aux->prepareFace(tid,
false);
1941 const std::vector<dof_id_type> & dof_indices,
1944 for (
const auto i : index_range(
_nl))
1947 _nl[i]->prepare(tid);
1952 _assembly[tid][current_nl_sys_num]->prepareBlock(ivar, jvar, dof_indices);
1957 _assembly[tid][current_nl_sys_num]->prepareBlockNonlocal(
1979 _assembly[tid][i]->setCurrentSubdomainID(did);
1989 SubdomainID did = elem->neighbor_ptr(side)->subdomain_id();
1990 for (
const auto i : index_range(
_nl))
1992 _assembly[tid][i]->setCurrentNeighborSubdomainID(did);
2003 for (
const auto i : index_range(
_nl))
2005 _assembly[tid][i]->setCurrentNeighborSubdomainID(did);
2109 std::vector<VectorTag> extra_residual_vector_tags;
2114 if (vector_tag._id != time_tag && vector_tag._id != non_time_tag)
2115 extra_residual_vector_tags.push_back(vector_tag);
2122 extra_residual_vector_tags);
2231 const DofMap & dof_map,
2232 std::vector<dof_id_type> & dof_indices,
2233 const std::set<TagID> & tags,
2256 _displaced_problem->addJacobianBlockTags(jacobian, ivar, jvar, dof_map, dof_indices, tags, tid);
2262 jacobian, ivar, jvar, dof_map, dof_indices, jv.
allDofIndices(), tags, tid);
2271 const DofMap & dof_map,
2272 std::vector<dof_id_type> & dof_indices,
2273 std::vector<dof_id_type> & neighbor_dof_indices,
2274 const std::set<TagID> & tags,
2282 neighbor_dof_indices,
2287 jacobian, ivar, jvar, dof_map, dof_indices, neighbor_dof_indices, tags, tid);
2326 TIME_SECTION(
"ghostGhostedBoundaries", 3,
"Ghosting Ghosted Boundaries");
2338 "This function is deprecated and no longer performs any function. Please do not call it."));
2346 unsigned int n_points = points.size();
2363 _zero[tid].resize(max_qpts, 0);
2364 _grad_zero[tid].resize(max_qpts, RealGradient(0.));
2371 for (
const auto i : index_range(
_nl))
2373 _assembly[tid][i]->reinitAtPhysical(elem, points);
2374 _nl[i]->prepare(tid);
2385 bool have_points = n_points > 0;
2400 sys->reinitElem(elem, tid);
2401 _aux->reinitElem(elem, tid);
2409 const std::vector<Point> & phys_points_in_elem,
2413 "Are you calling this method with a displaced mesh element?");
2417 _assembly[tid][i]->reinitAtPhysical(elem, phys_points_in_elem);
2430 const unsigned int side,
2435 "reinitElemFace with a BoundaryID argument is deprecated because the boundary id was never "
2436 "used. Please call reinitElemFace without the BoundaryID argument instead");
2449 _aux->reinitElemFace(elem, side, tid);
2458 const std::vector<Point> *
const pts,
2459 const std::vector<Real> *
const weights)
2474 for (
const auto i : index_range(
_nl))
2477 _nl[i]->reinitNode(node, tid);
2479 _aux->reinitNode(node, tid);
2488 for (
const auto i : index_range(
_nl))
2491 _nl[i]->reinitNodeFace(node, bnd_id, tid);
2493 _aux->reinitNodeFace(node, bnd_id, tid);
2499 TIME_SECTION(
"reinitScalars", 3,
"Reinitializing Scalar Variables");
2504 for (
auto & nl :
_nl)
2505 nl->reinitScalars(tid, reinit_for_derivative_reordering);
2506 _aux->reinitScalars(tid, reinit_for_derivative_reordering);
2526 const Elem * neighbor = elem->neighbor_ptr(side);
2527 unsigned int neighbor_side = neighbor->which_neighbor_am_i(elem);
2529 for (
const auto i : index_range(
_nl))
2531 _assembly[tid][i]->reinitElemAndNeighbor(elem, side, neighbor, neighbor_side);
2532 _nl[i]->prepareNeighbor(tid);
2536 _aux->prepareNeighbor(tid);
2538 for (
auto & nl :
_nl)
2540 nl->reinitElemFace(elem, side, tid);
2541 nl->reinitNeighborFace(neighbor, neighbor_side, tid);
2543 _aux->reinitElemFace(elem, side, tid);
2544 _aux->reinitNeighborFace(neighbor, neighbor_side, tid);
2553 const auto & displaced_ref_pts =
_assembly[tid][0]->qRuleNeighbor()->get_points();
2573 auto & neighbor =
_assembly[tid][0]->neighbor();
2574 auto & neighbor_side =
_assembly[tid][0]->neighborSide();
2576 if (lower_d_elem_neighbor &&
2579 auto qps =
_assembly[tid][0]->qPointsFaceNeighbor().stdVector();
2580 std::vector<Point> reference_points;
2582 lower_d_elem_neighbor->dim(), lower_d_elem_neighbor, qps, reference_points);
2594 unsigned int neighbor_side,
2595 const std::vector<Point> & physical_points,
2599 "Are you calling this method with a displaced mesh element?");
2601 for (
const auto i : index_range(
_nl))
2604 _assembly[tid][i]->reinitNeighborAtPhysical(neighbor, neighbor_side, physical_points);
2607 _nl[i]->prepareNeighbor(tid);
2609 _aux->prepareNeighbor(tid);
2615 for (
auto & nl :
_nl)
2616 nl->reinitNeighborFace(neighbor, neighbor_side, tid);
2617 _aux->reinitNeighborFace(neighbor, neighbor_side, tid);
2622 const std::vector<Point> & physical_points,
2626 "Are you calling this method with a displaced mesh element?");
2628 for (
const auto i : index_range(
_nl))
2631 _assembly[tid][i]->reinitNeighborAtPhysical(neighbor, physical_points);
2634 _nl[i]->prepareNeighbor(tid);
2636 _aux->prepareNeighbor(tid);
2642 for (
auto & nl :
_nl)
2643 nl->reinitNeighbor(neighbor, tid);
2644 _aux->reinitNeighbor(neighbor, tid);
2655 std::set<const Elem *> displaced_elements;
2660 for (
const auto & elem : displaced_elements)
2683 for (
auto & nl :
_nl)
2684 nl->subdomainSetup(subdomain, tid);
2698 const std::string & name,
2701 parallel_object_only();
2718 mooseError(
"Unrecognized function functor type");
2724 const std::string & name,
2727 parallel_object_only();
2739 const std::string class_name =
"DefaultNonlinearConvergence";
2743 params.
set<
bool>(
"added_as_default") =
true;
2751 const std::string class_name =
"DefaultMultiAppFixedPointConvergence";
2755 params.
set<
bool>(
"added_as_default") =
true;
2762 const std::string class_name =
"DefaultSteadyStateConvergence";
2766 params.
set<
bool>(
"added_as_default") =
true;
2786 std::istringstream ss(
name);
2790 if (ss >> real_value && ss.eof())
2793 params.
set<Real>(
"value") = real_value;
2794 addFunction(
"ConstantFunction", ss.str(), params);
2799 std::string
vars =
"x,y,z,t,NaN,pi,e";
2804 params.
set<std::string>(
"expression") =
name;
2812 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_function"),
2813 "getFunction() was called before Functions have been constructed. The requested "
2815 name +
"' may exist in the input file, but Functions are not available yet.");
2839 mooseError(
"The Convergence object '",
name,
"' does not exist.");
2844const std::vector<std::shared_ptr<Convergence>> &
2852 const std::string & name,
2855 parallel_object_only();
2870 mooseError(
"No MeshDivision object named ",
name,
" of appropriate type");
2883 mooseDeprecated(
"FEProblemBase::getNonlinearSystem() is deprecated, please use "
2884 "FEProblemBase::getNonlinearSystemBase() \n");
2886 mooseAssert(sys_num <
_nl.size(),
"System number greater than the number of nonlinear systems");
2887 auto nl_sys = std::dynamic_pointer_cast<NonlinearSystem>(
_nl[sys_num]);
2897 const std::string & name,
2907 std::vector<Distribution *> objs;
2911 .condition<AttribName>(
name)
2913 return !objs.empty();
2919 std::vector<Distribution *> objs;
2923 .condition<AttribName>(
name)
2927 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_distribution"),
2928 "A Distribution getter was called before Distributions have been constructed. "
2929 "If you are attempting to access this object in the constructor of another object "
2930 "then make sure that the Distribution is constructed before the object using it.");
2931 mooseError(
"Unable to find Distribution with name '" +
name +
"'");
2938 const std::string & name,
2942 for (
auto & sampler : samplers)
2949 std::vector<Sampler *> objs;
2953 .condition<AttribThread>(tid)
2958 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_sampler"),
2959 "A Sampler getter was called before Samplers have been constructed. "
2960 "If you are attempting to access this object in the constructor of another object "
2961 "then make sure that the Sampler is constructed before the object using it.");
2964 "Unable to find Sampler with name '" +
name +
2965 "', if you are attempting to access this object in the constructor of another object then "
2966 "make sure that the Sampler is constructed before the object using it.");
2973 const FEType & type,
2975 const std::set<SubdomainID> *
const active_subdomains)
2977 std::set<SubdomainID> subdomainIDs;
2978 if (active_subdomains->size() == 0)
2981 subdomainIDs.insert(subdomains.begin(), subdomains.end());
2984 subdomainIDs.insert(active_subdomains->begin(), active_subdomains->end());
2990 std::string error_prefix =
"";
2993 curr_sys_ptr =
_aux.get();
2994 other_sys_ptr = sys.get();
2995 error_prefix =
"aux";
2999 mooseError(
"Cannot have an auxiliary variable and a solver variable with the same name: ",
3009 mooseError(
"Mismatching types are specified for ",
3011 "variable with name '",
3023 std::set<SubdomainID> varSubdomainIDs;
3024 if (varActiveSubdomains.size() == 0)
3027 varSubdomainIDs.insert(subdomains.begin(), subdomains.end());
3030 varSubdomainIDs.insert(varActiveSubdomains.begin(), varActiveSubdomains.end());
3034 const auto isSubset = std::includes(varSubdomainIDs.begin(),
3035 varSubdomainIDs.end(),
3036 subdomainIDs.begin(),
3037 subdomainIDs.end());
3042 const auto stringifySubdomains = [
this](std::set<SubdomainID> subdomainIDs)
3044 std::stringstream s;
3045 for (
auto const i : subdomainIDs)
3053 if (subdomainName.empty())
3056 s << subdomainName <<
" (" << i <<
")";
3061 const std::string msg =
"Mismatching block-restrictions are specified for " +
3062 error_prefix +
"variable with name '" + var_name +
"': {" +
3063 stringifySubdomains(varSubdomainIDs) +
"} and {" +
3064 stringifySubdomains(subdomainIDs) +
"}";
3079 const std::string & var_name,
3082 parallel_object_only();
3086 const auto active_subdomains_vector =
3088 const std::set<SubdomainID> active_subdomains(active_subdomains_vector.begin(),
3089 active_subdomains_vector.end());
3096 SolverSystemName sys_name = params.
get<SolverSystemName>(
"solver_sys");
3098 const auto solver_system_number =
solverSysNum(sys_name);
3099 logAdd(
"Variable", var_name, var_type, params);
3100 _solver_systems[solver_system_number]->addVariable(var_type, var_name, params);
3108std::pair<bool, unsigned int>
3110 const bool error_if_not_found)
const
3117 "If the variable is in our FEProblem solver system map, then it must be in the "
3118 "solver system we expect");
3119 else if (error_if_not_found)
3121 if (
_aux->hasVariable(var_name) ||
_aux->hasScalarVariable(var_name))
3124 " found. Did you specify an auxiliary variable when you meant to specify a "
3125 "solver variable?");
3129 "'. It does not exist in the solver system(s) or auxiliary system");
3137 const std::string & name,
3139 const unsigned int nl_sys_num,
3140 const std::string & base_name,
3141 bool & reinit_displaced)
3147 reinit_displaced =
true;
3170 const std::string & name,
3172 const std::string & base_name)
3179 if (!
parameters.
get<std::vector<BoundaryName>>(
"boundary").empty())
3206 const std::string & name,
3209 parallel_object_only();
3212 mooseError(
"You are trying to add a Kernel to a linear variable/system, which is not "
3213 "supported at the moment!");
3222 const std::string & name,
3225 parallel_object_only();
3228 mooseError(
"You are trying to add a HDGKernel to a linear variable/system, which is not "
3229 "supported at the moment!");
3238 const std::string & name,
3241 parallel_object_only();
3271 const std::string & name,
3274 parallel_object_only();
3278 mooseError(
"You are trying to add a ScalarKernel to a linear variable/system, which is not "
3279 "supported at the moment!");
3308 const std::string & name,
3311 parallel_object_only();
3316 "You are trying to add a BoundaryCondition to a linear variable/system, which is not "
3317 "supported at the moment!");
3326 const std::string & name,
3329 parallel_object_only();
3333 auto determine_var_param_name = [&
parameters,
this]()
3342 if (!has_secondary_var && !has_primary_var)
3344 "Either a 'secondary_variable' or 'primary_variable' parameter must be supplied for '",
3347 return has_secondary_var ?
"secondary_variable" :
"primary_variable";
3351 const auto nl_sys_num =
3354 mooseError(
"You are trying to add a Constraint to a linear variable/system, which is not "
3355 "supported at the moment!");
3379 const std::string & var_name,
3382 parallel_object_only();
3386 const auto active_subdomains_vector =
3388 const std::set<SubdomainID> active_subdomains(active_subdomains_vector.begin(),
3389 active_subdomains_vector.end());
3397 logAdd(
"AuxVariable", var_name, var_type, params);
3398 _aux->addVariable(var_type, var_name, params);
3406 const std::string & var_name,
3414 const FEType & type,
3415 const std::set<SubdomainID> *
const active_subdomains)
3417 parallel_object_only();
3419 mooseDeprecated(
"Please use the addAuxVariable(var_type, var_name, params) API instead");
3424 std::string var_type;
3425 if (
type.order == CONSTANT &&
type.family == MONOMIAL && !
type.p_refinement)
3426 var_type =
"MooseVariableConstMonomial";
3427 else if (
type.family == SCALAR)
3428 var_type =
"MooseVariableScalar";
3430 var_type =
"VectorMooseVariable";
3432 var_type =
"MooseVariable";
3439 params.
set<
bool>(
"p_refinement") =
type.p_refinement;
3441 if (active_subdomains)
3443 params.set<
std::vector<SubdomainName>>(
"block").push_back(
Moose::stringify(id));
3445 logAdd(
"AuxVariable", var_name, var_type, params);
3446 _aux->addVariable(var_type, var_name, params);
3453 const FEType & type,
3454 unsigned int components,
3455 const std::set<SubdomainID> *
const active_subdomains)
3457 parallel_object_only();
3459 mooseDeprecated(
"Please use the addAuxVariable(var_type, var_name, params) API instead");
3469 params.
set<
bool>(
"p_refinement") =
type.p_refinement;
3470 params.
set<
unsigned int>(
"components") = components;
3472 if (active_subdomains)
3476 logAdd(
"Variable", var_name,
"ArrayMooseVariable", params);
3477 _aux->addVariable(
"ArrayMooseVariable", var_name, params);
3486 const std::set<SubdomainID> *
const active_subdomains)
3488 parallel_object_only();
3490 mooseDeprecated(
"Please use the addAuxVariable(var_type, var_name, params) API instead");
3495 FEType
type(order, SCALAR);
3505 params.
set<std::vector<Real>>(
"scaling") = std::vector<Real>{1};
3506 if (active_subdomains)
3510 logAdd(
"ScalarVariable", var_name,
"MooseVariableScalar", params);
3511 _aux->addVariable(
"MooseVariableScalar", var_name, params);
3518 const std::string & name,
3521 parallel_object_only();
3530 const std::string & name,
3533 parallel_object_only();
3562 const std::string & name,
3565 parallel_object_only();
3569 mooseError(
"You are trying to add a DiracKernel to a linear variable/system, which is not "
3570 "supported at the moment!");
3602 const std::string & name,
3605 parallel_object_only();
3609 mooseError(
"You are trying to add a DGKernel to a linear variable/system, which is not "
3610 "supported at the moment!");
3642 const std::string & name,
3656 const std::string & name,
3664 const std::string & name,
3669 addObject<FVInterfaceKernel>(
3675 const std::string & name,
3683 const std::string & name,
3693 const std::string & name,
3696 parallel_object_only();
3700 mooseError(
"You are trying to add a InterfaceKernel to a linear variable/system, which is not "
3701 "supported at the moment!");
3733 const std::string & name,
3734 const VariableName & var_name)
3738 std::string restart_method =
"";
3741 "a checkpoint restart, by IC object '" + ic_name +
"' for variable '" +
name +
"'";
3747 restarted_vars.insert(restarted_vars.end(), nodal_vars.begin(), nodal_vars.end());
3748 restarted_vars.insert(restarted_vars.end(), global_vars.begin(), global_vars.end());
3750 if (std::find(restarted_vars.begin(), restarted_vars.end(), var_name) != restarted_vars.end())
3751 restart_method =
"an Exodus restart, by IC object '" + ic_name +
"' for variable '" +
name +
3752 "' that is also being restarted";
3754 if (!restart_method.empty())
3756 "Initial conditions have been specified during ",
3758 ".\nThis is only allowed if you specify 'allow_initial_conditions_with_restart' to "
3759 "the [Problem], as initial conditions can override restarted fields");
3765 const std::string & name,
3768 parallel_object_only();
3772 const std::string & var_name =
parameters.
get<VariableName>(
"variable");
3787 std::shared_ptr<InitialConditionBase> ic;
3799 mooseError(
"Your FE variable in initial condition ",
3801 " must be either of scalar or vector type");
3812 std::shared_ptr<ScalarInitialCondition> ic =
3820 "Variable '", var_name,
"' requested in initial condition '",
name,
"' does not exist.");
3825 const std::string & name,
3828 parallel_object_only();
3832 const std::string & var_name =
parameters.
get<VariableName>(
"variable");
3847 std::shared_ptr<FVInitialConditionBase> ic;
3852 "Your variable for an FVInitialCondition needs to be an a finite volume variable!");
3859 "' requested in finite volume initial condition '",
3861 "' does not exist.");
3867 TIME_SECTION(
"projectSolution", 2,
"Projecting Initial Solutions")
3876 using ElemInfoRange = StoredRange<MooseMesh::const_elem_info_iterator, const ElemInfo *>;
3884 for (
auto & nl :
_nl)
3885 nl->solution().close();
3886 _aux->solution().close();
3892 for (
auto & nl :
_nl)
3893 nl->solution().close();
3894 _aux->solution().close();
3902 for (
const auto & ic : ics)
3907 DenseVector<Number> vals(var.
order());
3910 const unsigned int n_scalar_dofs = var.
dofIndices().size();
3911 for (
unsigned int i = 0; i < n_scalar_dofs; i++)
3913 const auto global_index = var.
dofIndices()[i];
3922 sys->solution().close();
3923 sys->solution().localize(*sys->system().current_local_solution, sys->dofMap().get_send_list());
3926 _aux->solution().close();
3927 _aux->solution().localize(*
_aux->sys().current_local_solution,
_aux->dofMap().get_send_list());
3932 ConstElemRange & elem_range,
3934 const std::optional<std::set<VariableName>> & target_vars)
3948 for (
auto & nl :
_nl)
3949 nl->solution().close();
3950 _aux->solution().close();
3963 for (
auto & nl :
_nl)
3964 nl->solution().close();
3965 _aux->solution().close();
3973 for (
const auto & ic : ics)
3977 if (target_vars && !target_vars->count(var.
name()))
3982 DenseVector<Number> vals(var.
order());
3985 const unsigned int n_scalar_dofs = var.
dofIndices().size();
3986 for (
unsigned int i = 0; i < n_scalar_dofs; i++)
3988 const auto global_index = var.
dofIndices()[i];
3995 for (
auto & nl :
_nl)
3997 nl->solution().close();
3998 nl->solution().localize(*nl->system().current_local_solution, nl->dofMap().get_send_list());
4001 _aux->solution().close();
4002 _aux->solution().localize(*
_aux->sys().current_local_solution,
_aux->dofMap().get_send_list());
4007 Number (*func)(
const Point &,
4009 const std::string &,
4010 const std::string &),
4011 Gradient (*func_grad)(
const Point &,
4013 const std::string &,
4014 const std::string &),
4016 const std::vector<VariableName> & target_vars)
4019 "We're performing a projection based on data from just the thread 0 variable, so any "
4020 "modifications to the variable solution must have been thread joined already");
4022 std::unordered_map<unsigned int, std::vector<unsigned int>> sys_to_var_nums;
4024 for (
const auto & target_var : target_vars)
4028 sys_to_var_nums[sn].push_back(var.number());
4031 for (
const auto & [sys_num, var_nums] : sys_to_var_nums)
4034 libmesh_sys.
project_solution(func, func_grad, params, elem_range, var_nums);
4038std::shared_ptr<MaterialBase>
4047 name +=
"_neighbor";
4060 "), but its compute flag is set to true. This indicates that MOOSE is "
4061 "computing this property which may not be desired and produce un-expected "
4090 mooseError(
"FEProblemBase::getMaterialData(): Invalid MaterialDataType ",
type);
4093const std::set<const MooseObject *> &
4108 mooseError(
"FEProblemBase::getMaterialPropertyStorageConsumers(): Invalid MaterialDataType ",
4117 "ignore_zeros_in_jacobian",
4118 "We likely cannot preserve the sparsity pattern if ignoring zeros in the Jacobian, which "
4119 "leads to removing those entries from the Jacobian sparsity pattern");
4132 const std::string & name,
4135 parallel_object_only();
4137 auto add_functor_materials = [&](
const auto &
parameters,
const auto &
name)
4142 std::shared_ptr<MaterialBase> material =
4156 add_functor_materials(disp_params,
name +
"_displaced");
4162 const std::string & name,
4170 const std::string & name,
4178 const std::string & mat_name,
4179 const std::string & name,
4182 parallel_object_only();
4206#ifdef MOOSE_KOKKOS_ENABLED
4211 for (
THREAD_ID tid = 0; tid < n_threads; tid++)
4214 std::shared_ptr<MaterialBase> material =
4217 bool discrete = !material->getParam<
bool>(
"compute");
4221 if (material->boundaryRestricted() ||
dynamic_cast<FunctorMaterial *
>(material.get()))
4227 for (
auto && warehouse : warehouses)
4228 warehouse->addObject(material, tid);
4240 std::string object_name;
4249 object_name =
name +
"_face";
4250 std::shared_ptr<MaterialBase> face_material =
4256 current_parameters.
set<
bool>(
"_neighbor") =
true;
4257 object_name =
name +
"_neighbor";
4258 std::shared_ptr<MaterialBase> neighbor_material =
4267 for (
auto && warehouse : warehouses)
4268 warehouse->addObjects(material, neighbor_material, face_material, tid);
4273 const auto param_names =
4278 for (
const auto & p_name : param_names)
4281 p_name.parameter());
4283 p_name.parameter());
4285 p_name.parameter());
4287 primary_name, face_name,
false);
4289 primary_name, neighbor_name,
false);
4300 std::set<MooseVariableFEBase *> needed_moose_vars;
4301 std::unordered_set<unsigned int> needed_mat_props;
4310 for (
const auto id : ids)
4317 needed_moose_vars.insert(current_active_elemental_moose_variables.begin(),
4318 current_active_elemental_moose_variables.end());
4320 needed_mat_props.insert(consumer_needed_mat_props.begin(), consumer_needed_mat_props.end());
4331 auto && elem =
_assembly[tid][0]->elem();
4332 unsigned int n_points =
_assembly[tid][0]->qRule()->n_points();
4335 material_data.
resize(n_points);
4339 material_data.swap(*elem);
4352 const bool swap_stateful,
4353 const std::deque<MaterialBase *> *
const reinit_mats)
4359 auto && elem =
_assembly[tid][0]->elem();
4360 unsigned int side =
_assembly[tid][0]->side();
4361 unsigned int n_points =
_assembly[tid][0]->qRuleFace()->n_points();
4364 bnd_material_data.
resize(n_points);
4366 if (swap_stateful && !bnd_material_data.isSwapped())
4367 bnd_material_data.swap(*elem, side);
4370 bnd_material_data.reset(
4374 bnd_material_data.reinit(*reinit_mats);
4376 bnd_material_data.reinit(
4385 const bool swap_stateful,
4386 const std::deque<MaterialBase *> *
const reinit_mats)
4392 const auto *
const elem =
_assembly[tid][0]->elem();
4393 unsigned int side =
_assembly[tid][0]->side();
4394 unsigned int n_points =
_assembly[tid][0]->qRuleFace()->n_points();
4397 bnd_material_data.
resize(n_points);
4399 if (swap_stateful && !bnd_material_data.isSwapped())
4400 bnd_material_data.swap(*elem, side);
4403 bnd_material_data.reset(
4407 bnd_material_data.reinit(*reinit_mats);
4409 bnd_material_data.reinit(
4419 const bool swap_stateful,
4420 const std::deque<MaterialBase *> *
const reinit_mats)
4434 const bool swap_stateful,
4435 const std::deque<MaterialBase *> *
const reinit_mats)
4442 const Elem * neighbor =
_assembly[tid][0]->neighbor();
4443 unsigned int neighbor_side = neighbor->which_neighbor_am_i(
_assembly[tid][0]->elem());
4445 mooseAssert(neighbor,
"neighbor should be non-null");
4446 mooseAssert(blk_id == neighbor->subdomain_id(),
4447 "The provided blk_id " << blk_id <<
" and neighbor subdomain ID "
4448 << neighbor->subdomain_id() <<
" do not match.");
4450 unsigned int n_points =
_assembly[tid][0]->qRuleNeighbor()->n_points();
4453 neighbor_material_data.
resize(n_points);
4457 neighbor_material_data.swap(*neighbor, neighbor_side);
4460 neighbor_material_data.reset(
4464 neighbor_material_data.reinit(*reinit_mats);
4466 neighbor_material_data.reinit(
4474 const bool swap_stateful,
4475 const std::deque<MaterialBase *> *
const reinit_mats)
4479 auto && elem =
_assembly[tid][0]->elem();
4480 unsigned int side =
_assembly[tid][0]->side();
4481 unsigned int n_points =
_assembly[tid][0]->qRuleFace()->n_points();
4484 bnd_material_data.
resize(n_points);
4486 if (swap_stateful && !bnd_material_data.isSwapped())
4487 bnd_material_data.swap(*elem, side);
4493 bnd_material_data.reinit(*reinit_mats);
4506 const Elem *
const & elem =
_assembly[tid][0]->elem();
4507 unsigned int side =
_assembly[tid][0]->side();
4508 unsigned int n_points =
_assembly[tid][0]->qRuleFace()->n_points();
4511 bnd_material_data.
resize(n_points);
4513 if (swap_stateful && !bnd_material_data.isSwapped())
4514 bnd_material_data.swap(*elem, side);
4524 auto && elem =
_assembly[tid][0]->elem();
4531 auto && elem =
_assembly[tid][0]->elem();
4532 unsigned int side =
_assembly[tid][0]->side();
4540 const Elem * neighbor =
_assembly[tid][0]->neighbor();
4541 unsigned int neighbor_side =
4555 neighbor_side =
_assembly[tid][0]->side();
4556 mooseAssert(neighbor,
"We should have an appropriate value for elem coming from Assembly");
4567 const std::string & name,
4568 const std::string & type,
4572 _console <<
"[DBG] Adding " << system <<
" '" <<
name <<
"' of type " <<
type << std::endl;
4579 const std::string & object_name,
4580 const std::string & var_param_name)
4586 unsigned int sys_num = 0;
4595 const auto var_sys_num = sys_num;
4598 mooseError(
"We dont support setting 'variable' to a variable that is not set to the same "
4599 "system as the 'solver_sys' parameter");
4606 if (sys_num ==
_aux->number())
4622 if (sys_num ==
_aux->number())
4631 const std::string & type)
const
4636 " already exists. You may not add a ",
4638 " by the same name.");
4640#ifdef MOOSE_KOKKOS_ENABLED
4644 " already exists. You may not add a ",
4646 " by the same name.");
4652 const std::string & name,
4662 const std::string & name,
4672 const std::string & name,
4680std::vector<std::shared_ptr<UserObject>>
4682 const std::string & name,
4685 parallel_object_only();
4687 std::vector<std::shared_ptr<UserObject>> uos;
4695 std::shared_ptr<UserObject> user_object =
4698 uos.push_back(user_object);
4701 user_object->setPrimaryThreadCopy(uos[0].get());
4706 auto euo = std::dynamic_pointer_cast<ElementUserObject>(user_object);
4707 auto suo = std::dynamic_pointer_cast<SideUserObject>(user_object);
4708 auto isuo = std::dynamic_pointer_cast<InternalSideUserObject>(user_object);
4709 auto iuo = std::dynamic_pointer_cast<InterfaceUserObjectBase>(user_object);
4710 auto nuo = std::dynamic_pointer_cast<NodalUserObject>(user_object);
4711 auto duo = std::dynamic_pointer_cast<DomainUserObject>(user_object);
4712 auto guo = std::dynamic_pointer_cast<GeneralUserObject>(user_object);
4713 auto tguo = std::dynamic_pointer_cast<ThreadedGeneralUserObject>(user_object);
4714 auto muo = std::dynamic_pointer_cast<MortarUserObject>(user_object);
4727 if (euo || nuo || duo)
4729 if (suo || duo || isuo || iuo)
4731 if (iuo || duo || isuo)
4736 if ((guo && !tguo) || muo)
4745 const decltype(uos)::size_type uo_index = uos.front()->needThreadedCopy() ? tid : 0;
4759 const std::string & name,
4762 parallel_object_only();
4776 const std::string & name,
4779 parallel_object_only();
4794 std::vector<UserObject *> objs;
4798 .condition<AttribThread>(tid)
4803 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_user_object"),
4804 "A UserObject getter was called before UserObjects have been constructed. The "
4805 "requested UserObject '" +
4806 name +
"' may exist in the input file, but UserObjects are not available yet.");
4808 mooseError(
"Unable to find user object with name '" +
name +
"'");
4810 mooseAssert(objs.size() == 1,
"Should only find one UO");
4817 std::vector<Positions *> objs;
4821 .condition<AttribName>(
name)
4824 mooseError(
"Unable to find Positions object with name '" +
name +
"'");
4825 mooseAssert(objs.size() == 1,
"Should only find one Positions");
4832 std::vector<UserObject *> objs;
4836 .condition<AttribThread>(0)
4839 return !objs.empty();
4845 std::vector<FVGradientMethod *> methods;
4849 .condition<AttribThread>(tid)
4851 .queryInto(methods);
4853 if (methods.empty())
4854 mooseError(
"Unable to find FVGradientMethod with name '",
name,
"'");
4856 mooseAssert(methods.size() == 1,
"Expected a single FVGradientMethod per thread");
4857 return *(methods[0]);
4863 std::vector<FVGradientMethod *> methods;
4867 .condition<AttribThread>(0)
4869 .queryInto(methods);
4870 return !methods.empty();
4877 std::vector<FVInterpolationMethod *> methods;
4881 .condition<AttribThread>(tid)
4883 .queryInto(methods);
4885 if (methods.empty())
4887 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_interpolation_method"),
4888 "An FVInterpolationMethod getter was called before FVInterpolationMethods have "
4889 "been constructed. If you are attempting to access this object in the constructor "
4890 "of another object then make sure that the FVInterpolationMethod is constructed "
4891 "before the object using it.");
4893 mooseError(
"Unable to find FVInterpolationMethod with name '",
name,
"'");
4896 mooseAssert(methods.size() == 1,
"Expected a single FVInterpolationMethod per thread");
4897 return *(methods[0]);
4912 ") is not a scalar face interpolation method.");
4914 return *face_method;
4924 if (!advected_method)
4929 ") is not an advected interpolation method.");
4931 return *advected_method;
4937 std::vector<FVInterpolationMethod *> methods;
4941 .condition<AttribThread>(0)
4943 .queryInto(methods);
4944 return !methods.empty();
4957 std::vector<Postprocessor *> objs;
4961 .condition<AttribThread>(tid)
4966 mooseError(
"Unable to find Postprocessor with name '", object_name,
"'");
4967 mooseAssert(objs.size() == 1,
4968 "We shouldn't find more than one postprocessor object for a given name");
4974 std::size_t t_index)
const
4983 std::size_t t_index)
4992 mooseDeprecated(
"FEProblemBase::hasPostprocssor is being removed; use "
4993 "hasPostprocessorValueByName instead.");
4999 const std::string & vector_name,
5000 std::size_t t_index)
const
5008 const std::string & vector_name,
5010 std::size_t t_index)
5020 std::vector<VectorPostprocessor *> objs;
5024 .condition<AttribThread>(tid)
5031 getMooseApp().actionWarehouse().isTaskComplete(
"add_vector_postprocessor"),
5032 "A VectorPostprocessor getter was called before VectorPostprocessors have been "
5033 "constructed. The requested VectorPostprocessor '" +
5035 "' may exist in the input file, but VectorPostprocessors are not available yet.");
5037 mooseError(
"Unable to find VectorPostprocessor with name '", object_name,
"'");
5039 mooseAssert(objs.size() == 1,
5040 "We shouldn't find more than one vector postprocessor object for a given name");
5049 const auto & objects = it.second.getActiveObjects();
5050 for (
const auto & obj : objects)
5051 obj->parentOutputPositionChanged();
5068 TIME_SECTION(
"computeIndicators", 1,
"Computing Indicators");
5072 const auto old_do_derivatives = ADReal::do_derivatives;
5073 ADReal::do_derivatives =
false;
5075 std::vector<std::string> fields;
5079 for (
const auto & indicator : indicators)
5080 fields.push_back(indicator->name());
5084 for (
const auto & internal_indicator : internal_indicators)
5085 fields.push_back(internal_indicator->name());
5087 _aux->zeroVariables(fields);
5092 _aux->solution().close();
5097 _aux->solution().close();
5100 ADReal::do_derivatives = old_do_derivatives;
5109 TIME_SECTION(
"computeMarkers", 1,
"Computing Markers");
5111 std::vector<std::string> fields;
5115 for (
const auto & marker : markers)
5116 fields.push_back(marker->name());
5118 _aux->zeroVariables(fields);
5125 for (
const auto & marker : markers)
5126 marker->markerSetup();
5132 _aux->solution().close();
5163 for (
THREAD_ID tid = 0; tid < n_threads; tid++)
5169#ifdef MOOSE_KOKKOS_ENABLED
5173 _aux->customSetup(exec_type);
5174 for (
auto & nl :
_nl)
5175 nl->customSetup(exec_type);
5180 for (
THREAD_ID tid = 0; tid < n_threads; tid++)
5187 std::vector<UserObject *> userobjs;
5189 for (
auto obj : userobjs)
5190 obj->customSetup(exec_type);
5192#ifdef MOOSE_KOKKOS_ENABLED
5194 std::vector<UserObjectBase *> userobjs;
5196 for (
auto obj : userobjs)
5197 obj->customSetup(exec_type);
5245 std::unique_ptr<NumericVector<Number>> x =
_aux->currentSolution()->clone();
5253 const Real check_tol = 1e-8;
5255 const Real xnorm = x->l2_norm();
5256 *x -= *
_aux->currentSolution();
5257 if (x->l2_norm() > check_tol * xnorm)
5259 const auto & sys =
_aux->system();
5260 const unsigned int n_vars = sys.n_vars();
5261 std::multimap<Real, std::string, std::greater<Real>> ordered_map;
5262 for (
const auto i : make_range(
n_vars))
5264 const Real vnorm = sys.calculate_norm(*x, i, DISCRETE_L2);
5265 ordered_map.emplace(vnorm, sys.variable_name(i));
5268 std::ostringstream oss;
5269 for (
const auto & [error_norm, var_name] : ordered_map)
5270 oss <<
" {" << var_name <<
", " << error_norm <<
"},\n";
5272 mooseError(
"Aux kernels, user objects appear to have states for aux variables on ",
5274 ".\nVariable error norms in descending order:\n",
5279 if (pp_values.size() != new_pp_values.size())
5280 mooseError(
"Second execution for uo/aux state check should not change the number of "
5281 "real reporter values");
5283 const Real ppnorm = pp_values.l2_norm();
5284 pp_values -= new_pp_values;
5285 if (pp_values.l2_norm() > check_tol * ppnorm)
5288 std::multimap<Real, std::string, std::greater<Real>> ordered_map;
5289 for (
const auto i : index_range(pp_names))
5290 ordered_map.emplace(std::abs(pp_values(i)), pp_names[i]);
5292 std::ostringstream oss;
5293 for (
const auto & [error_norm, pp_name] : ordered_map)
5294 oss <<
" {" << pp_name <<
", " << error_norm <<
"},\n";
5296 mooseError(
"Aux kernels, user objects appear to have states for real reporter values on ",
5298 ".\nErrors of real reporter values in descending order:\n",
5308 std::vector<UserObject *> objs;
5309 query.queryInto(objs);
5314 for (
auto obj : objs)
5315 if (obj->primaryThreadCopy())
5316 obj->primaryThreadCopy()->threadJoin(*obj);
5322 for (
auto obj : objs)
5330 _console <<
"[DBG] Initializing, executing & finalizing general UO '" << obj->name()
5355 auto reporter =
dynamic_cast<Reporter *
>(obj);
5381 std::set<int> & execution_groups)
const
5383 std::vector<UserObjectBase *> uos;
5384 query.queryIntoUnsorted(uos);
5385 for (
const auto & uo : uos)
5386 execution_groups.insert(uo->getParam<
int>(
"execution_order_group"));
5392 const std::string & name)
5397 std::set<int> execution_groups;
5399#ifdef MOOSE_KOKKOS_ENABLED
5408 for (
const auto execution_group : execution_groups)
5410#ifdef MOOSE_KOKKOS_ENABLED
5425 std::set<int> execution_groups;
5427#ifdef MOOSE_KOKKOS_ENABLED
5435 for (
const auto execution_group : execution_groups)
5437#ifdef MOOSE_KOKKOS_ENABLED
5459 TIME_SECTION(
"computeUserObjects", 1,
"Computing User Objects");
5461 std::vector<GeneralUserObject *> genobjs;
5464 std::vector<UserObject *> userobjs;
5469 .queryInto(userobjs);
5471 std::vector<UserObject *> tgobjs;
5476 std::vector<UserObject *> nodal;
5479 std::vector<MortarUserObject *> mortar;
5482 if (userobjs.empty() && genobjs.empty() && tgobjs.empty() && nodal.empty() && mortar.empty())
5491 for (
auto obj : userobjs)
5492 obj->residualSetup();
5493 for (
auto obj : nodal)
5494 obj->residualSetup();
5495 for (
auto obj : mortar)
5496 obj->residualSetup();
5497 for (
auto obj : tgobjs)
5498 obj->residualSetup();
5499 for (
auto obj : genobjs)
5500 obj->residualSetup();
5504 for (
auto obj : userobjs)
5505 obj->jacobianSetup();
5506 for (
auto obj : nodal)
5507 obj->jacobianSetup();
5508 for (
auto obj : mortar)
5509 obj->jacobianSetup();
5510 for (
auto obj : tgobjs)
5511 obj->jacobianSetup();
5512 for (
auto obj : genobjs)
5513 obj->jacobianSetup();
5516 for (
auto obj : userobjs)
5520 if (!userobjs.empty())
5539 for (
const auto & uo : userobjs)
5543 _aux->solution().close();
5544 _aux->system().update();
5552 for (
auto obj : nodal)
5562 for (
const auto & uo : nodal)
5566 _aux->solution().close();
5567 _aux->system().update();
5573 for (
auto obj : mortar)
5575 if (!mortar.empty())
5577 auto create_and_run_mortar_functors = [
this,
type, &mortar](
const bool displaced)
5581 for (
const auto & [primary_secondary_boundary_pair, interface_config] : mortar_interfaces)
5583 auto mortar_uos_to_execute =
5585 primary_secondary_boundary_pair.second,
5589 auto *
const subproblem = displaced ? cast_ptr<SubProblem *>(
_displaced_problem.get())
5590 : cast_ptr<SubProblem *>(
this);
5592 *interface_config.amg,
5596 subproblem->assembly(0, 0));
5602 create_and_run_mortar_functors(
false);
5604 create_and_run_mortar_functors(
true);
5606 for (
auto obj : mortar)
5611 for (
auto obj : tgobjs)
5613 std::vector<GeneralUserObject *> tguos_zero;
5617 .queryInto(tguos_zero);
5618 for (
auto obj : tguos_zero)
5620 std::vector<GeneralUserObject *> tguos;
5621 auto q =
query.clone()
5650 TIME_SECTION(
"executeControls", 1,
"Executing Controls");
5656 for (
const auto & it : controls_wh.getActiveObjects())
5661 std::vector<std::string> & dependent_controls = it->getDependencies();
5662 for (
const auto & depend_name : dependent_controls)
5664 if (controls_wh.hasActiveObject(depend_name))
5666 auto dep_control = controls_wh.getActiveObject(depend_name);
5667 resolver.
addEdge(dep_control, it);
5672 "\" was not created, did you make a "
5673 "spelling mistake or forget to include it "
5674 "in your input file?");
5680 if (!ordered_controls.empty())
5687 for (
const auto & control : ordered_controls)
5700 std::vector<Sampler *> objects;
5704 .condition<AttribThread>(tid)
5706 .queryInto(objects);
5708 if (!objects.empty())
5710 TIME_SECTION(
"executeSamplers", 1,
"Executing Samplers");
5711 FEProblemBase::objectSetupHelper<Sampler>(objects, exec_type);
5712 FEProblemBase::objectExecuteHelper<Sampler>(objects);
5720 TIME_SECTION(
"updateActiveObjects", 5,
"Updating Active Objects");
5724 for (
auto & nl :
_nl)
5725 nl->updateActive(tid);
5726 _aux->updateActive(tid);
5743#ifdef MOOSE_KOKKOS_ENABLED
5757 TIME_SECTION(
"reinitBecauseOfGhostingOrNewGeomObjects",
5759 "Reinitializing Because of Geometric Search Objects");
5768 (
_mortar_data->hasDisplacedObjects() && mortar_changed)));
5783 const std::string & name,
5786 parallel_object_only();
5788 const auto nl_sys_num =
5794 mooseError(
"You are trying to add a DGKernel to a linear variable/system, which is not "
5795 "supported at the moment!");
5808 for (
auto & nl :
_nl)
5814 const std::string & name,
5817 parallel_object_only();
5843 std::shared_ptr<Indicator> indicator =
5846 std::shared_ptr<InternalSideIndicatorBase> isi =
5847 std::dynamic_pointer_cast<InternalSideIndicatorBase>(indicator);
5857 const std::string & name,
5860 parallel_object_only();
5894 const std::string & name,
5897 parallel_object_only();
5925 multi_app->possiblyCreateChildApplications();
5930 std::shared_ptr<TransientMultiApp> trans_multi_app =
5931 std::dynamic_pointer_cast<TransientMultiApp>(multi_app);
5932 if (trans_multi_app)
5948std::shared_ptr<MultiApp>
5952 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_multi_app"),
5953 "A MultiApp getter was called before MultiApps have been constructed. "
5954 "If you are attempting to access this object in the constructor of another object "
5955 "then make sure that the MultiApp is constructed before the object using it.");
5963 const MultiAppName & source_app)
5966 bool is_executing_a_transfer =
false;
5971 std::string string_direction;
5972 std::string additional_source_info =
"";
5974 string_direction =
" To ";
5975 else if (from_multiapp)
5976 string_direction =
" From ";
5978 string_direction =
" Between ";
5979 if (!source_app.empty())
5980 additional_source_info =
" from app '" + source_app +
"'";
5983 auto executeThisTransfer = [
this, &direction, &source_app, &
type](
auto & transfer)
5985 mooseAssert(transfer->getExecuteOnEnum().contains(
type),
"Should execute on this schedule");
5991 if (transfer->getFromName() == source_app && transfer->executeAfterSiblingSourceApp())
5993 libmesh_ignore(
this);
5994 mooseAssert(this->
getMultiApp(transfer->getFromName())->getExecuteOnEnum().contains(
type),
5995 "from_multiapp should also execute on this schedule");
6001 if ((source_app.empty() && (!transfer->executeAfterSiblingSourceApp() ||
6002 !transfer->getFromMultiApp()->getExecuteOnEnum().contains(
type))) ||
6003 (transfer->getFromName() == source_app && transfer->executeAfterSiblingSourceApp()))
6014 TIME_SECTION(
"execMultiAppTransfers", 1,
"Executing Transfers");
6021 {
"Name",
"Type",
"From",
"To"});
6024 for (
const auto & transfer : transfers)
6029 if (!executeThisTransfer(multiapp_transfer))
6032 is_executing_a_transfer =
true;
6033 table.addRow(multiapp_transfer->name(),
6034 multiapp_transfer->type(),
6035 multiapp_transfer->getFromName(),
6036 multiapp_transfer->getToName());
6040 if (is_executing_a_transfer)
6043 <<
"MultiApps" << additional_source_info << COLOR_DEFAULT <<
":" << std::endl;
6049 for (
const auto & transfer : transfers)
6051 auto multiapp_transfer = libMesh::cast_ptr<MultiAppTransfer *>(transfer.get());
6052 if (!executeThisTransfer(multiapp_transfer))
6055 transfer->setCurrentDirection(direction);
6056 transfer->execute();
6063 << COLOR_DEFAULT << std::endl;
6069 << COLOR_DEFAULT << std::endl;
6072std::vector<std::shared_ptr<Transfer>>
6083std::vector<std::shared_ptr<Transfer>>
6113 std::map<unsigned int, std::vector<std::shared_ptr<MultiApp>>> groups;
6115 if (multi_app->usingPositions())
6116 groups[multi_app->getParam<
unsigned int>(
"execution_order_group")].push_back(multi_app);
6124 std::map<unsigned int, std::vector<std::shared_ptr<MultiApp>>> check_groups;
6126 check_groups[multi_app->getParam<
unsigned int>(
"execution_order_group")].push_back(multi_app);
6127 for (
const auto & [group_id, group] : check_groups)
6128 for (
const auto & multi_app : group)
6129 if (group.size() > 1 && !multi_app->usingPositions())
6130 multi_app->paramError(
6131 "execution_order_group",
6132 "This MultiApp must be placed in its own execution order group as concurrent execution "
6133 "has not been implemented for this type of app at this time");
6138 for (
const auto & [group_id, group] : groups)
6141 if (group.size() < 2)
6148 std::vector<processor_id_type>
count(group.size());
6149 std::vector<processor_id_type> caps(group.size());
6150 std::vector<processor_id_type> mins(group.size());
6151 std::vector<processor_id_type> maxs(group.size());
6152 processor_id_type min_total = 0;
6153 for (
const auto m : index_range(group))
6156 mins[m] = group[m]->getParam<processor_id_type>(
"min_procs_per_app");
6157 maxs[m] = group[m]->getParam<processor_id_type>(
"max_procs_per_app");
6158 const auto n_apps_m = cast_int<processor_id_type>(group[m]->numGlobalApps());
6159 caps[m] = (maxs[m] >= n_procs) ? n_procs : std::min(n_procs, n_apps_m * maxs[m]);
6161 min_total += mins[m];
6164 if (min_total > n_procs)
6165 mooseError(
"Not enough MPI ranks to run the ",
6167 " multiapps of 'execution_order_group' ",
6169 " concurrently: they need at least ",
6171 " ranks (from 'min_procs_per_app') but only ",
6173 " are available. Reduce the number of concurrent multiapps, lower "
6174 "'min_procs_per_app', or run with more processors.");
6177 processor_id_type remaining = n_procs - min_total;
6178 bool progress =
true;
6179 while (remaining > 0 && progress)
6182 for (
const auto m : index_range(group))
6183 if (remaining > 0 &&
count[m] < caps[m])
6194 processor_id_type offset = 0;
6195 for (
const auto m : index_range(group))
6198 if (my_rank >= offset && my_rank < offset +
count[m])
6200 my_rank - offset,
count[m], group[m]->numGlobalApps(), mins[m], maxs[m],
false);
6201 group[m]->init(group[m]->numGlobalApps(), cfg);
6211 const std::vector<MooseSharedPointer<MultiApp>> & multi_apps =
6215 for (
const auto & multi_app : multi_apps)
6216 multi_app->preTransfer(
_dt,
_time);
6229 std::map<unsigned int, std::vector<MooseSharedPointer<MultiApp>>> ordered_multi_apps;
6231 for (
const auto & multi_app : multi_apps)
6232 ordered_multi_apps[multi_app->getParam<
unsigned int>(
"execution_order_group")].push_back(
6238 bool has_concurrent_apps =
false;
6239 for (
const auto & [group, multi_app_group] : ordered_multi_apps)
6240 if (multi_app_group.size() > 1)
6241 has_concurrent_apps =
true;
6242 if (!has_concurrent_apps)
6244 "num_concurrent_multiapps",
6245 "Due to the specified multiapp execution groups, or differences in execution schedules, "
6246 "concurrent multiapps are not actually used on " +
6251 if (multi_apps.size())
6253 TIME_SECTION(
"execMultiApps", 1,
"Executing MultiApps",
false);
6257 << COLOR_DEFAULT << std::endl;
6259 bool success =
true;
6261 for (
const auto & [group_id, multi_app_group] : ordered_multi_apps)
6263 bool group_success =
true;
6266 << COLOR_DEFAULT << std::endl;
6271 _console << COLOR_CYAN <<
"\nConcurrent MultiApps: " << std::endl;
6272 for (
const auto & multi_app : multi_app_group)
6273 _console << multi_app->name() <<
" ";
6274 _console << COLOR_DEFAULT << std::endl;
6283 for (
const auto & multi_app : multi_app_group)
6284 if (!multi_app->solveStep(
_dt,
_time, auto_advance))
6285 group_success =
false;
6299 for (
const auto & multi_app : multi_app_group)
6312 << COLOR_DEFAULT << std::endl;
6327 for (
const auto & multi_app : multi_apps)
6328 multi_app->finalize();
6336 for (
const auto & multi_app : multi_apps)
6337 multi_app->postExecute();
6345 if (multi_apps.size())
6346 for (
const auto & multi_app : multi_apps)
6347 multi_app->incrementTStep(
_time);
6355 if (multi_apps.size())
6358 _console << COLOR_CYAN <<
"\nAdvancing MultiApps on " <<
type.name() << COLOR_DEFAULT
6361 for (
const auto & multi_app : multi_apps)
6362 multi_app->finishStep(recurse_through_multiapp_levels);
6367 _console << COLOR_CYAN <<
"Finished Advancing MultiApps on " <<
type.name() <<
"\n"
6368 << COLOR_DEFAULT << std::endl;
6377 if (multi_apps.size())
6379 TIME_SECTION(
"backupMultiApps", 5,
"Backing Up MultiApp");
6382 _console << COLOR_CYAN <<
"\nBacking Up MultiApps on " <<
type.name() << COLOR_DEFAULT
6385 for (
const auto & multi_app : multi_apps)
6386 multi_app->backup();
6391 _console << COLOR_CYAN <<
"Finished Backing Up MultiApps on " <<
type.name() <<
"\n"
6392 << COLOR_DEFAULT << std::endl;
6401 if (multi_apps.size())
6406 _console << COLOR_CYAN <<
"\nRestoring Multiapps on " <<
type.name()
6407 <<
" because of solve failure!" << COLOR_DEFAULT << std::endl;
6409 _console << COLOR_CYAN <<
"\nRestoring MultiApps on " <<
type.name() << COLOR_DEFAULT
6413 for (
const auto & multi_app : multi_apps)
6414 multi_app->restore(force);
6419 _console << COLOR_CYAN <<
"Finished Restoring MultiApps on " <<
type.name() <<
"\n"
6420 << COLOR_DEFAULT << std::endl;
6429 Real smallest_dt = std::numeric_limits<Real>::max();
6431 for (
const auto & multi_app : multi_apps)
6432 smallest_dt = std::min(smallest_dt, multi_app->computeDT());
6439 const std::string & name,
6442 parallel_object_only();
6473 std::shared_ptr<MultiApp> multiapp;
6486 exec_enum = multiapp->getParam<
ExecFlagEnum>(
"execute_on");
6494 std::shared_ptr<MultiAppTransfer> multi_app_transfer =
6495 std::dynamic_pointer_cast<MultiAppTransfer>(transfer);
6496 if (multi_app_transfer)
6513 if (sys->hasVariable(var_name))
6515 if (
_aux->hasVariable(var_name))
6525 if (sys->hasVariable(var_name))
6533 const std::string & var_name,
6545 if (sys->hasVariable(var_name))
6546 return sys->getFieldVariable<Real>(tid, var_name);
6547 if (
_aux->hasVariable(var_name))
6548 return _aux->getFieldVariable<Real>(tid, var_name);
6557 if (sys->hasVariable(var_name))
6558 return sys->getActualFieldVariable<Real>(tid, var_name);
6559 if (
_aux->hasVariable(var_name))
6560 return _aux->getActualFieldVariable<Real>(tid, var_name);
6569 if (sys->hasVariable(var_name))
6570 return sys->getFieldVariable<RealVectorValue>(tid, var_name);
6571 if (
_aux->hasVariable(var_name))
6572 return _aux->getFieldVariable<RealVectorValue>(tid, var_name);
6581 if (sys->hasVariable(var_name))
6582 return sys->getFieldVariable<RealEigenVector>(tid, var_name);
6583 if (
_aux->hasVariable(var_name))
6584 return _aux->getFieldVariable<RealEigenVector>(tid, var_name);
6593 if (sys->hasScalarVariable(var_name))
6595 if (
_aux->hasScalarVariable(var_name))
6605 if (sys->hasScalarVariable(var_name))
6606 return sys->getScalarVariable(tid, var_name);
6607 if (
_aux->hasScalarVariable(var_name))
6608 return _aux->getScalarVariable(tid, var_name);
6619 else if (
_aux->hasVariable(var_name) ||
_aux->hasScalarVariable(var_name))
6620 return _aux->system();
6622 mooseError(
"Unable to find a system containing the variable " + var_name);
6730 mat->setActiveProperties(mat_prop_ids);
6732 mat->setActiveProperties(mat_prop_ids);
6734 mat->setActiveProperties(mat_prop_ids);
6754#ifdef LIBMESH_ENABLE_AMR
6764 const std::string & redistributer_name,
6765 const bool use_displaced_mesh)
6769 redistribute_params.
set<std::string>(
"for_whom") = this->
name();
6773 redistribute_params.
set<
bool>(
"use_displaced_mesh") = use_displaced_mesh;
6776 std::shared_ptr<RedistributeProperties> redistributer =
6778 "RedistributeProperties", redistributer_name, redistribute_params);
6789 mesh.
getMesh().add_ghosting_functor(redistributer);
6792 add_redistributer(
_mesh,
"mesh_property_redistributer",
false);
6794 add_redistributer(
_displaced_problem->mesh(),
"displaced_mesh_property_redistributer",
true);
6816 mooseError(
"Max quadrature points per element assumptions made in some code (e.g. Coupleable ",
6817 "and MaterialPropertyInterface classes) have been violated.\n",
6818 "Complain to Moose developers to have constMaxQpsPerElem increased from ",
6826 _zero[tid].resize(max_qpts, 0);
6828 _grad_zero[tid].resize(max_qpts, RealGradient(0.));
6841 for (
const auto i : index_range(
_nl))
6854 for (
const auto i : index_range(
_nl))
6869 const bool allow_negative_qweights)
6871 if (order == INVALID_ORDER)
6875 for (
const auto i : make_range(std::size_t(1),
_solver_systems.size()))
6878 if (order < _aux->getMinQuadratureOrder())
6879 order =
_aux->getMinQuadratureOrder();
6882 if (volume_order == INVALID_ORDER)
6883 volume_order = order;
6885 if (face_order == INVALID_ORDER)
6891 type, order, volume_order, face_order, block, allow_negative_qweights);
6895 type, order, volume_order, face_order, block, allow_negative_qweights);
6906 mooseError(
"Someone told us (the FEProblemBase) to trust the user coupling matrix, but we "
6907 "haven't been provided a coupling matrix!");
6928 _cm[i] = std::move(cm);
6935 mooseError(
"Someone told us (the FEProblemBase) to trust the user coupling matrix, but we "
6936 "haven't been provided a coupling matrix!");
6944 TIME_SECTION(
"setNonlocalCouplingMatrix", 5,
"Setting Nonlocal Coupling Matrix");
6947 mooseError(
"Nonlocal kernels are weirdly stored on the FEProblem so we don't currently support "
6948 "multiple nonlinear systems with nonlocal kernels.");
6950 for (
const auto nl_sys_num : index_range(
_nl))
6952 auto & nl =
_nl[nl_sys_num];
6954 unsigned int n_vars = nl->nVariables();
6955 nonlocal_cm.resize(
n_vars);
6956 const auto &
vars = nl->getVariables(0);
6959 for (
const auto & ivar :
vars)
6961 for (
const auto & kernel : nonlocal_kernel)
6963 for (
unsigned int i = ivar->number(); i < ivar->number() + ivar->count(); ++i)
6964 if (i == kernel->variable().number())
6965 for (
const auto & jvar :
vars)
6970 unsigned int j = jvar->number();
6971 nonlocal_cm(i, j) = 1;
6975 for (
const auto & integrated_bc : nonlocal_integrated_bc)
6977 for (
unsigned int i = ivar->number(); i < ivar->number() + ivar->count(); ++i)
6978 if (i == integrated_bc->variable().number())
6979 for (
const auto & jvar :
vars)
6984 unsigned int j = jvar->number();
6985 nonlocal_cm(i, j) = 1;
6995 const unsigned int jvar,
6996 const unsigned int nl_sys)
const
6998 return (*
_cm[nl_sys])(ivar, jvar);
7001std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
7004 return _assembly[tid][nl_sys]->couplingEntries();
7007std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
7010 return _assembly[tid][nl_sys]->nonlocalCouplingEntries();
7013const std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> &
7016 return _assembly[tid][nl_sys]->fieldScalarCouplingEntries();
7025 TIME_SECTION(
"init", 2,
"Initializing");
7036 for (
const auto i : index_range(
_nl))
7041 unsigned int n_vars = nl->nVariables();
7043 TIME_SECTION(
"fillCouplingMatrix", 3,
"Filling Coupling Matrix");
7048 cm = std::make_unique<CouplingMatrix>(
n_vars);
7049 for (
unsigned int i = 0; i <
n_vars; i++)
7055 cm = std::make_unique<CouplingMatrix>(
n_vars);
7056 for (
unsigned int i = 0; i <
n_vars; i++)
7057 for (
unsigned int j = 0; j <
n_vars; j++)
7067 nl->dofMap()._dof_coupling = cm.get();
7073 nl->dofMap()._dof_coupling =
nullptr;
7075 nl->dofMap().attach_extra_sparsity_function(&
extraSparsity, nl.get());
7076 nl->dofMap().attach_extra_send_list_function(&
extraSendList, nl.get());
7080 mooseError(
"No variables specified in nonlinear system '", nl->name(),
"'.");
7102 for (
auto & nl :
_nl)
7104 nl->turnOffJacobian();
7122 TIME_SECTION(
"EquationSystems::Init", 2,
"Initializing Equation Systems");
7140 for (
const auto i : index_range(
_nl))
7144 "Coupling matrix not set for system "
7146 <<
". This should only happen if a preconditioner was not setup for this system");
7153#ifdef MOOSE_KOKKOS_ENABLED
7164 std::istringstream ss(nl_sys_name);
7165 unsigned int nl_sys_num;
7166 if (!(ss >> nl_sys_num) || !ss.eof())
7175 std::istringstream ss(linear_sys_name);
7176 unsigned int linear_sys_num;
7177 if (!(ss >> linear_sys_num) || !ss.eof())
7180 return linear_sys_num;
7186 std::istringstream ss(solver_sys_name);
7187 unsigned int solver_sys_num;
7188 if (!(ss >> solver_sys_num) || !ss.eof())
7192 mooseError(
"The solver system number was requested for system '" + solver_sys_name,
7193 "' but this system does not exist in the Problem. Systems can be added to the "
7194 "problem using the 'nl_sys_names'/'linear_sys_names' parameter.\nSystems in the "
7197 solver_sys_num = search->second;
7200 return solver_sys_num;
7207 if (solver_sys->hasVariable(variable_name))
7208 return solver_sys->number();
7209 mooseAssert(
_aux,
"Should have an auxiliary system");
7210 if (
_aux->hasVariable(variable_name))
7211 return _aux->number();
7215 "' was not found in any solver (nonlinear/linear) or auxiliary system");
7221 TIME_SECTION(
"solve", 1,
"Solving",
false);
7235#if PETSC_RELEASE_LESS_THAN(3, 12, 0)
7274#if !PETSC_RELEASE_LESS_THAN(3, 12, 0)
7276 LibmeshPetscCall(PetscOptionsPop());
7293 TIME_SECTION(
"checkExceptionAndStopSolve", 5);
7313 <<
"To recover, the solution will fail and then be re-attempted with a reduced time "
7328 _aux->solution().close();
7342 mooseError(
"The following parallel-communicated exception was detected during " +
7345 "\nBecause this did not occur during residual evaluation, there"
7346 " is no way to handle this, so the solution is aborting.\n");
7354 ADReal::do_derivatives =
true;
7379 TIME_SECTION(
"solve", 1,
"Solving",
false);
7389#if PETSC_RELEASE_LESS_THAN(3, 12, 0)
7391 options, solver_params));
7409#if !PETSC_RELEASE_LESS_THAN(3, 12, 0)
7411 LibmeshPetscCall(PetscOptionsPop());
7427 return _nl[nl_sys_num]->nNonlinearIterations();
7433 return _nl[nl_sys_num]->nLinearIterations();
7439 return _nl[nl_sys_num]->finalNonlinearResidual();
7445 return _nl[nl_sys_num]->computingPreSMOResidual();
7451 TIME_SECTION(
"copySolutionsBackwards", 3,
"Copying Solutions Backward");
7454 sys->copyStateHistoryBackwards();
7455 _aux->copyStateHistoryBackwards();
7462 sys->skipNextSolutionToOldCopy();
7463 _aux->skipNextSolutionToOldCopy();
7469 TIME_SECTION(
"advanceState", 5,
"Advancing State");
7495#ifdef MOOSE_KOKKOS_ENABLED
7530 TIME_SECTION(
"restoreSolutions", 5,
"Restoring Solutions");
7534 "There is currently no way to restore not-zeroed vectors.");
7539 _console <<
"Restoring solutions on system " << sys->name() <<
"..." << std::endl;
7540 sys->restoreStateHistory();
7544 _console <<
"Restoring solutions on Auxiliary system..." << std::endl;
7545 _aux->restoreStateHistory();
7548 _console <<
"Restoring postprocessor, vector-postprocessor, and reporter data..." << std::endl;
7558 TIME_SECTION(
"saveOldSolutions", 5,
"Saving Old Solutions");
7561 sys->saveOldSolutions();
7562 _aux->saveOldSolutions();
7568 TIME_SECTION(
"restoreOldSolutions", 5,
"Restoring Old Solutions");
7571 sys->restoreOldSolutions();
7572 _aux->restoreOldSolutions();
7578 TIME_SECTION(
"outputStep", 1,
"Outputting");
7615 TIME_SECTION(
"onTimestepBegin", 2);
7617 for (
auto & nl :
_nl)
7618 nl->onTimestepBegin();
7634 switch (state.
state)
7646 mooseError(
"Unhandled state ", state.
state,
" in FEProblemBase::getTimeFromStateArg");
7652 const std::string & name,
7655 parallel_object_only();
7667 _aux->addDotVectors();
7668 for (
auto & nl :
_nl)
7670 nl->addDotVectors();
7672 auto tag_udot = nl->getTimeIntegrators()[0]->uDotFactorTag();
7673 if (!nl->hasVector(tag_udot))
7674 nl->associateVectorToTag(*nl->solutionUDot(), tag_udot);
7675 auto tag_udotdot = nl->getTimeIntegrators()[0]->uDotDotFactorTag();
7677 nl->associateVectorToTag(*nl->solutionUDotDot(), tag_udotdot);
7687 const std::string & name,
7690 parallel_object_only();
7693 mooseError(
"Vector bounds cannot be used with LinearSystems!");
7699 for (
auto & nl :
_nl)
7700 nl->setPredictor(predictor);
7724 residual->scale(-1.0);
7726 return residual->l2_norm();
7732 TIME_SECTION(
"computeResidualL2Norm", 2,
"Computing L2 Norm of Residual");
7736 for (
auto sys :
_nl)
7739 l2_norm += norm * norm;
7745 l2_norm += norm * norm;
7748 return std::sqrt(l2_norm);
7753 const NumericVector<Number> & soln,
7754 NumericVector<Number> & residual)
7756 parallel_object_only();
7758 TIME_SECTION(
"computeResidualSys", 5);
7767 const NumericVector<Number> & soln,
7768 NumericVector<Number> & residual)
7777 NumericVector<Number> & residual,
7778 const unsigned int nl_sys_num)
7787 mooseAssert(
_fe_vector_tags.empty(),
"This should be empty indicating a clean starting state");
7798 NumericVector<Number> & residual,
7799 SparseMatrix<Number> & jacobian)
7810 "This should be empty indicating a clean starting state");
7822 for (
auto & tag : tags)
7840 for (
auto index : make_range(matrix.row_start(), matrix.row_stop()))
7841 matrix.add(index, index, 0);
7844 _aux->zeroVariablesForResidual();
7866 for (
unsigned int tid = 0; tid < n_threads; tid++)
7871 _aux->residualSetup();
7881 for (
THREAD_ID tid = 0; tid < n_threads; tid++)
7887#ifdef MOOSE_KOKKOS_ENABLED
7930 NumericVector<Number> & residual,
7952 mooseError(
"An unhandled MooseException was raised during residual computation. Please "
7953 "contact the MOOSE team for assistance.");
7959 NumericVector<Number> & residual,
7960 const std::set<TagID> & tags)
7962 parallel_object_only();
7964 TIME_SECTION(
"computeResidualInternal", 1);
7985 mooseError(
"An unhandled MooseException was raised during residual computation. Please "
7986 "contact the MOOSE team for assistance.");
7992 NumericVector<Number> & residual,
7995 TIME_SECTION(
"computeResidualType", 5);
8016 mooseError(
"An unhandled MooseException was raised during residual computation. Please "
8017 "contact the MOOSE team for assistance.");
8024 auto create_exception_message =
8025 [&calling_method](
const std::string & exception_type,
const auto & exception)
8027 return std::string(
"A " + exception_type +
" was raised during FEProblemBase::" +
8028 calling_method +
"\n" + std::string(exception.what()));
8037 setException(create_exception_message(
"MooseException", e));
8039 catch (
const MetaPhysicL::LogicError & e)
8055 mooseError(create_exception_message(
"libMesh::PetscSolverException", e));
8057 catch (
const std::exception & e)
8060 if (strstr(e.
what(),
"Jacobian") || strstr(e.
what(),
"singular") ||
8061 strstr(e.
what(),
"det != 0"))
8062 setException(create_exception_message(
"libMesh DegenerateMap", e));
8065 const auto message = create_exception_message(
"std::exception", e);
8079 parallel_object_only();
8085 TIME_SECTION(
"computeResidualTags", 5,
"Computing Residual");
8087 ADReal::do_derivatives =
false;
8091 _aux->zeroVariablesForResidual();
8111 for (
unsigned int tid = 0; tid < n_threads; tid++)
8116 _aux->residualSetup();
8126 for (
THREAD_ID tid = 0; tid < n_threads; tid++)
8132#ifdef MOOSE_KOKKOS_ENABLED
8168 const NumericVector<Number> & soln,
8169 SparseMatrix<Number> & jacobian)
8178 SparseMatrix<Number> & jacobian,
8192 SparseMatrix<Number> & jacobian,
8193 const unsigned int nl_sys_num)
8200 for (
auto & tag : tags)
8208 SparseMatrix<Number> & jacobian,
8209 const std::set<TagID> & tags)
8211 TIME_SECTION(
"computeJacobianInternal", 1);
8231 TIME_SECTION(
"computeJacobianTags", 5,
"Computing Jacobian");
8233 for (
auto tag : tags)
8245 for (
auto index : make_range(matrix.row_start(), matrix.row_stop()))
8246 matrix.add(index, index, 0);
8249 _aux->zeroVariablesForJacobian();
8264 for (
unsigned int tid = 0; tid < n_threads; tid++)
8269 _aux->jacobianSetup();
8284 for (
unsigned int tid = 0; tid < n_threads; tid++)
8290#ifdef MOOSE_KOKKOS_ENABLED
8335 const unsigned int nl_sys_num)
8337 TIME_SECTION(
"computeTransientImplicitJacobian", 2);
8359 JacobianBlock jac_block(precond_system, jacobian, ivar, jvar);
8360 std::vector<JacobianBlock *>
blocks = {&jac_block};
8367 NumericVector<Number> & lower,
8368 NumericVector<Number> & upper)
8375 "I expect these system numbers to be the same");
8380 TIME_SECTION(
"computeBounds", 1,
"Computing Bounds");
8389 _aux->residualSetup();
8411 SparseMatrix<Number> & system_matrix,
8412 NumericVector<Number> & rhs,
8413 const bool compute_gradients)
8415 TIME_SECTION(
"computeLinearSystemSys", 5);
8448 const std::set<TagID> & vector_tags,
8449 const std::set<TagID> & matrix_tags,
8450 const bool compute_gradients)
8452 TIME_SECTION(
"computeLinearSystemTags", 5,
"Computing Linear System");
8456 for (
auto tag : matrix_tags)
8474 _aux->jacobianSetup();
8476 for (
THREAD_ID tid = 0; tid < n_threads; tid++)
8481#ifdef MOOSE_KOKKOS_ENABLED
8491 _console <<
"\nA MooseException was raised during Auxiliary variable computation.\n"
8492 <<
"The next solve will fail, the timestep will be reduced, and we will try again.\n"
8519 std::vector<NumericVector<Number> *> & sp)
8522 "I expect these system numbers to be the same");
8525 for (
unsigned int i = 0; i <
subspaceDim(
"NearNullSpace"); ++i)
8527 std::stringstream postfix;
8528 postfix <<
"_" << i;
8529 std::string modename =
"NearNullSpace" + postfix.str();
8536 std::vector<NumericVector<Number> *> & sp)
8539 "I expect these system numbers to be the same");
8541 for (
unsigned int i = 0; i <
subspaceDim(
"NullSpace"); ++i)
8543 std::stringstream postfix;
8544 postfix <<
"_" << i;
8551 std::vector<NumericVector<Number> *> & sp)
8554 "I expect these system numbers to be the same");
8556 for (
unsigned int i = 0; i <
subspaceDim(
"TransposeNullSpace"); ++i)
8558 std::stringstream postfix;
8559 postfix <<
"_" << i;
8566 const NumericVector<Number> & old_soln,
8567 NumericVector<Number> & search_direction,
8568 NumericVector<Number> & new_soln,
8569 bool & changed_search_direction,
8570 bool & changed_new_soln)
8573 "I expect these system numbers to be the same");
8584 TIME_SECTION(
"computePostCheck", 2,
"Computing Post Check");
8599 std::unique_ptr<NumericVector<Number>> ghosted_solution =
8600 sys.current_local_solution->zero_clone(),
8601 ghosted_search_direction =
8602 sys.current_local_solution->zero_clone();
8605 *ghosted_solution = new_soln;
8606 *ghosted_search_direction = search_direction;
8611 Real damping =
computeDamping(*ghosted_solution, *ghosted_search_direction);
8617 new_soln = old_soln;
8618 new_soln.add(-damping, search_direction);
8619 changed_new_soln =
true;
8626 if (changed_new_soln)
8627 *ghosted_solution = new_soln;
8629 bool updated_solution =
updateSolution(new_soln, *ghosted_solution);
8630 if (updated_solution)
8631 changed_new_soln =
true;
8638 _aux->copyCurrentIntoPreviousNL();
8642 changed_search_direction =
false;
8649 const NumericVector<Number> & update)
8656 TIME_SECTION(
"computeDamping", 1,
"Computing Damping");
8684 NumericVector<Number> & )
8697 parallel_object_only();
8706 TIME_SECTION(
"updateGeometricSearch", 3,
"Updating Geometric Search");
8717 TIME_SECTION(
"updateMortarMesh", 5,
"Updating Mortar Mesh");
8735 const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
8736 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
8740 const bool correct_edge_dropping,
8741 const Real minimum_projection_angle,
8742 const Mortar3DSubpatchPlane mortar_3d_subpatch_plane,
8744 const bool triangulate_triangles,
8745 const Mortar3DQuadraturePointMapping mortar_3d_qp_mapping)
8750 return _mortar_data->createMortarInterface(primary_secondary_boundary_pair,
8751 primary_secondary_subdomain_pair,
8756 correct_edge_dropping,
8757 minimum_projection_angle,
8758 mortar_3d_subpatch_plane,
8760 triangulate_triangles,
8761 mortar_3d_qp_mapping);
8763 return _mortar_data->createMortarInterface(primary_secondary_boundary_pair,
8764 primary_secondary_subdomain_pair,
8769 correct_edge_dropping,
8770 minimum_projection_angle,
8771 mortar_3d_subpatch_plane,
8773 triangulate_triangles,
8774 mortar_3d_qp_mapping);
8779 const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
8780 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
8781 bool on_displaced)
const
8784 primary_secondary_boundary_pair, primary_secondary_subdomain_pair, on_displaced);
8789 const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
8790 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
8794 primary_secondary_boundary_pair, primary_secondary_subdomain_pair, on_displaced);
8802 TIME_SECTION(
"possiblyRebuildGeomSearchPatches", 5,
"Rebuilding Geometric Search Patches");
8836 libmesh_fallthrough();
8842 _console <<
"\n\nUpdating geometric search patches\n" << std::endl;
8858#ifdef LIBMESH_ENABLE_AMR
8867 mooseError(
"HFEM does not support mesh adaptivity currently.");
8869 TIME_SECTION(
"initialAdaptMesh", 2,
"Performing Initial Adaptivity");
8871 for (
unsigned int i = 0; i < n; i++)
8888 _console <<
"Mesh unchanged, skipping remaining steps..." << std::endl;
8904 TIME_SECTION(
"adaptMesh", 3,
"Adapting Mesh");
8908 bool mesh_changed =
false;
8910 for (
unsigned int i = 0; i < cycles_per_step; ++i)
8913 mooseError(
"HFEM does not support mesh adaptivity currently.");
8919 bool mesh_changed_this_step;
8922 if (mesh_changed_this_step)
8924 mesh_changed =
true;
8937 _console <<
"Mesh unchanged, skipping remaining steps..." << std::endl;
8953 return mesh_changed;
8969 data[tid] = &storage.getMaterialData(tid);
8976 for (
unsigned int i = 0; i < n_threads; ++i)
8977 for (
const auto nl_sys_num : index_range(
_nl))
8988 TIME_SECTION(
"updateMeshXFEM", 5,
"Updating XFEM");
8990 bool updated =
false;
8993 if (
_xfem->updateHeal())
8998 false,
true,
false);
9004 false,
true,
false);
9007 _console <<
"\nXFEM update complete: Mesh modified" << std::endl;
9010 _console <<
"\nXFEM update complete: Mesh not modified" << std::endl;
9017 const bool contract_mesh,
9018 const bool clean_refinement_flags)
9020 TIME_SECTION(
"meshChanged", 3,
"Handling Mesh Changes");
9042 if (intermediate_change)
9047 if (should_contract)
9050 if (clean_refinement_flags)
9058 if (!intermediate_change)
9094 mooseError(
"Disabling mesh contraction is not implemented when a displaced problem is used. "
9096 "developer of this application to discuss the combination of these features.");
9114 for (
auto & nl_sys :
_nl)
9115 nl_sys->reinitMortarFunctors();
9140 for (
const auto & elem : range)
9157 for (
const auto & elem : range)
9160 for (
auto && child : coarsened_children)
9196 mdi->meshDisplaced();
9207 cmt(elem_range,
true);
9209#ifdef MOOSE_KOKKOS_ENABLED
9218 TIME_SECTION(
"checkProblemIntegrity", 5);
9221 const auto & subdomain_names = getParam<std::vector<SubdomainName>>(
"block");
9223 std::set<SubdomainID> mesh_subdomains(mesh_subdomains_vec.begin(), mesh_subdomains_vec.end());
9229 std::set<SubdomainID>
blocks;
9232 blocks = mesh_subdomains;
9235 blocks = mesh_subdomains;
9243 "\" not found in mesh.");
9255 "\" not found in mesh.");
9259 for (
auto & nl :
_nl)
9260 nl->checkKernelCoverage(
blocks);
9265#ifdef LIBMESH_ENABLE_AMR
9270 _console <<
"Using EXPERIMENTAL Stateful Material Property projection with Adaptivity!\n"
9275 std::set<SubdomainID> local_mesh_subs(mesh_subdomains);
9284 bool check_material_coverage =
false;
9286 for (
const auto &
id : ids)
9288 local_mesh_subs.erase(
id);
9289 check_material_coverage =
true;
9300 "Subdomain \"" + subdomain_name +
"\" not found in mesh.");
9301 local_mesh_subs.erase(
id);
9306 std::set<SubdomainID>
blocks(local_mesh_subs);
9312 "Subdomain \"" + subdomain_name +
"\" not found in mesh.");
9315 for (
const auto id :
blocks)
9316 local_mesh_subs.erase(
id);
9320 auto && mortar_subdomain_ids =
_mortar_data->getMortarSubdomainIDs();
9321 for (
auto subdomain_id : mortar_subdomain_ids)
9322 local_mesh_subs.erase(subdomain_id);
9325 if (check_material_coverage && !local_mesh_subs.empty())
9327 std::stringstream extra_subdomain_ids;
9329 std::copy(local_mesh_subs.begin(),
9330 local_mesh_subs.end(),
9331 std::ostream_iterator<unsigned int>(extra_subdomain_ids,
" "));
9333 std::vector<SubdomainID> local_mesh_subs_vec(local_mesh_subs.begin(),
9334 local_mesh_subs.end());
9336 mooseError(
"The following blocks from your input mesh do not contain an active material: " +
9337 extra_subdomain_ids.str() +
9339 ")\nWhen ANY mesh block contains a Material object, "
9340 "all blocks must contain a Material object.\n");
9350 for (
const auto & material : materials)
9351 material->checkStatefulSanity();
9371 mooseError(
"Coordinate transformation parameters, listed below, are only to be used in the "
9372 "context of application to application field transfers at this time. The mesh is "
9373 "not modified by these parameters within an application.\n"
9374 "You should likely use a 'TransformGenerator' in the [Mesh] block to achieve the "
9375 "desired mesh modification.\n\n",
9392 bool mesh_has_second_order_elements =
false;
9396 if (elem->default_order() == SECOND)
9398 mesh_has_second_order_elements =
true;
9408 if (mesh_has_second_order_elements)
9410 const std::vector<std::string> & displacement_variables =
9413 for (
const auto & var_name : displacement_variables)
9420 if (mv.
order() != SECOND)
9421 mooseError(
"Error: mesh has SECOND order elements, so all displacement variables must be "
9433 std::set<SubdomainID> user_objects_blocks;
9437 std::set<std::string> names;
9439 std::vector<UserObjectBase *> objects;
9442 for (
const auto & obj : objects)
9443 names.insert(obj->name());
9446 std::set<SubdomainID> difference;
9447 std::set_difference(user_objects_blocks.begin(),
9448 user_objects_blocks.end(),
9449 mesh_subdomains.begin(),
9450 mesh_subdomains.end(),
9451 std::inserter(difference, difference.end()));
9453 if (!difference.empty())
9455 std::ostringstream oss;
9456 oss <<
"One or more UserObjects is referencing a nonexistent block:\n";
9457 for (
const auto &
id : difference)
9465 const std::map<
SubdomainID, std::vector<std::shared_ptr<MaterialBase>>> & materials_map)
9467 for (
const auto & it : materials_map)
9470 std::set<std::string> block_depend_props, block_supplied_props;
9472 for (
const auto & mat1 : it.second)
9474 auto & alldeps = mat1->getMatPropDependencies();
9475 for (
auto & dep : alldeps)
9479 for (
const auto & mat2 : it.second)
9481 const std::set<std::string> & supplied_props = mat2->MaterialBase::getSuppliedItems();
9482 block_supplied_props.insert(supplied_props.begin(), supplied_props.end());
9491 std::set<std::string> difference;
9492 std::set_difference(block_depend_props.begin(),
9493 block_depend_props.end(),
9494 block_supplied_props.begin(),
9495 block_supplied_props.end(),
9496 std::inserter(difference, difference.end()));
9498 if (!difference.empty())
9500 std::ostringstream oss;
9501 oss <<
"One or more Material Properties were not supplied on block ";
9503 if (subdomain_name.length() > 0)
9504 oss << subdomain_name <<
" (" << it.first <<
")";
9508 for (
const auto &
name : difference)
9509 oss <<
name <<
"\n";
9515 for (
const auto & it : materials_map)
9517 const auto & materials = it.second;
9518 std::set<std::string> inner_supplied, outer_supplied;
9520 for (
const auto & outer_mat : materials)
9523 outer_supplied = outer_mat->getSuppliedItems();
9524 inner_supplied.clear();
9527 std::map<std::string, std::set<std::string>> prop_to_mat;
9528 for (
const auto &
name : outer_supplied)
9529 prop_to_mat[
name].insert(outer_mat->name());
9531 for (
const auto & inner_mat : materials)
9533 if (outer_mat == inner_mat)
9537 auto outer_mat_type = outer_mat->type();
9538 auto inner_mat_type = inner_mat->type();
9543 if (outer_mat_type == inner_mat_type && outer_mat_type != outer_mat->type() &&
9544 inner_mat_type != inner_mat->type())
9547 inner_supplied.insert(inner_mat->getSuppliedItems().begin(),
9548 inner_mat->getSuppliedItems().end());
9550 for (
const auto & inner_supplied_name : inner_supplied)
9551 prop_to_mat[inner_supplied_name].insert(inner_mat->name());
9555 std::set<std::string> intersection;
9556 std::set_intersection(outer_supplied.begin(),
9557 outer_supplied.end(),
9558 inner_supplied.begin(),
9559 inner_supplied.end(),
9560 std::inserter(intersection, intersection.end()));
9562 if (!intersection.empty())
9564 std::ostringstream oss;
9565 oss <<
"The following material properties are declared on block " << it.first
9566 <<
" by multiple materials:\n";
9568 <<
"Material Objects\n";
9569 for (
const auto & outer_name : intersection)
9572 for (
const auto & inner_name : prop_to_mat[outer_name])
9573 oss << inner_name <<
" ";
9595 mooseInfo(
"Restart file ", file_name,
" is NOT being used since we are performing recovery.");
9601 mooseInfo(
"Using ", file_name,
" for restart.");
9605std::vector<VariableName>
9608 std::vector<VariableName> names;
9612 const std::vector<VariableName> & var_names = sys->getVariableNames();
9613 names.insert(names.end(), var_names.begin(), var_names.end());
9616 const std::vector<VariableName> & aux_var_names =
_aux->getVariableNames();
9617 names.insert(names.end(), aux_var_names.begin(), aux_var_names.end());
9626 "Solver system number '" << solver_sys_num <<
"' is out of bounds. We have '"
9643 auto random_data_ptr = insert_pair.first->second.get();
9653 bnd_mat_side_cache =
false;
9656 if (
_aux->needMaterialOnSide(bnd_id))
9658 bnd_mat_side_cache =
true;
9661 for (
auto & nl :
_nl)
9662 if (nl->needBoundaryMaterialOnSide(bnd_id, tid))
9664 bnd_mat_side_cache =
true;
9678 bnd_mat_side_cache =
true;
9692 interface_mat_side_cache =
false;
9695 for (
auto & nl :
_nl)
9696 if (nl->needInterfaceMaterialOnSide(bnd_id, tid))
9698 interface_mat_side_cache =
true;
9711 interface_mat_side_cache =
true;
9716 interface_mat_side_cache =
true;
9730 for (
auto & nl :
_nl)
9731 if (nl->needInternalNeighborSideMaterial(subdomain_id, tid))
9764 mooseError(
"Previous nonlinear solution is required but not added through "
9765 "Problem/previous_nl_solution_required=true");
9770 const unsigned int solver_sys_num)
9777 const unsigned int solver_sys_num)
const
9796 bool needed,
const unsigned int solver_sys_num)
9803 const unsigned int solver_sys_num)
const
9834 const std::string & object_name,
9837 parallel_object_only();
9844 mooseError(
"The name '", object_name,
"' is a reserved name for output objects");
9848 if (output_warehouse.
hasOutput(object_name))
9849 mooseError(
"An output object named '", object_name,
"' already exists");
9855 if (object_type ==
"Console" &&
_app.
getParam<
bool>(
"show_input") &&
9873 if (object_type ==
"XDR")
9875 else if (object_type ==
"XDA")
9879 if (object_name ==
"auto_recovery_checkpoint")
9911 else if (sys_name ==
"aux0")
9914 mooseError(
"System '" + sys_name +
"' was requested from problem but does not exist.");
9929 mooseAssert(sys_num <
_nl.size(),
"System number greater than the number of nonlinear systems");
9930 return *
_nl[sys_num];
9936 mooseAssert(sys_num <
_nl.size(),
"System number greater than the number of nonlinear systems");
9937 return *
_nl[sys_num];
9944 "System number greater than the number of linear systems");
9952 "System number greater than the number of linear systems");
9960 "System number greater than the number of solver systems");
9968 "System number greater than the number of solver systems");
9987 parallel_object_only();
10015 false,
true,
true);
10031 const std::vector<Point> *
const pts,
10032 const std::vector<Real> *
const weights,
10044 unsigned int neighbor_side,
10046 const std::vector<Point> *
const pts,
10047 const std::vector<Real> *
const weights,
10060 std::vector<std::shared_ptr<MaterialBase>> & face_materials,
10061 std::vector<std::shared_ptr<MaterialBase>> & neighbor_materials,
10062 std::set<MooseVariableFieldBase *> & variables,
10067 auto & this_face_mats =
10069 for (std::shared_ptr<MaterialBase> face_mat : this_face_mats)
10070 if (face_mat->ghostable())
10072 face_materials.push_back(face_mat);
10073 auto & var_deps = face_mat->getMooseVariableDependencies();
10074 for (
auto * var : var_deps)
10078 "Ghostable materials should only have finite volume variables coupled into them.");
10079 else if (face_mat->hasStatefulProperties())
10080 mooseError(
"Finite volume materials do not currently support stateful properties.");
10081 variables.insert(var);
10088 auto & this_neighbor_mats =
10090 for (std::shared_ptr<MaterialBase> neighbor_mat : this_neighbor_mats)
10091 if (neighbor_mat->ghostable())
10093 neighbor_materials.push_back(neighbor_mat);
10095 auto & var_deps = neighbor_mat->getMooseVariableDependencies();
10096 for (
auto * var : var_deps)
10100 "Ghostable materials should only have finite volume variables coupled into them.");
10101 else if (neighbor_mat->hasStatefulProperties())
10102 mooseError(
"Finite volume materials do not currently support stateful properties.");
10103 auto pr = variables.insert(var);
10104 mooseAssert(!pr.second,
10105 "We should not have inserted any new variables dependencies from our "
10106 "neighbor materials that didn't exist for our face materials");
10115 const unsigned int nqp,
10126 "There must be one convergence object per nonlinear system");
10131 _nl[i]->setConvergenceName(convergence_names[i]);
10146const std::vector<ConvergenceName> &
10151 mooseError(
"The nonlinear system convergence name(s) have not been set.");
10166 paramError(
"linear_convergence",
"There must be one convergence object per linear system");
10170const std::vector<ConvergenceName> &
10175 mooseError(
"The linear convergence name(s) have not been set.");
10178const ConvergenceName &
10184 mooseError(
"The fixed point convergence name has not been set.");
10187const ConvergenceName &
10193 mooseError(
"The steady convergence name has not been set.");
10238 return current_nl_sys_num;
10249 return current_linear_sys_num;
10266std::vector<MortarUserObject *>
10269 const bool displaced,
10270 const std::vector<MortarUserObject *> & mortar_uo_superset)
10272 std::vector<MortarUserObject *> mortar_uos;
10273 auto *
const subproblem =
10274 displaced ? cast_ptr<SubProblem *>(
_displaced_problem.get()) : cast_ptr<SubProblem *>(
this);
10275 for (
auto *
const obj : mortar_uo_superset)
10276 if (obj->onInterface(primary_boundary_id, secondary_boundary_id) &&
10277 (&obj->getSubProblem() == subproblem))
10278 mortar_uos.push_back(obj);
10283std::vector<MortarUserObject *>
10286 const bool displaced)
10288 std::vector<MortarUserObject *> mortar_uos;
10292 .queryInto(mortar_uos);
10293 return getMortarUserObjects(primary_boundary_id, secondary_boundary_id, displaced, mortar_uos);
10299 const bool displaced)
10301 const auto mortar_uos =
10303 for (
auto *
const mortar_uo : mortar_uos)
10305 mortar_uo->setNormals();
10306 mortar_uo->reinit();
10338 mooseAssert(nl_sys_num <
_nl.size(),
10339 "System number greater than the number of nonlinear systems");
10348 "System number greater than the number of linear systems");
10366const ConstElemRange &
10374const ConstNodeRange &
10443 return solver_params;
10461 return _mortar_data->getMortarInterfaces(on_displaced);
@ ThreadedGeneralUserObject
boundary_id_type BoundaryID
subdomain_id_type SubdomainID
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
LocalRankConfig rankConfig(processor_id_type rank, processor_id_type nprocs, dof_id_type napps, processor_id_type min_app_procs, processor_id_type max_app_procs, bool batch_mode=false)
Returns app partitioning information relevant to the given rank for a multiapp scenario with the give...
std::shared_ptr< DisplacedProblem > displaced_problem
for(PetscInt i=0;i< nvars;++i)
if(!dmm->_nl) SETERRQ(PETSC_COMM_WORLD
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
void restoreGeometricSearchState()
Restore geometric search state captured by the most recent backupGeometricSearchState().
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 bool allowMeshContractionAfterMeshChanged() const
Whether meshChanged() should allow the mesh to be contracted (deletes children of coarsened elements ...
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.
void backupGeometricSearchState()
Snapshot geometric search state (both on the regular and, if present, the displaced mesh) so it can b...
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.
const unsigned int _num_concurrent_multiapps
Number of concurrent applications being solved at the same time.
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
void partitionConcurrentMultiApps()
Assign each multiapp that shares an 'execution_order_group' with others a disjoint subset of the rank...
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
const bool & currentlyComputingResidual() const
Returns true if the problem is in the process of computing the residual.
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.
const std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > & fieldScalarCouplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num) const
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.
virtual Real & timeOlder() const
The time two steps back.
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 ...
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters ¶meters, THREAD_ID tid=0, bool print_deprecated=true)
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
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.
void restore()
Restore the PenetrationLocators' state captured by the most recent backup().
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.
void backup()
Snapshot the PenetrationLocators' restartable state (the same state used for restart/recover),...
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.
void paramInfo(const std::string ¶m, Args... args) const
Emits an informational message prefixed with the file and line number of the given param (from the in...
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)
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.
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 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
SparseMatrix< Number > * matrix
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
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()
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
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.
libMesh::FEType variableFEType(const InputParameters ¶ms)
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...
bool isSolverExecFlag(const ExecFlagType &exec_flag)
@ 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())
auto index_range(const T &sizable)
const unsigned int invalid_uint
RealTensorValue RealTensor
RealVectorValue RealGradient
void translateMetaPhysicLError(const MetaPhysicL::LogicError &)
emit a relatively clear error message when we catch a MetaPhysicL logic error
Holds app partitioning information relevant to the a particular rank for a multiapp scenario.
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.