10 #ifdef MOOSE_KOKKOS_ENABLED 129 #include "libmesh/exodusII_io.h" 130 #include "libmesh/quadrature.h" 131 #include "libmesh/coupling_matrix.h" 132 #include "libmesh/nonlinear_solver.h" 133 #include "libmesh/sparse_matrix.h" 134 #include "libmesh/string_to_enum.h" 135 #include "libmesh/fe_interface.h" 136 #include "libmesh/enum_norm_type.h" 137 #include "libmesh/petsc_solver_exception.h" 139 #include "metaphysicl/dualnumber.h" 165 params.
addParam<
unsigned int>(
"null_space_dimension", 0,
"The dimension of the nullspace");
167 "transpose_null_space_dimension", 0,
"The dimension of the transpose nullspace");
169 "near_null_space_dimension", 0,
"The dimension of the near nullspace");
172 "Whether or not to actually solve the Nonlinear system. " 173 "This is handy in the case that all you want to do is " 174 "execute AuxKernels, Transfers, etc. without actually " 176 params.
addParam<
bool>(
"use_nonlinear",
178 "Determines whether to use a Nonlinear vs a " 179 "Eigenvalue system (Automatically determined based " 181 params.
addParam<
bool>(
"error_on_jacobian_nonzero_reallocation",
182 "This causes PETSc to error if it had to reallocate memory in the Jacobian " 183 "matrix due to not having enough nonzeros");
184 params.
addParam<
bool>(
"ignore_zeros_in_jacobian",
186 "Do not explicitly store zero values in " 187 "the Jacobian matrix if true");
188 params.
addParam<
bool>(
"force_restart",
190 "EXPERIMENTAL: If true, a sub_app may use a " 191 "restart file instead of using of using the master " 195 "True to skip additional data in equation system for restart.",
196 "This parameter is no longer used, as we do not load additional " 197 "vectors by default with restart");
198 params.
addParam<
bool>(
"skip_nl_system_check",
200 "True to skip the NonlinearSystem check for work to do (e.g. Make sure " 201 "that there are variables to solve for).");
202 params.
addParam<
bool>(
"allow_initial_conditions_with_restart",
204 "True to allow the user to specify initial conditions when restarting. " 205 "Initial conditions can override any restarted field");
207 auto coverage_check_description = [](std::string scope, std::string list_param_name)
209 return "Controls, if and how a " + scope +
210 " subdomain coverage check is performed. " 211 "With 'TRUE' or 'ON' all subdomains are checked (the default). Setting 'FALSE' or 'OFF' " 212 "will disable the check for all subdomains. " 213 "To exclude a predefined set of subdomains 'SKIP_LIST' is to " 214 "be used, while the subdomains to skip are to be defined in the parameter '" +
216 "'. To limit the check to a list of subdomains, 'ONLY_LIST' is to " 217 "be used (again, using the parameter '" +
218 list_param_name +
"').";
221 params.
addParam<std::vector<SubdomainName>>(
224 "List of subdomains for kernel coverage and material coverage checks. Setting this parameter " 225 "is equivalent to setting 'kernel_coverage_block_list' and 'material_coverage_block_list' as " 226 "well as using 'ONLY_LIST' as the coverage check mode.");
228 MooseEnum kernel_coverage_check_modes(
"FALSE TRUE OFF ON SKIP_LIST ONLY_LIST",
"TRUE");
230 kernel_coverage_check_modes,
231 coverage_check_description(
"kernel",
"kernel_coverage_block_list"));
232 params.
addParam<std::vector<SubdomainName>>(
233 "kernel_coverage_block_list",
235 "List of subdomains for kernel coverage check. The meaning of this list is controlled by the " 236 "parameter 'kernel_coverage_check' (whether this is the list of subdomains to be checked, " 237 "not to be checked or not taken into account).");
239 "boundary_restricted_node_integrity_check",
241 "Set to false to disable checking of boundary restricted nodal object variable dependencies, " 242 "e.g. are the variable dependencies defined on the selected boundaries?");
243 params.
addParam<
bool>(
"boundary_restricted_elem_integrity_check",
245 "Set to false to disable checking of boundary restricted elemental object " 246 "variable dependencies, e.g. are the variable dependencies defined on the " 247 "selected boundaries?");
248 MooseEnum material_coverage_check_modes(
"FALSE TRUE OFF ON SKIP_LIST ONLY_LIST",
"TRUE");
250 "material_coverage_check",
251 material_coverage_check_modes,
252 coverage_check_description(
"material",
"material_coverage_block_list"));
253 params.
addParam<std::vector<SubdomainName>>(
254 "material_coverage_block_list",
256 "List of subdomains for material coverage check. The meaning of this list is controlled by " 257 "the parameter 'material_coverage_check' (whether this is the list of subdomains to be " 258 "checked, not to be checked or not taken into account).");
260 params.
addParam<
bool>(
"fv_bcs_integrity_check",
262 "Set to false to disable checking of overlapping Dirichlet and Flux BCs " 263 "and/or multiple DirichletBCs per sideset");
266 "material_dependency_check",
true,
"Set to false to disable material dependency check");
267 params.
addParam<
bool>(
"parallel_barrier_messaging",
269 "Displays messaging from parallel " 270 "barrier notifications when executing " 271 "or transferring to/from Multiapps " 274 MooseEnum verbosity(
"false true extra",
"false");
277 "Set to 'true' to have the problem report on any object created. Set " 278 "to 'extra' to also display all parameters.");
279 params.
addParam<
bool>(
"verbose_multiapps",
281 "Set to True to enable verbose screen printing related to MultiApps");
285 "Set to True to enable verbose screen printing related to solution restoration");
287 params.
addParam<FileNameNoExtension>(
"restart_file_base",
288 "File base name used for restart (e.g. " 289 "<path>/<filebase> or <path>/LATEST to " 290 "grab the latest file available)");
292 params.
addParam<std::vector<std::vector<TagName>>>(
295 "Extra vectors to add to the system that can be filled by objects which compute residuals " 296 "and Jacobians (Kernels, BCs, etc.) by setting tags on them. The outer index is for which " 297 "nonlinear system the extra tag vectors should be added for");
299 params.
addParam<std::vector<std::vector<TagName>>>(
300 "not_zeroed_tag_vectors",
302 "Extra vector tags which the sytem will not zero when other vector tags are zeroed. " 303 "The outer index is for which nonlinear system the extra tag vectors should be added for");
305 params.
addParam<std::vector<std::vector<TagName>>>(
306 "extra_tag_matrices",
308 "Extra matrices to add to the system that can be filled " 309 "by objects which compute residuals and Jacobians " 310 "(Kernels, BCs, etc.) by setting tags on them. The outer index is for which " 311 "nonlinear system the extra tag vectors should be added for");
313 params.
addParam<std::vector<TagName>>(
314 "extra_tag_solutions",
316 "Extra solution vectors to add to the system that can be used by " 317 "objects for coupling variable values stored in them.");
319 params.
addParam<
bool>(
"previous_nl_solution_required",
321 "True to indicate that this calculation requires a solution vector for " 322 "storing the previous nonlinear iteration.");
324 params.
addParam<std::vector<NonlinearSystemName>>(
325 "nl_sys_names", std::vector<NonlinearSystemName>{
"nl0"},
"The nonlinear system names");
327 params.
addParam<std::vector<LinearSystemName>>(
"linear_sys_names", {},
"The linear system names");
329 params.
addParam<
bool>(
"check_uo_aux_state",
331 "True to turn on a check that no state presents during the evaluation of " 332 "user objects and aux kernels");
339 "allow_invalid_solution",
341 "Set to true to allow convergence even though the solution has been marked as 'invalid'");
342 params.
addParam<
bool>(
"show_invalid_solution_console",
344 "Set to true to show the invalid solution occurrence summary in console");
345 params.
addParam<
bool>(
"immediately_print_invalid_solution",
347 "Whether or not to report invalid solution warnings at the time the " 348 "warning is produced instead of after the calculation");
351 "identify_variable_groups_in_nl",
353 "Whether to identify variable groups in nonlinear systems. This affects dof ordering");
356 "regard_general_exceptions_as_errors",
358 "If we catch an exception during residual/Jacobian evaluaton for which we don't have " 359 "specific handling, immediately error instead of allowing the time step to be cut");
361 params.
addParam<
bool>(
"use_hash_table_matrix_assembly",
363 "Whether to assemble matrices using hash tables instead of preallocating " 364 "matrix memory. This can be a good option if the sparsity pattern changes " 365 "throughout the course of the simulation.");
367 "restore_original_nonzero_pattern",
368 "Whether we should reset matrix memory for every Jacobian evaluation. This option is useful " 369 "if the sparsity pattern is constantly changing and you are using hash table assembly or if " 370 "you wish to continually restore the matrix to the originally preallocated sparsity pattern " 371 "computed by relationship managers.");
374 "skip_nl_system_check kernel_coverage_check kernel_coverage_block_list " 375 "boundary_restricted_node_integrity_check " 376 "boundary_restricted_elem_integrity_check material_coverage_check " 377 "material_coverage_block_list fv_bcs_integrity_check " 378 "material_dependency_check check_uo_aux_state error_on_jacobian_nonzero_reallocation",
379 "Simulation checks");
381 "ignore_zeros_in_jacobian identify_variable_groups_in_nl " 382 "use_hash_table_matrix_assembly restore_original_nonzero_pattern",
383 "Nonlinear system(s)");
385 "restart_file_base force_restart allow_initial_conditions_with_restart",
"Restart");
387 "verbose_setup verbose_multiapps verbose_restore parallel_barrier_messaging",
"Verbosity");
389 "null_space_dimension transpose_null_space_dimension near_null_space_dimension",
390 "Null space removal");
392 "extra_tag_vectors extra_tag_matrices extra_tag_solutions not_zeroed_tag_vectors",
393 "Contribution to tagged field data");
395 "allow_invalid_solution show_invalid_solution_console immediately_print_invalid_solution",
396 "Solution validity control");
404 _mesh(*getCheckedPointerParam<
MooseMesh *>(
"mesh")),
406 "equation_systems", nullptr, _mesh)),
408 _solve(getParam<bool>(
"solve")),
410 _time(declareRestartableData<
Real>(
"time")),
411 _time_old(declareRestartableData<
Real>(
"time_old")),
412 _t_step(declareRecoverableData<
int>(
"t_step")),
413 _dt(declareRestartableData<
Real>(
"dt")),
414 _dt_old(declareRestartableData<
Real>(
"dt_old")),
415 _need_to_add_default_nonlinear_convergence(false),
416 _need_to_add_default_multiapp_fixed_point_convergence(false),
417 _need_to_add_default_steady_state_convergence(false),
418 _linear_sys_names(getParam<
std::vector<LinearSystemName>>(
"linear_sys_names")),
419 _num_linear_sys(_linear_sys_names.size()),
420 _linear_systems(_num_linear_sys, nullptr),
421 _current_linear_sys(nullptr),
422 _using_default_nl(!isParamSetByUser(
"nl_sys_names")),
423 _nl_sys_names(!_using_default_nl || (_using_default_nl && !_linear_sys_names.size())
424 ? getParam<
std::vector<NonlinearSystemName>>(
"nl_sys_names")
425 :
std::vector<NonlinearSystemName>()),
426 _num_nl_sys(_nl_sys_names.size()),
427 _nl(_num_nl_sys, nullptr),
428 _current_nl_sys(nullptr),
429 _solver_systems(_num_nl_sys + _num_linear_sys, nullptr),
432 #ifdef MOOSE_KOKKOS_ENABLED
433 _kokkos_assembly(*this),
435 _mesh_divisions(true),
437 "material_props", &_mesh, _material_prop_registry, *this)),
439 "bnd_material_props", &_mesh, _material_prop_registry, *this)),
441 "neighbor_material_props", &_mesh, _material_prop_registry, *this)),
442 #ifdef MOOSE_KOKKOS_ENABLED
443 _kokkos_material_props(
445 "kokkos_material_props", &_mesh, _material_prop_registry, *this)),
446 _kokkos_bnd_material_props(
448 "kokkos_bnd_material_props", &_mesh, _material_prop_registry, *this)),
449 _kokkos_neighbor_material_props(
451 "kokkos_neighbor_material_props", &_mesh, _material_prop_registry, *this)),
453 _reporter_data(_app),
454 _multi_apps(_app.getExecuteOnEnum()),
455 _transient_multi_apps(_app.getExecuteOnEnum()),
456 _transfers(_app.getExecuteOnEnum(), false),
457 _to_multi_app_transfers(_app.getExecuteOnEnum(), false),
458 _from_multi_app_transfers(_app.getExecuteOnEnum(), false),
459 _between_multi_app_transfers(_app.getExecuteOnEnum(), false),
460 #ifdef LIBMESH_ENABLE_AMR
462 _cycles_completed(0),
464 _displaced_mesh(nullptr),
465 _geometric_search_data(*this, _mesh),
467 _reinit_displaced_elem(false),
468 _reinit_displaced_face(false),
469 _reinit_displaced_neighbor(false),
470 _input_file_saved(false),
472 _has_constraints(false),
473 _snesmf_reuse_base(true),
474 _skip_exception_check(false),
475 _snesmf_reuse_base_set_by_user(false),
476 _has_initialized_stateful(false),
477 _const_jacobian(false),
478 _has_jacobian(false),
479 _needs_old_newton_iter(false),
480 _previous_nl_solution_required(getParam<bool>(
"previous_nl_solution_required")),
481 _previous_multiapp_fp_nl_solution_required(_num_nl_sys + _num_linear_sys, false),
482 _previous_multiapp_fp_aux_solution_required(false),
483 _has_nonlocal_coupling(false),
484 _calculate_jacobian_in_uo(false),
485 _kernel_coverage_check(
487 _kernel_coverage_blocks(getParam<
std::vector<SubdomainName>>(
"kernel_coverage_block_list")),
488 _boundary_restricted_node_integrity_check(
489 getParam<bool>(
"boundary_restricted_node_integrity_check")),
490 _boundary_restricted_elem_integrity_check(
491 getParam<bool>(
"boundary_restricted_elem_integrity_check")),
492 _material_coverage_check(
494 _material_coverage_blocks(getParam<
std::vector<SubdomainName>>(
"material_coverage_block_list")),
495 _fv_bcs_integrity_check(getParam<bool>(
"fv_bcs_integrity_check")),
496 _material_dependency_check(getParam<bool>(
"material_dependency_check")),
497 _uo_aux_state_check(getParam<bool>(
"check_uo_aux_state")),
499 _check_residual_for_nans(false),
501 _max_qps(
std::numeric_limits<unsigned
int>::
max()),
503 _has_time_integrator(false),
504 _has_exception(false),
505 _parallel_barrier_messaging(getParam<bool>(
"parallel_barrier_messaging")),
506 _verbose_setup(getParam<
MooseEnum>(
"verbose_setup")),
507 _verbose_multiapps(getParam<bool>(
"verbose_multiapps")),
508 _verbose_restore(getParam<bool>(
"verbose_restore")),
510 _control_warehouse(_app.getExecuteOnEnum(), false),
511 _is_petsc_options_inserted(false),
512 _line_search(nullptr),
513 _using_ad_mat_props(false),
514 _current_ic_state(0),
515 _use_hash_table_matrix_assembly(getParam<bool>(
"use_hash_table_matrix_assembly")),
516 _error_on_jacobian_nonzero_reallocation(
517 isParamValid(
"error_on_jacobian_nonzero_reallocation")
518 ? getParam<bool>(
"error_on_jacobian_nonzero_reallocation")
519 : _app.errorOnJacobianNonzeroReallocation()),
520 _restore_original_nonzero_pattern(isParamValid(
"restore_original_nonzero_pattern")
521 ? getParam<bool>(
"restore_original_nonzero_pattern")
522 : _use_hash_table_matrix_assembly),
523 _ignore_zeros_in_jacobian(getParam<bool>(
"ignore_zeros_in_jacobian")),
524 _preserve_matrix_sparsity_pattern(true),
525 _force_restart(getParam<bool>(
"force_restart")),
526 _allow_ics_during_restart(getParam<bool>(
"allow_initial_conditions_with_restart")),
527 _skip_nl_system_check(getParam<bool>(
"skip_nl_system_check")),
528 _fail_next_system_convergence_check(false),
529 _allow_invalid_solution(getParam<bool>(
"allow_invalid_solution")),
530 _show_invalid_solution_console(getParam<bool>(
"show_invalid_solution_console")),
531 _immediately_print_invalid_solution(getParam<bool>(
"immediately_print_invalid_solution")),
532 _started_initial_setup(false),
533 _has_internal_edge_residual_objects(false),
534 _u_dot_requested(false),
535 _u_dotdot_requested(false),
536 _u_dot_old_requested(false),
537 _u_dotdot_old_requested(false),
540 _print_execution_on(),
541 _identify_variable_groups_in_nl(getParam<bool>(
"identify_variable_groups_in_nl")),
542 _regard_general_exceptions_as_errors(getParam<bool>(
"regard_general_exceptions_as_errors")),
543 _requires_nonlocal_coupling(false)
545 auto checkCoverageCheckConflict =
546 [
this](
const std::string & coverage_check,
548 const std::vector<SubdomainName> & coverage_blocks) ->
void 552 if (coverage_blocks.size() > 1)
553 if (
std::find(coverage_blocks.begin(), coverage_blocks.end(),
"ANY_BLOCK_ID") !=
554 coverage_blocks.end())
556 "The list of blocks used for ",
558 " cannot contain 'ANY_BLOCK_ID' along with other blocks. ");
561 checkCoverageCheckConflict(
563 checkCoverageCheckConflict(
569 ADReal::do_derivatives =
true;
633 std::string restart_file_base = getParam<FileNameNoExtension>(
"restart_file_base");
640 if (restart_file_base.size())
658 #if !PETSC_RELEASE_LESS_THAN(3, 12, 0) 677 mooseWarning(
"Displaced mesh was requested but the displaced problem does not exist. " 678 "Regular mesh will be returned");
686 mooseWarning(
"Displaced mesh was requested but the displaced problem does not exist. " 687 "Regular mesh will be returned");
695 auto & vectors = getParam<std::vector<std::vector<TagName>>>(
"extra_tag_vectors");
697 for (
auto & vector : vectors[sys_num])
703 auto & not_zeroed_vectors = getParam<std::vector<std::vector<TagName>>>(
"not_zeroed_tag_vectors");
704 for (
const auto sys_num :
index_range(not_zeroed_vectors))
705 for (
auto & vector : not_zeroed_vectors[sys_num])
716 auto & matrices = getParam<std::vector<std::vector<TagName>>>(
"extra_tag_matrices");
718 for (
auto & matrix : matrices[sys_num])
725 sys->sizeVariableMatrixData();
726 _aux->sizeVariableMatrixData();
732 for (
auto & vector :
getParam<std::vector<TagName>>(
"extra_tag_solutions"))
751 sys->associateVectorToTag(*sys->system().current_local_solution.get(), tag);
752 _aux->associateVectorToTag(*
_aux->system().current_local_solution.get(), tag);
759 sys->needSolutionState(state, iteration_type);
760 _aux->needSolutionState(state, iteration_type);
767 bool has_solution_state =
false;
769 has_solution_state |= sys->hasSolutionState(state, iteration_type);
770 has_solution_state |=
_aux->hasSolutionState(state, iteration_type);
771 return has_solution_state;
782 _assembly[i].resize(solver_systems.size());
784 _assembly[i][j] = std::make_unique<Assembly>(*solver_systems[j], i);
790 std::vector<std::shared_ptr<NonlinearSystemBase>> & nls)
792 TIME_SECTION(
"initNullSpaceVectors", 5,
"Initializing Null Space Vectors");
794 unsigned int dimNullSpace =
parameters.
get<
unsigned int>(
"null_space_dimension");
795 unsigned int dimTransposeNullSpace =
796 parameters.
get<
unsigned int>(
"transpose_null_space_dimension");
797 unsigned int dimNearNullSpace =
parameters.
get<
unsigned int>(
"near_null_space_dimension");
798 for (
unsigned int i = 0; i < dimNullSpace; ++i)
800 std::ostringstream oss;
804 for (
auto & nl : nls)
808 for (
unsigned int i = 0; i < dimTransposeNullSpace; ++i)
810 std::ostringstream oss;
814 for (
auto & nl : nls)
818 for (
unsigned int i = 0; i < dimNearNullSpace; ++i)
820 std::ostringstream oss;
824 for (
auto & nl : nls)
839 for (
unsigned int i = 0; i <
n_threads; i++)
855 #if !PETSC_RELEASE_LESS_THAN(3, 12, 0) 860 CHKERRABORT(this->
comm().
get(), ierr);
869 TIME_SECTION(
"setCoordSystem", 5,
"Setting Coordinate System");
884 std::vector<const DofMap *> dof_maps(
es().n_systems());
888 dof_maps[i] = &sys.get_dof_map();
891 std::make_unique<ConstElemRange>(
_mesh.
getMesh().multi_evaluable_elements_begin(dof_maps),
892 _mesh.
getMesh().multi_evaluable_elements_end(dof_maps));
902 std::vector<const DofMap *> dof_maps(
_nl.size());
904 dof_maps[i] = &
_nl[i]->dofMap();
906 std::make_unique<ConstElemRange>(
_mesh.
getMesh().multi_evaluable_elements_begin(dof_maps),
907 _mesh.
getMesh().multi_evaluable_elements_end(dof_maps));
916 TIME_SECTION(
"initialSetup", 2,
"Performing Initial Setup");
921 mooseError(
"Checkpoint recovery and restart and exodus restart are all mutually exclusive.");
924 mooseWarning(
"MOOSE may fail to catch an exception when the \"skip_exception_check\" parameter " 925 "is used. If you receive a terse MPI error during execution, remove this " 926 "parameter and rerun your simulation");
941 _aux->initSolutionState();
954 TIME_SECTION(
"computingMaxDofs", 3,
"Computing Max Dofs Per Element");
958 max_var_n_dofs_per_elem = mvndpe.
max();
963 max_var_n_dofs_per_node = mvndpn.
max();
965 global_max_var_n_dofs_per_elem =
966 std::max(global_max_var_n_dofs_per_elem, max_var_n_dofs_per_elem);
970 TIME_SECTION(
"assignMaxDofs", 5,
"Assigning Maximum Dofs Per Elem");
972 sys.assignMaxVarNDofsPerElem(max_var_n_dofs_per_elem);
975 displaced_problem->solverSys(i).assignMaxVarNDofsPerElem(max_var_n_dofs_per_elem);
977 sys.assignMaxVarNDofsPerNode(max_var_n_dofs_per_node);
979 displaced_problem->solverSys(i).assignMaxVarNDofsPerNode(max_var_n_dofs_per_node);
984 TIME_SECTION(
"resizingVarValues", 5,
"Resizing Variable Values");
988 _phi_zero[tid].resize(global_max_var_n_dofs_per_elem, std::vector<Real>(
getMaxQps(), 0.));
1009 props->setRecovering();
1011 #ifdef MOOSE_KOKKOS_ENABLED 1014 props->setRecovering();
1018 TIME_SECTION(
"restore", 3,
"Restoring from backup");
1045 TIME_SECTION(
"copyingFromExodus", 3,
"Copying Variables From Exodus");
1048 sys->copyVars(*reader);
1049 _aux->copyVars(*reader);
1054 mooseError(
"Need Exodus reader to restart variables but the reader is not available\n" 1055 "Use either FileMesh with an Exodus mesh file or FileMeshGenerator with an " 1056 "Exodus mesh file and with use_for_exodus_restart equal to true");
1072 mooseError(
"Stateful neighbor material properties do not work with mesh adaptivity");
1088 "Doing extra refinements when restarting is NOT supported for sub-apps of a MultiApp");
1098 TIME_SECTION(
"convergenceInitialSetup", 5,
"Initializing Convergence objects");
1106 std::set<std::string> depend_objects_aux =
_aux->getDependObjects();
1108 std::map<int, std::vector<UserObjectBase *>> group_userobjs;
1112 std::vector<UserObjectBase *> userobjs;
1117 for (
auto obj : userobjs)
1118 group_userobjs[obj->getParam<
int>(
"execution_order_group")].push_back(obj);
1120 #ifdef MOOSE_KOKKOS_ENABLED 1124 std::vector<UserObjectBase *> userobjs;
1129 for (
auto obj : userobjs)
1130 group_userobjs[obj->getParam<
int>(
"execution_order_group")].push_back(obj);
1134 for (
auto & [group, objs] : group_userobjs)
1135 for (
auto obj : objs)
1136 obj->initialSetup();
1148 TIME_SECTION(
"initializingFunctions", 5,
"Initializing Functions");
1158 #ifdef MOOSE_KOKKOS_ENABLED 1164 TIME_SECTION(
"initializingRandomObjects", 5,
"Initializing Random Objects");
1176 TIME_SECTION(
"ICinitialSetup", 5,
"Setting Up Initial Conditions");
1190 TIME_SECTION(
"materialInitialSetup", 3,
"Setting Up Materials");
1211 #ifdef MOOSE_KOKKOS_ENABLED 1216 TIME_SECTION(
"computingInitialStatefulProps", 3,
"Computing Initial Material Values");
1223 #ifdef MOOSE_KOKKOS_ENABLED 1238 props->setRestartInPlace();
1239 props->setRecovering();
1250 #ifdef LIBMESH_ENABLE_AMR 1256 mooseError(
"Cannot perform initial adaptivity during restart on sub-apps of a MultiApp!");
1261 #endif // LIBMESH_ENABLE_AMR 1272 unsigned short ic_state_max = 0;
1274 auto findMax = [&ic_state_max](
const auto & obj_list)
1276 for (
auto ic : obj_list.getActiveObjects())
1277 ic_state_max =
std::max(ic_state_max, ic->getState());
1284 if (ic_state_max > 0)
1288 std::vector<std::unique_ptr<NumericVector<Real>>> state0_sys_buffers(
_solver_systems.size());
1289 std::unique_ptr<NumericVector<Real>> state0_aux_buffer;
1295 state0_aux_buffer =
_aux->solutionState(0).clone();
1316 _aux->solutionState(0) = *state0_aux_buffer;
1317 _aux->solutionState(0).close();
1330 sys->initialSetup();
1333 _aux->initialSetup();
1340 sys->setSolution(*(sys->system().current_local_solution.get()));
1370 const auto & tis = sys->getTimeIntegrators();
1373 TIME_SECTION(
"timeIntegratorInitialSetup", 5,
"Initializing Time Integrator");
1374 for (
auto & ti : tis)
1385 TIME_SECTION(
"initialSetupMultiApps", 2,
"Initializing MultiApps",
false);
1391 TIME_SECTION(
"initialSetupTransfers", 2,
"Initializing Transfers");
1397 for (
const auto & transfer : to_multi_app_objects)
1399 transfer->setCurrentDirection(Transfer::DIRECTION::TO_MULTIAPP);
1400 transfer->initialSetup();
1405 for (
const auto & transfer : from_multi_app_objects)
1407 transfer->setCurrentDirection(Transfer::DIRECTION::FROM_MULTIAPP);
1408 transfer->initialSetup();
1413 for (
const auto & transfer : between_multi_app_objects)
1415 transfer->setCurrentDirection(Transfer::DIRECTION::BETWEEN_MULTIAPP);
1416 transfer->initialSetup();
1422 TIME_SECTION(
"BoundaryRestrictedNodeIntegrityCheck", 5);
1427 Threads::parallel_reduce(bnd_nodes, bnict);
1431 for (
const auto & bnode : bnd_nodes)
1433 const auto boundary_id = bnode->_bnd_id;
1434 const Node *
const node = bnode->_node;
1441 const Elem *
const an_elem =
1448 for (
auto & nl :
_nl)
1450 const auto & nodal_bcs = nl->getNodalBCWarehouse();
1451 if (!nodal_bcs.hasBoundaryObjects(boundary_id, 0))
1454 const auto & bnd_objects = nodal_bcs.getBoundaryObjects(boundary_id, 0);
1455 for (
const auto & bnd_object : bnd_objects)
1458 if (!bnd_object->requiresGeometricSearch() &&
1459 bnd_object->checkVariableBoundaryIntegrity())
1461 std::set<MooseVariableFieldBase *> vars_to_omit = {
1466 *bnd_object, bnd_object->checkAllVariables(*node, vars_to_omit), bnd_name);
1474 TIME_SECTION(
"BoundaryRestrictedElemIntegrityCheck", 5);
1479 Threads::parallel_reduce(bnd_elems, beict);
1488 mooseError(
"failed to converge initial MultiApp");
1521 TIME_SECTION(
"computeMaterials", 2,
"Computing Initial Material Properties");
1525 #ifdef MOOSE_KOKKOS_ENABLED 1530 TIME_SECTION(
"computeMaterials", 2,
"Computing Initial Material Properties");
1542 for (
unsigned int tid = 0; tid <
n_threads; tid++)
1560 TIME_SECTION(
"lineSearchInitialSetup", 5,
"Initializing Line Search");
1582 "\" has the same name as a scalar variable in the system.");
1593 std::unique_ptr<libMesh::MeshRefinement> displaced_mesh_refinement(
nullptr);
1595 displaced_mesh_refinement = std::make_unique<libMesh::MeshRefinement>(*_displaced_mesh);
1611 displaced_mesh_refinement->uniformly_coarsen();
1660 #ifdef MOOSE_KOKKOS_ENABLED 1664 _aux->timestepSetup();
1666 sys->timestepSetup();
1679 std::vector<UserObject *> userobjs;
1681 for (
auto obj : userobjs)
1682 obj->timestepSetup();
1684 #ifdef MOOSE_KOKKOS_ENABLED 1686 std::vector<UserObjectBase *> userobjs;
1688 for (
auto obj : userobjs)
1689 obj->timestepSetup();
1718 TIME_SECTION(
"checkNonlocalCoupling", 5,
"Checking Nonlocal Coupling");
1721 for (
auto & nl :
_nl)
1723 const auto & all_kernels = nl->getKernelWarehouse();
1724 const auto & kernels = all_kernels.getObjects(tid);
1725 for (
const auto & kernel : kernels)
1727 std::shared_ptr<NonlocalKernel> nonlocal_kernel =
1729 if (nonlocal_kernel)
1737 nl->getIntegratedBCWarehouse();
1738 const auto & integrated_bcs = all_integrated_bcs.
getObjects(tid);
1739 for (
const auto & integrated_bc : integrated_bcs)
1741 std::shared_ptr<NonlocalIntegratedBC> nonlocal_integrated_bc =
1743 if (nonlocal_integrated_bc)
1756 std::set<const MooseVariableFEBase *> uo_jacobian_moose_vars;
1758 std::vector<ShapeElementUserObject *> objs;
1762 .condition<AttribThread>(tid)
1765 for (
const auto & uo : objs)
1768 const auto & mv_deps = uo->jacobianMooseVariables();
1769 uo_jacobian_moose_vars.insert(mv_deps.begin(), mv_deps.end());
1773 std::vector<ShapeSideUserObject *> objs;
1777 .condition<AttribThread>(tid)
1779 for (
const auto & uo : objs)
1782 const auto & mv_deps = uo->jacobianMooseVariables();
1783 uo_jacobian_moose_vars.insert(mv_deps.begin(), mv_deps.end());
1795 for (
unsigned int i = 0; i < moose_vars.size(); ++i)
1797 VariableName var_name = moose_vars[i]->name();
1799 sys->setVariableGlobalDoFs(var_name);
1817 _assembly[tid][i]->prepareJacobianBlock();
1840 for (
auto & nl :
_nl)
1841 nl->prepareFace(tid,
true);
1842 _aux->prepareFace(tid,
false);
1852 const std::vector<dof_id_type> & dof_indices,
1858 _nl[i]->prepare(tid);
1863 _assembly[tid][current_nl_sys_num]->prepareBlock(ivar, jvar, dof_indices);
1868 _assembly[tid][current_nl_sys_num]->prepareBlockNonlocal(
1890 _assembly[tid][i]->setCurrentSubdomainID(did);
1903 _assembly[tid][i]->setCurrentNeighborSubdomainID(did);
1916 _assembly[tid][i]->setCurrentNeighborSubdomainID(did);
2010 std::vector<VectorTag> extra_residual_vector_tags;
2015 if (vector_tag._id != time_tag && vector_tag._id != non_time_tag)
2016 extra_residual_vector_tags.push_back(vector_tag);
2023 extra_residual_vector_tags);
2133 std::vector<dof_id_type> & dof_indices,
2134 const std::set<TagID> & tags,
2157 _displaced_problem->addJacobianBlockTags(jacobian, ivar, jvar, dof_map, dof_indices, tags, tid);
2163 jacobian, ivar, jvar, dof_map, dof_indices, jv.
allDofIndices(), tags, tid);
2173 std::vector<dof_id_type> & dof_indices,
2174 std::vector<dof_id_type> & neighbor_dof_indices,
2175 const std::set<TagID> & tags,
2183 neighbor_dof_indices,
2188 jacobian, ivar, jvar, dof_map, dof_indices, neighbor_dof_indices, tags, tid);
2227 TIME_SECTION(
"ghostGhostedBoundaries", 3,
"Ghosting Ghosted Boundaries");
2239 "This function is deprecated and no longer performs any function. Please do not call it."));
2247 unsigned int n_points = points.size();
2264 _zero[tid].resize(max_qpts, 0);
2274 _assembly[tid][i]->reinitAtPhysical(elem, points);
2275 _nl[i]->prepare(tid);
2286 bool have_points = n_points > 0;
2301 sys->reinitElem(elem, tid);
2302 _aux->reinitElem(elem, tid);
2310 const std::vector<Point> & phys_points_in_elem,
2314 "Are you calling this method with a displaced mesh element?");
2318 _assembly[tid][i]->reinitAtPhysical(elem, phys_points_in_elem);
2331 const unsigned int side,
2336 "reinitElemFace with a BoundaryID argument is deprecated because the boundary id was never " 2337 "used. Please call reinitElemFace without the BoundaryID argument instead");
2350 _aux->reinitElemFace(elem, side, tid);
2359 const std::vector<Point> *
const pts,
2360 const std::vector<Real> *
const weights)
2378 _nl[i]->reinitNode(node, tid);
2380 _aux->reinitNode(node, tid);
2392 _nl[i]->reinitNodeFace(node, bnd_id, tid);
2394 _aux->reinitNodeFace(node, bnd_id, tid);
2403 for (
auto & nl :
_nl)
2404 nl->reinitNodes(nodes, tid);
2405 _aux->reinitNodes(nodes, tid);
2414 for (
auto & nl :
_nl)
2415 nl->reinitNodesNeighbor(nodes, tid);
2416 _aux->reinitNodesNeighbor(nodes, tid);
2422 TIME_SECTION(
"reinitScalars", 3,
"Reinitializing Scalar Variables");
2427 for (
auto & nl :
_nl)
2428 nl->reinitScalars(tid, reinit_for_derivative_reordering);
2429 _aux->reinitScalars(tid, reinit_for_derivative_reordering);
2454 _assembly[tid][i]->reinitElemAndNeighbor(elem, side, neighbor, neighbor_side);
2455 _nl[i]->prepareNeighbor(tid);
2459 _aux->prepareNeighbor(tid);
2461 for (
auto & nl :
_nl)
2463 nl->reinitElemFace(elem, side, tid);
2464 nl->reinitNeighborFace(neighbor, neighbor_side, tid);
2466 _aux->reinitElemFace(elem, side, tid);
2467 _aux->reinitNeighborFace(neighbor, neighbor_side, tid);
2476 const auto & displaced_ref_pts =
_assembly[tid][0]->qRuleNeighbor()->get_points();
2496 auto & neighbor =
_assembly[tid][0]->neighbor();
2497 auto & neighbor_side =
_assembly[tid][0]->neighborSide();
2499 if (lower_d_elem_neighbor &&
2502 auto qps =
_assembly[tid][0]->qPointsFaceNeighbor().stdVector();
2503 std::vector<Point> reference_points;
2505 lower_d_elem_neighbor->
dim(), lower_d_elem_neighbor, qps, reference_points);
2517 unsigned int neighbor_side,
2518 const std::vector<Point> & physical_points,
2522 "Are you calling this method with a displaced mesh element?");
2527 _assembly[tid][i]->reinitNeighborAtPhysical(neighbor, neighbor_side, physical_points);
2530 _nl[i]->prepareNeighbor(tid);
2532 _aux->prepareNeighbor(tid);
2538 for (
auto & nl :
_nl)
2539 nl->reinitNeighborFace(neighbor, neighbor_side, tid);
2540 _aux->reinitNeighborFace(neighbor, neighbor_side, tid);
2545 const std::vector<Point> & physical_points,
2549 "Are you calling this method with a displaced mesh element?");
2554 _assembly[tid][i]->reinitNeighborAtPhysical(neighbor, physical_points);
2557 _nl[i]->prepareNeighbor(tid);
2559 _aux->prepareNeighbor(tid);
2565 for (
auto & nl :
_nl)
2566 nl->reinitNeighbor(neighbor, tid);
2567 _aux->reinitNeighbor(neighbor, tid);
2578 std::set<const Elem *> displaced_elements;
2583 for (
const auto & elem : displaced_elements)
2606 for (
auto & nl :
_nl)
2607 nl->subdomainSetup(subdomain, tid);
2621 const std::string & name,
2624 parallel_object_only();
2641 mooseError(
"Unrecognized function functor type");
2647 const std::string & name,
2650 parallel_object_only();
2662 const std::string class_name =
"DefaultNonlinearConvergence";
2666 params.
set<
bool>(
"added_as_default") =
true;
2674 const std::string class_name =
"DefaultMultiAppFixedPointConvergence";
2678 params.
set<
bool>(
"added_as_default") =
true;
2685 const std::string class_name =
"DefaultSteadyStateConvergence";
2689 params.
set<
bool>(
"added_as_default") =
true;
2709 std::istringstream ss(
name);
2713 if (ss >> real_value && ss.eof())
2716 params.
set<
Real>(
"value") = real_value;
2717 addFunction(
"ConstantFunction", ss.str(), params);
2722 std::string
vars =
"x,y,z,t,NaN,pi,e";
2727 params.
set<std::string>(
"expression") =
name;
2735 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_function"),
2736 "getFunction() was called before Functions have been constructed. The requested " 2738 name +
"' may exist in the input file, but Functions are not available yet.");
2762 mooseError(
"The Convergence object '",
name,
"' does not exist.");
2767 const std::vector<std::shared_ptr<Convergence>> &
2775 const std::string & name,
2778 parallel_object_only();
2793 mooseError(
"No MeshDivision object named ",
name,
" of appropriate type");
2806 mooseDeprecated(
"FEProblemBase::getNonlinearSystem() is deprecated, please use " 2807 "FEProblemBase::getNonlinearSystemBase() \n");
2809 mooseAssert(sys_num <
_nl.size(),
"System number greater than the number of nonlinear systems");
2820 const std::string & name,
2830 std::vector<Distribution *> objs;
2834 .condition<AttribName>(
name)
2836 return !objs.empty();
2842 std::vector<Distribution *> objs;
2846 .condition<AttribName>(
name)
2850 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_distribution"),
2851 "A Distribution getter was called before Distributions have been constructed. " 2852 "If you are attempting to access this object in the constructor of another object " 2853 "then make sure that the Distribution is constructed before the object using it.");
2854 mooseError(
"Unable to find Distribution with name '" +
name +
"'");
2861 const std::string & name,
2865 for (
auto & sampler : samplers)
2872 std::vector<Sampler *> objs;
2876 .condition<AttribThread>(tid)
2881 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_sampler"),
2882 "A Sampler getter was called before Samplers have been constructed. " 2883 "If you are attempting to access this object in the constructor of another object " 2884 "then make sure that the Sampler is constructed before the object using it.");
2887 "Unable to find Sampler with name '" +
name +
2888 "', if you are attempting to access this object in the constructor of another object then " 2889 "make sure that the Sampler is constructed before the object using it.");
2898 const std::set<SubdomainID> *
const active_subdomains)
2900 std::set<SubdomainID> subdomainIDs;
2901 if (active_subdomains->size() == 0)
2904 subdomainIDs.insert(subdomains.begin(), subdomains.end());
2907 subdomainIDs.insert(active_subdomains->begin(), active_subdomains->end());
2913 std::string error_prefix =
"";
2916 curr_sys_ptr =
_aux.get();
2917 other_sys_ptr = sys.get();
2918 error_prefix =
"aux";
2922 mooseError(
"Cannot have an auxiliary variable and a solver variable with the same name: ",
2933 const auto stringifyType = [](
FEType t)
2936 mooseError(
"Mismatching types are specified for ",
2938 "variable with name '",
2941 stringifyType(var.
type()),
2943 stringifyType(
type),
2951 std::set<SubdomainID> varSubdomainIDs;
2952 if (varActiveSubdomains.size() == 0)
2955 varSubdomainIDs.insert(subdomains.begin(), subdomains.end());
2958 varSubdomainIDs.insert(varActiveSubdomains.begin(), varActiveSubdomains.end());
2962 const auto isSubset = std::includes(varSubdomainIDs.begin(),
2963 varSubdomainIDs.end(),
2964 subdomainIDs.begin(),
2965 subdomainIDs.end());
2970 const auto stringifySubdomains = [
this](std::set<SubdomainID> subdomainIDs)
2972 std::stringstream s;
2973 for (
auto const i : subdomainIDs)
2981 if (subdomainName.empty())
2984 s << subdomainName <<
" (" << i <<
")";
2989 const std::string msg =
"Mismatching block-restrictions are specified for " +
2990 error_prefix +
"variable with name '" + var_name +
"': {" +
2991 stringifySubdomains(varSubdomainIDs) +
"} and {" +
2992 stringifySubdomains(subdomainIDs) +
"}";
3007 const std::string & var_name,
3010 parallel_object_only();
3012 const auto order = Utility::string_to_enum<Order>(params.
get<
MooseEnum>(
"order"));
3013 const auto family = Utility::string_to_enum<FEFamily>(params.
get<
MooseEnum>(
"family"));
3014 const auto fe_type =
FEType(order, family);
3016 const auto active_subdomains_vector =
3018 const std::set<SubdomainID> active_subdomains(active_subdomains_vector.begin(),
3019 active_subdomains_vector.end());
3026 SolverSystemName sys_name = params.
get<SolverSystemName>(
"solver_sys");
3028 const auto solver_system_number =
solverSysNum(sys_name);
3029 logAdd(
"Variable", var_name, var_type, params);
3030 _solver_systems[solver_system_number]->addVariable(var_type, var_name, params);
3042 std::pair<bool, unsigned int>
3044 const bool error_if_not_found)
const 3051 "If the variable is in our FEProblem solver system map, then it must be in the " 3052 "solver system we expect");
3053 else if (error_if_not_found)
3055 if (
_aux->hasVariable(var_name) ||
_aux->hasScalarVariable(var_name))
3058 " found. Did you specify an auxiliary variable when you meant to specify a " 3059 "solver variable?");
3063 "'. It does not exist in the solver system(s) or auxiliary system");
3071 const std::string & name,
3073 const unsigned int nl_sys_num,
3074 const std::string & base_name,
3075 bool & reinit_displaced)
3081 reinit_displaced =
true;
3104 const std::string & name,
3106 const std::string & base_name)
3113 if (!
parameters.
get<std::vector<BoundaryName>>(
"boundary").empty())
3140 const std::string & name,
3143 parallel_object_only();
3146 mooseError(
"You are trying to add a Kernel to a linear variable/system, which is not " 3147 "supported at the moment!");
3156 const std::string & name,
3159 parallel_object_only();
3162 mooseError(
"You are trying to add a HDGKernel to a linear variable/system, which is not " 3163 "supported at the moment!");
3172 const std::string & name,
3175 parallel_object_only();
3205 const std::string & name,
3208 parallel_object_only();
3212 mooseError(
"You are trying to add a ScalarKernel to a linear variable/system, which is not " 3213 "supported at the moment!");
3242 const std::string & name,
3245 parallel_object_only();
3250 "You are trying to add a BoundaryCondition to a linear variable/system, which is not " 3251 "supported at the moment!");
3260 const std::string & name,
3263 parallel_object_only();
3267 auto determine_var_param_name = [&
parameters,
this]()
3276 if (!has_secondary_var && !has_primary_var)
3278 "Either a 'secondary_variable' or 'primary_variable' parameter must be supplied for '",
3281 return has_secondary_var ?
"secondary_variable" :
"primary_variable";
3285 const auto nl_sys_num =
3288 mooseError(
"You are trying to add a Constraint to a linear variable/system, which is not " 3289 "supported at the moment!");
3313 const std::string & var_name,
3316 parallel_object_only();
3318 const auto order = Utility::string_to_enum<Order>(params.
get<
MooseEnum>(
"order"));
3319 const auto family = Utility::string_to_enum<FEFamily>(params.
get<
MooseEnum>(
"family"));
3320 const auto fe_type =
FEType(order, family);
3322 const auto active_subdomains_vector =
3324 const std::set<SubdomainID> active_subdomains(active_subdomains_vector.begin(),
3325 active_subdomains_vector.end());
3333 logAdd(
"AuxVariable", var_name, var_type, params);
3334 _aux->addVariable(var_type, var_name, params);
3346 const std::string & var_name,
3355 const std::set<SubdomainID> *
const active_subdomains)
3357 parallel_object_only();
3359 mooseDeprecated(
"Please use the addAuxVariable(var_type, var_name, params) API instead");
3364 std::string var_type;
3366 var_type =
"MooseVariableConstMonomial";
3368 var_type =
"MooseVariableScalar";
3370 var_type =
"VectorMooseVariable";
3372 var_type =
"MooseVariable";
3380 if (active_subdomains)
3384 logAdd(
"AuxVariable", var_name, var_type, params);
3385 _aux->addVariable(var_type, var_name, params);
3397 unsigned int components,
3398 const std::set<SubdomainID> *
const active_subdomains)
3400 parallel_object_only();
3402 mooseDeprecated(
"Please use the addAuxVariable(var_type, var_name, params) API instead");
3412 params.
set<
unsigned int>(
"components") = components;
3414 if (active_subdomains)
3418 logAdd(
"Variable", var_name,
"ArrayMooseVariable", params);
3419 _aux->addVariable(
"ArrayMooseVariable", var_name, params);
3432 const std::set<SubdomainID> *
const active_subdomains)
3434 parallel_object_only();
3436 mooseDeprecated(
"Please use the addAuxVariable(var_type, var_name, params) API instead");
3451 params.
set<std::vector<Real>>(
"scaling") = std::vector<Real>{1};
3452 if (active_subdomains)
3456 logAdd(
"ScalarVariable", var_name,
"MooseVariableScalar", params);
3457 _aux->addVariable(
"MooseVariableScalar", var_name, params);
3464 const std::string & name,
3467 parallel_object_only();
3476 const std::string & name,
3479 parallel_object_only();
3508 const std::string & name,
3511 parallel_object_only();
3515 mooseError(
"You are trying to add a DiracKernel to a linear variable/system, which is not " 3516 "supported at the moment!");
3548 const std::string & name,
3551 parallel_object_only();
3555 mooseError(
"You are trying to add a DGKernel to a linear variable/system, which is not " 3556 "supported at the moment!");
3588 const std::string & name,
3602 const std::string & name,
3610 const std::string & name,
3615 addObject<FVInterfaceKernel>(
3621 const std::string & name,
3629 const std::string & name,
3639 const std::string & name,
3642 parallel_object_only();
3646 mooseError(
"You are trying to add a InterfaceKernel to a linear variable/system, which is not " 3647 "supported at the moment!");
3679 const std::string & name,
3680 const VariableName & var_name)
3684 std::string restart_method =
"";
3687 "a checkpoint restart, by IC object '" + ic_name +
"' for variable '" +
name +
"'";
3693 restarted_vars.insert(restarted_vars.end(), nodal_vars.begin(), nodal_vars.end());
3694 restarted_vars.insert(restarted_vars.end(), global_vars.begin(), global_vars.end());
3696 if (
std::find(restarted_vars.begin(), restarted_vars.end(), var_name) != restarted_vars.end())
3697 restart_method =
"an Exodus restart, by IC object '" + ic_name +
"' for variable '" +
name +
3698 "' that is also being restarted";
3700 if (!restart_method.empty())
3702 "Initial conditions have been specified during ",
3704 ".\nThis is only allowed if you specify 'allow_initial_conditions_with_restart' to " 3705 "the [Problem], as initial conditions can override restarted fields");
3711 const std::string & name,
3714 parallel_object_only();
3718 const std::string & var_name =
parameters.
get<VariableName>(
"variable");
3733 std::shared_ptr<InitialConditionBase> ic;
3734 if (dynamic_cast<MooseVariable *>(&var))
3736 else if (dynamic_cast<VectorMooseVariable *>(&var))
3738 else if (dynamic_cast<ArrayMooseVariable *>(&var))
3740 else if (dynamic_cast<MooseVariableFVReal *>(&var))
3742 else if (dynamic_cast<MooseLinearVariableFVReal *>(&var))
3745 mooseError(
"Your FE variable in initial condition ",
3747 " must be either of scalar or vector type");
3758 std::shared_ptr<ScalarInitialCondition> ic =
3766 "Variable '", var_name,
"' requested in initial condition '",
name,
"' does not exist.");
3771 const std::string & name,
3774 parallel_object_only();
3778 const std::string & var_name =
parameters.
get<VariableName>(
"variable");
3793 std::shared_ptr<FVInitialConditionBase> ic;
3798 "Your variable for an FVInitialCondition needs to be an a finite volume variable!");
3805 "' requested in finite volume initial condition '",
3807 "' does not exist.");
3813 TIME_SECTION(
"projectSolution", 2,
"Projecting Initial Solutions")
3826 Threads::parallel_reduce(elem_info_range, cfvic);
3830 for (
auto & nl :
_nl)
3831 nl->solution().close();
3832 _aux->solution().close();
3838 for (
auto & nl :
_nl)
3839 nl->solution().close();
3840 _aux->solution().close();
3848 for (
const auto & ic : ics)
3856 const unsigned int n_scalar_dofs = var.
dofIndices().size();
3857 for (
unsigned int i = 0; i < n_scalar_dofs; i++)
3859 const auto global_index = var.
dofIndices()[i];
3868 sys->solution().close();
3869 sys->solution().localize(*sys->system().current_local_solution, sys->dofMap().get_send_list());
3872 _aux->solution().close();
3873 _aux->solution().localize(*
_aux->sys().current_local_solution,
_aux->dofMap().get_send_list());
3880 const std::optional<std::set<VariableName>> & target_vars)
3885 Threads::parallel_reduce(elem_range, cic);
3890 Threads::parallel_reduce(elem_range, cic);
3894 for (
auto & nl :
_nl)
3895 nl->solution().close();
3896 _aux->solution().close();
3901 Threads::parallel_reduce(bnd_nodes, cbic);
3906 Threads::parallel_reduce(bnd_nodes, cbic);
3909 for (
auto & nl :
_nl)
3910 nl->solution().close();
3911 _aux->solution().close();
3919 for (
const auto & ic : ics)
3923 if (target_vars && !target_vars->count(var.
name()))
3931 const unsigned int n_scalar_dofs = var.
dofIndices().size();
3932 for (
unsigned int i = 0; i < n_scalar_dofs; i++)
3934 const auto global_index = var.
dofIndices()[i];
3941 for (
auto & nl :
_nl)
3943 nl->solution().close();
3944 nl->solution().localize(*nl->system().current_local_solution, nl->dofMap().get_send_list());
3947 _aux->solution().close();
3948 _aux->solution().localize(*
_aux->sys().current_local_solution,
_aux->dofMap().get_send_list());
3953 Number (*func)(
const Point &,
3955 const std::string &,
3956 const std::string &),
3959 const std::string &,
3960 const std::string &),
3962 const std::vector<VariableName> & target_vars)
3964 mooseAssert(!Threads::in_threads,
3965 "We're performing a projection based on data from just the thread 0 variable, so any " 3966 "modifications to the variable solution must have been thread joined already");
3968 std::unordered_map<unsigned int, std::vector<unsigned int>> sys_to_var_nums;
3970 for (
const auto & target_var : target_vars)
3974 sys_to_var_nums[sn].push_back(var.number());
3977 for (
const auto & [sys_num, var_nums] : sys_to_var_nums)
3980 libmesh_sys.
project_solution(func, func_grad, params, elem_range, var_nums);
3984 std::shared_ptr<MaterialBase>
3993 name +=
"_neighbor";
4006 "), but its compute flag is set to true. This indicates that MOOSE is " 4007 "computing this property which may not be desired and produce un-expected " 4036 mooseError(
"FEProblemBase::getMaterialData(): Invalid MaterialDataType ",
type);
4039 const std::set<const MooseObject *> &
4054 mooseError(
"FEProblemBase::getMaterialPropertyStorageConsumers(): Invalid MaterialDataType ",
4063 "ignore_zeros_in_jacobian",
4064 "We likely cannot preserve the sparsity pattern if ignoring zeros in the Jacobian, which " 4065 "leads to removing those entries from the Jacobian sparsity pattern");
4078 const std::string & name,
4081 parallel_object_only();
4083 auto add_functor_materials = [&](
const auto &
parameters,
const auto &
name)
4088 std::shared_ptr<MaterialBase> material =
4102 add_functor_materials(disp_params,
name +
"_displaced");
4108 const std::string & name,
4116 const std::string & name,
4124 const std::string & mat_name,
4125 const std::string & name,
4128 parallel_object_only();
4152 #ifdef MOOSE_KOKKOS_ENABLED 4160 std::shared_ptr<MaterialBase> material =
4163 bool discrete = !material->getParam<
bool>(
"compute");
4167 if (material->boundaryRestricted() ||
dynamic_cast<FunctorMaterial *
>(material.get()))
4173 for (
auto && warehouse : warehouses)
4174 warehouse->addObject(material, tid);
4186 std::string object_name;
4195 object_name =
name +
"_face";
4196 std::shared_ptr<MaterialBase> face_material =
4202 current_parameters.set<
bool>(
"_neighbor") =
true;
4203 object_name =
name +
"_neighbor";
4204 std::shared_ptr<MaterialBase> neighbor_material =
4213 for (
auto && warehouse : warehouses)
4214 warehouse->addObjects(material, neighbor_material, face_material, tid);
4219 const auto param_names =
4224 for (
const auto & p_name : param_names)
4227 p_name.parameter());
4229 p_name.parameter());
4231 p_name.parameter());
4233 primary_name, face_name,
false);
4235 primary_name, neighbor_name,
false);
4246 std::set<MooseVariableFEBase *> needed_moose_vars;
4247 std::unordered_set<unsigned int> needed_mat_props;
4256 for (
const auto id : ids)
4263 needed_moose_vars.insert(current_active_elemental_moose_variables.begin(),
4264 current_active_elemental_moose_variables.end());
4266 needed_mat_props.insert(consumer_needed_mat_props.begin(), consumer_needed_mat_props.end());
4277 auto && elem =
_assembly[tid][0]->elem();
4278 unsigned int n_points =
_assembly[tid][0]->qRule()->n_points();
4281 material_data.
resize(n_points);
4285 material_data.swap(*elem);
4298 const bool swap_stateful,
4299 const std::deque<MaterialBase *> *
const reinit_mats)
4305 auto && elem =
_assembly[tid][0]->elem();
4306 unsigned int side =
_assembly[tid][0]->side();
4307 unsigned int n_points =
_assembly[tid][0]->qRuleFace()->n_points();
4310 bnd_material_data.
resize(n_points);
4312 if (swap_stateful && !bnd_material_data.isSwapped())
4313 bnd_material_data.swap(*elem, side);
4316 bnd_material_data.reset(
4320 bnd_material_data.reinit(*reinit_mats);
4322 bnd_material_data.reinit(
4331 const bool swap_stateful,
4332 const std::deque<MaterialBase *> *
const reinit_mats)
4338 const auto *
const elem =
_assembly[tid][0]->elem();
4339 unsigned int side =
_assembly[tid][0]->side();
4340 unsigned int n_points =
_assembly[tid][0]->qRuleFace()->n_points();
4343 bnd_material_data.
resize(n_points);
4345 if (swap_stateful && !bnd_material_data.isSwapped())
4346 bnd_material_data.swap(*elem, side);
4349 bnd_material_data.reset(
4353 bnd_material_data.reinit(*reinit_mats);
4355 bnd_material_data.reinit(
4365 const bool swap_stateful,
4366 const std::deque<MaterialBase *> *
const reinit_mats)
4380 const bool swap_stateful,
4381 const std::deque<MaterialBase *> *
const reinit_mats)
4391 mooseAssert(neighbor,
"neighbor should be non-null");
4393 "The provided blk_id " << blk_id <<
" and neighbor subdomain ID " 4396 unsigned int n_points =
_assembly[tid][0]->qRuleNeighbor()->n_points();
4399 neighbor_material_data.
resize(n_points);
4403 neighbor_material_data.swap(*neighbor, neighbor_side);
4406 neighbor_material_data.reset(
4410 neighbor_material_data.reinit(*reinit_mats);
4412 neighbor_material_data.reinit(
4420 const bool swap_stateful,
4421 const std::deque<MaterialBase *> *
const reinit_mats)
4425 auto && elem =
_assembly[tid][0]->elem();
4426 unsigned int side =
_assembly[tid][0]->side();
4427 unsigned int n_points =
_assembly[tid][0]->qRuleFace()->n_points();
4430 bnd_material_data.
resize(n_points);
4432 if (swap_stateful && !bnd_material_data.isSwapped())
4433 bnd_material_data.swap(*elem, side);
4439 bnd_material_data.reinit(*reinit_mats);
4453 unsigned int side =
_assembly[tid][0]->side();
4454 unsigned int n_points =
_assembly[tid][0]->qRuleFace()->n_points();
4457 bnd_material_data.
resize(n_points);
4459 if (swap_stateful && !bnd_material_data.isSwapped())
4460 bnd_material_data.swap(*elem, side);
4470 auto && elem =
_assembly[tid][0]->elem();
4477 auto && elem =
_assembly[tid][0]->elem();
4478 unsigned int side =
_assembly[tid][0]->side();
4487 unsigned int neighbor_side =
4501 neighbor_side =
_assembly[tid][0]->side();
4502 mooseAssert(neighbor,
"We should have an appropriate value for elem coming from Assembly");
4513 const std::string & name,
4514 const std::string & type,
4518 _console <<
"[DBG] Adding " << system <<
" '" <<
name <<
"' of type " <<
type << std::endl;
4525 const std::string & object_name,
4526 const std::string & var_param_name)
4532 unsigned int sys_num = 0;
4541 const auto var_sys_num = sys_num;
4544 mooseError(
"We dont support setting 'variable' to a variable that is not set to the same " 4545 "system as the 'solver_sys' parameter");
4552 if (sys_num ==
_aux->number())
4568 if (sys_num ==
_aux->number())
4577 const std::string & type)
const 4582 " already exists. You may not add a ",
4584 " by the same name.");
4586 #ifdef MOOSE_KOKKOS_ENABLED 4590 " already exists. You may not add a ",
4592 " by the same name.");
4598 const std::string & name,
4608 const std::string & name,
4618 const std::string & name,
4626 std::vector<std::shared_ptr<UserObject>>
4628 const std::string & name,
4631 parallel_object_only();
4633 std::vector<std::shared_ptr<UserObject>> uos;
4641 std::shared_ptr<UserObject> user_object =
4644 uos.push_back(user_object);
4647 user_object->setPrimaryThreadCopy(uos[0].
get());
4673 if (euo || nuo || duo)
4675 if (suo || duo || isuo || iuo)
4677 if (iuo || duo || isuo)
4682 if ((guo && !tguo) || muo)
4691 const decltype(uos)::size_type uo_index = uos.front()->needThreadedCopy() ? tid : 0;
4705 const std::string & name,
4708 parallel_object_only();
4723 std::vector<UserObject *> objs;
4727 .condition<AttribThread>(tid)
4732 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_user_object"),
4733 "A UserObject getter was called before UserObjects have been constructed. The " 4734 "requested UserObject '" +
4735 name +
"' may exist in the input file, but UserObjects are not available yet.");
4737 mooseError(
"Unable to find user object with name '" +
name +
"'");
4739 mooseAssert(objs.size() == 1,
"Should only find one UO");
4746 std::vector<Positions *> objs;
4750 .condition<AttribName>(
name)
4753 mooseError(
"Unable to find Positions object with name '" +
name +
"'");
4754 mooseAssert(objs.size() == 1,
"Should only find one Positions");
4761 std::vector<UserObject *> objs;
4765 .condition<AttribThread>(0)
4768 return !objs.empty();
4775 std::vector<FVInterpolationMethod *> methods;
4779 .condition<AttribThread>(tid)
4781 .queryInto(methods);
4783 if (methods.empty())
4785 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_interpolation_method"),
4786 "An FVInterpolationMethod getter was called before FVInterpolationMethods have " 4787 "been constructed. If you are attempting to access this object in the constructor " 4788 "of another object then make sure that the FVInterpolationMethod is constructed " 4789 "before the object using it.");
4791 mooseError(
"Unable to find FVInterpolationMethod with name '",
name,
"'");
4794 mooseAssert(methods.size() == 1,
"Expected a single FVInterpolationMethod per thread");
4795 return *(methods[0]);
4810 ") is not a scalar face interpolation method.");
4812 return *face_method;
4822 if (!advected_method)
4827 ") is not an advected interpolation method.");
4829 return *advected_method;
4835 std::vector<FVInterpolationMethod *> methods;
4839 .condition<AttribThread>(0)
4841 .queryInto(methods);
4842 return !methods.empty();
4855 std::vector<Postprocessor *> objs;
4859 .condition<AttribThread>(tid)
4864 mooseError(
"Unable to find Postprocessor with name '", object_name,
"'");
4865 mooseAssert(objs.size() == 1,
4866 "We shouldn't find more than one postprocessor object for a given name");
4872 std::size_t t_index)
const 4881 std::size_t t_index)
4890 mooseDeprecated(
"FEProblemBase::hasPostprocssor is being removed; use " 4891 "hasPostprocessorValueByName instead.");
4897 const std::string & vector_name,
4898 std::size_t t_index)
const 4906 const std::string & vector_name,
4908 std::size_t t_index)
4918 std::vector<VectorPostprocessor *> objs;
4922 .condition<AttribThread>(tid)
4929 getMooseApp().actionWarehouse().isTaskComplete(
"add_vector_postprocessor"),
4930 "A VectorPostprocessor getter was called before VectorPostprocessors have been " 4931 "constructed. The requested VectorPostprocessor '" +
4933 "' may exist in the input file, but VectorPostprocessors are not available yet.");
4935 mooseError(
"Unable to find VectorPostprocessor with name '", object_name,
"'");
4937 mooseAssert(objs.size() == 1,
4938 "We shouldn't find more than one vector postprocessor object for a given name");
4947 const auto & objects = it.second.getActiveObjects();
4948 for (
const auto & obj : objects)
4949 obj->parentOutputPositionChanged();
4966 TIME_SECTION(
"computeIndicators", 1,
"Computing Indicators");
4970 const auto old_do_derivatives = ADReal::do_derivatives;
4971 ADReal::do_derivatives =
false;
4973 std::vector<std::string>
fields;
4977 for (
const auto & indicator : indicators)
4978 fields.push_back(indicator->name());
4982 for (
const auto & internal_indicator : internal_indicators)
4983 fields.push_back(internal_indicator->name());
4990 _aux->solution().close();
4995 _aux->solution().close();
4998 ADReal::do_derivatives = old_do_derivatives;
5007 TIME_SECTION(
"computeMarkers", 1,
"Computing Markers");
5009 std::vector<std::string>
fields;
5013 for (
const auto & marker : markers)
5014 fields.push_back(marker->name());
5023 for (
const auto & marker : markers)
5024 marker->markerSetup();
5030 _aux->solution().close();
5067 #ifdef MOOSE_KOKKOS_ENABLED 5071 _aux->customSetup(exec_type);
5072 for (
auto & nl :
_nl)
5073 nl->customSetup(exec_type);
5085 std::vector<UserObject *> userobjs;
5087 for (
auto obj : userobjs)
5088 obj->customSetup(exec_type);
5090 #ifdef MOOSE_KOKKOS_ENABLED 5092 std::vector<UserObjectBase *> userobjs;
5094 for (
auto obj : userobjs)
5095 obj->customSetup(exec_type);
5143 std::unique_ptr<NumericVector<Number>> x =
_aux->currentSolution()->clone();
5151 const Real check_tol = 1e-8;
5153 const Real xnorm = x->l2_norm();
5154 *x -= *
_aux->currentSolution();
5155 if (x->l2_norm() > check_tol * xnorm)
5157 const auto & sys =
_aux->system();
5158 const unsigned int n_vars = sys.n_vars();
5159 std::multimap<Real, std::string, std::greater<Real>> ordered_map;
5163 ordered_map.emplace(vnorm, sys.variable_name(i));
5166 std::ostringstream oss;
5167 for (
const auto & [error_norm, var_name] : ordered_map)
5168 oss <<
" {" << var_name <<
", " << error_norm <<
"},\n";
5170 mooseError(
"Aux kernels, user objects appear to have states for aux variables on ",
5172 ".\nVariable error norms in descending order:\n",
5177 if (pp_values.
size() != new_pp_values.
size())
5178 mooseError(
"Second execution for uo/aux state check should not change the number of " 5179 "real reporter values");
5182 pp_values -= new_pp_values;
5183 if (pp_values.
l2_norm() > check_tol * ppnorm)
5186 std::multimap<Real, std::string, std::greater<Real>> ordered_map;
5188 ordered_map.emplace(
std::abs(pp_values(i)), pp_names[i]);
5190 std::ostringstream oss;
5191 for (
const auto & [error_norm, pp_name] : ordered_map)
5192 oss <<
" {" << pp_name <<
", " << error_norm <<
"},\n";
5194 mooseError(
"Aux kernels, user objects appear to have states for real reporter values on ",
5196 ".\nErrors of real reporter values in descending order:\n",
5206 std::vector<UserObject *> objs;
5207 query.queryInto(objs);
5212 for (
auto obj : objs)
5213 if (obj->primaryThreadCopy())
5214 obj->primaryThreadCopy()->threadJoin(*obj);
5220 for (
auto obj : objs)
5222 if (isgen && dynamic_cast<ThreadedGeneralUserObject *>(obj))
5228 _console <<
"[DBG] Initializing, executing & finalizing general UO '" << obj->name()
5253 auto reporter =
dynamic_cast<Reporter *
>(obj);
5279 std::set<int> & execution_groups)
const 5281 std::vector<UserObjectBase *> uos;
5282 query.queryIntoUnsorted(uos);
5283 for (
const auto & uo : uos)
5284 execution_groups.insert(uo->getParam<
int>(
"execution_order_group"));
5290 const std::string & name)
5295 std::set<int> execution_groups;
5297 #ifdef MOOSE_KOKKOS_ENABLED 5306 for (
const auto execution_group : execution_groups)
5308 #ifdef MOOSE_KOKKOS_ENABLED 5323 std::set<int> execution_groups;
5325 #ifdef MOOSE_KOKKOS_ENABLED 5333 for (
const auto execution_group : execution_groups)
5335 #ifdef MOOSE_KOKKOS_ENABLED 5350 TIME_SECTION(
"computeUserObjects", 1,
"Computing User Objects");
5352 std::vector<GeneralUserObject *> genobjs;
5355 std::vector<UserObject *> userobjs;
5360 .queryInto(userobjs);
5362 std::vector<UserObject *> tgobjs;
5367 std::vector<UserObject *> nodal;
5370 std::vector<MortarUserObject *> mortar;
5373 if (userobjs.empty() && genobjs.empty() && tgobjs.empty() && nodal.empty() && mortar.empty())
5382 for (
auto obj : userobjs)
5383 obj->residualSetup();
5384 for (
auto obj : nodal)
5385 obj->residualSetup();
5386 for (
auto obj : mortar)
5387 obj->residualSetup();
5388 for (
auto obj : tgobjs)
5389 obj->residualSetup();
5390 for (
auto obj : genobjs)
5391 obj->residualSetup();
5395 for (
auto obj : userobjs)
5396 obj->jacobianSetup();
5397 for (
auto obj : nodal)
5398 obj->jacobianSetup();
5399 for (
auto obj : mortar)
5400 obj->jacobianSetup();
5401 for (
auto obj : tgobjs)
5402 obj->jacobianSetup();
5403 for (
auto obj : genobjs)
5404 obj->jacobianSetup();
5407 for (
auto obj : userobjs)
5411 if (!userobjs.empty())
5430 for (
const auto & uo : userobjs)
5431 if (
auto euo = dynamic_cast<const ElementUserObject *>(uo);
5432 euo && euo->hasWritableCoupledVariables())
5434 _aux->solution().close();
5435 _aux->system().update();
5443 for (
auto obj : nodal)
5453 for (
const auto & uo : nodal)
5454 if (
auto nuo = dynamic_cast<const NodalUserObject *>(uo);
5455 nuo && nuo->hasWritableCoupledVariables())
5457 _aux->solution().close();
5458 _aux->system().update();
5464 for (
auto obj : mortar)
5466 if (!mortar.empty())
5468 auto create_and_run_mortar_functors = [
this,
type, &mortar](
const bool displaced)
5472 for (
const auto & [primary_secondary_boundary_pair, mortar_generation_ptr] :
5475 auto mortar_uos_to_execute =
5477 primary_secondary_boundary_pair.second,
5481 auto *
const subproblem = displaced
5483 : static_cast<SubProblem *>(
this);
5485 *mortar_generation_ptr,
5489 subproblem->assembly(0, 0));
5495 create_and_run_mortar_functors(
false);
5497 create_and_run_mortar_functors(
true);
5499 for (
auto obj : mortar)
5504 for (
auto obj : tgobjs)
5506 std::vector<GeneralUserObject *> tguos_zero;
5510 .queryInto(tguos_zero);
5511 for (
auto obj : tguos_zero)
5513 std::vector<GeneralUserObject *> tguos;
5514 auto q =
query.clone()
5543 TIME_SECTION(
"executeControls", 1,
"Executing Controls");
5549 for (
const auto & it : controls_wh.getActiveObjects())
5554 std::vector<std::string> & dependent_controls = it->getDependencies();
5555 for (
const auto & depend_name : dependent_controls)
5557 if (controls_wh.hasActiveObject(depend_name))
5559 auto dep_control = controls_wh.getActiveObject(depend_name);
5560 resolver.
addEdge(dep_control, it);
5565 "\" was not created, did you make a " 5566 "spelling mistake or forget to include it " 5567 "in your input file?");
5573 if (!ordered_controls.empty())
5580 for (
const auto & control : ordered_controls)
5593 std::vector<Sampler *> objects;
5597 .condition<AttribThread>(tid)
5599 .queryInto(objects);
5601 if (!objects.empty())
5603 TIME_SECTION(
"executeSamplers", 1,
"Executing Samplers");
5604 FEProblemBase::objectSetupHelper<Sampler>(objects, exec_type);
5605 FEProblemBase::objectExecuteHelper<Sampler>(objects);
5613 TIME_SECTION(
"updateActiveObjects", 5,
"Updating Active Objects");
5617 for (
auto & nl :
_nl)
5618 nl->updateActive(tid);
5619 _aux->updateActive(tid);
5636 #ifdef MOOSE_KOKKOS_ENABLED 5650 TIME_SECTION(
"reinitBecauseOfGhostingOrNewGeomObjects",
5652 "Reinitializing Because of Geometric Search Objects");
5661 (
_mortar_data->hasDisplacedObjects() && mortar_changed)));
5676 const std::string & name,
5679 parallel_object_only();
5681 const auto nl_sys_num =
5687 mooseError(
"You are trying to add a DGKernel to a linear variable/system, which is not " 5688 "supported at the moment!");
5701 for (
auto & nl :
_nl)
5707 const std::string & name,
5710 parallel_object_only();
5736 std::shared_ptr<Indicator> indicator =
5739 std::shared_ptr<InternalSideIndicatorBase> isi =
5750 const std::string & name,
5753 parallel_object_only();
5787 const std::string & name,
5790 parallel_object_only();
5818 multi_app->setupPositions();
5823 std::shared_ptr<TransientMultiApp> trans_multi_app =
5825 if (trans_multi_app)
5841 std::shared_ptr<MultiApp>
5845 mooseAssert(
getMooseApp().actionWarehouse().isTaskComplete(
"add_multi_app"),
5846 "A MultiApp getter was called before MultiApps have been constructed. " 5847 "If you are attempting to access this object in the constructor of another object " 5848 "then make sure that the MultiApp is constructed before the object using it.");
5858 std::string string_direction;
5860 string_direction =
" To ";
5861 else if (from_multiapp)
5862 string_direction =
" From ";
5864 string_direction =
" Between ";
5872 TIME_SECTION(
"execMultiAppTransfers", 1,
"Executing Transfers");
5879 <<
"MultiApps" << COLOR_DEFAULT <<
":" << std::endl;
5882 {
"Name",
"Type",
"From",
"To"});
5885 for (
const auto & transfer : transfers)
5889 table.addRow(multiapp_transfer->name(),
5890 multiapp_transfer->type(),
5891 multiapp_transfer->getFromName(),
5892 multiapp_transfer->getToName());
5899 for (
const auto & transfer : transfers)
5902 transfer->execute();
5909 << COLOR_DEFAULT << std::endl;
5916 << COLOR_DEFAULT << std::endl;
5920 std::vector<std::shared_ptr<Transfer>>
5931 std::vector<std::shared_ptr<Transfer>>
5957 const std::vector<MooseSharedPointer<MultiApp>> & multi_apps =
5961 for (
const auto & multi_app : multi_apps)
5962 multi_app->preTransfer(
_dt,
_time);
5971 if (multi_apps.size())
5973 TIME_SECTION(
"execMultiApps", 1,
"Executing MultiApps",
false);
5977 << COLOR_DEFAULT << std::endl;
5979 bool success =
true;
5981 for (
const auto & multi_app : multi_apps)
5983 success = multi_app->solveStep(
_dt,
_time, auto_advance);
5998 << COLOR_DEFAULT << std::endl;
6013 for (
const auto & multi_app : multi_apps)
6014 multi_app->finalize();
6022 for (
const auto & multi_app : multi_apps)
6023 multi_app->postExecute();
6031 if (multi_apps.size())
6032 for (
const auto & multi_app : multi_apps)
6033 multi_app->incrementTStep(
_time);
6041 if (multi_apps.size())
6044 _console << COLOR_CYAN <<
"\nAdvancing MultiApps on " <<
type.name() << COLOR_DEFAULT
6047 for (
const auto & multi_app : multi_apps)
6048 multi_app->finishStep(recurse_through_multiapp_levels);
6053 _console << COLOR_CYAN <<
"Finished Advancing MultiApps on " <<
type.name() <<
"\n" 6054 << COLOR_DEFAULT << std::endl;
6063 if (multi_apps.size())
6065 TIME_SECTION(
"backupMultiApps", 5,
"Backing Up MultiApp");
6068 _console << COLOR_CYAN <<
"\nBacking Up MultiApps on " <<
type.name() << COLOR_DEFAULT
6071 for (
const auto & multi_app : multi_apps)
6072 multi_app->backup();
6077 _console << COLOR_CYAN <<
"Finished Backing Up MultiApps on " <<
type.name() <<
"\n" 6078 << COLOR_DEFAULT << std::endl;
6087 if (multi_apps.size())
6092 _console << COLOR_CYAN <<
"\nRestoring Multiapps on " <<
type.name()
6093 <<
" because of solve failure!" << COLOR_DEFAULT << std::endl;
6095 _console << COLOR_CYAN <<
"\nRestoring MultiApps on " <<
type.name() << COLOR_DEFAULT
6099 for (
const auto & multi_app : multi_apps)
6100 multi_app->restore(force);
6105 _console << COLOR_CYAN <<
"Finished Restoring MultiApps on " <<
type.name() <<
"\n" 6106 << COLOR_DEFAULT << std::endl;
6117 for (
const auto & multi_app : multi_apps)
6118 smallest_dt =
std::min(smallest_dt, multi_app->computeDT());
6128 TIME_SECTION(
"execTransfers", 3,
"Executing Transfers");
6132 for (
const auto & transfer : transfers)
6133 transfer->execute();
6139 const std::string & name,
6142 parallel_object_only();
6173 std::shared_ptr<MultiApp> multiapp;
6186 exec_enum = multiapp->getParam<
ExecFlagEnum>(
"execute_on");
6194 std::shared_ptr<MultiAppTransfer> multi_app_transfer =
6196 if (multi_app_transfer)
6213 if (sys->hasVariable(var_name))
6215 if (
_aux->hasVariable(var_name))
6225 if (sys->hasVariable(var_name))
6233 const std::string & var_name,
6245 if (sys->hasVariable(var_name))
6246 return sys->getFieldVariable<
Real>(tid, var_name);
6247 if (
_aux->hasVariable(var_name))
6248 return _aux->getFieldVariable<
Real>(tid, var_name);
6257 if (sys->hasVariable(var_name))
6258 return sys->getActualFieldVariable<
Real>(tid, var_name);
6259 if (
_aux->hasVariable(var_name))
6260 return _aux->getActualFieldVariable<
Real>(tid, var_name);
6269 if (sys->hasVariable(var_name))
6271 if (
_aux->hasVariable(var_name))
6281 if (sys->hasVariable(var_name))
6283 if (
_aux->hasVariable(var_name))
6293 if (sys->hasScalarVariable(var_name))
6295 if (
_aux->hasScalarVariable(var_name))
6305 if (sys->hasScalarVariable(var_name))
6306 return sys->getScalarVariable(tid, var_name);
6307 if (
_aux->hasScalarVariable(var_name))
6308 return _aux->getScalarVariable(tid, var_name);
6319 else if (
_aux->hasVariable(var_name) ||
_aux->hasScalarVariable(var_name))
6320 return _aux->system();
6322 mooseError(
"Unable to find a system containing the variable " + var_name);
6430 mat->setActiveProperties(mat_prop_ids);
6432 mat->setActiveProperties(mat_prop_ids);
6434 mat->setActiveProperties(mat_prop_ids);
6454 #ifdef LIBMESH_ENABLE_AMR 6464 const std::string & redistributer_name,
6465 const bool use_displaced_mesh)
6469 redistribute_params.
set<std::string>(
"for_whom") = this->
name();
6473 redistribute_params.
set<
bool>(
"use_displaced_mesh") = use_displaced_mesh;
6476 std::shared_ptr<RedistributeProperties> redistributer =
6478 "RedistributeProperties", redistributer_name, redistribute_params);
6492 add_redistributer(
_mesh,
"mesh_property_redistributer",
false);
6494 add_redistributer(
_displaced_problem->mesh(),
"displaced_mesh_property_redistributer",
true);
6496 #endif // LIBMESH_ENABLE_AMR 6516 mooseError(
"Max quadrature points per element assumptions made in some code (e.g. Coupleable ",
6517 "and MaterialPropertyInterface classes) have been violated.\n",
6518 "Complain to Moose developers to have constMaxQpsPerElem increased from ",
6526 _zero[tid].resize(max_qpts, 0);
6569 const bool allow_negative_qweights)
6578 if (order < _aux->getMinQuadratureOrder())
6579 order =
_aux->getMinQuadratureOrder();
6583 volume_order = order;
6591 type, order, volume_order, face_order, block, allow_negative_qweights);
6595 type, order, volume_order, face_order, block, allow_negative_qweights);
6606 mooseError(
"Someone told us (the FEProblemBase) to trust the user coupling matrix, but we " 6607 "haven't been provided a coupling matrix!");
6628 _cm[i] = std::move(cm);
6635 mooseError(
"Someone told us (the FEProblemBase) to trust the user coupling matrix, but we " 6636 "haven't been provided a coupling matrix!");
6644 TIME_SECTION(
"setNonlocalCouplingMatrix", 5,
"Setting Nonlocal Coupling Matrix");
6647 mooseError(
"Nonlocal kernels are weirdly stored on the FEProblem so we don't currently support " 6648 "multiple nonlinear systems with nonlocal kernels.");
6652 auto & nl =
_nl[nl_sys_num];
6654 unsigned int n_vars = nl->nVariables();
6655 nonlocal_cm.resize(
n_vars);
6656 const auto &
vars = nl->getVariables(0);
6659 for (
const auto & ivar :
vars)
6661 for (
const auto & kernel : nonlocal_kernel)
6663 for (
unsigned int i = ivar->number(); i < ivar->number() + ivar->count(); ++i)
6664 if (i == kernel->variable().number())
6665 for (
const auto & jvar :
vars)
6670 unsigned int j = jvar->number();
6671 nonlocal_cm(i, j) = 1;
6675 for (
const auto & integrated_bc : nonlocal_integrated_bc)
6677 for (
unsigned int i = ivar->number(); i < ivar->number() + ivar->count(); ++i)
6678 if (i == integrated_bc->variable().number())
6679 for (
const auto & jvar :
vars)
6684 unsigned int j = jvar->number();
6685 nonlocal_cm(i, j) = 1;
6695 const unsigned int jvar,
6696 const unsigned int nl_sys)
const 6698 return (*
_cm[nl_sys])(ivar, jvar);
6701 std::vector<std::pair<MooseVariableFEBase *, MooseVariableFEBase *>> &
6704 return _assembly[tid][nl_sys]->couplingEntries();
6707 std::vector<std::pair<MooseVariableFEBase *, MooseVariableFEBase *>> &
6710 return _assembly[tid][nl_sys]->nonlocalCouplingEntries();
6719 TIME_SECTION(
"init", 2,
"Initializing");
6735 unsigned int n_vars = nl->nVariables();
6737 TIME_SECTION(
"fillCouplingMatrix", 3,
"Filling Coupling Matrix");
6742 cm = std::make_unique<CouplingMatrix>(
n_vars);
6743 for (
unsigned int i = 0; i <
n_vars; i++)
6749 cm = std::make_unique<CouplingMatrix>(
n_vars);
6750 for (
unsigned int i = 0; i <
n_vars; i++)
6751 for (
unsigned int j = 0; j <
n_vars; j++)
6761 nl->dofMap()._dof_coupling = cm.get();
6767 nl->dofMap()._dof_coupling =
nullptr;
6769 nl->dofMap().attach_extra_sparsity_function(&
extraSparsity, nl.get());
6770 nl->dofMap().attach_extra_send_list_function(&
extraSendList, nl.get());
6774 mooseError(
"No variables specified in nonlinear system '", nl->name(),
"'.");
6796 for (
auto & nl :
_nl)
6798 nl->turnOffJacobian();
6816 TIME_SECTION(
"EquationSystems::Init", 2,
"Initializing Equation Systems");
6838 "Coupling matrix not set for system " 6840 <<
". This should only happen if a preconditioner was not setup for this system");
6847 #ifdef MOOSE_KOKKOS_ENABLED 6858 std::istringstream ss(nl_sys_name);
6859 unsigned int nl_sys_num;
6860 if (!(ss >> nl_sys_num) || !ss.eof())
6869 std::istringstream ss(linear_sys_name);
6870 unsigned int linear_sys_num;
6871 if (!(ss >> linear_sys_num) || !ss.eof())
6874 return linear_sys_num;
6880 std::istringstream ss(solver_sys_name);
6881 unsigned int solver_sys_num;
6882 if (!(ss >> solver_sys_num) || !ss.eof())
6886 mooseError(
"The solver system number was requested for system '" + solver_sys_name,
6887 "' but this system does not exist in the Problem. Systems can be added to the " 6888 "problem using the 'nl_sys_names'/'linear_sys_names' parameter.\nSystems in the " 6891 solver_sys_num = search->second;
6894 return solver_sys_num;
6901 if (solver_sys->hasVariable(variable_name))
6902 return solver_sys->number();
6903 mooseAssert(
_aux,
"Should have an auxiliary system");
6904 if (
_aux->hasVariable(variable_name))
6905 return _aux->number();
6909 "' was not found in any solver (nonlinear/linear) or auxiliary system");
6915 TIME_SECTION(
"solve", 1,
"Solving",
false);
6929 #if PETSC_RELEASE_LESS_THAN(3, 12, 0) 6968 #if !PETSC_RELEASE_LESS_THAN(3, 12, 0) 6970 LibmeshPetscCall(PetscOptionsPop());
6987 TIME_SECTION(
"checkExceptionAndStopSolve", 5);
7008 <<
"To recover, the solution will fail and then be re-attempted with a reduced time " 7023 _aux->solution().close();
7037 mooseError(
"The following parallel-communicated exception was detected during " +
7040 "\nBecause this did not occur during residual evaluation, there" 7041 " is no way to handle this, so the solution is aborting.\n");
7049 ADReal::do_derivatives =
true;
7074 TIME_SECTION(
"solve", 1,
"Solving",
false);
7084 #if PETSC_RELEASE_LESS_THAN(3, 12, 0) 7086 options, solver_params));
7104 #if !PETSC_RELEASE_LESS_THAN(3, 12, 0) 7106 LibmeshPetscCall(PetscOptionsPop());
7122 return _nl[nl_sys_num]->nNonlinearIterations();
7128 return _nl[nl_sys_num]->nLinearIterations();
7134 return _nl[nl_sys_num]->finalNonlinearResidual();
7140 return _nl[nl_sys_num]->computingPreSMOResidual();
7146 TIME_SECTION(
"copySolutionsBackwards", 3,
"Copying Solutions Backward");
7149 sys->copySolutionsBackwards();
7150 _aux->copySolutionsBackwards();
7157 sys->skipNextSolutionToOldCopy();
7158 _aux->skipNextSolutionToOldCopy();
7164 TIME_SECTION(
"advanceState", 5,
"Advancing State");
7167 sys->copyOldSolutions();
7168 _aux->copyOldSolutions();
7190 #ifdef MOOSE_KOKKOS_ENABLED 7205 TIME_SECTION(
"restoreSolutions", 5,
"Restoring Solutions");
7209 "There is currently no way to restore not-zeroed vectors.");
7214 _console <<
"Restoring solutions on system " << sys->name() <<
"..." << std::endl;
7215 sys->restoreSolutions();
7219 _console <<
"Restoring solutions on Auxiliary system..." << std::endl;
7220 _aux->restoreSolutions();
7223 _console <<
"Restoring postprocessor, vector-postprocessor, and reporter data..." << std::endl;
7233 TIME_SECTION(
"saveOldSolutions", 5,
"Saving Old Solutions");
7236 sys->saveOldSolutions();
7237 _aux->saveOldSolutions();
7243 TIME_SECTION(
"restoreOldSolutions", 5,
"Restoring Old Solutions");
7246 sys->restoreOldSolutions();
7247 _aux->restoreOldSolutions();
7253 TIME_SECTION(
"outputStep", 1,
"Outputting");
7290 TIME_SECTION(
"onTimestepBegin", 2);
7292 for (
auto & nl :
_nl)
7293 nl->onTimestepBegin();
7309 switch (state.
state)
7318 mooseError(
"Unhandled state ", state.
state,
" in FEProblemBase::getTimeFromStateArg");
7324 const std::string & name,
7327 parallel_object_only();
7339 _aux->addDotVectors();
7340 for (
auto & nl :
_nl)
7342 nl->addDotVectors();
7344 auto tag_udot = nl->getTimeIntegrators()[0]->uDotFactorTag();
7345 if (!nl->hasVector(tag_udot))
7346 nl->associateVectorToTag(*nl->solutionUDot(), tag_udot);
7347 auto tag_udotdot = nl->getTimeIntegrators()[0]->uDotDotFactorTag();
7349 nl->associateVectorToTag(*nl->solutionUDotDot(), tag_udotdot);
7359 const std::string & name,
7362 parallel_object_only();
7365 mooseError(
"Vector bounds cannot be used with LinearSystems!");
7371 for (
auto & nl :
_nl)
7372 nl->setPredictor(predictor);
7396 residual->scale(-1.0);
7398 return residual->l2_norm();
7404 TIME_SECTION(
"computeResidualL2Norm", 2,
"Computing L2 Norm of Residual");
7408 for (
auto sys :
_nl)
7428 parallel_object_only();
7430 TIME_SECTION(
"computeResidualSys", 5);
7450 const unsigned int nl_sys_num)
7459 mooseAssert(
_fe_vector_tags.empty(),
"This should be empty indicating a clean starting state");
7482 "This should be empty indicating a clean starting state");
7494 for (
auto & tag : tags)
7512 for (
auto index :
make_range(matrix.row_start(), matrix.row_stop()))
7513 matrix.add(index, index, 0);
7516 _aux->zeroVariablesForResidual();
7540 for (
unsigned int tid = 0; tid <
n_threads; tid++)
7545 _aux->residualSetup();
7561 #ifdef MOOSE_KOKKOS_ENABLED 7626 mooseError(
"An unhandled MooseException was raised during residual computation. Please " 7627 "contact the MOOSE team for assistance.");
7634 const std::set<TagID> & tags)
7636 parallel_object_only();
7638 TIME_SECTION(
"computeResidualInternal", 1);
7659 mooseError(
"An unhandled MooseException was raised during residual computation. Please " 7660 "contact the MOOSE team for assistance.");
7669 TIME_SECTION(
"computeResidualType", 5);
7690 mooseError(
"An unhandled MooseException was raised during residual computation. Please " 7691 "contact the MOOSE team for assistance.");
7698 auto create_exception_message =
7699 [&calling_method](
const std::string & exception_type,
const auto & exception)
7701 return std::string(
"A " + exception_type +
" was raised during FEProblemBase::" +
7702 calling_method +
"\n" + std::string(exception.what()));
7711 setException(create_exception_message(
"MooseException", e));
7713 catch (
const MetaPhysicL::LogicError & e)
7729 mooseError(create_exception_message(
"libMesh::PetscSolverException", e));
7731 catch (
const std::exception & e)
7734 if (strstr(e.what(),
"Jacobian") || strstr(e.what(),
"singular") ||
7735 strstr(e.what(),
"det != 0"))
7736 setException(create_exception_message(
"libMesh DegenerateMap", e));
7739 const auto message = create_exception_message(
"std::exception", e);
7753 parallel_object_only();
7759 TIME_SECTION(
"computeResidualTags", 5,
"Computing Residual");
7761 ADReal::do_derivatives =
false;
7765 _aux->zeroVariablesForResidual();
7779 for (
unsigned int tid = 0; tid <
n_threads; tid++)
7784 _aux->residualSetup();
7800 #ifdef MOOSE_KOKKOS_ENABLED 7861 const unsigned int nl_sys_num)
7868 for (
auto & tag : tags)
7877 const std::set<TagID> & tags)
7879 TIME_SECTION(
"computeJacobianInternal", 1);
7899 TIME_SECTION(
"computeJacobianTags", 5,
"Computing Jacobian");
7901 for (
auto tag : tags)
7913 for (
auto index :
make_range(matrix.row_start(), matrix.row_stop()))
7914 matrix.add(index, index, 0);
7917 _aux->zeroVariablesForJacobian();
7933 for (
unsigned int tid = 0; tid <
n_threads; tid++)
7938 _aux->jacobianSetup();
7946 for (
unsigned int tid = 0; tid <
n_threads; tid++)
7952 #ifdef MOOSE_KOKKOS_ENABLED 7997 const unsigned int nl_sys_num)
7999 TIME_SECTION(
"computeTransientImplicitJacobian", 2);
8021 JacobianBlock jac_block(precond_system, jacobian, ivar, jvar);
8022 std::vector<JacobianBlock *>
blocks = {&jac_block};
8037 "I expect these system numbers to be the same");
8042 TIME_SECTION(
"computeBounds", 1,
"Computing Bounds");
8051 _aux->residualSetup();
8075 const bool compute_gradients)
8077 TIME_SECTION(
"computeLinearSystemSys", 5);
8110 const std::set<TagID> & vector_tags,
8111 const std::set<TagID> & matrix_tags,
8112 const bool compute_gradients)
8114 TIME_SECTION(
"computeLinearSystemTags", 5,
"Computing Linear System");
8118 for (
auto tag : matrix_tags)
8137 _aux->jacobianSetup();
8144 #ifdef MOOSE_KOKKOS_ENABLED 8154 _console <<
"\nA MooseException was raised during Auxiliary variable computation.\n" 8155 <<
"The next solve will fail, the timestep will be reduced, and we will try again.\n" 8185 "I expect these system numbers to be the same");
8188 for (
unsigned int i = 0; i <
subspaceDim(
"NearNullSpace"); ++i)
8190 std::stringstream postfix;
8191 postfix <<
"_" << i;
8192 std::string modename =
"NearNullSpace" + postfix.str();
8202 "I expect these system numbers to be the same");
8204 for (
unsigned int i = 0; i <
subspaceDim(
"NullSpace"); ++i)
8206 std::stringstream postfix;
8207 postfix <<
"_" << i;
8217 "I expect these system numbers to be the same");
8219 for (
unsigned int i = 0; i <
subspaceDim(
"TransposeNullSpace"); ++i)
8221 std::stringstream postfix;
8222 postfix <<
"_" << i;
8232 bool & changed_search_direction,
8233 bool & changed_new_soln)
8236 "I expect these system numbers to be the same");
8247 TIME_SECTION(
"computePostCheck", 2,
"Computing Post Check");
8262 std::unique_ptr<NumericVector<Number>> ghosted_solution =
8264 ghosted_search_direction =
8268 *ghosted_solution = new_soln;
8269 *ghosted_search_direction = search_direction;
8280 new_soln = old_soln;
8281 new_soln.
add(-damping, search_direction);
8282 changed_new_soln =
true;
8289 if (changed_new_soln)
8290 *ghosted_solution = new_soln;
8292 bool updated_solution =
updateSolution(new_soln, *ghosted_solution);
8293 if (updated_solution)
8294 changed_new_soln =
true;
8301 _aux->copyCurrentIntoPreviousNL();
8305 changed_search_direction =
false;
8319 TIME_SECTION(
"computeDamping", 1,
"Computing Damping");
8360 parallel_object_only();
8369 TIME_SECTION(
"updateGeometricSearch", 3,
"Updating Geometric Search");
8380 TIME_SECTION(
"updateMortarMesh", 5,
"Updating Mortar Mesh");
8389 const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
8390 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
8394 const bool correct_edge_dropping,
8395 const Real minimum_projection_angle)
8400 return _mortar_data->createMortarInterface(primary_secondary_boundary_pair,
8401 primary_secondary_subdomain_pair,
8406 correct_edge_dropping,
8407 minimum_projection_angle);
8409 return _mortar_data->createMortarInterface(primary_secondary_boundary_pair,
8410 primary_secondary_subdomain_pair,
8415 correct_edge_dropping,
8416 minimum_projection_angle);
8421 const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
8422 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
8423 bool on_displaced)
const 8426 primary_secondary_boundary_pair, primary_secondary_subdomain_pair, on_displaced);
8431 const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
8432 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
8436 primary_secondary_boundary_pair, primary_secondary_subdomain_pair, on_displaced);
8444 TIME_SECTION(
"possiblyRebuildGeomSearchPatches", 5,
"Rebuilding Geometric Search Patches");
8478 libmesh_fallthrough();
8484 _console <<
"\n\nUpdating geometric search patches\n" << std::endl;
8500 #ifdef LIBMESH_ENABLE_AMR 8509 mooseError(
"HFEM does not support mesh adaptivity currently.");
8511 TIME_SECTION(
"initialAdaptMesh", 2,
"Performing Initial Adaptivity");
8513 for (
unsigned int i = 0; i < n; i++)
8530 _console <<
"Mesh unchanged, skipping remaining steps..." << std::endl;
8546 TIME_SECTION(
"adaptMesh", 3,
"Adapting Mesh");
8550 bool mesh_changed =
false;
8552 for (
unsigned int i = 0; i < cycles_per_step; ++i)
8555 mooseError(
"HFEM does not support mesh adaptivity currently.");
8561 bool mesh_changed_this_step;
8564 if (mesh_changed_this_step)
8566 mesh_changed =
true;
8579 _console <<
"Mesh unchanged, skipping remaining steps..." << std::endl;
8595 return mesh_changed;
8597 #endif // LIBMESH_ENABLE_AMR 8611 data[tid] = &storage.getMaterialData(tid);
8618 for (
unsigned int i = 0; i <
n_threads; ++i)
8630 TIME_SECTION(
"updateMeshXFEM", 5,
"Updating XFEM");
8632 bool updated =
false;
8635 if (
_xfem->updateHeal())
8640 false,
true,
false);
8646 false,
true,
false);
8649 _console <<
"\nXFEM update complete: Mesh modified" << std::endl;
8652 _console <<
"\nXFEM update complete: Mesh not modified" << std::endl;
8659 const bool contract_mesh,
8660 const bool clean_refinement_flags)
8662 TIME_SECTION(
"meshChanged", 3,
"Handling Mesh Changes");
8680 if (intermediate_change)
8688 if (clean_refinement_flags)
8696 if (!intermediate_change)
8746 for (
auto & nl_sys :
_nl)
8747 nl_sys->reinitMortarFunctors();
8764 Threads::parallel_reduce(range, pmp);
8772 for (
const auto & elem : range)
8785 Threads::parallel_reduce(range, pmp);
8789 for (
const auto & elem : range)
8792 for (
auto && child : coarsened_children)
8828 mdi->meshDisplaced();
8837 Threads::parallel_reduce(elem_range, cmt);
8839 cmt(elem_range,
true);
8841 #ifdef MOOSE_KOKKOS_ENABLED 8850 TIME_SECTION(
"checkProblemIntegrity", 5);
8853 const auto & subdomain_names = getParam<std::vector<SubdomainName>>(
"block");
8855 std::set<SubdomainID> mesh_subdomains(mesh_subdomains_vec.begin(), mesh_subdomains_vec.end());
8861 std::set<SubdomainID>
blocks;
8864 blocks = mesh_subdomains;
8867 blocks = mesh_subdomains;
8875 "\" not found in mesh.");
8887 "\" not found in mesh.");
8891 for (
auto & nl :
_nl)
8892 nl->checkKernelCoverage(
blocks);
8897 #ifdef LIBMESH_ENABLE_AMR 8902 _console <<
"Using EXPERIMENTAL Stateful Material Property projection with Adaptivity!\n" 8907 std::set<SubdomainID> local_mesh_subs(mesh_subdomains);
8916 bool check_material_coverage =
false;
8918 for (
const auto &
id : ids)
8920 local_mesh_subs.erase(
id);
8921 check_material_coverage =
true;
8932 "Subdomain \"" + subdomain_name +
"\" not found in mesh.");
8933 local_mesh_subs.erase(
id);
8938 std::set<SubdomainID>
blocks(local_mesh_subs);
8944 "Subdomain \"" + subdomain_name +
"\" not found in mesh.");
8947 for (
const auto id :
blocks)
8948 local_mesh_subs.erase(
id);
8952 auto && mortar_subdomain_ids =
_mortar_data->getMortarSubdomainIDs();
8953 for (
auto subdomain_id : mortar_subdomain_ids)
8954 local_mesh_subs.erase(subdomain_id);
8957 if (check_material_coverage && !local_mesh_subs.empty())
8959 std::stringstream extra_subdomain_ids;
8961 std::copy(local_mesh_subs.begin(),
8962 local_mesh_subs.end(),
8963 std::ostream_iterator<unsigned int>(extra_subdomain_ids,
" "));
8965 std::vector<SubdomainID> local_mesh_subs_vec(local_mesh_subs.begin(),
8966 local_mesh_subs.end());
8968 mooseError(
"The following blocks from your input mesh do not contain an active material: " +
8969 extra_subdomain_ids.str() +
8971 ")\nWhen ANY mesh block contains a Material object, " 8972 "all blocks must contain a Material object.\n");
8982 for (
const auto & material : materials)
8983 material->checkStatefulSanity();
9003 mooseError(
"Coordinate transformation parameters, listed below, are only to be used in the " 9004 "context of application to application field transfers at this time. The mesh is " 9005 "not modified by these parameters within an application.\n" 9006 "You should likely use a 'TransformGenerator' in the [Mesh] block to achieve the " 9007 "desired mesh modification.\n\n",
9024 bool mesh_has_second_order_elements =
false;
9030 mesh_has_second_order_elements =
true;
9040 if (mesh_has_second_order_elements)
9042 const std::vector<std::string> & displacement_variables =
9045 for (
const auto & var_name : displacement_variables)
9053 mooseError(
"Error: mesh has SECOND order elements, so all displacement variables must be " 9065 std::set<SubdomainID> user_objects_blocks;
9069 std::set<std::string> names;
9071 std::vector<UserObjectBase *> objects;
9074 for (
const auto & obj : objects)
9075 names.insert(obj->name());
9078 std::set<SubdomainID> difference;
9079 std::set_difference(user_objects_blocks.begin(),
9080 user_objects_blocks.end(),
9081 mesh_subdomains.begin(),
9082 mesh_subdomains.end(),
9083 std::inserter(difference, difference.end()));
9085 if (!difference.empty())
9087 std::ostringstream oss;
9088 oss <<
"One or more UserObjects is referencing a nonexistent block:\n";
9089 for (
const auto &
id : difference)
9097 const std::map<
SubdomainID, std::vector<std::shared_ptr<MaterialBase>>> & materials_map)
9099 for (
const auto & it : materials_map)
9102 std::set<std::string> block_depend_props, block_supplied_props;
9104 for (
const auto & mat1 : it.second)
9106 auto & alldeps = mat1->getMatPropDependencies();
9107 for (
auto & dep : alldeps)
9111 for (
const auto & mat2 : it.second)
9113 const std::set<std::string> & supplied_props = mat2->MaterialBase::getSuppliedItems();
9114 block_supplied_props.insert(supplied_props.begin(), supplied_props.end());
9123 std::set<std::string> difference;
9124 std::set_difference(block_depend_props.begin(),
9125 block_depend_props.end(),
9126 block_supplied_props.begin(),
9127 block_supplied_props.end(),
9128 std::inserter(difference, difference.end()));
9130 if (!difference.empty())
9132 std::ostringstream oss;
9133 oss <<
"One or more Material Properties were not supplied on block ";
9135 if (subdomain_name.length() > 0)
9136 oss << subdomain_name <<
" (" << it.first <<
")";
9140 for (
const auto &
name : difference)
9141 oss <<
name <<
"\n";
9147 for (
const auto & it : materials_map)
9149 const auto & materials = it.second;
9150 std::set<std::string> inner_supplied, outer_supplied;
9152 for (
const auto & outer_mat : materials)
9155 outer_supplied = outer_mat->getSuppliedItems();
9156 inner_supplied.clear();
9159 std::map<std::string, std::set<std::string>> prop_to_mat;
9160 for (
const auto &
name : outer_supplied)
9161 prop_to_mat[
name].insert(outer_mat->name());
9163 for (
const auto & inner_mat : materials)
9165 if (outer_mat == inner_mat)
9169 auto outer_mat_type = outer_mat->type();
9170 auto inner_mat_type = inner_mat->type();
9175 if (outer_mat_type == inner_mat_type && outer_mat_type != outer_mat->type() &&
9176 inner_mat_type != inner_mat->type())
9179 inner_supplied.insert(inner_mat->getSuppliedItems().begin(),
9180 inner_mat->getSuppliedItems().end());
9182 for (
const auto & inner_supplied_name : inner_supplied)
9183 prop_to_mat[inner_supplied_name].insert(inner_mat->name());
9187 std::set<std::string> intersection;
9188 std::set_intersection(outer_supplied.begin(),
9189 outer_supplied.end(),
9190 inner_supplied.begin(),
9191 inner_supplied.end(),
9192 std::inserter(intersection, intersection.end()));
9194 if (!intersection.empty())
9196 std::ostringstream oss;
9197 oss <<
"The following material properties are declared on block " << it.first
9198 <<
" by multiple materials:\n";
9200 <<
"Material Objects\n";
9201 for (
const auto & outer_name : intersection)
9204 for (
const auto & inner_name : prop_to_mat[outer_name])
9205 oss << inner_name <<
" ";
9227 mooseInfo(
"Restart file ", file_name,
" is NOT being used since we are performing recovery.");
9233 mooseInfo(
"Using ", file_name,
" for restart.");
9237 std::vector<VariableName>
9240 std::vector<VariableName> names;
9244 const std::vector<VariableName> & var_names = sys->getVariableNames();
9245 names.insert(names.end(), var_names.begin(), var_names.end());
9248 const std::vector<VariableName> & aux_var_names =
_aux->getVariableNames();
9249 names.insert(names.end(), aux_var_names.begin(), aux_var_names.end());
9258 "Solver system number '" << solver_sys_num <<
"' is out of bounds. We have '" 9275 auto random_data_ptr = insert_pair.first->second.get();
9285 bnd_mat_side_cache =
false;
9288 if (
_aux->needMaterialOnSide(bnd_id))
9290 bnd_mat_side_cache =
true;
9293 for (
auto & nl :
_nl)
9294 if (nl->needBoundaryMaterialOnSide(bnd_id, tid))
9296 bnd_mat_side_cache =
true;
9310 bnd_mat_side_cache =
true;
9324 interface_mat_side_cache =
false;
9327 for (
auto & nl :
_nl)
9328 if (nl->needInterfaceMaterialOnSide(bnd_id, tid))
9330 interface_mat_side_cache =
true;
9343 interface_mat_side_cache =
true;
9348 interface_mat_side_cache =
true;
9362 for (
auto & nl :
_nl)
9363 if (nl->needInternalNeighborSideMaterial(subdomain_id, tid))
9396 mooseError(
"Previous nonlinear solution is required but not added through " 9397 "Problem/previous_nl_solution_required=true");
9402 const unsigned int solver_sys_num)
9409 const unsigned int solver_sys_num)
const 9440 const std::string & object_name,
9443 parallel_object_only();
9450 mooseError(
"The name '", object_name,
"' is a reserved name for output objects");
9454 if (output_warehouse.
hasOutput(object_name))
9455 mooseError(
"An output object named '", object_name,
"' already exists");
9461 if (object_type ==
"Console" &&
_app.
getParam<
bool>(
"show_input") &&
9472 if (object_type ==
"XDR")
9474 else if (object_type ==
"XDA")
9478 if (object_name ==
"auto_recovery_checkpoint")
9510 else if (sys_name ==
"aux0")
9513 mooseError(
"System '" + sys_name +
"' was requested from problem but does not exist.");
9528 mooseAssert(sys_num <
_nl.size(),
"System number greater than the number of nonlinear systems");
9529 return *
_nl[sys_num];
9535 mooseAssert(sys_num <
_nl.size(),
"System number greater than the number of nonlinear systems");
9536 return *
_nl[sys_num];
9543 "System number greater than the number of linear systems");
9551 "System number greater than the number of linear systems");
9559 "System number greater than the number of solver systems");
9567 "System number greater than the number of solver systems");
9586 parallel_object_only();
9630 const std::vector<Point> *
const pts,
9631 const std::vector<Real> *
const weights,
9643 unsigned int neighbor_side,
9645 const std::vector<Point> *
const pts,
9646 const std::vector<Real> *
const weights,
9659 std::vector<std::shared_ptr<MaterialBase>> & face_materials,
9660 std::vector<std::shared_ptr<MaterialBase>> & neighbor_materials,
9661 std::set<MooseVariableFieldBase *> & variables,
9666 auto & this_face_mats =
9668 for (std::shared_ptr<MaterialBase> face_mat : this_face_mats)
9669 if (face_mat->ghostable())
9671 face_materials.push_back(face_mat);
9672 auto & var_deps = face_mat->getMooseVariableDependencies();
9673 for (
auto * var : var_deps)
9677 "Ghostable materials should only have finite volume variables coupled into them.");
9678 else if (face_mat->hasStatefulProperties())
9679 mooseError(
"Finite volume materials do not currently support stateful properties.");
9680 variables.insert(var);
9687 auto & this_neighbor_mats =
9689 for (std::shared_ptr<MaterialBase> neighbor_mat : this_neighbor_mats)
9690 if (neighbor_mat->ghostable())
9692 neighbor_materials.push_back(neighbor_mat);
9694 auto & var_deps = neighbor_mat->getMooseVariableDependencies();
9695 for (
auto * var : var_deps)
9699 "Ghostable materials should only have finite volume variables coupled into them.");
9700 else if (neighbor_mat->hasStatefulProperties())
9701 mooseError(
"Finite volume materials do not currently support stateful properties.");
9702 auto pr = variables.insert(var);
9703 mooseAssert(!pr.second,
9704 "We should not have inserted any new variables dependencies from our " 9705 "neighbor materials that didn't exist for our face materials");
9714 const unsigned int nqp,
9725 "There must be one convergence object per nonlinear system");
9741 const std::vector<ConvergenceName> &
9746 mooseError(
"The nonlinear system convergence name(s) have not been set.");
9761 paramError(
"linear_convergence",
"There must be one convergence object per linear system");
9765 const std::vector<ConvergenceName> &
9770 mooseError(
"The linear convergence name(s) have not been set.");
9773 const ConvergenceName &
9779 mooseError(
"The fixed point convergence name has not been set.");
9782 const ConvergenceName &
9788 mooseError(
"The steady convergence name has not been set.");
9799 _nl[i]->residualSetup();
9813 _nl[i]->jacobianSetup();
9833 return current_nl_sys_num;
9844 return current_linear_sys_num;
9861 std::vector<MortarUserObject *>
9864 const bool displaced,
9865 const std::vector<MortarUserObject *> & mortar_uo_superset)
9867 std::vector<MortarUserObject *> mortar_uos;
9869 : static_cast<SubProblem *>(
this);
9870 for (
auto *
const obj : mortar_uo_superset)
9871 if (obj->onInterface(primary_boundary_id, secondary_boundary_id) &&
9872 (&obj->getSubProblem() == subproblem))
9873 mortar_uos.push_back(obj);
9878 std::vector<MortarUserObject *>
9881 const bool displaced)
9883 std::vector<MortarUserObject *> mortar_uos;
9887 .queryInto(mortar_uos);
9888 return getMortarUserObjects(primary_boundary_id, secondary_boundary_id, displaced, mortar_uos);
9894 const bool displaced)
9896 const auto mortar_uos =
9898 for (
auto *
const mortar_uo : mortar_uos)
9900 mortar_uo->setNormals();
9901 mortar_uo->reinit();
9933 mooseAssert(nl_sys_num <
_nl.size(),
9934 "System number greater than the number of nonlinear systems");
9943 "System number greater than the number of linear systems");
9956 solver_sys->compute(
type);
10038 return solver_params;
10053 const std::unordered_map<std::pair<BoundaryID, BoundaryID>,
10054 std::unique_ptr<AutomaticMortarGeneration>> &
10057 return _mortar_data->getMortarInterfaces(on_displaced);
bool _reinit_displaced_elem
Whether to call DisplacedProblem::reinitElem when this->reinitElem is called.
This class determines the maximum number of Quadrature Points and Shape Functions used for a given si...
virtual void addInterfaceMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters)
std::map< NonlinearSystemName, unsigned int > _nl_sys_name_to_num
Map from nonlinear system name to number.
void setCurrentAlgebraicElementRange(libMesh::ConstElemRange *range)
These functions allow setting custom ranges for the algebraic elements, nodes, and boundary nodes tha...
std::string indent(unsigned int spaces)
Create empty string for indenting.
std::vector< Point > _point_zero
Interface for objects that need parallel consistent random numbers without patterns over the course o...
void updateVariableDependency(std::set< MooseVariableFieldBase *> &needed_moose_vars, THREAD_ID tid=0) const
Update variable dependency vector.
virtual void addCachedResidual(const THREAD_ID tid)
virtual void computeJacobianTag(const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian, TagID tag)
Form a Jacobian matrix for a given tag.
void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.
unsigned short getCurrentICState()
Retrieves the current initial condition state.
virtual void addFVInitialCondition(const std::string &ic_name, const std::string &name, InputParameters ¶meters)
Add an initial condition for a finite volume variables.
bool adaptMesh(std::string marker_name=std::string())
Adapts the mesh based on the error estimator used.
void sort(THREAD_ID tid=0)
Sort the objects using the DependencyResolver.
virtual void addMaterialHelper(std::vector< MaterialWarehouse *> warehouse, const std::string &material_name, const std::string &name, InputParameters ¶meters)
bool initialAdaptMesh()
Used during initial adaptivity.
virtual void residualSetup(THREAD_ID tid=0) const
virtual bool hasVariable(const std::string &var_name) const override
Whether or not this problem has the variable.
virtual void stopSolve(const ExecFlagType &exec_flag, const std::set< TagID > &vector_tags_to_close) override
Quit the current solve as soon as possible.
bool hasInvalidSolutionError() const
Whether or not an invalid solution was encountered that was an error.
void mooseInfo(Args &&... args) const
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 bool _regard_general_exceptions_as_errors
If we catch an exception during residual/Jacobian evaluaton for which we don't have specific handling...
const std::size_t _num_nl_sys
The number of nonlinear systems.
void setVariableAllDoFMap(const std::vector< const MooseVariableFEBase *> &moose_vars)
void computeJacobianBlocks(std::vector< JacobianBlock *> &blocks)
Computes several Jacobian blocks simultaneously, summing their contributions into smaller preconditio...
virtual void initPetscOutputAndSomeSolverSettings()
Reinitialize PETSc output for proper linear/nonlinear iteration display.
const std::vector< ConvergenceName > & getNonlinearConvergenceNames() const
Gets the nonlinear system convergence object name(s).
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)
void timestepSetup() override
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.
bool _skip_exception_check
If or not skip 'exception and stop solve'.
const std::vector< std::string > & get_global_var_names()
bool isFiniteVolumeInfoDirty() const
Helper class for holding the preconditioning blocks to fill.
virtual void restore_original_nonzero_pattern()
bool _reinit_displaced_neighbor
Whether to call DisplacedProblem::reinitNeighbor when this->reinitNeighbor is called.
virtual void clearActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid)
void outputStep(ExecFlagType type)
Calls the outputStep method for each output object.
virtual void meshChanged()
Deprecated.
virtual void addDamper(const std::string &damper_name, const std::string &name, InputParameters ¶meters)
std::map< LinearSystemName, unsigned int > _linear_sys_name_to_num
Map from linear system name to number.
virtual void clearActiveFEVariableCoupleableVectorTags(const THREAD_ID tid)
libMesh::ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
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.
std::vector< MooseArray< ADRealTensorValue > > _ad_second_zero
bool _have_ad_objects
AD flag indicating whether any AD objects have been added.
void shift()
Shift the material properties in time.
virtual void prepareFace(const Elem *elem, const THREAD_ID tid) override
Base class for function objects.
void setPreserveMatrixSparsityPattern(bool preserve)
Set whether the sparsity pattern of the matrices being formed during the solve (usually the Jacobian)...
void reinitBecauseOfGhostingOrNewGeomObjects(bool mortar_changed=false)
Call when it is possible that the needs for ghosted elements has changed.
void fill_data(std::map< processor_id_type, std::vector< std::set< unsigned int >>> &data, int M)
virtual void addTransfer(const std::string &transfer_name, const std::string &name, InputParameters ¶meters)
Add a Transfer to the problem.
KOKKOS_INLINE_FUNCTION const T * find(const T &target, const T *const begin, const T *const end)
Find a value in an array.
virtual libMesh::System & getSystem(const std::string &var_name) override
Returns the equation system containing the variable provided.
virtual void setActiveScalarVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid)
static const std::string app_param
The name of the parameter that contains the MooseApp.
A MultiMooseEnum object to hold "execute_on" flags.
static SolverParams makeLinearSolverParams()
Make basic solver params for linear solves.
bool _parallel_barrier_messaging
Whether or not information about how many transfers have completed is printed.
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 addResidualLower(const THREAD_ID tid) override
A class for creating restricted objects.
bool isUltimateMaster() const
Whether or not this app is the ultimate master app.
virtual void addJacobianLowerD(const THREAD_ID tid) override
Factory & _factory
The Factory for building objects.
virtual void clearActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid) override
MaterialPropertyStorage & _bnd_material_props
virtual void addGhostedElem(dof_id_type elem_id) override
Will make sure that all dofs connected to elem_id are ghosted to this processor.
void setNonlocalCouplingMatrix()
Set custom coupling matrix for variables requiring nonlocal contribution.
Threads::spin_mutex get_function_mutex
void initialSetup()
Calls the initialSetup function for each of the output objects.
virtual Real & time() const
virtual const char * what() const
Get out the error message.
std::vector< std::pair< MooseVariableFEBase *, MooseVariableFEBase * > > & couplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num)
const Variable & variable(unsigned int var) const
void checkDependMaterialsHelper(const std::map< SubdomainID, std::vector< std::shared_ptr< MaterialBase >>> &materials_map)
Helper method for checking Material object dependency.
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.
virtual void cacheResidualNeighbor(const THREAD_ID tid) override
ExecFlagType _current_execute_on_flag
Current execute_on flag.
const std::set< SubdomainID > & interiorLowerDBlocks() const
void clearCurrentResidualVectorTags()
Clear the current residual vector tag data structure.
bool hasActiveBlockObjects(THREAD_ID tid=0) const
QueryCache is a convenient way to construct and pass around (possible partially constructed) warehous...
std::shared_ptr< DisplacedProblem > displaced_problem
const unsigned int invalid_uint
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)
RelationshipManagerType
Main types of Relationship Managers.
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
unsigned int get_node_index(const Node *node_ptr) const
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...
virtual void meshDisplaced()
Update data after a mesh displaced.
const std::set< BoundaryID > & getSubdomainBoundaryIds(const SubdomainID subdomain_id) const
Get the list of boundary ids associated with the given subdomain id.
std::optional< ConvergenceName > _multiapp_fixed_point_convergence_name
MultiApp fixed point convergence name.
const std::string & name() const
MooseAppCoordTransform & coordTransform()
virtual void setActiveFEVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid) override
void setCurrentAlgebraicNodeRange(libMesh::ConstNodeRange *range)
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.
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::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
Real computeDamping(const NumericVector< Number > &solution, const NumericVector< Number > &update)
Compute damping.
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
virtual void reinitNode(const Node *node, const THREAD_ID tid) override
virtual std::size_t numNonlinearSystems() const override
Base class for implementing interface user objects.
virtual void setPreviousNewtonSolution(const NumericVector< Number > &soln)
virtual void predictorCleanup(NumericVector< libMesh::Number > &ghosted_solution)
Perform cleanup tasks after application of predictor to solution vector.
virtual void prepare(const Elem *elem, const THREAD_ID tid) override
TagID rightHandSideVectorTag() const
virtual Elem * elemPtr(const dof_id_type i)
TagID systemMatrixTag() const override
Return the Matrix Tag ID for System.
NumericVector< Number > & solution()
bool hasObjects(THREAD_ID tid=0) const
Convenience functions for determining if objects exist.
bool _has_jacobian
Indicates if the Jacobian was computed.
virtual bool haveFV() const override
returns true if this problem includes/needs finite volume functionality.
Interface for objects acting when the mesh has been displaced.
static void uniformRefine(MooseMesh *mesh, unsigned int level=libMesh::invalid_uint)
Performs uniform refinement of the passed Mesh object.
bool _has_dampers
Whether or not this system has any Dampers associated with it.
MooseObjectWarehouse< InternalSideIndicatorBase > _internal_side_indicators
void shift()
Shift current, old, and older material property data storages.
std::vector< SubdomainName > _kernel_coverage_blocks
const std::map< dof_id_type, std::vector< dof_id_type > > & nodeToActiveSemilocalElemMap()
If not already created, creates a map from every node to all active semilocal elements to which they ...
virtual Distribution & getDistribution(const std::string &name)
void swapBack(const Elem &elem, unsigned int side=0)
material properties for given element (and possible side)
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...
bool _has_nonlocal_coupling
Indicates if nonlocal coupling is required/exists.
void setCurrentAlgebraicBndNodeRange(ConstBndNodeRange *range)
This is the base class for Samplers as used within the Stochastic Tools module.
Base class for predictors.
bool areCoupled(const unsigned int ivar, const unsigned int jvar, const unsigned int nl_sys_num) const
Moose::LineSearchType _line_search
const T & get() const
Get the restartable value.
void setPostprocessorValueByName(const PostprocessorName &name, const PostprocessorValue &value, std::size_t t_index=0)
Set the value of a PostprocessorValue.
virtual void jacobianSetup(THREAD_ID tid=0) const override
virtual void clearActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid) override
virtual void postExecute()
Method called at the end of the simulation.
void reinit(bool reinit_for_derivative_reordering=false)
Fill out the VariableValue arrays from the system solution vector.
unsigned int number() const
Get variable number coming from libMesh.
void eraseProperty(const Elem *elem)
Remove the property storage and element pointer from internal data structures Use this when elements ...
bool isSolverSystemNonlinear(const unsigned int sys_num)
Check if the solver system is nonlinear.
void petscSetDefaults(FEProblemBase &problem)
Sets the default options for PETSc.
std::unordered_set< TagID > _not_zeroed_tagged_vectors
the list of vector tags that will not be zeroed when all other tags are
void joinAndFinalize(TheWarehouse::Query query, bool isgen=false)
bool hasInitialBackup() const
std::vector< MooseArray< ADRealVectorValue > > _ad_grad_zero
std::vector< SolverParams > _solver_params
InputParameterWarehouse & getInputParameterWarehouse()
Get the InputParameterWarehouse for MooseObjects.
ExecuteMooseObjectWarehouse< Control > _control_warehouse
The control logic warehouse.
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...
void updateActive(THREAD_ID tid=0) override
Updates the active objects storage.
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.
std::unique_ptr< libMesh::ConstNodeRange > _current_algebraic_node_range
virtual void setActiveScalarVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid) override
void setCoupling(Moose::CouplingType type)
Set the coupling between variables TODO: allow user-defined coupling.
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 ExecFlagType & getCurrentExecuteOnFlag() const
Return/set the current execution flag.
unsigned int _cycles_completed
bool _currently_computing_jacobian
Flag to determine whether the problem is currently computing Jacobian.
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
const ExecFlagEnum & getExecuteOnEnum() const
Return the app level ExecFlagEnum, this contains all the available flags for the app.
virtual void init() override
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...
void translateMetaPhysicLError(const MetaPhysicL::LogicError &)
emit a relatively clear error message when we catch a MetaPhysicL logic error
virtual void getDiracElements(std::set< const Elem *> &elems) override
Fills "elems" with the elements that should be looped over for Dirac Kernels.
virtual void setActiveElementalMooseVariables(const std::set< MooseVariableFieldBase *> &moose_vars, const THREAD_ID tid)
Set the MOOSE variables to be reinited on each element.
void parentOutputPositionChanged()
Calls parentOutputPositionChanged() on all sub apps.
void setupDM()
Setup the PETSc DM object (when appropriate)
virtual void setCurrentBoundaryID(BoundaryID bid, const THREAD_ID tid)
sets the current boundary ID in assembly
virtual void addInterfaceKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
virtual void neighborSubdomainSetup(THREAD_ID tid=0) const
libMesh::LinearImplicitSystem & linearImplicitSystem()
Return a reference to the stored linear implicit system.
bool _is_petsc_options_inserted
If or not PETSc options have been added to database.
void setCurrentlyComputingResidual(bool currently_computing_residual) final
Set whether or not the problem is in the process of computing the residual.
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters)
virtual void lineSearch()
execute MOOSE line search
const std::vector< T > & getSortedValues()
This function also returns dependency resolved values but with a simpler single vector interface...
unsigned int getCyclesPerStep() const
Pull out the number of cycles_per_step previously set through the AdaptivityAction.
virtual void setCurrentLowerDElem(const Elem *const lower_d_elem, const THREAD_ID tid)
Set the current lower dimensional element.
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...
NonlocalIntegratedBC is used for solving integral terms in integro-differential equations.
virtual bool checkNonlocalCouplingRequirement() const override
virtual bool uDotDotRequested()
Get boolean flag to check whether solution second time derivative needs to be stored.
bool _has_kokkos_objects
Whether we have any Kokkos objects.
void updateErrorVectors()
Update the ErrorVectors that have been requested through calls to getErrorVector().
const InputParameters & parameters() const
Get the parameters of the object.
unsigned short _current_ic_state
virtual void reinitNeighborPhys(const Elem *neighbor, unsigned int neighbor_side, const std::vector< Point > &physical_points, const THREAD_ID tid) override
virtual TagID addVectorTag(const TagName &tag_name, const Moose::VectorTagType type=Moose::VECTOR_TAG_RESIDUAL)
Create a Tag.
std::vector< MeshDisplacedInterface * > _notify_when_mesh_displaces
Objects to be notified when the mesh displaces.
std::vector< T * > & queryInto(std::vector< T *> &results, Args &&... args)
queryInto executes the query and stores the results in the given vector.
void trustUserCouplingMatrix()
Whether to trust the user coupling matrix even if we want to do things like be paranoid and create a ...
virtual void newAssemblyArray(std::vector< std::shared_ptr< SolverSystem >> &solver_systems)
const bool _uo_aux_state_check
Whether or not checking the state of uo/aux evaluation.
virtual const std::set< MooseVariableFieldBase * > & getActiveElementalMooseVariables(const THREAD_ID tid) const
Get the MOOSE variables to be reinited on each element.
This is a template class that implements the workhorse compute and computeNodal methods.
virtual void timestepSetup(THREAD_ID tid=0) const override
virtual void addMeshDivision(const std::string &type, const std::string &name, InputParameters ¶ms)
Add a MeshDivision.
const ExecFlagType EXEC_NONE
A struct for storing the various types of petsc options and values.
virtual void computeMarkers()
void reportMooseObjectDependency(MooseObject *a, MooseObject *b)
Register a MOOSE object dependency so we can either order operations properly or report when we canno...
void residualSetup() override
MaterialDataType
MaterialData types.
TagID nonTimeVectorTag() const override
A class for "pretty printing" a table of data.
virtual void addCachedJacobian(const THREAD_ID tid)
void cacheChangedLists()
Cache information about what elements were refined and coarsened in the previous step.
virtual void residualSetup()
Positions objects are under the hood Reporters.
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...
virtual TagID systemMatrixTag() const override
Return the Matrix Tag ID for System.
virtual void associateVectorToTag(NumericVector< Number > &vec, TagID tag)
Associate a vector for a given tag.
virtual void reinitNodes(const std::vector< dof_id_type > &nodes, const THREAD_ID tid) override
virtual void updateActiveObjects()
Update the active objects in the warehouses.
Stores the stateful material properties computed by materials.
const RestartableEquationSystems & getRestartableEquationSystems() const
Get the RestartableEquationSystems object.
virtual void computeIndicatorsAndMarkers()
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 addJacobianOffDiagScalar(unsigned int ivar, const THREAD_ID tid=0)
virtual void setException(const std::string &message)
Set an exception, which is stored at this point by toggling a member variable in this class...
virtual void addJacobian(const THREAD_ID tid) override
void addFunctor(const std::string &name, const Moose::FunctorBase< T > &functor, const THREAD_ID tid)
add a functor to the problem functor container
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
std::filesystem::path restartFolderBase(const std::filesystem::path &folder_base) const
The file suffix for restartable data.
const std::string & getBoundaryName(const BoundaryID boundary_id) const
Return the name of the boundary given the id.
virtual void addAuxScalarKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
virtual void customSetup(const ExecFlagType &exec_type, THREAD_ID tid=0) const
bool isReservedName(const std::string &name)
Test if the given name is reserved.
bool globalADIndexing()
Whether we are using global AD indexing.
bool hasOutput(const std::string &name) const
Returns true if the output object exists.
Interface for interpolation methods that provide matrix and RHS contributions for advected face value...
Base class for MOOSE-based applications.
void disable_refine_in_reinit()
PetscOptions _petsc_option_data_base
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 const std::vector< VectorTag > & currentResidualVectorTags() const override
Return the residual vector tags we are currently computing.
processor_id_type rank() const
std::vector< SubdomainName > _material_coverage_blocks
bool computingScalingJacobian() const
Whether we are computing an initial Jacobian for automatic variable scaling.
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
NumericVector< Number > * rhs
void setSteadyStateConvergenceName(const ConvergenceName &convergence_name)
Sets the steady-state detection convergence object name if there is one.
virtual void addAuxScalarVariable(const std::string &var_name, libMesh::Order order, Real scale_factor=1., const std::set< SubdomainID > *const active_subdomains=NULL)
virtual const SystemBase & systemBaseLinear(unsigned int sys_num) const override
Get a constant base class reference to a linear system.
const Parallel::Communicator & comm() const
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 bool hasScalarVariable(const std::string &var_name) const override
Returns a Boolean indicating whether any system contains a variable with the name provided...
void setSolution(const NumericVector< Number > &soln)
Set the solution to a given vector.
MultiApp Implementation for Transient Apps.
Solving a linear problem.
void resizeMaterialData(Moose::MaterialDataType data_type, unsigned int nqp, const THREAD_ID tid)
Resize material data.
void finishMultiAppStep(ExecFlagType type, bool recurse_through_multiapp_levels=false)
Finish the MultiApp time step (endStep, postStep) associated with the ExecFlagType.
virtual void addFunctorMaterial(const std::string &functor_material_name, const std::string &name, InputParameters ¶meters)
Registered base class for linear FV interpolation objects.
std::vector< VariableSecond > _second_zero
void clean_refinement_flags()
std::map< SolverVariableName, unsigned int > _solver_var_to_sys_num
Map connecting variable names with their respective solver systems.
virtual std::unique_ptr< NumericVector< T > > clone() const=0
std::vector< MooseArray< ADReal > > _ad_zero
void customSetup(const ExecFlagType &exec_type)
Calls the setup function for each of the output objects.
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
bool _requires_nonlocal_coupling
nonlocal coupling requirement flag
virtual void onTimestepEnd() override
virtual void computeNearNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > *> &sp)
virtual void addNodalKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
std::vector< std::shared_ptr< SolverSystem > > _solver_systems
Combined container to base pointer of every solver system.
All Distributions should inherit from this class.
void setCurrentDirection(const int direction)
Set this Transfer to be executed in a given direction.
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
These are reworked from https://stackoverflow.com/a/11003103.
ConstElemPointerRange * refinedElementRange() const
Return a range that is suitable for threaded execution over elements that were just refined...
MaterialWarehouse _kokkos_materials
bool hasKokkosUserObject(const std::string &name) const
Check if there if a Kokkos user object of given name.
std::vector< VectorVariableCurl > _vector_curl_zero
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.
Base class for user objects executed one or more sidesets, which may be on the outer boundary of the ...
bool _has_exception
Whether or not an exception has occurred.
unsigned int _num_grid_steps
Number of steps in a grid sequence.
virtual void associateMatrixToTag(libMesh::SparseMatrix< Number > &matrix, TagID tag)
Associate a matrix to a tag.
bool haveXFEM()
Find out whether the current analysis is using XFEM.
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)
void registerRandomInterface(RandomInterface &random_interface, const std::string &name)
bool _has_time_integrator
Indicates whether or not this executioner has a time integrator (during setup)
void computeUserObjectsInternal(const ExecFlagType &type, TheWarehouse::Query &query)
This class provides an interface for common operations on field variables of both FE and FV types wit...
const Parallel::Communicator & _communicator
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
MaterialPropertyRegistry _material_prop_registry
virtual void jacobianSetup()
void clearActiveMaterialProperties(const THREAD_ID tid)
Clear the active material properties.
virtual unsigned int nLinearIterations(const unsigned int nl_sys_num) const override
bool has_static_condensation() const
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.
ExecuteMooseObjectWarehouse< TransientMultiApp > _transient_multi_apps
Storage for TransientMultiApps (only needed for calling 'computeDT')
bool hasUserObject(const std::string &name) const
Check if there if a user object of given name.
MaterialWarehouse _interface_materials
Real getStartTime() const
Thread to compute threaded general user objects.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
bool _ignore_zeros_in_jacobian
Whether to ignore zeros in the Jacobian, thereby leading to a reduced sparsity pattern.
const libMesh::ConstElemRange & getCurrentAlgebraicElementRange()
These are the element and nodes that contribute to the jacobian and residual for this local processor...
void setup(const ExecFlagType &exec_flag, THREAD_ID tid=0) const
void setCurrentExecuteOnFlag(const ExecFlagType &)
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.
void copyValuesBack()
Copies current chain control data values into old values.
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...
const libMesh::ConstNodeRange & getCurrentAlgebraicNodeRange()
void setCurrentlyComputingResidualAndJacobian(bool currently_computing_residual_and_jacobian)
Set whether or not the problem is in the process of computing the Jacobian.
ExecuteMooseObjectWarehouse< Transfer > _from_multi_app_transfers
Transfers executed just after MultiApps to transfer data from them.
virtual void addKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
libMesh::TensorValue< ADReal > ADRealTensorValue
Base class for a system (of equations)
const ExecFlagType EXEC_ALWAYS
SparseMatrix< Number > & getSystemMatrix()
Fetching the system matrix from the libmesh system.
This user object allows related evaluations on elements, boundaries, internal sides, interfaces in one single place.
virtual void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
Canonical method for adding an auxiliary variable.
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 T_sys & get_system(std::string_view name) const
std::optional< ConvergenceName > _steady_state_convergence_name
Steady-state detection convergence name.
Base class for MeshDivision objects.
std::vector< bool > _previous_multiapp_fp_nl_solution_required
Indicates we need to save the previous multiapp fixed-point iteration solver variable values...
MooseObjectWarehouse< Moose::FunctionBase > _kokkos_functions
bool computingNonlinearResid() const
Returns true if the problem is in the process of computing the nonlinear residual.
virtual void addFVInterfaceKernel(const std::string &fv_ik_name, const std::string &name, InputParameters ¶meters)
MeshDivision & getMeshDivision(const std::string &name, const THREAD_ID tid=0) const
Get a MeshDivision.
bool isRestarting() const
Whether or not this is a "restart" calculation.
Base class for creating new nodally-based mortar user objects.
Reporter objects allow for the declaration of arbitrary data types that are aggregate values for a si...
libMesh::ConstNodeRange * getLocalNodeRange()
const Positions & getPositionsObject(const std::string &name) const
Get the Positions object by its name.
std::map< SolverSystemName, unsigned int > _solver_sys_name_to_num
Map connecting solver system names with their respective systems.
FEProblemBase(const InputParameters ¶meters)
void addEdge(const T &a, const T &b)
Add an edge between nodes 'a' and 'b'.
std::string convertLatestCheckpoint(std::string orig)
bool isOn()
Is adaptivity on?
void computeResidualTags(const std::set< TagID > &tags)
Form multiple tag-associated residual vectors for all the given tags.
virtual void cacheJacobianNeighbor(const THREAD_ID tid) override
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual void clearActiveElementalMooseVariables(const THREAD_ID tid)
Clear the active elemental MooseVariableFieldBase.
std::vector< std::unordered_map< BoundaryID, bool > > _bnd_mat_side_cache
Cache for calculating materials on side.
bool hasLinearConvergenceObjects() const
Whether we have linear convergence objects.
virtual const Node & nodeRef(const dof_id_type i) const
std::set< dof_id_type > _ghosted_elems
Elements that should have Dofs ghosted to the local processor.
ExecFlagEnum _print_execution_on
When to print the execution of loops.
bool needsPreviousMultiAppFixedPointIterationAuxiliary() const
Check to see whether we need to compute the variable values of the previous multiapp fixed point iter...
std::vector< SubdomainID > getSubdomainIDs(const std::vector< SubdomainName > &subdomain_names) const
Get the associated subdomainIDs for the subdomain names that are passed in.
void clearAllDofIndices()
Clear dof indices from variables in nl and aux systems.
virtual void setResidual(NumericVector< libMesh::Number > &residual, const THREAD_ID tid) override
virtual void solve(const unsigned int nl_sys_num)
virtual void setCurrentLowerDElem(const Elem *const lower_d_elem, const THREAD_ID tid) override
Set the current lower dimensional element.
std::set< TagID > _linear_matrix_tags
Temporary storage for filtered matrix tags for linear systems.
void bumpAllQRuleOrder(libMesh::Order order, SubdomainID block)
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Real computeMultiAppsDT(ExecFlagType type)
Find the smallest timestep over all MultiApps.
const std::string & getSubdomainName(SubdomainID subdomain_id) const
Return the name of a block given an id.
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...
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...
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
std::unique_ptr< libMesh::ConstElemRange > _nl_evaluable_local_elem_range
virtual void disassociateMatrixFromTag(libMesh::SparseMatrix< Number > &matrix, TagID tag)
Disassociate a matrix from a tag.
Scope guard for starting and stopping Floating Point Exception Trapping.
virtual void computeResidualTags(const std::set< TagID > &tags)
Form multiple residual vectors and each is associated with one tag.
void forceOutput()
Indicates that the next call to outputStep should be forced This is private, users should utilize FEP...
virtual void computeJacobianSys(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian)
Form a Jacobian matrix.
void skipNextForwardSolutionCopyToOld()
Prevents the copy of the solution vector to the old solution vector in each system.
auto max(const L &left, const R &right)
std::shared_ptr< MultiApp > getMultiApp(const std::string &multi_app_name) const
Get a MultiApp object by name.
virtual void reinitElemNeighborAndLowerD(const Elem *elem, unsigned int side, const THREAD_ID tid) override
bool hasSolverVariable(const std::string &var_name) const
void preparePRefinement()
Prepare DofMap and Assembly classes with our p-refinement information.
AuxGroup
Flag for AuxKernel related execution type.
void removeSubstring(std::string &main, const std::string &sub)
virtual Elem * queryElemPtr(const dof_id_type i)
virtual void addMarker(const std::string &marker_name, const std::string &name, InputParameters ¶meters)
void updateGhostedElems()
Updates the list of ghosted elements at the start of each time step for the nonlinear iteration patch...
unsigned int subspaceDim(const std::string &prefix) const
Dimension of the subspace spanned by vectors with a given prefix.
elem_info_iterator ownedElemInfoBegin()
Iterators to owned faceInfo objects.
void setCurrentlyComputingJacobian(const bool currently_computing_jacobian)
Set whether or not the problem is in the process of computing the Jacobian.
unsigned int variable_number(std::string_view var) const
A ReporterName that represents a VectorPostprocessor.
bool needsPreviousNewtonIteration() const
Check to see whether we need to compute the variable values of the previous Newton iterate...
virtual void addBoundaryCondition(const std::string &bc_name, const std::string &name, InputParameters ¶meters)
bool _computing_nonlinear_residual
Whether the non-linear residual is being evaluated.
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. ...
void update()
Update the system (doing libMesh magic)
This class is a container/interface for the objects involved in automatic generation of mortar spaces...
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) override
void createTagMatrices(CreateTaggedMatrixKey)
const bool _skip_nl_system_check
virtual void resetState()
Reset state of this object in preparation for the next evaluation.
void jacobianSetup()
Calls the jacobianSetup function for each of the output objects.
virtual void addInitialCondition(const std::string &ic_name, const std::string &name, InputParameters ¶meters)
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...
void resetIterationOccurences()
Reset the number of solution invalid occurrences back to zero.
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
const SubdomainID INVALID_BLOCK_ID
ScalarInitialConditionWarehouse _scalar_ics
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. ...
Nonlinear system to be solved.
bool getExodusFileRestart() const
Whether or not we need to use a separate Exodus reader to read the mesh BEFORE we create the mesh...
virtual void swapBackMaterialsFace(const THREAD_ID tid)
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 advanceState()
Advance all of the state holding vectors / datastructures so that we can move to the next timestep...
A user object that runs over all the nodes and does an aggregation step to compute a single value...
ExecuteMooseObjectWarehouse< Transfer > _transfers
Normal Transfers.
void checkUserObjectNameCollision(const std::string &name, const std::string &type) const
Check for name collision between different user objects.
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 customSetup(const ExecFlagType &exec_type)
virtual void checkBoundaryMatProps()
Checks boundary material properties integrity.
std::map< std::string, std::vector< dof_id_type > > _var_dof_map
Based class for output objects.
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 addPredictor(const std::string &type, const std::string &name, InputParameters ¶meters)
virtual Function & getFunction(const std::string &name, const THREAD_ID tid=0)
virtual void computeJacobianBlocks(std::vector< JacobianBlock *> &blocks, const unsigned int nl_sys_num)
Computes several Jacobian blocks simultaneously, summing their contributions into smaller preconditio...
virtual void copySolutionsBackwards()
const ConstBndNodeRange & getCurrentAlgebraicBndNodeRange()
bool _calculate_jacobian_in_uo
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
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...
virtual void setActiveScalarVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid)
virtual void prepareFaceShapes(unsigned int var, const THREAD_ID tid) override
virtual void addPostprocessor(const std::string &pp_name, const std::string &name, InputParameters ¶meters)
virtual Real finalNonlinearResidual(const unsigned int nl_sys_num) const override
void addItem(const T &value)
Add an independent item to the set.
std::vector< std::shared_ptr< NonlinearSystemBase > > _nl
The nonlinear systems.
bool automaticScaling() const
Automatic scaling getter.
virtual void computeUserObjects(const ExecFlagType &type, const Moose::AuxGroup &group)
Call compute methods on UserObjects.
virtual void setActiveElementalMooseVariables(const std::set< MooseVariableFEBase *> &moose_vars, const THREAD_ID tid) override
Set the MOOSE variables to be reinited on each element.
virtual void reinit_systems()
std::map< std::pair< BoundaryID, BoundaryID >, NearestNodeLocator * > _nearest_node_locators
std::vector< VariablePhiGradient > _grad_phi_zero
void mooseWarning(Args &&... args) const
void initialSetup(THREAD_ID tid)
Initial setup.
bool hasJacobian() const
Returns _has_jacobian.
void notifyWhenMeshDisplaces(MeshDisplacedInterface *mdi)
Register an object that derives from MeshDisplacedInterface to be notified when the displaced mesh ge...
void createTagSolutions()
Create extra tagged solution vectors.
std::vector< SolverSystemName > _solver_sys_names
The union of nonlinear and linear system names.
virtual void execute(const ExecFlagType &exec_type)
Convenience function for performing execution of MOOSE systems.
bool _verbose_restore
Whether or not to be verbose on solution restoration post a failed time step.
bool _previous_nl_solution_required
Indicates we need to save the previous NL iteration variable values.
processor_id_type n_processors() const
bool _trust_user_coupling_matrix
Whether to trust the user coupling matrix no matter what.
void setRestartRecoverFileBase(const std::string &file_base)
mutator for recover_base (set by RecoverBaseAction)
unsigned int number() const
const ConvergenceName & getSteadyStateConvergenceName() const
Gets the steady-state detection convergence object name.
void computeResidualAndJacobianTags(const std::set< TagID > &vector_tags, const std::set< TagID > &matrix_tags)
Form possibly multiple tag-associated vectors and matrices.
void handleException(const std::string &calling_method)
Handle exceptions.
virtual std::vector< VariableName > getVariableNames()
Returns a list of all the variables in the problem (both from the NL and Aux systems.
ReporterData _reporter_data
const std::string & name() const
Get the name of the class.
void uniformRefine()
uniformly refine the problem mesh(es).
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.
const ReporterData & getReporterData() const
Provides const access the ReporterData object.
virtual const libMesh::CouplingMatrix & nonlocalCouplingMatrix(const unsigned i) const override
std::unique_ptr< libMesh::ConstElemRange > _current_algebraic_elem_range
FunctorMaterials compute functor material properties.
std::vector< std::shared_ptr< Transfer > > getTransfers(ExecFlagType type, Transfer::DIRECTION direction) const
Get Transfers by ExecFlagType and direction.
virtual void addConvergence(const std::string &type, const std::string &name, InputParameters ¶meters)
Adds a Convergence object.
MultiPointMap & getPoints()
Returns a writeable reference to the _points container.
bool shouldPrintExecution(const THREAD_ID tid) const
Check whether the problem should output execution orders at this time.
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...
const std::set< subdomain_id_type > & active_subdomains() const
bool havePRefinement() const
Query whether p-refinement has been requested at any point during the simulation. ...
virtual Real l2_norm() const=0
bool getRecomputeMarkersFlag() const
Pull out the _recompute_markers_during_cycles flag previously set through the AdaptivityAction.
const bool & _solve
Whether or not to actually solve the nonlinear system.
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.
DenseVector< Real > getAllRealReporterValues() const
Get all real reporter values including postprocessor and vector postprocessor values into a dense vec...
ExecuteMooseObjectWarehouse< Transfer > _to_multi_app_transfers
Transfers executed just before MultiApps to transfer data to them.
std::set< SubdomainID > getActiveBlocks(THREAD_ID tid=0) const
Return a set of active SubdomainsIDs.
NonlinearSystemBase * _current_nl_sys
The current nonlinear system that we are solving.
MooseObjectWarehouse< Convergence > _convergences
convergence warehouse
Interface for notifications that the mesh has changed.
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 std::unique_ptr< Base > create()=0
void setCurrentNonlinearSystem(const unsigned int nl_sys_num)
std::shared_ptr< T > getActiveObject(const std::string &name, 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...
virtual const NumericVector< Number > *const & currentSolution() const override final
The solution vector that is currently being operated on.
void initialSetup()
Initial setup.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
Base class for convergence criteria.
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
bool hasFVInterpolationMethod(const InterpolationMethodName &name) const
Check if an FV interpolation method with a given name exists.
void min(const T &r, T &o, Request &req) const
virtual void reinitElem(const Elem *elem, const THREAD_ID tid) override
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.
virtual Convergence & getConvergence(const std::string &name, const THREAD_ID tid=0) const
Gets a Convergence object.
TheWarehouse & theWarehouse() const
void createTagVectors()
Create extra tagged vectors and matrices.
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)
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
void setMultiAppFixedPointConvergenceName(const ConvergenceName &convergence_name)
Sets the MultiApp fixed point convergence object name if there is one.
void computeKokkosUserObjectsInternal(const ExecFlagType &type, TheWarehouse::Query &query)
Moose::CouplingType _coupling
Type of variable coupling.
Every object that can be built by the factory should be derived from this class.
virtual bool shouldUpdateSolution()
Check to see whether the problem should update the solution.
const FVInterpolationMethod & getFVInterpolationMethod(const InterpolationMethodName &name, const THREAD_ID tid=0) const
Retrieve an FV interpolation method.
virtual void setActiveFEVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid)
void extraSendList(std::vector< dof_id_type > &send_list, void *context)
///< Type of coordinate system
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...
const ConvergenceName & getMultiAppFixedPointConvergenceName() const
Gets the MultiApp fixed point convergence object name.
std::vector< std::string > getAllRealReporterFullNames() const
Get full names of all real reporter values Note: For a postprocessor, the full name is the postproces...
virtual void clearActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid)
Real getTimeFromStateArg(const Moose::StateArg &state) const
Returns the time associated with the requested state.
virtual std::string solverTypeString(unsigned int solver_sys_num=0)
Return solver type as a human readable string.
const ExecFlagType EXEC_TIMESTEP_BEGIN
std::shared_ptr< T > getObject(const std::string &name, THREAD_ID tid=0) const
void executeSamplers(const ExecFlagType &exec_type)
Performs setup and execute calls for Sampler objects.
unsigned int which_neighbor_am_i(const Elem *e) const
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.
bool _safe_access_tagged_vectors
Is it safe to retrieve data from tagged vectors.
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).
const std::unordered_map< std::pair< BoundaryID, BoundaryID >, std::unique_ptr< AutomaticMortarGeneration > > & getMortarInterfaces(bool on_displaced) const
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...
void getUOExecutionGroups(TheWarehouse::Query &query, std::set< int > &execution_groups) const
void addOutput(const std::string &, const std::string &, InputParameters &)
Adds an Output object.
SolutionIterationType iteration_type
The solution iteration type, e.g. time or nonlinear.
boundary_id_type BoundaryID
void boundaryIntegrityCheckError(const MooseObject &object, const std::set< MooseVariableFieldBase *> &variables, const BoundaryName &boundary_name)
Compose boundary restricted error message for the provided object, variables, and boundary_name if th...
const bool _allow_ics_during_restart
bool constJacobian() const
Returns _const_jacobian (whether a MOOSE object has specified that the Jacobian is the same as the pr...
virtual void clearActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) override
void computeJacobianTags(const std::set< TagID > &tags)
Computes multiple (tag associated) Jacobian matricese.
SolutionInvalidity & solutionInvalidity()
Get the SolutionInvalidity for this app.
std::vector< MeshChangedInterface * > _notify_when_mesh_changes
Objects to be notified when the mesh changes.
virtual void timestepSetup(THREAD_ID tid=0) const
void checkNonlocalCoupling()
VarKindType
Framework-wide stuff.
void addDefaultSteadyStateConvergence(const InputParameters ¶ms)
Adds the default steady-state detection Convergence.
NonlinearSystemBase & currentNonlinearSystem()
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
Jacobian-Free Newton Krylov.
void groupUserObjects(TheWarehouse &w, AuxiliarySystem &aux, const ExecFlagEnum &execute_flags, const std::vector< T *> &objs, const std::set< std::string > &ic_deps)
void checkDisplacementOrders()
Verify that SECOND order mesh uses SECOND order displacements.
virtual void addFunction(const std::string &type, const std::string &name, InputParameters ¶meters)
Real PostprocessorValue
various MOOSE typedefs
void uniformly_coarsen(unsigned int n=1)
virtual void addJacobianNeighbor(const THREAD_ID tid) override
virtual TagID addMatrixTag(TagName tag_name)
Create a Tag.
virtual libMesh::EquationSystems & es() override
std::vector< std::unordered_map< SubdomainID, bool > > _block_mat_side_cache
Cache for calculating materials on side.
std::shared_ptr< AuxiliarySystem > _aux
The auxiliary system.
void setRestart(bool value)
Sets the restart/recover flags.
AttribBoundaries tracks all boundary IDs associated with an object.
void setValue(unsigned int i, Number value)
Set the nodal value for this variable (to keep everything up to date.
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 void addVectorPostprocessor(const std::string &pp_name, const std::string &name, InputParameters ¶meters)
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
virtual bool converged(const unsigned int sys_num)
Eventually we want to convert this virtual over to taking a solver system number argument.
virtual unsigned int currentNlSysNum() const override
virtual void computeIndicators()
virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the scalar variable reference from whichever system contains it.
const bool _boundary_restricted_node_integrity_check
whether to perform checking of boundary restricted nodal object variable dependencies, e.g.
virtual void setActiveScalarVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid) override
virtual bool updateMeshXFEM()
Update the mesh due to changing XFEM cuts.
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.
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...
virtual void restoreSolutions()
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.
void markFamilyPRefinement(const InputParameters ¶ms)
Mark a variable family for either disabling or enabling p-refinement with valid parameters of a varia...
virtual const std::vector< dof_id_type > & dofIndices() const
Get local DoF indices.
void addAnyRedistributers()
void mooseDeprecated(Args &&... args) const
const std::string & type() const
Get the type of this class.
bool hasPostprocessorValueByName(const PostprocessorName &name) const
Whether or not a Postprocessor value exists by a given name.
virtual void checkBlockMatProps()
Checks block material properties integrity.
void restoreFromInitialBackup(const bool for_restart)
Restores from a "initial" backup, that is, one set in _initial_backup.
void setAxisymmetricCoordAxis(const MooseEnum &rz_coord_axis)
void initialSetup() override
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
void reinit()
Completely redo all geometric search objects.
std::vector< VectorTag > getVectorTags(const std::set< TagID > &tag_ids) const
bool allowInvalidSolution() const
Whether to accept / allow an invalid solution.
bool needInternalNeighborSideMaterial(SubdomainID subdomain_id, const THREAD_ID tid)
virtual const SystemBase & systemBaseAuxiliary() const override
Return the auxiliary system object as a base class reference.
void setLinearConvergenceNames(const std::vector< ConvergenceName > &convergence_names)
Sets the linear convergence object name(s) if there is one.
void checkUserObjectJacobianRequirement(THREAD_ID tid)
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...
void finalize(const std::string &object_name)
Helper function for performing post calculation actions via the ReporterContext objects.
void addObject(std::shared_ptr< InitialConditionBase > object, THREAD_ID tid, bool recurse=true)
Add object to the warehouse.
virtual bool hasDistribution(const std::string &name) const
virtual void disassociateVectorFromTag(NumericVector< Number > &vec, TagID tag)
Disassociate a given vector from a given tag.
virtual void computeNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > *> &sp)
virtual void addTimeIntegrator(const std::string &type, const std::string &name, InputParameters ¶meters)
LinearSystem * _current_linear_sys
The current linear system that we are solving.
virtual void cacheResidual(const THREAD_ID tid) override
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.
const bool _force_restart
void checkCoordinateSystems()
Performs a sanity check for every element in the mesh.
QueryCache clone() const
clone creates and returns an independent copy of the query in its current state.
void forceOutput()
Indicates that the next call to outputStep should be forced.
const VectorPostprocessor & getVectorPostprocessorObjectByName(const std::string &object_name, const THREAD_ID tid=0) const
Return the VPP object given the name.
std::vector< VariablePhiSecond > _second_phi_zero
StoredRange< std::vector< GeneralUserObject * >::iterator, GeneralUserObject * > GeneralUserObjectRange
bool _started_initial_setup
At or beyond initialSteup stage.
std::map< std::string, std::unique_ptr< RandomData > > _random_data_objects
A map of objects that consume random numbers.
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
std::unique_ptr< ConstBndNodeRange > _current_algebraic_bnd_node_range
virtual void addResidual(const THREAD_ID tid) override
virtual void addResidualNeighbor(const THREAD_ID tid) override
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...
void setCoordSystem(const std::vector< SubdomainName > &blocks, const MultiMooseEnum &coord_sys)
Set the coordinate system for the provided blocks to coord_sys.
Base class for all Postprocessors.
libMesh::ExodusII_IO * getExReaderForRestart() const
Get the Exodus reader to restart variables from an Exodus mesh file.
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...
void clearPoints()
Remove all of the current points and elements.
std::string typeAndName() const
Get the class's combined type and name; useful in error handling.
MooseApp & _app
The MOOSE application this is associated with.
virtual void clearActiveFEVariableCoupleableVectorTags(const THREAD_ID tid) override
void maxloc(T &r, unsigned int &max_id) const
bool isValueSet(const std::string &value) const
Methods for seeing if a value is set in the MultiMooseEnum.
void setCouplingMatrix(std::unique_ptr< libMesh::CouplingMatrix > cm, const unsigned int nl_sys_num)
Set custom coupling matrix.
unsigned int number() const
Gets the number of this system.
virtual void addDefaultNonlinearConvergence(const InputParameters ¶ms)
Adds the default nonlinear Convergence associated with the problem.
virtual void solve() override
Solve the system (using libMesh magic)
void setNonlinearConvergenceNames(const std::vector< ConvergenceName > &convergence_names)
Sets the nonlinear convergence object name(s) if there is one.
unsigned int uniformRefineLevel() const
Returns the level of uniform refinement requested (zero if AMR is disabled).
const ExecFlagType EXEC_LINEAR
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
virtual bool solverSystemConverged(const unsigned int solver_sys_num) override
std::string stringify(const T &t)
conversion to string
std::string _exception_message
The error message to go with an exception.
const std::set< SubdomainID > & boundaryLowerDBlocks() const
std::vector< SubdomainName > getSubdomainNames(const std::vector< SubdomainID > &subdomain_ids) const
Get the associated subdomainNames for the subdomain ids that are passed in.
virtual void checkProblemIntegrity()
Method called to perform a series of sanity checks before a simulation is run.
void setReporterValue(const ReporterName &reporter_name, const T &value, const std::size_t time_index=0)
Method for setting Reporter values that already exist.
Class for storing and utilizing output objects.
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
AuxiliarySystem & getAuxiliarySystem()
virtual void initialSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods.
virtual void updateGeomSearch(GeometricSearchData::GeometricSearchType type=GeometricSearchData::ALL) override
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.
MooseObjectWarehouse< MeshDivision > _mesh_divisions
Warehouse to store mesh divisions NOTE: this could probably be moved to the MooseMesh instead of the ...
virtual void addConstraint(const std::string &c_name, const std::string &name, InputParameters ¶meters)
void buildRefinementAndCoarseningMaps(Assembly *assembly)
Create the refinement and coarsening maps necessary for projection of stateful material properties wh...
MooseObjectWarehouse< Indicator > _indicators
virtual void addMultiApp(const std::string &multi_app_name, const std::string &name, InputParameters ¶meters)
Add a MultiApp to the problem.
virtual void prepareAssembly(const THREAD_ID tid) override
bool haveADObjects() const
Method for reading wehther we have any ad objects.
unsigned int systemNumForVariable(const VariableName &variable_name) const
bool _checking_uo_aux_state
Flag used to indicate whether we are doing the uo/aux state check in execute.
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.
MeshBase::element_iterator activeLocalElementsBegin()
Calls active_local_nodes_begin/end() on the underlying libMesh mesh object.
InitialConditions are objects that set the initial value of variables.
Base class for user objects executed on all element sides internal to one or more blocks...
virtual void clearActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid)
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 initNullSpaceVectors(const InputParameters ¶meters, std::vector< std::shared_ptr< NonlinearSystemBase >> &nl)
virtual bool hasVariable(const std::string &var_name) const
Query a system for a variable.
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
virtual void setCurrentSubdomainID(const Elem *elem, const THREAD_ID tid) override
MaterialData & getMaterialData(Moose::MaterialDataType type, const THREAD_ID tid=0, const MooseObject *object=nullptr) const
void broadcast(T &data, const unsigned int root_id=0, const bool identical_sizes=false) const
virtual void clearDiracInfo() override
Gets called before Dirac Kernels are asked to add the points they are supposed to be evaluated in...
virtual void addIndicator(const std::string &indicator_name, const std::string &name, InputParameters ¶meters)
virtual void reinitNodesNeighbor(const std::vector< dof_id_type > &nodes, const THREAD_ID tid) override
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.
virtual void solve() override=0
Solve the system (using libMesh magic)
GeometricSearchType
Used to select groups of geometric search objects to update.
void backupMultiApps(ExecFlagType type)
Backup the MultiApps associated with the ExecFlagType.
A ReporterName that represents a Postprocessor.
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
Canonical method for adding a non-linear variable.
bool doingPRefinement() const
ExecuteMooseObjectWarehouse< MultiApp > _multi_apps
MultiApp Warehouse.
virtual void jacobianSetup(THREAD_ID tid=0) const
void uniformRefineWithProjection()
Performs uniform refinement on the meshes in the current object.
void updateBlockMatPropDependency(SubdomainID id, std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0, const bool producer_only=false) const
TagID residualVectorTag() const override
std::vector< std::vector< std::unique_ptr< Assembly > > > _assembly
The Assembly objects.
virtual void addDisplacedProblem(std::shared_ptr< DisplacedProblem > displaced_problem)
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const
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 void cacheJacobianNeighbor(const THREAD_ID tid)
void updateBoundaryMatPropDependency(std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0, const bool producer_only=false) const
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.
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 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.
void setCoordSystem(const std::vector< SubdomainName > &blocks, const MultiMooseEnum &coord_sys)
virtual void swapBackMaterialsNeighbor(const THREAD_ID tid)
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
bool hasStatefulProperties() const
void residualSetup()
Calls the residualSetup function for each of the output objects.
virtual void residualSetup(THREAD_ID tid=0) const override
virtual void subdomainSetup(THREAD_ID tid=0) const override
virtual NonlinearSystem & getNonlinearSystem(const unsigned int sys_num)
void solveSetup()
Calls the timestepSetup function for each of the output objects.
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.
MooseAppCoordTransform & coordTransform()
virtual void cacheResidual(const THREAD_ID tid)
virtual void timestepSetup()
libMesh::Order order() const
Get the order of this variable Note: Order enum can be implicitly converted to unsigned int...
const ExecFlagType EXEC_PRE_DISPLACE
virtual const Elem * elem_ptr(const dof_id_type i) const=0
const std::vector< NonlinearSystemName > _nl_sys_names
The nonlinear system names.
const ExecFlagType EXEC_POSTCHECK
PetscErrorCode PetscInt const PetscInt fields[]
const ExecFlagType EXEC_NONLINEAR
const FVAdvectedInterpolationMethod & getFVAdvectedInterpolationMethod(const InterpolationMethodName &name, const THREAD_ID tid=0) const
Retrieve an advected interpolation method.
std::vector< Real > VectorPostprocessorValue
virtual void updateMortarMesh()
void copyValuesBack()
At the end of a timestep this method is called to copy the values back in time in preparation for the...
const std::vector< const Elem * > & coarsenedElementChildren(const Elem *elem) const
Get the newly removed children element ids for an element that was just coarsened.
void restore(const std::filesystem::path &folder_base, const bool for_restart)
Restore an application from file.
TheWarehouse::Query getUOQuery(const std::string &system, const ExecFlagType &type, const Moose::AuxGroup &group) const
void addDefaultMultiAppFixedPointConvergence(const InputParameters ¶ms)
Adds the default fixed point Convergence associated with the problem.
std::set< TagID > _fe_matrix_tags
Moose::Kokkos::MaterialPropertyStorage & _kokkos_material_props
virtual NumericVector< Number > & RHS()=0
virtual void addAuxArrayVariable(const std::string &var_name, const libMesh::FEType &type, unsigned int components, const std::set< SubdomainID > *const active_subdomains=NULL)
const ExecuteMooseObjectWarehouse< Transfer > & getMultiAppTransferWarehouse(Transfer::DIRECTION direction) const
Return the complete warehouse for MultiAppTransfer object for the given direction.
virtual const SystemBase & getSystemBase(const unsigned int sys_num) const
Get constant reference to a system in this problem.
const Elem * neighbor_ptr(unsigned int i) const
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
Provides a way for users to bail out of the current solve.
virtual void addReporter(const std::string &type, const std::string &name, InputParameters ¶meters)
Add a Reporter object to the simulation.
virtual void swapBackMaterials(const THREAD_ID tid)
std::vector< VariablePhiValue > _phi_zero
InitialConditionWarehouse _ics
std::vector< unsigned char > _has_active_material_properties
Whether there are active material properties on each thread.
MaterialWarehouse _discrete_materials
bool _reinit_displaced_face
Whether to call DisplacedProblem::reinitElemFace when this->reinitElemFace is called.
void setSinglePetscOption(const std::string &name, const std::string &value="", FEProblemBase *const problem=nullptr)
A wrapper function for dealing with different versions of PetscOptionsSetValue.
virtual void initialSetup()
NumericVector< Number > & getRightHandSideVector()
Fetching the right hand side vector from the libmesh system.
std::unique_ptr< MortarInterfaceWarehouse > _mortar_data
virtual void addDGKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
virtual void setCurrentBoundaryID(BoundaryID bid, const THREAD_ID tid) override
sets the current boundary ID in assembly
SolverSystem * _current_solver_sys
The current solver system.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::shared_ptr< const DisplacedProblem > getDisplacedProblem() const
virtual bool contract()=0
std::optional< std::vector< ConvergenceName > > _nonlinear_convergence_names
Nonlinear system(s) convergence name(s)
Generic class for solving transient nonlinear problems.
virtual void preProblemInit()
Perform initializations during executing actions right before init_problem task.
void updateActiveSemiLocalNodeRange(std::set< dof_id_type > &ghosted_elems)
Clears the "semi-local" node list and rebuilds it.
subdomain_id_type subdomain_id() const
virtual void stopSolve(const ExecFlagType &exec_flag, const std::set< TagID > &vector_tags_to_close)=0
Quit the current solve as soon as possible.
const Postprocessor & getPostprocessorObjectByName(const PostprocessorName &object_name, const THREAD_ID tid=0) const
Return the Postprocessor object registered under the supplied object name.
const InputParameters * getCommonParameters() const
Get a reference to the common output parameters.
TagID timeVectorTag() const override
Ideally, we should not need this API.
std::map< SubdomainID, std::set< MaterialPropertyName > > _zero_block_material_props
Set of properties returned as zero properties.
Class for containing MooseEnum item information.
unsigned int solverSysNum(const SolverSystemName &solver_sys_name) const override
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 swap(NumericVector< T > &v)
bool hasActiveObject(const std::string &name, THREAD_ID tid=0) const
Convenience functions for checking/getting specific objects.
std::vector< VariableGradient > _grad_zero
bool hasActiveObjects(THREAD_ID tid=0) const
void clearCurrentJacobianMatrixTags()
Clear the current Jacobian matrix tag data structure ...
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
virtual void subdomainSetup(SubdomainID subdomain, const THREAD_ID tid)
virtual void restoreOldSolutions()
Restore old solutions from the backup vectors and deallocate them.
unsigned int getInitialSteps() const
Pull out the number of initial steps previously set by calling init()
void max(const T &r, T &o, Request &req) const
void reinitMaterials(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true)
virtual unsigned short dim() const=0
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 ...
bool acceptInvalidSolution() const
Whether or not to accept the solution based on its invalidity.
void setLoadAllVectors(const bool load_all_vectors)
Sets whether or not all vectors are to be loaded.
Class for threaded computation of UserObjects.
const bool _restore_original_nonzero_pattern
Whether we should restore the original nonzero pattern for every Jacobian evaluation.
void setRandomDataPointer(RandomData *random_data)
Base class for all MultiAppTransfer objects.
virtual libMesh::SparseMatrix< Number > & getMatrix(TagID tag)
Get a raw SparseMatrix.
void execMultiAppTransfers(ExecFlagType type, Transfer::DIRECTION direction)
Execute MultiAppTransfers associated with execution flag and direction.
T & set(const std::string &)
Wrapper class that owns a libMesh EquationSystem and adds advanced restart capability to it...
void restoreMultiApps(ExecFlagType type, bool force=false)
Restore the MultiApps associated with the ExecFlagType.
virtual void addLinearFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters ¶meters)
virtual bool is_vertex(const unsigned int i) const=0
void subdomainSetup()
Calls the subdomainSetup function for each of the output objects.
const std::string & getName(const unsigned int id) const
const std::vector< dof_id_type > & allDofIndices() const
Get all global dofindices for the variable.
const std::vector< std::string > & get_elem_var_names()
void addMaterialPropertyStorage(MaterialPropertyStorage &mat_props)
Pushes the given pair ( mat_data , mat_props ) onto our list of _materials data to redistribute each ...
SparseMatrix< Number > * matrix
void customSetup(const ExecFlagType &exec_type) override
void setRestartFile(const std::string &file_name)
Communicate to the Resurector the name of the restart filer.
void setCurrentLinearSystem(unsigned int sys_num)
Set the current linear system pointer.
void initNonlocalCoupling()
Create pair of variables requiring nonlocal jacobian contributions.
void executeControls(const ExecFlagType &exec_type)
Performs setup and execute calls for Control objects.
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters ¶meters)
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse...
void allowOutput(bool state)
Ability to enable/disable output calls This is private, users should utilize FEProblemBase::allowOutp...
bool hasStartTime() const
virtual void onTimestepBegin() override
virtual void computeBounds(libMesh::NonlinearImplicitSystem &sys, NumericVector< libMesh::Number > &lower, NumericVector< libMesh::Number > &upper)
Nonlinear system to be solved.
void initKokkos()
Construct Kokkos assembly and systems and allocate Kokkos material property storages.
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)
void checkDuplicatePostprocessorVariableNames()
void addConsumer(Moose::MaterialDataType type, const MooseObject *object)
Add object as the consumer of storage of type type.
void setAxisymmetricCoordAxis(const MooseEnum &rz_coord_axis)
For axisymmetric simulations, set the symmetry coordinate axis.
void addOutput(std::shared_ptr< Output > output)
Adds an existing output object to the warehouse.
void computeResidualAndJacobian(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, libMesh::SparseMatrix< libMesh::Number > &jacobian)
Form a residual and Jacobian with default tags.
std::vector< std::pair< MooseVariableFEBase *, MooseVariableFEBase * > > & nonlocalCouplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num)
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.
std::vector< VariableValue > _scalar_zero
virtual Real computeResidualL2Norm()
Computes the residual using whatever is sitting in the current solution vector then returns the L2 no...
void update(GeometricSearchType type=ALL)
Update all of the search objects.
const std::vector< LinearSystemName > _linear_sys_names
The linear system names.
virtual void initialSetup(THREAD_ID tid=0) const override
Convenience methods for calling object setup methods that handle the extra neighbor and face objects...
void incrementMultiAppTStep(ExecFlagType type)
Advance the MultiApps t_step (incrementStepOrReject) associated with the ExecFlagType.
Class for scalar variables (they are different).
IntRange< T > make_range(T beg, T end)
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.
void bumpVolumeQRuleOrder(libMesh::Order order, SubdomainID block)
Increases the element/volume quadrature order for the specified mesh block if and only if the current...
const bool _material_dependency_check
Determines whether a check to verify material dependencies on every subdomain.
std::vector< std::vector< const MooseVariableFEBase * > > _uo_jacobian_moose_vars
virtual MooseMesh & mesh() override
NonlocalKernel is used for solving integral terms in integro-differential equations.
std::vector< VariableValue > _zero
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
const ExecFlagType EXEC_SAME_AS_MULTIAPP
unsigned int linearSysNum(const LinearSystemName &linear_sys_name) const override
LinearSystem & currentLinearSystem()
Get a non-constant reference to the current linear system.
virtual void updateActive(THREAD_ID tid=0) override
Update the active status of Kernels.
std::set< TagID > _fe_vector_tags
const std::set< const MooseObject * > & getConsumers(Moose::MaterialDataType type) const
const std::set< const MooseObject * > & getMaterialPropertyStorageConsumers(Moose::MaterialDataType type) const
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().
virtual unsigned int size() const override final
SolverParams & solverParams(unsigned int solver_sys_num=0)
Get the solver parameters.
virtual void saveOldSolutions()
Allocate vectors and save old solutions into them.
std::unique_ptr< NumericVector< Number > > current_local_solution
ADRealVectorValue ADRealGradient
virtual void setActiveFEVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid)
void mooseConsole()
Send current output buffer to Console output objects.
std::set< std::string > getDependObjects() const
Get a list of dependent UserObjects for this exec type.
virtual void computeTransposeNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > *> &sp)
bool hasPostprocessor(const std::string &name) const
Deprecated.
virtual bool updateSolution(NumericVector< libMesh::Number > &vec_solution, NumericVector< libMesh::Number > &ghosted_solution)
Update the solution.
ChainControlDataSystem & getChainControlDataSystem()
Gets the system that manages the ChainControls.
bool _previous_multiapp_fp_aux_solution_required
Indicates we need to save the previous multiapp fixed-point iteration auxiliary variable values...
std::shared_ptr< DisplacedProblem > _displaced_problem
GeometricSearchData _geometric_search_data
State argument for evaluating functors.
void setCurrentResidualVectorTags(const std::set< TagID > &vector_tags)
Set the current residual vector tag data structure based on the passed in tag IDs.
MooseObjectWarehouse< Function > _functions
functions
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.
virtual Real & timeOld() const
Proxy for accessing MaterialPropertyStorage.
std::vector< VectorVariableValue > _vector_zero
bool hasMultiApp(const std::string &name) const
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)
std::vector< std::unique_ptr< libMesh::CouplingMatrix > > _cm
Coupling matrix for variables.
bool needInterfaceMaterialOnSide(BoundaryID bnd_id, const THREAD_ID tid)
void reinitElemFace(const Elem *elem, unsigned int side, BoundaryID, const THREAD_ID tid)
virtual void cacheResidualNeighbor(const THREAD_ID tid)
Linear system to be solved.
bool hasReporterValue(const ReporterName &reporter_name) const
Return True if a Reporter value with the given type and name have been created.
std::optional< std::vector< ConvergenceName > > _linear_convergence_names
Linear system(s) convergence name(s) (if any)
bool _has_initialized_stateful
Whether nor not stateful materials have been initialized.
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...
virtual void setResidualNeighbor(NumericVector< libMesh::Number > &residual, const THREAD_ID tid) override
QueryCache & condition(Args &&... args)
Adds a new condition to the query.
const TagName SOLUTION_TAG
unsigned int _max_qps
Maximum number of quadrature points used in the problem.
A class for storing an input parameter name.
static InputParameters validParams()
virtual void addFVInterpolationMethod(const std::string &method_type, const std::string &name, InputParameters ¶meters)
Add an FV interpolation method.
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
virtual void addScalarKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
elem_info_iterator ownedElemInfoEnd()
std::set< const Elem * > & getElements()
Returns a writeable reference to the _elements container.
virtual void set(const numeric_index_type i, const T value)=0
void addGhostedBoundary(BoundaryID boundary_id)
This will add the boundary ids to be ghosted to this processor.
bool _preserve_matrix_sparsity_pattern
Whether to preserve the system matrix / Jacobian sparsity pattern, using 0-valued entries usually...
virtual unsigned int nNonlinearIterations(const unsigned int nl_sys_num) const override
CoverageCheckMode _material_coverage_check
Determines whether and which subdomains are to be checked to ensure that they have an active material...
bool isAdaptivityDue()
Query if an adaptivity step should be performed at the current time / time step.
virtual std::size_t numLinearSystems() const override
MaterialPropertyStorage & _neighbor_material_props
std::unique_ptr< Backup > finalizeRestore()
Finalizes (closes) the restoration process done in restore().
libMesh::StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > * getBoundaryElementRange()
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
const std::size_t _num_linear_sys
The number of linear systems.
std::map< std::string, unsigned int > _subspace_dim
Dimension of the subspace spanned by the vectors with a given prefix.
const libMesh::ConstElemRange & getEvaluableElementRange()
In general, {evaluable elements} >= {local elements} U {algebraic ghosting elements}.
static InputParameters validParams()
bool _currently_computing_residual
Whether the residual is being evaluated.
const UserObject & getUserObjectBase(const std::string &name, const THREAD_ID tid=0) const
Get the user object by its name.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type...
MooseVariableFieldBase & getVariable(THREAD_ID tid, const std::string &var_name) const
Gets a reference to a variable of with specified name.
bool _has_internal_edge_residual_objects
Whether the problem has dgkernels or interface kernels.
bool execMultiApps(ExecFlagType type, bool auto_advance=true)
Execute the MultiApps associated with the ExecFlagType.
const std::string & name() const
void paramWarning(const std::string ¶m, Args... args) const
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...
const ExecFlagType EXEC_SUBDOMAIN
bool _has_constraints
Whether or not this system has any Constraints.
virtual bool isTransient() const override
bool hasMultiApps() const
Returns whether or not the current simulation has any multiapps.
virtual void reinitNeighbor(const Elem *elem, unsigned int side, const THREAD_ID tid) override
const MaterialData & getMaterialData(const THREAD_ID tid) const
void doingPRefinement(bool doing_p_refinement)
Indicate whether the kind of adaptivity we're doing includes p-refinement.
const bool & currentlyComputingJacobian() const
Returns true if the problem is in the process of computing the Jacobian.
void notifyWhenMeshChanges(MeshChangedInterface *mci)
Register an object that derives from MeshChangedInterface to be notified when the mesh changes...
ConstElemPointerRange * coarsenedElementRange() const
Return a range that is suitable for threaded execution over elements that were just coarsened...
std::unique_ptr< libMesh::ConstElemRange > _evaluable_local_elem_range
const Moose::PatchUpdateType & getPatchUpdateStrategy() const
Get the current patch update strategy.
const FVFaceInterpolationMethod & getFVFaceInterpolationMethod(const InterpolationMethodName &name, const THREAD_ID tid=0) const
Retrieve a scalar face interpolation method.
virtual void executeAllObjects(const ExecFlagType &exec_type)
CoverageCheckMode _kernel_coverage_check
Determines whether and which subdomains are to be checked to ensure that they have an active kernel...
virtual void setActiveFEVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid) override
void check() const
Perform integrity check for get/declare calls.
std::set< std::string > getPostprocessorNames() const
Return a list of all postprocessor names.
bool _fail_next_system_convergence_check
void ghostGhostedBoundaries()
Actually do the ghosting of boundaries that need to be ghosted to this processor. ...
std::vector< std::shared_ptr< LinearSystem > > _linear_systems
The vector of linear systems.
const hit::Node * getHitNode() const
std::shared_ptr< XFEMInterface > _xfem
Pointer to XFEM controller.
virtual void prepareShapes(unsigned int var, const THREAD_ID tid) override
const bool _boundary_restricted_elem_integrity_check
whether to perform checking of boundary restricted elemental object variable dependencies, e.g.
void reinitMaterialsInterface(BoundaryID boundary_id, const THREAD_ID tid, bool swap_stateful=true)
bool _const_jacobian
true if the Jacobian is constant
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.
virtual void solveLinearSystem(const unsigned int linear_sys_num, const Moose::PetscSupport::PetscOptions *po=nullptr)
Build and solve a linear system.
virtual void computeUserObjectByName(const ExecFlagType &type, const Moose::AuxGroup &group, const std::string &name)
Compute an user object with the given name.
virtual void possiblyRebuildGeomSearchPatches()
virtual void add(const numeric_index_type i, const T value)=0
bool _safe_access_tagged_matrices
Is it safe to retrieve data from tagged matrices.
std::set< TagID > _linear_vector_tags
Temporary storage for filtered vector tags for linear systems.
Class that represents the dependecy as a graph.
Moose::Kokkos::MaterialPropertyStorage & _kokkos_bnd_material_props
DiracKernelInfo _dirac_kernel_info
Abstract base class for interpolation methods that produce a scalar face value from adjacent cell val...
A MultiApp represents one or more MOOSE applications that are running simultaneously.
const TagName PREVIOUS_NL_SOLUTION_TAG
void updateBoundaryVariableDependency(std::set< MooseVariableFieldBase *> &needed_moose_vars, THREAD_ID tid=0) const
processor_id_type processor_id() const
void addObject(std::shared_ptr< FVInitialConditionBase > object, THREAD_ID tid, bool recurse=true)
Add object to the warehouse.
const libMesh::ConstElemRange & getNonlinearEvaluableElementRange()
A class for storing the names of MooseObject by tag and object name.
MaterialPropertyStorage & _material_props
Base class for Postprocessors that produce a vector of values.
virtual Order default_order() const=0
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...
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
virtual void addFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters ¶meters)
libMesh::Order _max_scalar_order
Maximum scalar variable order.
virtual void addGhostedBoundary(BoundaryID boundary_id) override
Will make sure that all necessary elements from boundary_id are ghosted to this processor.
virtual bool hasFunction(const std::string &name, const THREAD_ID tid=0)
Adaptivity & adaptivity()
bool hasActiveMaterialProperties(const THREAD_ID tid) const
Method to check whether or not a list of active material roperties has been set.
ExecuteMooseObjectWarehouse< Transfer > _between_multi_app_transfers
Transfers executed just before MultiApps to transfer data between them.
bool isRecovering() const
Whether or not this is a "recover" calculation.
SystemBase & sys()
Get the system this variable is part of.
virtual void cacheJacobian(const THREAD_ID tid) override
auto min(const L &left, const R &right)
void jacobianSetup() override
virtual std::size_t numSolverSystems() const override
virtual void addHDGKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Restartable::ManagedValue< RestartableEquationSystems > _req
The EquationSystems object, wrapped for restart.
virtual unsigned int currentLinearSysNum() const override
std::vector< libMesh::CouplingMatrix > _nonlocal_cm
nonlocal coupling matrix
virtual void reinitNodeFace(const Node *node, BoundaryID bnd_id, const THREAD_ID tid) override
virtual void reinitOffDiagScalars(const THREAD_ID tid) override
processor_id_type processor_id() const
virtual void reinitElemPhys(const Elem *elem, const std::vector< Point > &phys_points_in_elem, const THREAD_ID tid) override
std::vector< std::unordered_map< BoundaryID, bool > > _interface_mat_side_cache
Cache for calculating materials on interface.
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.
void initKokkosStatefulProps()
const std::vector< std::string > & get_nodal_var_names()
std::string getRestartRecoverFileBase() const
The file_base for the recovery file.
virtual void addJacobianNeighborLowerD(const THREAD_ID tid) override
virtual void prepareNeighborShapes(unsigned int var, const THREAD_ID tid) override
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.
MooseObjectWarehouse< Marker > _markers
FVInitialConditionWarehouse _fv_ics
void setVerboseProblem(bool verbose)
Make the problem be verbose.
virtual void setNeighborSubdomainID(const Elem *elem, unsigned int side, const THREAD_ID tid) override
virtual const VectorTag & getVectorTag(const TagID tag_id) const
Get a VectorTag from a TagID.
MaterialBases compute MaterialProperties.
virtual void initialAdaptMesh()
void updatePointLocator(const MooseMesh &mesh)
Called during FEProblemBase::meshChanged() to update the PointLocator object used by the DiracKernels...
virtual void addResidualScalar(const THREAD_ID tid=0)
Moose::Kokkos::MaterialPropertyStorage & _kokkos_neighbor_material_props
This is a template class that implements the workhorse compute and computeNodal methods.
MaterialWarehouse _all_materials
const MeshBase::element_iterator activeLocalElementsEnd()
virtual void addCachedResidual(const THREAD_ID tid) override
for(PetscInt i=0;i< nvars;++i)
void clearNearestNodeLocators()
Clear out the Penetration Locators so they will redo the search.
Moose::PetscSupport::PetscOptions _petsc_options
PETSc option storage.
libMesh::StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > * getBoundaryNodeRange()
virtual const std::vector< std::shared_ptr< Convergence > > & getConvergenceObjects(const THREAD_ID tid=0) const
Gets the Convergence objects.
void ErrorVector unsigned int
virtual void clearActiveElementalMooseVariables(const THREAD_ID tid) override
Clear the active elemental MooseVariableFEBase.
auto index_range(const T &sizable)
Base class for user-specific data.
void timestepSetup()
Calls the timestepSetup function for each of the output objects.
void allowOutput(bool state)
Ability to enable/disable all output calls.
virtual void cacheJacobian(const THREAD_ID tid)
virtual Sampler & getSampler(const std::string &name, const THREAD_ID tid=0)
const std::string & _type
The type of this class.
virtual void outputStep(ExecFlagType type)
Output the current step.
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...
virtual unsigned int nlSysNum(const NonlinearSystemName &nl_sys_name) const override
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
virtual void updateActive(THREAD_ID tid=0) override
Update the active status of Kernels.
MooseEnum _verbose_setup
Whether or not to be verbose during setup.
static InputParameters validParams()
RedistributeProperties is used for its redistribute() callback, which ensures that any stateful prope...
unsigned int state
The state.
virtual void computeJacobianTags(const std::set< TagID > &tags)
Form multiple matrices, and each is associated with a tag.
void computeSystems(const ExecFlagType &type)
Do generic system computations.
MooseMesh * _displaced_mesh
void resize(unsigned int n_qpoints)
Resize the data to hold properties for n_qpoints quadrature points.
bool _has_mortar
Whether the simulation requires mortar coupling.
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.
libMesh::Order getMaxScalarOrder() const
void execTransfers(ExecFlagType type)
Execute the Transfers associated with the ExecFlagType.
void addNotZeroedVectorTag(const TagID tag)
Adds a vector tag to the list of vectors that will not be zeroed when other tagged vectors are...
void restoreState(bool verbose=false)
When a time step fails, this method is called to revert the current reporter values to their old stat...
void meshChanged()
Declares that the MooseMesh has changed, invalidates cached data and rebuilds caches.
void buildPRefinementAndCoarseningMaps(Assembly *assembly)
const std::vector< ConvergenceName > & getLinearConvergenceNames() const
Gets the linear convergence object name(s).
virtual void ghostGhostedBoundaries() override
Causes the boundaries added using addGhostedBoundary to actually be ghosted.
const ExecFlagType EXEC_POST_ADAPTIVITY
void add_ghosting_functor(GhostingFunctor &ghosting_functor)
MaterialWarehouse _materials
virtual void addJacobianScalar(const THREAD_ID tid=0)
virtual void addDiracKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
An instance of this object type has one copy per thread that runs on each thread. ...
MooseObjectWarehouse< IntegratedBCBase > _nonlocal_integrated_bcs
nonlocal integrated_bcs
virtual void computeResidualTag(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, TagID tag)
Form a residual vector for a given tag.
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...
std::shared_ptr< LineSearch > _line_search
void initXFEM(std::shared_ptr< XFEMInterface > xfem)
Create XFEM controller object.
const std::set< SubdomainID > & meshSubdomains() const
Returns a read-only reference to the set of subdomains currently present in the Mesh.
SubdomainID getSubdomainID(const SubdomainName &subdomain_name) const
Get the associated subdomain ID for the subdomain name.
const FEType & type() const
Base class for all Transfer objects.
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.
void parallelBarrierNotify(const Parallel::Communicator &comm, bool messaging)
virtual void neighborSubdomainSetup(SubdomainID subdomain, const THREAD_ID tid)
void setupFiniteVolumeMeshData() const
Sets up the additional data needed for finite volume computations.
virtual void addCachedJacobian(const THREAD_ID tid) override
virtual void sizeZeroes(unsigned int size, const THREAD_ID tid)
virtual Real computeDamping(const NumericVector< libMesh::Number > &soln, const NumericVector< libMesh::Number > &update)
std::vector< Real > _real_zero
Convenience zeros.
MooseObjectWarehouse< KernelBase > _nonlocal_kernels
nonlocal kernels
void checkCoordinateSystems()
Verify that there are no element type/coordinate type conflicts.
unsigned int getMaxQps() const
const ExecFlagType EXEC_INITIAL
virtual libMesh::System & system() override
Get the reference to the libMesh system.
bool _verbose_multiapps
Whether or not to be verbose with multiapps.
Key structure for APIs manipulating global vectors/matrices.