119 #include "libmesh/exodusII_io.h" 120 #include "libmesh/quadrature.h" 121 #include "libmesh/coupling_matrix.h" 122 #include "libmesh/nonlinear_solver.h" 123 #include "libmesh/sparse_matrix.h" 124 #include "libmesh/string_to_enum.h" 125 #include "libmesh/fe_interface.h" 126 #include "libmesh/enum_norm_type.h" 127 #include "libmesh/petsc_solver_exception.h" 129 #include "metaphysicl/dualnumber.h" 152 params.
addParam<
unsigned int>(
"null_space_dimension", 0,
"The dimension of the nullspace");
154 "transpose_null_space_dimension", 0,
"The dimension of the transpose nullspace");
156 "near_null_space_dimension", 0,
"The dimension of the near nullspace");
159 "Whether or not to actually solve the Nonlinear system. " 160 "This is handy in the case that all you want to do is " 161 "execute AuxKernels, Transfers, etc. without actually " 163 params.
addParam<
bool>(
"use_nonlinear",
165 "Determines whether to use a Nonlinear vs a " 166 "Eigenvalue system (Automatically determined based " 168 params.
addParam<
bool>(
"error_on_jacobian_nonzero_reallocation",
169 "This causes PETSc to error if it had to reallocate memory in the Jacobian " 170 "matrix due to not having enough nonzeros");
171 params.
addParam<
bool>(
"ignore_zeros_in_jacobian",
173 "Do not explicitly store zero values in " 174 "the Jacobian matrix if true");
175 params.
addParam<
bool>(
"force_restart",
177 "EXPERIMENTAL: If true, a sub_app may use a " 178 "restart file instead of using of using the master " 182 "True to skip additional data in equation system for restart.",
183 "This parameter is no longer used, as we do not load additional " 184 "vectors by default with restart");
185 params.
addParam<
bool>(
"skip_nl_system_check",
187 "True to skip the NonlinearSystem check for work to do (e.g. Make sure " 188 "that there are variables to solve for).");
189 params.
addParam<
bool>(
"allow_initial_conditions_with_restart",
191 "True to allow the user to specify initial conditions when restarting. " 192 "Initial conditions can override any restarted field");
200 "block", {},
"Block IDs for the coordinate systems",
"Please use 'Mesh/coord_block' instead");
205 "Type of the coordinate system per block param",
206 "Please use 'Mesh/coord_type' instead");
209 "The rotation axis (X | Y) for axisymetric coordinates",
210 "Please use 'Mesh/rz_coord_axis' instead");
211 auto coverage_check_description = [](std::string scope, std::string list_param_name)
213 return "Controls, if and how a " + scope +
214 " subdomain coverage check is performed. " 215 "With 'TRUE' or 'ON' all subdomains are checked (the default). Setting 'FALSE' or 'OFF' " 216 "will disable the check for all subdomains. " 217 "To exclude a predefined set of subdomains 'SKIP_LIST' is to " 218 "be used, while the subdomains to skip are to be defined in the parameter '" +
220 "'. To limit the check to a list of subdomains, 'ONLY_LIST' is to " 221 "be used (again, using the parameter '" +
222 list_param_name +
"').";
224 MooseEnum kernel_coverage_check_modes(
"FALSE TRUE OFF ON SKIP_LIST ONLY_LIST",
"TRUE");
226 kernel_coverage_check_modes,
227 coverage_check_description(
"kernel",
"kernel_coverage_block_list"));
228 params.
addParam<std::vector<SubdomainName>>(
229 "kernel_coverage_block_list",
231 "List of subdomains for kernel coverage check. The meaning of this list is controlled by the " 232 "parameter 'kernel_coverage_check' (whether this is the list of subdomains to be checked, " 233 "not to be checked or not taken into account).");
235 "boundary_restricted_node_integrity_check",
237 "Set to false to disable checking of boundary restricted nodal object variable dependencies, " 238 "e.g. are the variable dependencies defined on the selected boundaries?");
239 params.
addParam<
bool>(
"boundary_restricted_elem_integrity_check",
241 "Set to false to disable checking of boundary restricted elemental object " 242 "variable dependencies, e.g. are the variable dependencies defined on the " 243 "selected boundaries?");
244 MooseEnum material_coverage_check_modes(
"FALSE TRUE OFF ON SKIP_LIST ONLY_LIST",
"TRUE");
246 "material_coverage_check",
247 material_coverage_check_modes,
248 coverage_check_description(
"material",
"material_coverage_block_list"));
249 params.
addParam<std::vector<SubdomainName>>(
250 "material_coverage_block_list",
252 "List of subdomains for material coverage check. The meaning of this list is controlled by " 253 "the parameter 'material_coverage_check' (whether this is the list of subdomains to be " 254 "checked, not to be checked or not taken into account).");
256 params.
addParam<
bool>(
"fv_bcs_integrity_check",
258 "Set to false to disable checking of overlapping Dirichlet and Flux BCs " 259 "and/or multiple DirichletBCs per sideset");
262 "material_dependency_check",
true,
"Set to false to disable material dependency check");
263 params.
addParam<
bool>(
"parallel_barrier_messaging",
265 "Displays messaging from parallel " 266 "barrier notifications when executing " 267 "or transferring to/from Multiapps " 270 MooseEnum verbosity(
"false true extra",
"false");
273 "Set to 'true' to have the problem report on any object created. Set " 274 "to 'extra' to also display all parameters.");
275 params.
addParam<
bool>(
"verbose_multiapps",
277 "Set to True to enable verbose screen printing related to MultiApps");
279 params.
addParam<FileNameNoExtension>(
"restart_file_base",
280 "File base name used for restart (e.g. " 281 "<path>/<filebase> or <path>/LATEST to " 282 "grab the latest file available)");
284 params.
addParam<std::vector<std::vector<TagName>>>(
287 "Extra vectors to add to the system that can be filled by objects which compute residuals " 288 "and Jacobians (Kernels, BCs, etc.) by setting tags on them. The outer index is for which " 289 "nonlinear system the extra tag vectors should be added for");
291 params.
addParam<std::vector<std::vector<TagName>>>(
292 "not_zeroed_tag_vectors",
294 "Extra vector tags which the sytem will not zero when other vector tags are zeroed. " 295 "The outer index is for which nonlinear system the extra tag vectors should be added for");
297 params.
addParam<std::vector<std::vector<TagName>>>(
298 "extra_tag_matrices",
300 "Extra matrices to add to the system that can be filled " 301 "by objects which compute residuals and Jacobians " 302 "(Kernels, BCs, etc.) by setting tags on them. The outer index is for which " 303 "nonlinear system the extra tag vectors should be added for");
305 params.
addParam<std::vector<TagName>>(
306 "extra_tag_solutions",
308 "Extra solution vectors to add to the system that can be used by " 309 "objects for coupling variable values stored in them.");
311 params.
addParam<
bool>(
"previous_nl_solution_required",
313 "True to indicate that this calculation requires a solution vector for " 314 "storing the previous nonlinear iteration.");
316 params.
addParam<std::vector<NonlinearSystemName>>(
317 "nl_sys_names", std::vector<NonlinearSystemName>{
"nl0"},
"The nonlinear system names");
319 params.
addParam<std::vector<LinearSystemName>>(
"linear_sys_names", {},
"The linear system names");
321 params.
addParam<
bool>(
"check_uo_aux_state",
323 "True to turn on a check that no state presents during the evaluation of " 324 "user objects and aux kernels");
331 "allow_invalid_solution",
333 "Set to true to allow convergence even though the solution has been marked as 'invalid'");
334 params.
addParam<
bool>(
"show_invalid_solution_console",
336 "Set to true to show the invalid solution occurance summary in console");
337 params.
addParam<
bool>(
"immediately_print_invalid_solution",
339 "Whether or not to report invalid solution warnings at the time the " 340 "warning is produced instead of after the calculation");
343 "identify_variable_groups_in_nl",
345 "Whether to identify variable groups in nonlinear systems. This affects dof ordering");
348 "regard_general_exceptions_as_errors",
350 "If we catch an exception during residual/Jacobian evaluaton for which we don't have " 351 "specific handling, immediately error instead of allowing the time step to be cut");
354 "skip_nl_system_check kernel_coverage_check kernel_coverage_block_list " 355 "boundary_restricted_node_integrity_check " 356 "boundary_restricted_elem_integrity_check material_coverage_check " 357 "material_coverage_block_list fv_bcs_integrity_check " 358 "material_dependency_check check_uo_aux_state error_on_jacobian_nonzero_reallocation",
359 "Simulation checks");
361 "ignore_zeros_in_jacobian identify_variable_groups_in_nl",
362 "Nonlinear system(s)");
364 "restart_file_base force_restart allow_initial_conditions_with_restart",
"Restart");
368 "null_space_dimension transpose_null_space_dimension near_null_space_dimension",
369 "Null space removal");
371 "extra_tag_vectors extra_tag_matrices extra_tag_solutions not_zeroed_tag_vectors",
372 "Contribution to tagged field data");
374 "allow_invalid_solution show_invalid_solution_console immediately_print_invalid_solution",
375 "Solution validity control");
383 _mesh(*getCheckedPointerParam<
MooseMesh *>(
"mesh")),
385 "equation_systems", nullptr, _mesh)),
387 _solve(getParam<bool>(
"solve")),
389 _time(declareRestartableData<
Real>(
"time")),
390 _time_old(declareRestartableData<
Real>(
"time_old")),
391 _t_step(declareRecoverableData<
int>(
"t_step")),
392 _dt(declareRestartableData<
Real>(
"dt")),
393 _dt_old(declareRestartableData<
Real>(
"dt_old")),
394 _set_nonlinear_convergence_names(false),
395 _need_to_add_default_nonlinear_convergence(false),
396 _linear_sys_names(getParam<
std::vector<LinearSystemName>>(
"linear_sys_names")),
397 _num_linear_sys(_linear_sys_names.size()),
398 _linear_systems(_num_linear_sys, nullptr),
399 _current_linear_sys(nullptr),
400 _using_default_nl(!isParamSetByUser(
"nl_sys_names")),
401 _nl_sys_names(!_using_default_nl || (_using_default_nl && !_linear_sys_names.size())
402 ? getParam<
std::vector<NonlinearSystemName>>(
"nl_sys_names")
403 :
std::vector<NonlinearSystemName>()),
404 _num_nl_sys(_nl_sys_names.size()),
405 _nl(_num_nl_sys, nullptr),
406 _current_nl_sys(nullptr),
407 _solver_systems(_num_nl_sys + _num_linear_sys, nullptr),
410 _mesh_divisions(true),
412 "material_props", &_mesh, _material_prop_registry)),
414 "bnd_material_props", &_mesh, _material_prop_registry)),
416 "neighbor_material_props", &_mesh, _material_prop_registry)),
417 _reporter_data(_app),
419 _all_user_objects(_app.getExecuteOnEnum()),
420 _multi_apps(_app.getExecuteOnEnum()),
421 _transient_multi_apps(_app.getExecuteOnEnum()),
422 _transfers(_app.getExecuteOnEnum(), false),
423 _to_multi_app_transfers(_app.getExecuteOnEnum(), false),
424 _from_multi_app_transfers(_app.getExecuteOnEnum(), false),
425 _between_multi_app_transfers(_app.getExecuteOnEnum(), false),
426 #ifdef LIBMESH_ENABLE_AMR
428 _cycles_completed(0),
430 _displaced_mesh(nullptr),
431 _geometric_search_data(*this, _mesh),
433 _reinit_displaced_elem(false),
434 _reinit_displaced_face(false),
435 _reinit_displaced_neighbor(false),
436 _input_file_saved(false),
438 _has_constraints(false),
439 _snesmf_reuse_base(true),
440 _skip_exception_check(false),
441 _snesmf_reuse_base_set_by_user(false),
442 _has_initialized_stateful(false),
443 _const_jacobian(false),
444 _has_jacobian(false),
445 _needs_old_newton_iter(false),
446 _previous_nl_solution_required(getParam<bool>(
"previous_nl_solution_required")),
447 _has_nonlocal_coupling(false),
448 _calculate_jacobian_in_uo(false),
449 _kernel_coverage_check(
451 _kernel_coverage_blocks(getParam<
std::vector<SubdomainName>>(
"kernel_coverage_block_list")),
452 _boundary_restricted_node_integrity_check(
453 getParam<bool>(
"boundary_restricted_node_integrity_check")),
454 _boundary_restricted_elem_integrity_check(
455 getParam<bool>(
"boundary_restricted_elem_integrity_check")),
456 _material_coverage_check(
458 _material_coverage_blocks(getParam<
std::vector<SubdomainName>>(
"material_coverage_block_list")),
459 _fv_bcs_integrity_check(getParam<bool>(
"fv_bcs_integrity_check")),
460 _material_dependency_check(getParam<bool>(
"material_dependency_check")),
461 _uo_aux_state_check(getParam<bool>(
"check_uo_aux_state")),
462 _max_qps(
std::numeric_limits<unsigned
int>::
max()),
464 _has_time_integrator(false),
465 _has_exception(false),
466 _parallel_barrier_messaging(getParam<bool>(
"parallel_barrier_messaging")),
467 _verbose_setup(getParam<
MooseEnum>(
"verbose_setup")),
468 _verbose_multiapps(getParam<bool>(
"verbose_multiapps")),
470 _control_warehouse(_app.getExecuteOnEnum(), false),
471 _is_petsc_options_inserted(false),
472 _line_search(nullptr),
473 _using_ad_mat_props(false),
474 _current_ic_state(0),
475 _error_on_jacobian_nonzero_reallocation(
476 isParamValid(
"error_on_jacobian_nonzero_reallocation")
477 ? getParam<bool>(
"error_on_jacobian_nonzero_reallocation")
478 : _app.errorOnJacobianNonzeroReallocation()),
479 _ignore_zeros_in_jacobian(getParam<bool>(
"ignore_zeros_in_jacobian")),
480 _preserve_matrix_sparsity_pattern(true),
481 _force_restart(getParam<bool>(
"force_restart")),
482 _allow_ics_during_restart(getParam<bool>(
"allow_initial_conditions_with_restart")),
483 _skip_nl_system_check(getParam<bool>(
"skip_nl_system_check")),
484 _fail_next_nonlinear_convergence_check(false),
485 _allow_invalid_solution(getParam<bool>(
"allow_invalid_solution")),
486 _show_invalid_solution_console(getParam<bool>(
"show_invalid_solution_console")),
487 _immediately_print_invalid_solution(getParam<bool>(
"immediately_print_invalid_solution")),
488 _started_initial_setup(false),
489 _has_internal_edge_residual_objects(false),
490 _u_dot_requested(false),
491 _u_dotdot_requested(false),
492 _u_dot_old_requested(false),
493 _u_dotdot_old_requested(false),
496 _print_execution_on(),
497 _identify_variable_groups_in_nl(getParam<bool>(
"identify_variable_groups_in_nl")),
498 _regard_general_exceptions_as_errors(getParam<bool>(
"regard_general_exceptions_as_errors"))
503 ADReal::do_derivatives =
true;
564 getParam<MultiMooseEnum>(
"coord_type"));
570 std::string restart_file_base = getParam<FileNameNoExtension>(
"restart_file_base");
577 if (restart_file_base.size())
595 #if !PETSC_RELEASE_LESS_THAN(3, 12, 0) 614 mooseWarning(
"Displaced mesh was requested but the displaced problem does not exist. " 615 "Regular mesh will be returned");
623 auto & vectors = getParam<std::vector<std::vector<TagName>>>(
"extra_tag_vectors");
625 for (
auto & vector : vectors[nl_sys_num])
631 auto & not_zeroed_vectors = getParam<std::vector<std::vector<TagName>>>(
"not_zeroed_tag_vectors");
632 for (
const auto nl_sys_num :
index_range(not_zeroed_vectors))
633 for (
auto & vector : not_zeroed_vectors[nl_sys_num])
636 _nl[nl_sys_num]->addVector(tag,
false,
GHOSTED);
641 auto & matrices = getParam<std::vector<std::vector<TagName>>>(
"extra_tag_matrices");
642 for (
const auto nl_sys_num :
index_range(matrices))
643 for (
auto & matrix : matrices[nl_sys_num])
646 _nl[nl_sys_num]->addMatrix(tag);
653 for (
auto & vector :
getParam<std::vector<TagName>>(
"extra_tag_solutions"))
672 sys->associateVectorToTag(*sys->system().current_local_solution.get(), tag);
673 _aux->associateVectorToTag(*
_aux->system().current_local_solution.get(), tag);
680 for (
const auto i :
make_range((
unsigned)0, oldest_needed))
683 sys->needSolutionState(i, iteration_type);
684 _aux->needSolutionState(i, iteration_type);
696 _assembly[i].resize(solver_systems.size());
698 _assembly[i][j] = std::make_unique<Assembly>(*solver_systems[j], i);
704 std::vector<std::shared_ptr<NonlinearSystemBase>> & nls)
706 TIME_SECTION(
"initNullSpaceVectors", 5,
"Initializing Null Space Vectors");
708 unsigned int dimNullSpace =
parameters.
get<
unsigned int>(
"null_space_dimension");
709 unsigned int dimTransposeNullSpace =
710 parameters.
get<
unsigned int>(
"transpose_null_space_dimension");
711 unsigned int dimNearNullSpace =
parameters.
get<
unsigned int>(
"near_null_space_dimension");
712 for (
unsigned int i = 0; i < dimNullSpace; ++i)
714 std::ostringstream oss;
718 for (
auto & nl : nls)
722 for (
unsigned int i = 0; i < dimTransposeNullSpace; ++i)
724 std::ostringstream oss;
728 for (
auto & nl : nls)
732 for (
unsigned int i = 0; i < dimNearNullSpace; ++i)
734 std::ostringstream oss;
738 for (
auto & nl : nls)
753 for (
unsigned int i = 0; i <
n_threads; i++)
769 #if !PETSC_RELEASE_LESS_THAN(3, 12, 0) 774 CHKERRABORT(this->
comm().
get(), ierr);
783 TIME_SECTION(
"setCoordSystem", 5,
"Setting Coordinate System");
798 std::vector<const DofMap *> dof_maps(
es().n_systems());
802 dof_maps[i] = &sys.get_dof_map();
805 std::make_unique<ConstElemRange>(
_mesh.
getMesh().multi_evaluable_elements_begin(dof_maps),
806 _mesh.
getMesh().multi_evaluable_elements_end(dof_maps));
816 std::vector<const DofMap *> dof_maps(
_nl.size());
818 dof_maps[i] = &
_nl[i]->dofMap();
820 std::make_unique<ConstElemRange>(
_mesh.
getMesh().multi_evaluable_elements_begin(dof_maps),
821 _mesh.
getMesh().multi_evaluable_elements_end(dof_maps));
830 TIME_SECTION(
"initialSetup", 2,
"Performing Initial Setup");
835 mooseError(
"Checkpoint recovery and restart and exodus restart are all mutually exclusive.");
838 mooseWarning(
"MOOSE may fail to catch an exception when the \"skip_exception_check\" parameter " 839 "is used. If you receive a terse MPI error during execution, remove this " 840 "parameter and rerun your simulation");
855 _aux->initSolutionState();
868 TIME_SECTION(
"computingMaxDofs", 3,
"Computing Max Dofs Per Element");
872 max_var_n_dofs_per_elem = mvndpe.
max();
877 max_var_n_dofs_per_node = mvndpn.
max();
879 global_max_var_n_dofs_per_elem =
880 std::max(global_max_var_n_dofs_per_elem, max_var_n_dofs_per_elem);
884 TIME_SECTION(
"assignMaxDofs", 5,
"Assigning Maximum Dofs Per Elem");
886 sys.assignMaxVarNDofsPerElem(max_var_n_dofs_per_elem);
888 if (displaced_problem)
889 displaced_problem->solverSys(i).assignMaxVarNDofsPerElem(max_var_n_dofs_per_elem);
891 sys.assignMaxVarNDofsPerNode(max_var_n_dofs_per_node);
892 if (displaced_problem)
893 displaced_problem->solverSys(i).assignMaxVarNDofsPerNode(max_var_n_dofs_per_node);
898 TIME_SECTION(
"resizingVarValues", 5,
"Resizing Variable Values");
902 _phi_zero[tid].resize(global_max_var_n_dofs_per_elem, std::vector<Real>(
getMaxQps(), 0.));
922 props->setRecovering();
924 TIME_SECTION(
"restore", 3,
"Restoring from backup");
951 TIME_SECTION(
"copyingFromExodus", 3,
"Copying Variables From Exodus");
954 sys->copyVars(*reader);
955 _aux->copyVars(*reader);
960 mooseError(
"Need Exodus reader to restart variables but the reader is not available\n" 961 "Use either FileMesh with an Exodus mesh file or FileMeshGenerator with an " 962 "Exodus mesh file and with use_for_exodus_restart equal to true");
978 mooseError(
"Stateful neighbor material properties do not work with mesh adaptivity");
994 "Doing extra refinements when restarting is NOT supported for sub-apps of a MultiApp");
1004 TIME_SECTION(
"convergenceInitialSetup", 5,
"Initializing Convergence objects");
1012 std::set<std::string> depend_objects_aux =
_aux->getDependObjects();
1016 std::vector<UserObject *> userobjs;
1021 std::map<int, std::vector<UserObject *>> group_userobjs;
1022 for (
auto obj : userobjs)
1023 group_userobjs[obj->getParam<
int>(
"execution_order_group")].push_back(obj);
1025 for (
auto & [group, objs] : group_userobjs)
1026 for (
auto obj : objs)
1027 obj->initialSetup();
1039 TIME_SECTION(
"initializingFunctions", 5,
"Initializing Functions");
1051 TIME_SECTION(
"initializingRandomObjects", 5,
"Initializing Random Objects");
1063 TIME_SECTION(
"ICinitialSetup", 5,
"Setting Up Initial Conditions");
1077 TIME_SECTION(
"materialInitialSetup", 3,
"Setting Up Materials");
1099 TIME_SECTION(
"computingInitialStatefulProps", 3,
"Computing Initial Material Values");
1115 props->setRestartInPlace();
1116 props->setRecovering();
1127 #ifdef LIBMESH_ENABLE_AMR 1133 mooseError(
"Cannot perform initial adaptivity during restart on sub-apps of a MultiApp!");
1138 #endif // LIBMESH_ENABLE_AMR 1149 unsigned short ic_state_max = 0;
1151 auto findMax = [&ic_state_max](
const auto & obj_list)
1153 for (
auto ic : obj_list.getActiveObjects())
1154 ic_state_max =
std::max(ic_state_max, ic->getState());
1161 if (ic_state_max > 0)
1165 std::vector<std::unique_ptr<NumericVector<Real>>> state0_sys_buffers(
_solver_systems.size());
1166 std::unique_ptr<NumericVector<Real>> state0_aux_buffer;
1172 state0_aux_buffer =
_aux->solutionState(0).clone();
1193 _aux->solutionState(0) = *state0_aux_buffer;
1194 _aux->solutionState(0).close();
1207 sys->initialSetup();
1210 _aux->initialSetup();
1217 sys->setSolution(*(sys->system().current_local_solution.get()));
1243 const auto & tis = sys->getTimeIntegrators();
1246 TIME_SECTION(
"timeIntegratorInitialSetup", 5,
"Initializing Time Integrator");
1247 for (
auto & ti : tis)
1258 TIME_SECTION(
"initialSetupMultiApps", 2,
"Initializing MultiApps",
false);
1264 TIME_SECTION(
"initialSetupTransfers", 2,
"Initializing Transfers");
1270 for (
const auto & transfer : to_multi_app_objects)
1272 transfer->setCurrentDirection(Transfer::DIRECTION::TO_MULTIAPP);
1273 transfer->initialSetup();
1278 for (
const auto & transfer : from_multi_app_objects)
1280 transfer->setCurrentDirection(Transfer::DIRECTION::FROM_MULTIAPP);
1281 transfer->initialSetup();
1286 for (
const auto & transfer : between_multi_app_objects)
1288 transfer->setCurrentDirection(Transfer::DIRECTION::BETWEEN_MULTIAPP);
1289 transfer->initialSetup();
1295 TIME_SECTION(
"BoundaryRestrictedNodeIntegrityCheck", 5);
1300 Threads::parallel_reduce(bnd_nodes, bnict);
1304 for (
const auto & bnode : bnd_nodes)
1306 const auto boundary_id = bnode->_bnd_id;
1307 const Node *
const node = bnode->_node;
1314 const Elem *
const an_elem =
1321 for (
auto & nl :
_nl)
1323 const auto & nodal_bcs = nl->getNodalBCWarehouse();
1324 if (!nodal_bcs.hasBoundaryObjects(boundary_id, 0))
1327 const auto & bnd_objects = nodal_bcs.getBoundaryObjects(boundary_id, 0);
1328 for (
const auto & bnd_object : bnd_objects)
1331 if (!bnd_object->requiresGeometricSearch() &&
1332 bnd_object->checkVariableBoundaryIntegrity())
1334 std::set<MooseVariableFieldBase *> vars_to_omit = {
1339 *bnd_object, bnd_object->checkAllVariables(*node, vars_to_omit), bnd_name);
1347 TIME_SECTION(
"BoundaryRestrictedElemIntegrityCheck", 5);
1352 Threads::parallel_reduce(bnd_elems, beict);
1361 mooseError(
"failed to converge initial MultiApp");
1393 TIME_SECTION(
"computeMaterials", 2,
"Computing Initial Material Properties");
1402 for (
unsigned int tid = 0; tid <
n_threads; tid++)
1420 TIME_SECTION(
"lineSearchInitialSetup", 5,
"Initializing Line Search");
1442 "\" has the same name as a scalar variable in the system.");
1453 std::unique_ptr<libMesh::MeshRefinement> displaced_mesh_refinement(
nullptr);
1455 displaced_mesh_refinement = std::make_unique<libMesh::MeshRefinement>(*_displaced_mesh);
1471 displaced_mesh_refinement->uniformly_coarsen();
1518 _aux->timestepSetup();
1520 sys->timestepSetup();
1533 std::vector<UserObject *> userobjs;
1535 for (
auto obj : userobjs)
1536 obj->timestepSetup();
1563 TIME_SECTION(
"checkNonlocalCoupling", 5,
"Checking Nonlocal Coupling");
1566 for (
auto & nl :
_nl)
1568 const auto & all_kernels = nl->getKernelWarehouse();
1569 const auto & kernels = all_kernels.getObjects(tid);
1570 for (
const auto & kernel : kernels)
1572 std::shared_ptr<NonlocalKernel> nonlocal_kernel =
1574 if (nonlocal_kernel)
1582 nl->getIntegratedBCWarehouse();
1583 const auto & integrated_bcs = all_integrated_bcs.
getObjects(tid);
1584 for (
const auto & integrated_bc : integrated_bcs)
1586 std::shared_ptr<NonlocalIntegratedBC> nonlocal_integrated_bc =
1588 if (nonlocal_integrated_bc)
1601 std::set<const MooseVariableFEBase *> uo_jacobian_moose_vars;
1603 std::vector<ShapeElementUserObject *> objs;
1607 .condition<AttribThread>(tid)
1610 for (
const auto & uo : objs)
1613 const auto & mv_deps = uo->jacobianMooseVariables();
1614 uo_jacobian_moose_vars.insert(mv_deps.begin(), mv_deps.end());
1618 std::vector<ShapeSideUserObject *> objs;
1622 .condition<AttribThread>(tid)
1624 for (
const auto & uo : objs)
1627 const auto & mv_deps = uo->jacobianMooseVariables();
1628 uo_jacobian_moose_vars.insert(mv_deps.begin(), mv_deps.end());
1640 for (
unsigned int i = 0; i < moose_vars.size(); ++i)
1642 VariableName var_name = moose_vars[i]->name();
1644 sys->setVariableGlobalDoFs(var_name);
1662 _assembly[tid][i]->prepareJacobianBlock();
1685 for (
auto & nl :
_nl)
1686 nl->prepareFace(tid,
true);
1687 _aux->prepareFace(tid,
false);
1697 const std::vector<dof_id_type> & dof_indices,
1703 _nl[i]->prepare(tid);
1708 _assembly[tid][current_nl_sys_num]->prepareBlock(ivar, jvar, dof_indices);
1713 _assembly[tid][current_nl_sys_num]->prepareBlockNonlocal(
1735 _assembly[tid][i]->setCurrentSubdomainID(did);
1748 _assembly[tid][i]->setCurrentNeighborSubdomainID(did);
1761 _assembly[tid][i]->setCurrentNeighborSubdomainID(did);
1963 std::vector<dof_id_type> & dof_indices,
1964 const std::set<TagID> & tags,
1987 _displaced_problem->addJacobianBlockTags(jacobian, ivar, jvar, dof_map, dof_indices, tags, tid);
1993 jacobian, ivar, jvar, dof_map, dof_indices, jv.
allDofIndices(), tags, tid);
2003 std::vector<dof_id_type> & dof_indices,
2004 std::vector<dof_id_type> & neighbor_dof_indices,
2005 const std::set<TagID> & tags,
2013 neighbor_dof_indices,
2018 jacobian, ivar, jvar, dof_map, dof_indices, neighbor_dof_indices, tags, tid);
2057 TIME_SECTION(
"ghostGhostedBoundaries", 3,
"Ghosting Ghosted Boundaries");
2069 "This function is deprecated and no longer performs any function. Please do not call it."));
2077 unsigned int n_points = points.size();
2094 _zero[tid].resize(max_qpts, 0);
2104 _assembly[tid][i]->reinitAtPhysical(elem, points);
2105 _nl[i]->prepare(tid);
2116 bool have_points = n_points > 0;
2131 sys->reinitElem(elem, tid);
2132 _aux->reinitElem(elem, tid);
2140 const std::vector<Point> & phys_points_in_elem,
2144 "Are you calling this method with a displaced mesh element?");
2148 _assembly[tid][i]->reinitAtPhysical(elem, phys_points_in_elem);
2161 const unsigned int side,
2166 "reinitElemFace with a BoundaryID argument is deprecated because the boundary id was never " 2167 "used. Please call reinitElemFace without the BoundaryID argument instead");
2180 _aux->reinitElemFace(elem, side, tid);
2189 const std::vector<Point> *
const pts,
2190 const std::vector<Real> *
const weights)
2208 _nl[i]->reinitNode(node, tid);
2210 _aux->reinitNode(node, tid);
2222 _nl[i]->reinitNodeFace(node, bnd_id, tid);
2224 _aux->reinitNodeFace(node, bnd_id, tid);
2233 for (
auto & nl :
_nl)
2234 nl->reinitNodes(nodes, tid);
2235 _aux->reinitNodes(nodes, tid);
2244 for (
auto & nl :
_nl)
2245 nl->reinitNodesNeighbor(nodes, tid);
2246 _aux->reinitNodesNeighbor(nodes, tid);
2252 TIME_SECTION(
"reinitScalars", 3,
"Reinitializing Scalar Variables");
2257 for (
auto & nl :
_nl)
2258 nl->reinitScalars(tid, reinit_for_derivative_reordering);
2259 _aux->reinitScalars(tid, reinit_for_derivative_reordering);
2284 _assembly[tid][i]->reinitElemAndNeighbor(elem, side, neighbor, neighbor_side);
2285 _nl[i]->prepareNeighbor(tid);
2289 _aux->prepareNeighbor(tid);
2291 for (
auto & nl :
_nl)
2293 nl->reinitElemFace(elem, side, tid);
2294 nl->reinitNeighborFace(neighbor, neighbor_side, tid);
2296 _aux->reinitElemFace(elem, side, tid);
2297 _aux->reinitNeighborFace(neighbor, neighbor_side, tid);
2306 const auto & displaced_ref_pts =
_assembly[tid][0]->qRuleNeighbor()->get_points();
2326 auto & neighbor =
_assembly[tid][0]->neighbor();
2327 auto & neighbor_side =
_assembly[tid][0]->neighborSide();
2329 if (lower_d_elem_neighbor &&
2332 auto qps =
_assembly[tid][0]->qPointsFaceNeighbor().stdVector();
2333 std::vector<Point> reference_points;
2335 lower_d_elem_neighbor->
dim(), lower_d_elem_neighbor, qps, reference_points);
2348 unsigned int neighbor_side,
2349 const std::vector<Point> & physical_points,
2353 "Are you calling this method with a displaced mesh element?");
2358 _assembly[tid][i]->reinitNeighborAtPhysical(neighbor, neighbor_side, physical_points);
2361 _nl[i]->prepareNeighbor(tid);
2363 _aux->prepareNeighbor(tid);
2369 for (
auto & nl :
_nl)
2370 nl->reinitNeighborFace(neighbor, neighbor_side, tid);
2371 _aux->reinitNeighborFace(neighbor, neighbor_side, tid);
2376 const std::vector<Point> & physical_points,
2380 "Are you calling this method with a displaced mesh element?");
2385 _assembly[tid][i]->reinitNeighborAtPhysical(neighbor, physical_points);
2388 _nl[i]->prepareNeighbor(tid);
2390 _aux->prepareNeighbor(tid);
2396 for (
auto & nl :
_nl)
2397 nl->reinitNeighbor(neighbor, tid);
2398 _aux->reinitNeighbor(neighbor, tid);
2409 std::set<const Elem *> displaced_elements;
2414 for (
const auto & elem : displaced_elements)
2437 for (
auto & nl :
_nl)
2438 nl->subdomainSetup(subdomain, tid);
2452 const std::string & name,
2455 parallel_object_only();
2472 mooseError(
"Unrecognized function functor type");
2478 const std::string & name,
2481 parallel_object_only();
2493 const std::string class_name =
"DefaultNonlinearConvergence";
2497 params.
set<
bool>(
"added_as_default") =
true;
2518 std::istringstream ss(
name);
2522 if (ss >> real_value && ss.eof())
2525 params.
set<
Real>(
"value") = real_value;
2526 addFunction(
"ConstantFunction", ss.str(), params);
2531 std::string vars =
"x,y,z,t,NaN,pi,e";
2532 if (fp.Parse(
name, vars) == -1)
2536 params.
set<std::string>(
"expression") =
name;
2564 mooseError(
"The Convergence object '",
name,
"' does not exist.");
2569 const std::vector<std::shared_ptr<Convergence>> &
2577 const std::string & name,
2580 parallel_object_only();
2595 mooseError(
"No MeshDivision object named ",
name,
" of appropriate type");
2608 mooseDeprecated(
"FEProblemBase::getNonlinearSystem() is deprecated, please use " 2609 "FEProblemBase::getNonlinearSystemBase() \n");
2611 mooseAssert(sys_num <
_nl.size(),
"System number greater than the number of nonlinear systems");
2622 const std::string & name,
2632 std::vector<Distribution *> objs;
2636 .condition<AttribName>(
name)
2639 mooseError(
"Unable to find Distribution with name '" +
name +
"'");
2645 const std::string & name,
2649 for (
auto & sampler : samplers)
2656 std::vector<Sampler *> objs;
2660 .condition<AttribThread>(tid)
2665 "Unable to find Sampler with name '" +
name +
2666 "', if you are attempting to access this object in the constructor of another object then " 2667 "the object being retrieved must occur prior to the caller within the input file.");
2675 const std::set<SubdomainID> *
const active_subdomains)
2678 std::set<SubdomainID> subdomainIDs;
2679 if (active_subdomains->size() == 0)
2682 subdomainIDs.insert(subdomains.begin(), subdomains.end());
2685 subdomainIDs.insert(active_subdomains->begin(), active_subdomains->end());
2691 std::string error_prefix =
"";
2694 curr_sys_ptr =
_aux.get();
2695 other_sys_ptr = sys.get();
2696 error_prefix =
"aux";
2700 mooseError(
"Cannot have an auxiliary variable and a solver variable with the same name: ",
2711 const auto stringifyType = [](
FEType t)
2714 mooseError(
"Mismatching types are specified for ",
2716 "variable with name '",
2719 stringifyType(var.
type()),
2721 stringifyType(
type),
2729 std::set<SubdomainID> varSubdomainIDs;
2730 if (varActiveSubdomains.size() == 0)
2733 varSubdomainIDs.insert(subdomains.begin(), subdomains.end());
2736 varSubdomainIDs.insert(varActiveSubdomains.begin(), varActiveSubdomains.end());
2740 const auto isSubset = std::includes(varSubdomainIDs.begin(),
2741 varSubdomainIDs.end(),
2742 subdomainIDs.begin(),
2743 subdomainIDs.end());
2748 const auto stringifySubdomains = [
this](std::set<SubdomainID> subdomainIDs)
2750 std::stringstream s;
2751 for (
auto const i : subdomainIDs)
2759 if (subdomainName.empty())
2762 s << subdomainName <<
" (" << i <<
")";
2767 const std::string msg =
"Mismatching block-restrictions are specified for " +
2768 error_prefix +
"variable with name '" + var_name +
"': {" +
2769 stringifySubdomains(varSubdomainIDs) +
"} and {" +
2770 stringifySubdomains(subdomainIDs) +
"}";
2785 const std::string & var_name,
2788 parallel_object_only();
2790 const auto order = Utility::string_to_enum<Order>(params.
get<
MooseEnum>(
"order"));
2791 const auto family = Utility::string_to_enum<FEFamily>(params.
get<
MooseEnum>(
"family"));
2792 const auto fe_type =
FEType(order, family);
2794 const auto active_subdomains_vector =
2796 const std::set<SubdomainID> active_subdomains(active_subdomains_vector.begin(),
2797 active_subdomains_vector.end());
2804 SolverSystemName sys_name = params.
get<SolverSystemName>(
"solver_sys");
2806 const auto solver_system_number =
solverSysNum(sys_name);
2807 logAdd(
"Variable", var_name, var_type, params);
2808 _solver_systems[solver_system_number]->addVariable(var_type, var_name, params);
2818 std::pair<bool, unsigned int>
2820 const bool error_if_not_found)
const 2827 "If the variable is in our FEProblem solver system map, then it must be in the " 2828 "solver system we expect");
2829 else if (error_if_not_found)
2831 if (
_aux->hasVariable(var_name) ||
_aux->hasScalarVariable(var_name))
2834 " found. Did you specify an auxiliary variable when you meant to specify a " 2835 "solver variable?");
2839 "'. It does not exist in the solver system(s) or auxiliary system");
2847 const std::string & name,
2849 const unsigned int nl_sys_num,
2850 const std::string & base_name,
2851 bool & reinit_displaced)
2857 reinit_displaced =
true;
2880 const std::string & name,
2883 parallel_object_only();
2886 mooseError(
"You are trying to add a Kernel to a linear variable/system, which is not " 2887 "supported at the moment!");
2896 const std::string & name,
2899 parallel_object_only();
2902 mooseError(
"You are trying to add a HDGKernel to a linear variable/system, which is not " 2903 "supported at the moment!");
2912 const std::string & name,
2915 parallel_object_only();
2945 const std::string & name,
2948 parallel_object_only();
2952 mooseError(
"You are trying to add a ScalarKernel to a linear variable/system, which is not " 2953 "supported at the moment!");
2982 const std::string & name,
2985 parallel_object_only();
2990 "You are trying to add a BoundaryCondition to a linear variable/system, which is not " 2991 "supported at the moment!");
3000 const std::string & name,
3003 parallel_object_only();
3006 mooseError(
"You are trying to add a HDGIntegratedBC to a linear variable/system, which is not " 3007 "supported at the moment!");
3016 const std::string & name,
3019 parallel_object_only();
3023 auto determine_var_param_name = [&
parameters,
this]()
3032 if (!has_secondary_var && !has_primary_var)
3034 "Either a 'secondary_variable' or 'primary_variable' parameter must be supplied for '",
3037 return has_secondary_var ?
"secondary_variable" :
"primary_variable";
3041 const auto nl_sys_num =
3044 mooseError(
"You are trying to add a Constraint to a linear variable/system, which is not " 3045 "supported at the moment!");
3069 const std::string & var_name,
3072 parallel_object_only();
3074 const auto order = Utility::string_to_enum<Order>(params.
get<
MooseEnum>(
"order"));
3075 const auto family = Utility::string_to_enum<FEFamily>(params.
get<
MooseEnum>(
"family"));
3076 const auto fe_type =
FEType(order, family);
3078 const auto active_subdomains_vector =
3080 const std::set<SubdomainID> active_subdomains(active_subdomains_vector.begin(),
3081 active_subdomains_vector.end());
3089 logAdd(
"AuxVariable", var_name, var_type, params);
3090 _aux->addVariable(var_type, var_name, params);
3101 const std::set<SubdomainID> *
const active_subdomains)
3103 parallel_object_only();
3105 mooseDeprecated(
"Please use the addAuxVariable(var_type, var_name, params) API instead");
3110 std::string var_type;
3112 var_type =
"MooseVariableConstMonomial";
3114 var_type =
"MooseVariableScalar";
3116 var_type =
"VectorMooseVariable";
3118 var_type =
"MooseVariable";
3126 if (active_subdomains)
3130 logAdd(
"AuxVariable", var_name, var_type, params);
3131 _aux->addVariable(var_type, var_name, params);
3141 unsigned int components,
3142 const std::set<SubdomainID> *
const active_subdomains)
3144 parallel_object_only();
3146 mooseDeprecated(
"Please use the addAuxVariable(var_type, var_name, params) API instead");
3156 params.
set<
unsigned int>(
"components") = components;
3158 if (active_subdomains)
3162 logAdd(
"Variable", var_name,
"ArrayMooseVariable", params);
3163 _aux->addVariable(
"ArrayMooseVariable", var_name, params);
3174 const std::set<SubdomainID> *
const active_subdomains)
3176 parallel_object_only();
3178 mooseDeprecated(
"Please use the addAuxVariable(var_type, var_name, params) API instead");
3193 params.
set<std::vector<Real>>(
"scaling") = {1};
3194 if (active_subdomains)
3198 logAdd(
"ScalarVariable", var_name,
"MooseVariableScalar", params);
3199 _aux->addVariable(
"MooseVariableScalar", var_name, params);
3206 const std::string & name,
3209 parallel_object_only();
3216 if (!
parameters.
get<std::vector<BoundaryName>>(
"boundary").empty())
3244 const std::string & name,
3247 parallel_object_only();
3276 const std::string & name,
3279 parallel_object_only();
3283 mooseError(
"You are trying to add a DiracKernel to a linear variable/system, which is not " 3284 "supported at the moment!");
3316 const std::string & name,
3319 parallel_object_only();
3323 mooseError(
"You are trying to add a DGKernel to a linear variable/system, which is not " 3324 "supported at the moment!");
3356 const std::string & name,
3370 const std::string & name,
3378 const std::string & name,
3383 addObject<FVInterfaceKernel>(
3389 const std::string & name,
3397 const std::string & name,
3407 const std::string & name,
3410 parallel_object_only();
3414 mooseError(
"You are trying to add a InterfaceKernel to a linear variable/system, which is not " 3415 "supported at the moment!");
3447 const std::string & name,
3448 const VariableName & var_name)
3452 std::string restart_method =
"";
3455 "a checkpoint restart, by IC object '" + ic_name +
"' for variable '" +
name +
"'";
3461 restarted_vars.insert(restarted_vars.end(), nodal_vars.begin(), nodal_vars.end());
3462 restarted_vars.insert(restarted_vars.end(), global_vars.begin(), global_vars.end());
3464 if (std::find(restarted_vars.begin(), restarted_vars.end(), var_name) != restarted_vars.end())
3465 restart_method =
"an Exodus restart, by IC object '" + ic_name +
"' for variable '" +
name +
3466 "' that is also being restarted";
3468 if (!restart_method.empty())
3470 "Initial conditions have been specified during ",
3472 ".\nThis is only allowed if you specify 'allow_initial_conditions_with_restart' to " 3473 "the [Problem], as initial conditions can override restarted fields");
3479 const std::string & name,
3482 parallel_object_only();
3486 const std::string & var_name =
parameters.
get<VariableName>(
"variable");
3501 std::shared_ptr<InitialConditionBase> ic;
3502 if (dynamic_cast<MooseVariable *>(&var))
3504 else if (dynamic_cast<VectorMooseVariable *>(&var))
3506 else if (dynamic_cast<ArrayMooseVariable *>(&var))
3508 else if (dynamic_cast<MooseVariableFVReal *>(&var))
3510 else if (dynamic_cast<MooseLinearVariableFVReal *>(&var))
3513 mooseError(
"Your FE variable in initial condition ",
3515 " must be either of scalar or vector type");
3526 std::shared_ptr<ScalarInitialCondition> ic =
3534 "Variable '", var_name,
"' requested in initial condition '",
name,
"' does not exist.");
3539 const std::string & name,
3542 parallel_object_only();
3546 const std::string & var_name =
parameters.
get<VariableName>(
"variable");
3561 std::shared_ptr<FVInitialConditionBase> ic;
3566 "Your variable for an FVInitialCondition needs to be an a finite volume variable!");
3573 "' requested in finite volume initial condition '",
3575 "' does not exist.");
3581 TIME_SECTION(
"projectSolution", 2,
"Projecting Initial Solutions")
3587 Threads::parallel_reduce(elem_range, cic);
3595 Threads::parallel_reduce(elem_info_range, cfvic);
3599 for (
auto & nl :
_nl)
3600 nl->solution().close();
3601 _aux->solution().close();
3606 Threads::parallel_reduce(bnd_nodes, cbic);
3608 for (
auto & nl :
_nl)
3609 nl->solution().close();
3610 _aux->solution().close();
3618 for (
const auto & ic : ics)
3626 const unsigned int n_SCALAR_dofs = var.
dofIndices().size();
3627 for (
unsigned int i = 0; i < n_SCALAR_dofs; i++)
3638 sys->solution().close();
3639 sys->solution().localize(*sys->system().current_local_solution, sys->dofMap().get_send_list());
3642 _aux->solution().close();
3643 _aux->solution().localize(*
_aux->sys().current_local_solution,
_aux->dofMap().get_send_list());
3651 Threads::parallel_reduce(elem_range, cic);
3654 for (
auto & nl :
_nl)
3655 nl->solution().close();
3656 _aux->solution().close();
3659 Threads::parallel_reduce(bnd_nodes, cbic);
3661 for (
auto & nl :
_nl)
3662 nl->solution().close();
3663 _aux->solution().close();
3671 for (
const auto & ic : ics)
3679 const unsigned int n_SCALAR_dofs = var.
dofIndices().size();
3680 for (
unsigned int i = 0; i < n_SCALAR_dofs; i++)
3689 for (
auto & nl :
_nl)
3691 nl->solution().close();
3692 nl->solution().localize(*nl->system().current_local_solution, nl->dofMap().get_send_list());
3695 _aux->solution().close();
3696 _aux->solution().localize(*
_aux->sys().current_local_solution,
_aux->dofMap().get_send_list());
3699 std::shared_ptr<MaterialBase>
3708 name +=
"_neighbor";
3721 "), but its compute flag is set to true. This indicates that MOOSE is " 3722 "computing this property which may not be desired and produce un-expected " 3743 mooseError(
"FEProblemBase::getMaterialData(): Invalid MaterialDataType ",
type);
3751 "ignore_zeros_in_jacobian",
3752 "We likely cannot preserve the sparsity pattern if ignoring zeros in the Jacobian, which " 3753 "leads to removing those entries from the Jacobian sparsity pattern");
3766 const std::string & name,
3769 parallel_object_only();
3771 auto add_functor_materials = [&](
const auto &
parameters,
const auto &
name)
3776 std::shared_ptr<MaterialBase> material =
3790 add_functor_materials(disp_params,
name +
"_displaced");
3796 const std::string & name,
3804 const std::string & name,
3812 const std::string & mat_name,
3813 const std::string & name,
3816 parallel_object_only();
3841 std::shared_ptr<MaterialBase> material =
3844 bool discrete = !material->getParam<
bool>(
"compute");
3848 if (material->boundaryRestricted() ||
dynamic_cast<FunctorMaterial *
>(material.get()))
3854 for (
auto && warehouse : warehouses)
3855 warehouse->addObject(material, tid);
3867 std::string object_name;
3876 object_name =
name +
"_face";
3877 std::shared_ptr<MaterialBase> face_material =
3883 current_parameters.set<
bool>(
"_neighbor") =
true;
3884 object_name =
name +
"_neighbor";
3885 std::shared_ptr<MaterialBase> neighbor_material =
3894 for (
auto && warehouse : warehouses)
3895 warehouse->addObjects(material, neighbor_material, face_material, tid);
3898 const std::string & base =
parameters.
get<std::string>(
"_moose_base");
3900 const auto param_names =
3905 for (
const auto & p_name : param_names)
3908 p_name.parameter());
3910 p_name.parameter());
3912 p_name.parameter());
3914 primary_name, face_name,
false);
3916 primary_name, neighbor_name,
false);
3927 std::set<MooseVariableFEBase *> needed_moose_vars;
3928 std::unordered_set<unsigned int> needed_mat_props;
3937 for (
const auto id : ids)
3944 needed_moose_vars.insert(current_active_elemental_moose_variables.begin(),
3945 current_active_elemental_moose_variables.end());
3947 needed_mat_props.insert(consumer_needed_mat_props.begin(), consumer_needed_mat_props.end());
3958 auto && elem =
_assembly[tid][0]->elem();
3959 unsigned int n_points =
_assembly[tid][0]->qRule()->n_points();
3962 material_data.
resize(n_points);
3966 material_data.swap(*elem);
3979 const bool swap_stateful,
3980 const std::deque<MaterialBase *> *
const reinit_mats)
3984 auto && elem =
_assembly[tid][0]->elem();
3985 unsigned int side =
_assembly[tid][0]->side();
3986 unsigned int n_points =
_assembly[tid][0]->qRuleFace()->n_points();
3989 bnd_material_data.
resize(n_points);
3991 if (swap_stateful && !bnd_material_data.isSwapped())
3992 bnd_material_data.swap(*elem, side);
3995 bnd_material_data.reset(
3999 bnd_material_data.reinit(*reinit_mats);
4001 bnd_material_data.reinit(
4009 const bool swap_stateful,
4010 const std::deque<MaterialBase *> *
const reinit_mats)
4020 mooseAssert(neighbor,
"neighbor should be non-null");
4022 "The provided blk_id " << blk_id <<
" and neighbor subdomain ID " 4025 unsigned int n_points =
_assembly[tid][0]->qRuleNeighbor()->n_points();
4028 neighbor_material_data.
resize(n_points);
4032 neighbor_material_data.swap(*neighbor, neighbor_side);
4035 neighbor_material_data.reset(
4039 neighbor_material_data.reinit(*reinit_mats);
4041 neighbor_material_data.reinit(
4049 const bool swap_stateful,
4050 const std::deque<MaterialBase *> *
const reinit_mats)
4054 auto && elem =
_assembly[tid][0]->elem();
4055 unsigned int side =
_assembly[tid][0]->side();
4056 unsigned int n_points =
_assembly[tid][0]->qRuleFace()->n_points();
4059 bnd_material_data.
resize(n_points);
4061 if (swap_stateful && !bnd_material_data.isSwapped())
4062 bnd_material_data.swap(*elem, side);
4068 bnd_material_data.reinit(*reinit_mats);
4082 unsigned int side =
_assembly[tid][0]->side();
4083 unsigned int n_points =
_assembly[tid][0]->qRuleFace()->n_points();
4086 bnd_material_data.
resize(n_points);
4088 if (swap_stateful && !bnd_material_data.isSwapped())
4089 bnd_material_data.swap(*elem, side);
4099 auto && elem =
_assembly[tid][0]->elem();
4106 auto && elem =
_assembly[tid][0]->elem();
4107 unsigned int side =
_assembly[tid][0]->side();
4116 unsigned int neighbor_side =
4130 neighbor_side =
_assembly[tid][0]->side();
4131 mooseAssert(neighbor,
"We should have an appropriate value for elem coming from Assembly");
4142 const std::string & name,
4143 const std::string & type,
4147 _console <<
"[DBG] Adding " << system <<
" '" <<
name <<
"' of type " <<
type << std::endl;
4154 const std::string & object_name,
4155 const std::string & var_param_name)
4161 unsigned int sys_num = 0;
4173 if (sys_num ==
_aux->number())
4189 if (sys_num ==
_aux->number())
4198 const std::string & name,
4205 "\" already exists. You may not add a Postprocessor by the same name.");
4212 const std::string & name,
4219 "\" already exists. You may not add a VectorPostprocessor by the same name.");
4226 const std::string & name,
4232 "\" already exists. You may not add a Reporter by the same name.");
4237 std::vector<std::shared_ptr<UserObject>>
4239 const std::string & name,
4242 parallel_object_only();
4244 std::vector<std::shared_ptr<UserObject>> uos;
4252 std::shared_ptr<UserObject> user_object =
4255 uos.push_back(user_object);
4258 user_object->setPrimaryThreadCopy(uos[0].
get());
4279 if (euo || nuo || duo)
4289 if ((guo && !tguo) || muo)
4298 const decltype(uos)::size_type uo_index = uos.front()->needThreadedCopy() ? tid : 0;
4313 std::vector<UserObject *> objs;
4317 .condition<AttribThread>(tid)
4321 mooseError(
"Unable to find user object with name '" +
name +
"'");
4322 mooseAssert(objs.size() == 1,
"Should only find one UO");
4329 std::vector<Positions *> objs;
4333 .condition<AttribName>(
name)
4336 mooseError(
"Unable to find Positions object with name '" +
name +
"'");
4337 mooseAssert(objs.size() == 1,
"Should only find one Positions");
4344 std::vector<UserObject *> objs;
4348 .condition<AttribThread>(0)
4351 return !objs.empty();
4362 std::size_t t_index)
const 4371 std::size_t t_index)
4380 mooseDeprecated(
"FEProblemBase::hasPostprocssor is being removed; use " 4381 "hasPostprocessorValueByName instead.");
4387 const std::string & vector_name,
4388 std::size_t t_index)
const 4396 const std::string & vector_name,
4398 std::size_t t_index)
4408 return getUserObject<VectorPostprocessor>(object_name, tid);
4416 const auto & objects = it.second.getActiveObjects();
4417 for (
const auto & obj : objects)
4418 obj->parentOutputPositionChanged();
4435 TIME_SECTION(
"computeIndicators", 1,
"Computing Indicators");
4439 const auto old_do_derivatives = ADReal::do_derivatives;
4440 ADReal::do_derivatives =
false;
4442 std::vector<std::string>
fields;
4446 for (
const auto & indicator : indicators)
4447 fields.push_back(indicator->name());
4451 for (
const auto & internal_indicator : internal_indicators)
4452 fields.push_back(internal_indicator->name());
4459 _aux->solution().close();
4464 _aux->solution().close();
4467 ADReal::do_derivatives = old_do_derivatives;
4476 TIME_SECTION(
"computeMarkers", 1,
"Computing Markers");
4478 std::vector<std::string>
fields;
4482 for (
const auto & marker : markers)
4483 fields.push_back(marker->name());
4492 for (
const auto & marker : markers)
4493 marker->markerSetup();
4499 _aux->solution().close();
4536 _aux->customSetup(exec_type);
4537 for (
auto & nl :
_nl)
4538 nl->customSetup(exec_type);
4550 std::vector<UserObject *> userobjs;
4552 for (
auto obj : userobjs)
4553 obj->customSetup(exec_type);
4598 std::unique_ptr<NumericVector<Number>> x =
_aux->currentSolution()->clone();
4606 const Real check_tol = 1e-8;
4608 const Real xnorm = x->l2_norm();
4609 *x -= *
_aux->currentSolution();
4610 if (x->l2_norm() > check_tol * xnorm)
4612 const auto & sys =
_aux->system();
4613 const unsigned int n_vars = sys.n_vars();
4614 std::multimap<Real, std::string, std::greater<Real>> ordered_map;
4618 ordered_map.emplace(vnorm, sys.variable_name(i));
4621 std::ostringstream oss;
4622 for (
const auto & [error_norm, var_name] : ordered_map)
4623 oss <<
" {" << var_name <<
", " << error_norm <<
"},\n";
4625 mooseError(
"Aux kernels, user objects appear to have states for aux variables on ",
4627 ".\nVariable error norms in descending order:\n",
4632 if (pp_values.
size() != new_pp_values.
size())
4633 mooseError(
"Second execution for uo/aux state check should not change the number of " 4634 "real reporter values");
4637 pp_values -= new_pp_values;
4638 if (pp_values.
l2_norm() > check_tol * ppnorm)
4641 std::multimap<Real, std::string, std::greater<Real>> ordered_map;
4643 ordered_map.emplace(
std::abs(pp_values(i)), pp_names[i]);
4645 std::ostringstream oss;
4646 for (
const auto & [error_norm, pp_name] : ordered_map)
4647 oss <<
" {" << pp_name <<
", " << error_norm <<
"},\n";
4649 mooseError(
"Aux kernels, user objects appear to have states for real reporter values on ",
4651 ".\nErrors of real reporter values in descending order:\n",
4661 std::vector<UserObject *> objs;
4662 query.queryInto(objs);
4667 for (
auto obj : objs)
4668 if (obj->primaryThreadCopy())
4669 obj->primaryThreadCopy()->threadJoin(*obj);
4675 for (
auto obj : objs)
4677 if (isgen && dynamic_cast<ThreadedGeneralUserObject *>(obj))
4683 _console <<
"[DBG] Initializing, executing & finalizing general UO '" << obj->name()
4708 auto reporter =
dynamic_cast<Reporter *
>(obj);
4717 const std::string & name)
4724 .condition<AttribExecOns>(
type)
4745 TIME_SECTION(
"computeUserObjects", 1,
"Computing User Objects");
4756 std::vector<UserObject *> uos;
4758 std::set<int> execution_groups;
4759 for (
const auto & uo : uos)
4760 execution_groups.insert(uo->getParam<
int>(
"execution_order_group"));
4763 for (
const auto execution_group : execution_groups)
4767 std::vector<GeneralUserObject *> genobjs;
4770 std::vector<UserObject *> userobjs;
4776 .queryInto(userobjs);
4778 std::vector<UserObject *> tgobjs;
4783 std::vector<UserObject *> nodal;
4786 std::vector<MortarUserObject *> mortar;
4789 if (userobjs.empty() && genobjs.empty() && tgobjs.empty() && nodal.empty() && mortar.empty())
4798 for (
auto obj : userobjs)
4799 obj->residualSetup();
4800 for (
auto obj : nodal)
4801 obj->residualSetup();
4802 for (
auto obj : mortar)
4803 obj->residualSetup();
4804 for (
auto obj : tgobjs)
4805 obj->residualSetup();
4806 for (
auto obj : genobjs)
4807 obj->residualSetup();
4811 for (
auto obj : userobjs)
4812 obj->jacobianSetup();
4813 for (
auto obj : nodal)
4814 obj->jacobianSetup();
4815 for (
auto obj : mortar)
4816 obj->jacobianSetup();
4817 for (
auto obj : tgobjs)
4818 obj->jacobianSetup();
4819 for (
auto obj : genobjs)
4820 obj->jacobianSetup();
4823 for (
auto obj : userobjs)
4827 if (!userobjs.empty())
4846 for (
const auto & uo : userobjs)
4847 if (
auto euo = dynamic_cast<const ElementUserObject *>(uo);
4848 euo && euo->hasWritableCoupledVariables())
4850 _aux->solution().close();
4851 _aux->system().update();
4859 for (
auto obj : nodal)
4869 for (
const auto & uo : nodal)
4870 if (
auto nuo = dynamic_cast<const NodalUserObject *>(uo);
4871 nuo && nuo->hasWritableCoupledVariables())
4873 _aux->solution().close();
4874 _aux->system().update();
4880 for (
auto obj : mortar)
4882 if (!mortar.empty())
4884 auto create_and_run_mortar_functors = [
this,
type, &mortar](
const bool displaced)
4888 for (
const auto & mortar_interface : mortar_interfaces)
4890 const auto primary_secondary_boundary_pair = mortar_interface.first;
4891 auto mortar_uos_to_execute =
4893 primary_secondary_boundary_pair.second,
4896 const auto & mortar_generation_object = mortar_interface.second;
4898 auto *
const subproblem = displaced
4900 : static_cast<SubProblem *>(
this);
4902 mortar_generation_object,
4906 subproblem->assembly(0, 0));
4912 create_and_run_mortar_functors(
false);
4914 create_and_run_mortar_functors(
true);
4916 for (
auto obj : mortar)
4921 for (
auto obj : tgobjs)
4923 std::vector<GeneralUserObject *> tguos_zero;
4927 .queryInto(tguos_zero);
4928 for (
auto obj : tguos_zero)
4930 std::vector<GeneralUserObject *> tguos;
4931 auto q =
query.clone()
4957 TIME_SECTION(
"executeControls", 1,
"Executing Controls");
4963 for (
const auto & it : controls_wh.getActiveObjects())
4968 std::vector<std::string> & dependent_controls = it->getDependencies();
4969 for (
const auto & depend_name : dependent_controls)
4971 if (controls_wh.hasActiveObject(depend_name))
4973 auto dep_control = controls_wh.getActiveObject(depend_name);
4974 resolver.
addEdge(dep_control, it);
4979 "\" was not created, did you make a " 4980 "spelling mistake or forget to include it " 4981 "in your input file?");
4987 if (!ordered_controls.empty())
4991 for (
const auto & control : ordered_controls)
5004 std::vector<Sampler *> objects;
5008 .condition<AttribThread>(tid)
5010 .queryInto(objects);
5012 if (!objects.empty())
5014 TIME_SECTION(
"executeSamplers", 1,
"Executing Samplers");
5015 FEProblemBase::objectSetupHelper<Sampler>(objects, exec_type);
5016 FEProblemBase::objectExecuteHelper<Sampler>(objects);
5024 TIME_SECTION(
"updateActiveObjects", 5,
"Updating Active Objects");
5028 for (
auto & nl :
_nl)
5029 nl->updateActive(tid);
5030 _aux->updateActive(tid);
5057 TIME_SECTION(
"reinitBecauseOfGhostingOrNewGeomObjects",
5059 "Reinitializing Because of Geometric Search Objects");
5083 const std::string & name,
5086 parallel_object_only();
5088 const auto nl_sys_num =
5094 mooseError(
"You are trying to add a DGKernel to a linear variable/system, which is not " 5095 "supported at the moment!");
5108 for (
auto & nl :
_nl)
5114 const std::string & name,
5117 parallel_object_only();
5143 std::shared_ptr<Indicator> indicator =
5146 std::shared_ptr<InternalSideIndicator> isi =
5157 const std::string & name,
5160 parallel_object_only();
5194 const std::string & name,
5197 parallel_object_only();
5226 multi_app->setupPositions();
5231 std::shared_ptr<TransientMultiApp> trans_multi_app =
5233 if (trans_multi_app)
5249 std::shared_ptr<MultiApp>
5260 std::string string_direction;
5262 string_direction =
" To ";
5263 else if (from_multiapp)
5264 string_direction =
" From ";
5266 string_direction =
" Between ";
5274 TIME_SECTION(
"execMultiAppTransfers", 1,
"Executing Transfers");
5281 <<
"MultiApps" << COLOR_DEFAULT <<
":" << std::endl;
5284 {
"Name",
"Type",
"From",
"To"});
5287 for (
const auto & transfer : transfers)
5291 table.addRow(multiapp_transfer->name(),
5292 multiapp_transfer->type(),
5293 multiapp_transfer->getFromName(),
5294 multiapp_transfer->getToName());
5301 for (
const auto & transfer : transfers)
5304 transfer->execute();
5311 << COLOR_DEFAULT << std::endl;
5318 << COLOR_DEFAULT << std::endl;
5322 std::vector<std::shared_ptr<Transfer>>
5333 std::vector<std::shared_ptr<Transfer>>
5359 const std::vector<MooseSharedPointer<MultiApp>> & multi_apps =
5363 for (
const auto & multi_app : multi_apps)
5364 multi_app->preTransfer(
_dt,
_time);
5373 if (multi_apps.size())
5375 TIME_SECTION(
"execMultiApps", 1,
"Executing MultiApps",
false);
5379 << COLOR_DEFAULT << std::endl;
5381 bool success =
true;
5383 for (
const auto & multi_app : multi_apps)
5385 success = multi_app->solveStep(
_dt,
_time, auto_advance);
5400 << COLOR_DEFAULT << std::endl;
5415 for (
const auto & multi_app : multi_apps)
5416 multi_app->finalize();
5424 for (
const auto & multi_app : multi_apps)
5425 multi_app->postExecute();
5433 if (multi_apps.size())
5434 for (
const auto & multi_app : multi_apps)
5435 multi_app->incrementTStep(
_time);
5443 if (multi_apps.size())
5446 _console << COLOR_CYAN <<
"\nAdvancing MultiApps on " <<
type.name() << COLOR_DEFAULT
5449 for (
const auto & multi_app : multi_apps)
5450 multi_app->finishStep(recurse_through_multiapp_levels);
5455 _console << COLOR_CYAN <<
"Finished Advancing MultiApps on " <<
type.name() <<
"\n" 5456 << COLOR_DEFAULT << std::endl;
5465 if (multi_apps.size())
5467 TIME_SECTION(
"backupMultiApps", 5,
"Backing Up MultiApp");
5470 _console << COLOR_CYAN <<
"\nBacking Up MultiApps on " <<
type.name() << COLOR_DEFAULT
5473 for (
const auto & multi_app : multi_apps)
5474 multi_app->backup();
5479 _console << COLOR_CYAN <<
"Finished Backing Up MultiApps on " <<
type.name() <<
"\n" 5480 << COLOR_DEFAULT << std::endl;
5489 if (multi_apps.size())
5494 _console << COLOR_CYAN <<
"\nRestoring Multiapps on " <<
type.name()
5495 <<
" because of solve failure!" << COLOR_DEFAULT << std::endl;
5497 _console << COLOR_CYAN <<
"\nRestoring MultiApps on " <<
type.name() << COLOR_DEFAULT
5501 for (
const auto & multi_app : multi_apps)
5502 multi_app->restore(force);
5507 _console << COLOR_CYAN <<
"Finished Restoring MultiApps on " <<
type.name() <<
"\n" 5508 << COLOR_DEFAULT << std::endl;
5519 for (
const auto & multi_app : multi_apps)
5520 smallest_dt =
std::min(smallest_dt, multi_app->computeDT());
5530 TIME_SECTION(
"execTransfers", 3,
"Executing Transfers");
5534 for (
const auto & transfer : transfers)
5535 transfer->execute();
5541 const std::string & name,
5544 parallel_object_only();
5575 std::shared_ptr<MultiApp> multiapp;
5586 exec_enum = multiapp->getParam<
ExecFlagEnum>(
"execute_on");
5594 std::shared_ptr<MultiAppTransfer> multi_app_transfer =
5596 if (multi_app_transfer)
5613 if (sys->hasVariable(var_name))
5615 if (
_aux->hasVariable(var_name))
5625 if (sys->hasVariable(var_name))
5633 const std::string & var_name,
5645 if (sys->hasVariable(var_name))
5646 return sys->getFieldVariable<
Real>(tid, var_name);
5647 if (
_aux->hasVariable(var_name))
5648 return _aux->getFieldVariable<
Real>(tid, var_name);
5657 if (sys->hasVariable(var_name))
5658 return sys->getActualFieldVariable<
Real>(tid, var_name);
5659 if (
_aux->hasVariable(var_name))
5660 return _aux->getActualFieldVariable<
Real>(tid, var_name);
5669 if (sys->hasVariable(var_name))
5671 if (
_aux->hasVariable(var_name))
5681 if (sys->hasVariable(var_name))
5683 if (
_aux->hasVariable(var_name))
5693 if (sys->hasScalarVariable(var_name))
5695 if (
_aux->hasScalarVariable(var_name))
5705 if (sys->hasScalarVariable(var_name))
5706 return sys->getScalarVariable(tid, var_name);
5707 if (
_aux->hasScalarVariable(var_name))
5708 return _aux->getScalarVariable(tid, var_name);
5719 else if (
_aux->hasVariable(var_name) ||
_aux->hasScalarVariable(var_name))
5720 return _aux->system();
5722 mooseError(
"Unable to find a system containing the variable " + var_name);
5824 mat->setActiveProperties(mat_prop_ids);
5826 mat->setActiveProperties(mat_prop_ids);
5828 mat->setActiveProperties(mat_prop_ids);
5848 #ifdef LIBMESH_ENABLE_AMR 5858 const std::string & redistributer_name,
5859 const bool use_displaced_mesh)
5863 redistribute_params.
set<std::string>(
"for_whom") = this->
name();
5867 redistribute_params.
set<
bool>(
"use_displaced_mesh") = use_displaced_mesh;
5870 std::shared_ptr<RedistributeProperties> redistributer =
5872 "RedistributeProperties", redistributer_name, redistribute_params);
5886 add_redistributer(
_mesh,
"mesh_property_redistributer",
false);
5888 add_redistributer(
_displaced_problem->mesh(),
"displaced_mesh_property_redistributer",
true);
5890 #endif // LIBMESH_ENABLE_AMR 5910 mooseError(
"Max quadrature points per element assumptions made in some code (e.g. Coupleable ",
5911 "and MaterialPropertyInterface classes) have been violated.\n",
5912 "Complain to Moose developers to have constMaxQpsPerElem increased from ",
5920 _zero[tid].resize(max_qpts, 0);
5963 const bool allow_negative_qweights)
5972 if (order < _aux->getMinQuadratureOrder())
5973 order =
_aux->getMinQuadratureOrder();
5977 volume_order = order;
5985 type, order, volume_order, face_order, block, allow_negative_qweights);
5989 type, order, volume_order, face_order, block, allow_negative_qweights);
6000 mooseError(
"Someone told us (the FEProblemBase) to trust the user coupling matrix, but we " 6001 "haven't been provided a coupling matrix!");
6022 _cm[i] = std::move(cm);
6029 mooseError(
"Someone told us (the FEProblemBase) to trust the user coupling matrix, but we " 6030 "haven't been provided a coupling matrix!");
6038 TIME_SECTION(
"setNonlocalCouplingMatrix", 5,
"Setting Nonlocal Coupling Matrix");
6041 mooseError(
"Nonlocal kernels are weirdly stored on the FEProblem so we don't currently support " 6042 "multiple nonlinear systems with nonlocal kernels.");
6046 auto & nl =
_nl[nl_sys_num];
6048 unsigned int n_vars = nl->nVariables();
6049 nonlocal_cm.resize(
n_vars);
6050 const auto & vars = nl->getVariables(0);
6053 for (
const auto & ivar : vars)
6055 for (
const auto & kernel : nonlocal_kernel)
6057 for (
unsigned int i = ivar->number(); i < ivar->number() + ivar->count(); ++i)
6058 if (i == kernel->variable().number())
6059 for (
const auto & jvar : vars)
6064 unsigned int j = jvar->number();
6065 nonlocal_cm(i, j) = 1;
6069 for (
const auto & integrated_bc : nonlocal_integrated_bc)
6071 for (
unsigned int i = ivar->number(); i < ivar->number() + ivar->count(); ++i)
6072 if (i == integrated_bc->variable().number())
6073 for (
const auto & jvar : vars)
6078 unsigned int j = jvar->number();
6079 nonlocal_cm(i, j) = 1;
6089 const unsigned int jvar,
6090 const unsigned int nl_sys)
const 6092 return (*
_cm[nl_sys])(ivar, jvar);
6095 std::vector<std::pair<MooseVariableFEBase *, MooseVariableFEBase *>> &
6098 return _assembly[tid][nl_sys]->couplingEntries();
6101 std::vector<std::pair<MooseVariableFEBase *, MooseVariableFEBase *>> &
6104 return _assembly[tid][nl_sys]->nonlocalCouplingEntries();
6113 TIME_SECTION(
"init", 2,
"Initializing");
6129 unsigned int n_vars = nl->nVariables();
6131 TIME_SECTION(
"fillCouplingMatrix", 3,
"Filling Coupling Matrix");
6136 cm = std::make_unique<CouplingMatrix>(
n_vars);
6137 for (
unsigned int i = 0; i <
n_vars; i++)
6143 cm = std::make_unique<CouplingMatrix>(
n_vars);
6144 for (
unsigned int i = 0; i <
n_vars; i++)
6145 for (
unsigned int j = 0; j <
n_vars; j++)
6155 nl->dofMap()._dof_coupling = cm.get();
6161 nl->dofMap()._dof_coupling =
nullptr;
6163 nl->dofMap().attach_extra_sparsity_function(&
extraSparsity, nl.get());
6164 nl->dofMap().attach_extra_send_list_function(&
extraSendList, nl.get());
6168 mooseError(
"No variables specified in nonlinear system '", nl->name(),
"'.");
6190 for (
auto & nl :
_nl)
6192 nl->turnOffJacobian();
6210 TIME_SECTION(
"EquationSystems::Init", 2,
"Initializing Equation Systems");
6232 "Coupling matrix not set for system " 6234 <<
". This should only happen if a preconditioner was not setup for this system");
6247 std::istringstream ss(nl_sys_name);
6248 unsigned int nl_sys_num;
6249 if (!(ss >> nl_sys_num) || !ss.eof())
6258 std::istringstream ss(linear_sys_name);
6259 unsigned int linear_sys_num;
6260 if (!(ss >> linear_sys_num) || !ss.eof())
6263 return linear_sys_num;
6269 std::istringstream ss(solver_sys_name);
6270 unsigned int solver_sys_num;
6271 if (!(ss >> solver_sys_num) || !ss.eof())
6275 mooseError(
"The solver system number was requested for system '" + solver_sys_name,
6276 "' but this system does not exist in the Problem. Systems can be added to the " 6277 "problem using the 'nl_sys_names' parameter.\nSystems in the Problem: " +
6279 solver_sys_num = search->second;
6282 return solver_sys_num;
6289 if (solver_sys->hasVariable(variable_name))
6290 return solver_sys->number();
6291 mooseAssert(
_aux,
"Should have an auxiliary system");
6292 if (
_aux->hasVariable(variable_name))
6293 return _aux->number();
6297 "' was not found in any solver (nonlinear/linear) or auxiliary system");
6303 TIME_SECTION(
"solve", 1,
"Solving",
false);
6317 #if PETSC_RELEASE_LESS_THAN(3, 12, 0) 6356 #if !PETSC_RELEASE_LESS_THAN(3, 12, 0) 6358 LibmeshPetscCall(PetscOptionsPop());
6375 TIME_SECTION(
"checkExceptionAndStopSolve", 5);
6396 <<
"To recover, the solution will fail and then be re-attempted with a reduced time " 6411 _aux->solution().close();
6425 mooseError(
"The following parallel-communicated exception was detected during " +
6428 "\nBecause this did not occur during residual evaluation, there" 6429 " is no way to handle this, so the solution is aborting.\n");
6437 ADReal::do_derivatives =
true;
6462 TIME_SECTION(
"solve", 1,
"Solving",
false);
6469 #if PETSC_RELEASE_LESS_THAN(3, 12, 0) 6471 options, solver_params));
6489 #if !PETSC_RELEASE_LESS_THAN(3, 12, 0) 6491 LibmeshPetscCall(PetscOptionsPop());
6507 return _nl[nl_sys_num]->nNonlinearIterations();
6513 return _nl[nl_sys_num]->nLinearIterations();
6519 return _nl[nl_sys_num]->finalNonlinearResidual();
6525 return _nl[nl_sys_num]->computingPreSMOResidual();
6531 TIME_SECTION(
"copySolutionsBackwards", 3,
"Copying Solutions Backward");
6534 sys->copySolutionsBackwards();
6535 _aux->copySolutionsBackwards();
6541 TIME_SECTION(
"advanceState", 5,
"Advancing State");
6544 sys->copyOldSolutions();
6545 _aux->copyOldSolutions();
6571 TIME_SECTION(
"restoreSolutions", 5,
"Restoring Solutions");
6574 sys->restoreSolutions();
6575 _aux->restoreSolutions();
6584 TIME_SECTION(
"saveOldSolutions", 5,
"Saving Old Solutions");
6587 sys->saveOldSolutions();
6588 _aux->saveOldSolutions();
6594 TIME_SECTION(
"restoreOldSolutions", 5,
"Restoring Old Solutions");
6597 sys->restoreOldSolutions();
6598 _aux->restoreOldSolutions();
6604 TIME_SECTION(
"outputStep", 1,
"Outputting");
6640 TIME_SECTION(
"onTimestepBegin", 2);
6642 for (
auto & nl :
_nl)
6643 nl->onTimestepBegin();
6659 switch (state.
state)
6668 mooseError(
"Unhandled state ", state.
state,
" in FEProblemBase::getTimeFromStateArg");
6674 const std::string & name,
6677 parallel_object_only();
6689 _aux->addDotVectors();
6690 for (
auto & nl :
_nl)
6692 nl->addDotVectors();
6694 auto tag_udot = nl->getTimeIntegrators()[0]->uDotFactorTag();
6695 if (!nl->hasVector(tag_udot))
6696 nl->associateVectorToTag(*nl->solutionUDot(), tag_udot);
6697 auto tag_udotdot = nl->getTimeIntegrators()[0]->uDotDotFactorTag();
6699 nl->associateVectorToTag(*nl->solutionUDotDot(), tag_udotdot);
6709 const std::string & name,
6712 parallel_object_only();
6715 mooseError(
"Vector bounds cannot be used with LinearSystems!");
6721 for (
auto & nl :
_nl)
6722 nl->setPredictor(predictor);
6746 residual->scale(-1.0);
6748 return residual->l2_norm();
6754 TIME_SECTION(
"computeResidualL2Norm", 2,
"Computing L2 Norm of Residual");
6758 for (
auto sys :
_nl)
6778 parallel_object_only();
6780 TIME_SECTION(
"computeResidualSys", 5);
6798 const unsigned int nl_sys_num)
6807 mooseAssert(
_fe_vector_tags.empty(),
"This should be empty indicating a clean starting state");
6830 "This should be empty indicating a clean starting state");
6842 for (
auto & tag : tags)
6860 for (
auto index :
make_range(matrix.row_start(), matrix.row_stop()))
6861 matrix.add(index, index, 0);
6864 _aux->zeroVariablesForResidual();
6888 for (
unsigned int tid = 0; tid <
n_threads; tid++)
6893 _aux->residualSetup();
6970 mooseError(
"An unhandled MooseException was raised during residual computation. Please " 6971 "contact the MOOSE team for assistance.");
6978 const std::set<TagID> & tags)
6980 parallel_object_only();
6982 TIME_SECTION(
"computeResidualInternal", 1);
7003 mooseError(
"An unhandled MooseException was raised during residual computation. Please " 7004 "contact the MOOSE team for assistance.");
7013 TIME_SECTION(
"computeResidualType", 5);
7034 mooseError(
"An unhandled MooseException was raised during residual computation. Please " 7035 "contact the MOOSE team for assistance.");
7042 auto create_exception_message =
7043 [&calling_method](
const std::string & exception_type,
const auto & exception)
7045 return std::string(
"A " + exception_type +
" was raised during FEProblemBase::" +
7046 calling_method +
"\n" + std::string(exception.what()));
7055 setException(create_exception_message(
"libMesh::LogicError", e));
7059 setException(create_exception_message(
"MooseException", e));
7061 catch (
const MetaPhysicL::LogicError & e)
7077 mooseError(create_exception_message(
"libMesh::PetscSolverException", e));
7079 catch (
const std::exception & e)
7081 const auto message = create_exception_message(
"std::exception", e);
7094 parallel_object_only();
7100 TIME_SECTION(
"computeResidualTags", 5,
"Computing Residual");
7102 ADReal::do_derivatives =
false;
7106 _aux->zeroVariablesForResidual();
7120 for (
unsigned int tid = 0; tid <
n_threads; tid++)
7125 _aux->residualSetup();
7196 const unsigned int nl_sys_num)
7203 for (
auto & tag : tags)
7212 const std::set<TagID> & tags)
7214 TIME_SECTION(
"computeJacobianInternal", 1);
7234 TIME_SECTION(
"computeJacobianTags", 5,
"Computing Jacobian");
7236 for (
auto tag : tags)
7245 for (
auto index :
make_range(matrix.row_start(), matrix.row_stop()))
7246 matrix.add(index, index, 0);
7249 _aux->zeroVariablesForJacobian();
7265 for (
unsigned int tid = 0; tid <
n_threads; tid++)
7270 _aux->jacobianSetup();
7278 for (
unsigned int tid = 0; tid <
n_threads; tid++)
7325 const unsigned int nl_sys_num)
7327 TIME_SECTION(
"computeTransientImplicitJacobian", 2);
7349 JacobianBlock jac_block(precond_system, jacobian, ivar, jvar);
7350 std::vector<JacobianBlock *> blocks = {&jac_block};
7365 "I expect these system numbers to be the same");
7370 TIME_SECTION(
"computeBounds", 1,
"Computing Bounds");
7379 _aux->residualSetup();
7403 const bool compute_gradients)
7405 TIME_SECTION(
"computeLinearSystemSys", 5);
7429 const std::set<TagID> & vector_tags,
7430 const std::set<TagID> & matrix_tags,
7431 const bool compute_gradients)
7433 TIME_SECTION(
"computeLinearSystemTags", 5,
"Computing Linear System");
7440 for (
const auto tag : matrix_tags)
7459 _aux->jacobianSetup();
7472 _console <<
"\nA MooseException was raised during Auxiliary variable computation.\n" 7473 <<
"The next solve will fail, the timestep will be reduced, and we will try again.\n" 7510 "I expect these system numbers to be the same");
7513 for (
unsigned int i = 0; i <
subspaceDim(
"NearNullSpace"); ++i)
7515 std::stringstream postfix;
7516 postfix <<
"_" << i;
7517 std::string modename =
"NearNullSpace" + postfix.str();
7527 "I expect these system numbers to be the same");
7529 for (
unsigned int i = 0; i <
subspaceDim(
"NullSpace"); ++i)
7531 std::stringstream postfix;
7532 postfix <<
"_" << i;
7542 "I expect these system numbers to be the same");
7544 for (
unsigned int i = 0; i <
subspaceDim(
"TransposeNullSpace"); ++i)
7546 std::stringstream postfix;
7547 postfix <<
"_" << i;
7557 bool & changed_search_direction,
7558 bool & changed_new_soln)
7561 "I expect these system numbers to be the same");
7572 TIME_SECTION(
"computePostCheck", 2,
"Computing Post Check");
7587 std::unique_ptr<NumericVector<Number>> ghosted_solution =
7589 ghosted_search_direction =
7593 *ghosted_solution = new_soln;
7594 *ghosted_search_direction = search_direction;
7605 new_soln = old_soln;
7606 new_soln.
add(-damping, search_direction);
7607 changed_new_soln =
true;
7614 if (changed_new_soln)
7615 *ghosted_solution = new_soln;
7617 bool updated_solution =
updateSolution(new_soln, *ghosted_solution);
7618 if (updated_solution)
7619 changed_new_soln =
true;
7626 _aux->copyCurrentIntoPreviousNL();
7630 changed_search_direction =
false;
7644 TIME_SECTION(
"computeDamping", 1,
"Computing Damping");
7685 parallel_object_only();
7694 TIME_SECTION(
"updateGeometricSearch", 3,
"Updating Geometric Search");
7705 TIME_SECTION(
"updateMortarMesh", 5,
"Updating Mortar Mesh");
7714 const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
7715 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
7719 const bool correct_edge_dropping,
7720 const Real minimum_projection_angle)
7726 primary_secondary_subdomain_pair,
7731 correct_edge_dropping,
7732 minimum_projection_angle);
7735 primary_secondary_subdomain_pair,
7740 correct_edge_dropping,
7741 minimum_projection_angle);
7746 const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
7747 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
7748 bool on_displaced)
const 7751 primary_secondary_boundary_pair, primary_secondary_subdomain_pair, on_displaced);
7756 const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
7757 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
7761 primary_secondary_boundary_pair, primary_secondary_subdomain_pair, on_displaced);
7775 TIME_SECTION(
"possiblyRebuildGeomSearchPatches", 5,
"Rebuilding Geometric Search Patches");
7809 libmesh_fallthrough();
7815 _console <<
"\n\nUpdating geometric search patches\n" << std::endl;
7831 #ifdef LIBMESH_ENABLE_AMR 7840 mooseError(
"HFEM does not support mesh adaptivity currently.");
7842 TIME_SECTION(
"initialAdaptMesh", 2,
"Performing Initial Adaptivity");
7844 for (
unsigned int i = 0; i < n; i++)
7860 _console <<
"Mesh unchanged, skipping remaining steps..." << std::endl;
7876 TIME_SECTION(
"adaptMesh", 3,
"Adapting Mesh");
7880 bool mesh_changed =
false;
7882 for (
unsigned int i = 0; i < cycles_per_step; ++i)
7885 mooseError(
"HFEM does not support mesh adaptivity currently.");
7891 bool mesh_changed_this_step;
7894 if (mesh_changed_this_step)
7896 mesh_changed =
true;
7903 _console <<
"Mesh unchanged, skipping remaining steps..." << std::endl;
7916 return mesh_changed;
7918 #endif // LIBMESH_ENABLE_AMR 7932 data[tid] = &storage.getMaterialData(tid);
7939 for (
unsigned int i = 0; i <
n_threads; ++i)
7951 TIME_SECTION(
"updateMeshXFEM", 5,
"Updating XFEM");
7953 bool updated =
false;
7956 if (
_xfem->updateHeal())
7973 TIME_SECTION(
"meshChanged", 3,
"Handling Mesh Changes");
7981 TIME_SECTION(
"meshChangedHelper", 5);
7999 if (intermediate_change)
8065 Threads::parallel_reduce(range, pmp);
8073 for (
const auto & elem : range)
8086 Threads::parallel_reduce(range, pmp);
8090 for (
const auto & elem : range)
8093 for (
auto && child : coarsened_children)
8121 Threads::parallel_reduce(elem_range, cmt);
8123 cmt(elem_range,
true);
8129 TIME_SECTION(
"checkProblemIntegrity", 5);
8138 std::set<SubdomainID> blocks;
8141 blocks = mesh_subdomains;
8144 blocks = mesh_subdomains;
8150 "Subdomain \"" + subdomain_name +
"\" not found in mesh.");
8160 "Subdomain \"" + subdomain_name +
"\" not found in mesh.");
8163 if (!blocks.empty())
8164 for (
auto & nl :
_nl)
8165 nl->checkKernelCoverage(blocks);
8170 #ifdef LIBMESH_ENABLE_AMR 8175 _console <<
"Using EXPERIMENTAL Stateful Material Property projection with Adaptivity!\n" 8180 std::set<SubdomainID> local_mesh_subs(mesh_subdomains);
8189 bool check_material_coverage =
false;
8191 for (
const auto &
id : ids)
8193 local_mesh_subs.erase(
id);
8194 check_material_coverage =
true;
8205 "Subdomain \"" + subdomain_name +
"\" not found in mesh.");
8206 local_mesh_subs.erase(
id);
8211 std::set<SubdomainID> blocks(local_mesh_subs);
8217 "Subdomain \"" + subdomain_name +
"\" not found in mesh.");
8220 for (
const auto id : blocks)
8221 local_mesh_subs.erase(
id);
8226 for (
auto subdomain_id : mortar_subdomain_ids)
8227 local_mesh_subs.erase(subdomain_id);
8230 if (check_material_coverage && !local_mesh_subs.empty())
8232 std::stringstream extra_subdomain_ids;
8234 std::copy(local_mesh_subs.begin(),
8235 local_mesh_subs.end(),
8236 std::ostream_iterator<unsigned int>(extra_subdomain_ids,
" "));
8238 std::vector<SubdomainID> local_mesh_subs_vec(local_mesh_subs.begin(),
8239 local_mesh_subs.end());
8241 mooseError(
"The following blocks from your input mesh do not contain an active material: " +
8242 extra_subdomain_ids.str() +
8244 ")\nWhen ANY mesh block contains a Material object, " 8245 "all blocks must contain a Material object.\n");
8255 for (
const auto & material : materials)
8256 material->checkStatefulSanity();
8286 bool mesh_has_second_order_elements =
false;
8292 mesh_has_second_order_elements =
true;
8302 if (mesh_has_second_order_elements)
8304 const std::vector<std::string> & displacement_variables =
8307 for (
const auto & var_name : displacement_variables)
8315 mooseError(
"Error: mesh has SECOND order elements, so all displacement variables must be " 8327 std::set<SubdomainID> user_objects_blocks;
8331 std::set<std::string> names;
8333 std::vector<UserObject *> objects;
8336 for (
const auto & obj : objects)
8337 names.insert(obj->name());
8340 std::set<SubdomainID> difference;
8341 std::set_difference(user_objects_blocks.begin(),
8342 user_objects_blocks.end(),
8343 mesh_subdomains.begin(),
8344 mesh_subdomains.end(),
8345 std::inserter(difference, difference.end()));
8347 if (!difference.empty())
8349 std::ostringstream oss;
8350 oss <<
"One or more UserObjects is referencing a nonexistent block:\n";
8351 for (
const auto &
id : difference)
8359 const std::map<
SubdomainID, std::vector<std::shared_ptr<MaterialBase>>> & materials_map)
8361 for (
const auto & it : materials_map)
8364 std::set<std::string> block_depend_props, block_supplied_props;
8366 for (
const auto & mat1 : it.second)
8368 const std::set<std::string> & depend_props = mat1->getRequestedItems();
8369 block_depend_props.insert(depend_props.begin(), depend_props.end());
8371 auto & alldeps = mat1->getMatPropDependencies();
8372 for (
auto & dep : alldeps)
8374 block_depend_props.insert(*
name);
8377 for (
const auto & mat2 : it.second)
8379 const std::set<std::string> & supplied_props = mat2->MaterialBase::getSuppliedItems();
8380 block_supplied_props.insert(supplied_props.begin(), supplied_props.end());
8389 std::set<std::string> difference;
8390 std::set_difference(block_depend_props.begin(),
8391 block_depend_props.end(),
8392 block_supplied_props.begin(),
8393 block_supplied_props.end(),
8394 std::inserter(difference, difference.end()));
8396 if (!difference.empty())
8398 std::ostringstream oss;
8399 oss <<
"One or more Material Properties were not supplied on block ";
8401 if (subdomain_name.length() > 0)
8402 oss << subdomain_name <<
" (" << it.first <<
")";
8406 for (
const auto &
name : difference)
8407 oss <<
name <<
"\n";
8413 for (
const auto & it : materials_map)
8415 const auto & materials = it.second;
8416 std::set<std::string> inner_supplied, outer_supplied;
8418 for (
const auto & outer_mat : materials)
8421 outer_supplied = outer_mat->getSuppliedItems();
8422 inner_supplied.clear();
8425 std::map<std::string, std::set<std::string>> prop_to_mat;
8426 for (
const auto &
name : outer_supplied)
8427 prop_to_mat[
name].insert(outer_mat->name());
8429 for (
const auto & inner_mat : materials)
8431 if (outer_mat == inner_mat)
8435 auto outer_mat_type = outer_mat->type();
8436 auto inner_mat_type = inner_mat->type();
8441 if (outer_mat_type == inner_mat_type && outer_mat_type != outer_mat->type() &&
8442 inner_mat_type != inner_mat->type())
8445 inner_supplied.insert(inner_mat->getSuppliedItems().begin(),
8446 inner_mat->getSuppliedItems().end());
8448 for (
const auto & inner_supplied_name : inner_supplied)
8449 prop_to_mat[inner_supplied_name].insert(inner_mat->name());
8453 std::set<std::string> intersection;
8454 std::set_intersection(outer_supplied.begin(),
8455 outer_supplied.end(),
8456 inner_supplied.begin(),
8457 inner_supplied.end(),
8458 std::inserter(intersection, intersection.end()));
8460 if (!intersection.empty())
8462 std::ostringstream oss;
8463 oss <<
"The following material properties are declared on block " << it.first
8464 <<
" by multiple materials:\n";
8466 <<
"Material Objects\n";
8467 for (
const auto & outer_name : intersection)
8470 for (
const auto & inner_name : prop_to_mat[outer_name])
8471 oss << inner_name <<
" ";
8493 mooseInfo(
"Restart file ", file_name,
" is NOT being used since we are performing recovery.");
8499 mooseInfo(
"Using ", file_name,
" for restart.");
8503 std::vector<VariableName>
8506 std::vector<VariableName> names;
8510 const std::vector<VariableName> & var_names = sys->getVariableNames();
8511 names.insert(names.end(), var_names.begin(), var_names.end());
8514 const std::vector<VariableName> & aux_var_names =
_aux->getVariableNames();
8515 names.insert(names.end(), aux_var_names.begin(), aux_var_names.end());
8524 "Solver system number '" << solver_sys_num <<
"' is out of bounds. We have '" 8541 auto random_data_ptr = insert_pair.first->second.get();
8551 bnd_mat_side_cache =
false;
8553 if (
_aux->needMaterialOnSide(bnd_id))
8555 bnd_mat_side_cache =
true;
8559 for (
auto & nl :
_nl)
8560 if (nl->needBoundaryMaterialOnSide(bnd_id, tid))
8562 bnd_mat_side_cache =
true;
8573 bnd_mat_side_cache =
true;
8587 interface_mat_side_cache =
false;
8589 for (
auto & nl :
_nl)
8590 if (nl->needInterfaceMaterialOnSide(bnd_id, tid))
8592 interface_mat_side_cache =
true;
8603 interface_mat_side_cache =
true;
8608 interface_mat_side_cache =
true;
8622 for (
auto & nl :
_nl)
8623 if (nl->needSubdomainMaterialOnSide(subdomain_id, tid))
8654 mooseError(
"Previous nonlinear solution is required but not added through " 8655 "Problem/previous_nl_solution_required=true");
8672 const std::string & object_name,
8675 parallel_object_only();
8682 mooseError(
"The name '", object_name,
"' is a reserved name for output objects");
8686 if (output_warehouse.
hasOutput(object_name))
8687 mooseError(
"An output object named '", object_name,
"' already exists");
8693 std::vector<std::string> exclude;
8694 if (object_type ==
"Console")
8696 exclude.push_back(
"execute_on");
8704 else if (object_type ==
"Checkpoint")
8705 exclude.push_back(
"execute_on");
8711 if (common && std::find(exclude.begin(), exclude.end(),
"execute_on") != exclude.
end() &&
8714 "'execute_on' parameter specified in [Outputs] block is ignored for object '" +
8716 "'.\nDefine this object in its own sub-block of [Outputs] to modify its " 8717 "execution schedule.");
8720 if (object_type ==
"XDR")
8722 else if (object_type ==
"XDA")
8726 if (object_name ==
"auto_recovery_checkpoint")
8764 mooseAssert(sys_num <
_nl.size(),
"System number greater than the number of nonlinear systems");
8765 return *
_nl[sys_num];
8771 return *
_nl[sys_num];
8778 "System number greater than the number of linear systems");
8786 "System number greater than the number of linear systems");
8805 parallel_object_only();
8848 const std::vector<Point> *
const pts,
8849 const std::vector<Real> *
const weights,
8861 unsigned int neighbor_side,
8863 const std::vector<Point> *
const pts,
8864 const std::vector<Real> *
const weights,
8877 std::vector<std::shared_ptr<MaterialBase>> & face_materials,
8878 std::vector<std::shared_ptr<MaterialBase>> & neighbor_materials,
8879 std::set<MooseVariableFieldBase *> & variables,
8884 auto & this_face_mats =
8886 for (std::shared_ptr<MaterialBase> face_mat : this_face_mats)
8887 if (face_mat->ghostable())
8889 face_materials.push_back(face_mat);
8890 auto & var_deps = face_mat->getMooseVariableDependencies();
8891 for (
auto * var : var_deps)
8895 "Ghostable materials should only have finite volume variables coupled into them.");
8896 else if (face_mat->hasStatefulProperties())
8897 mooseError(
"Finite volume materials do not currently support stateful properties.");
8898 variables.insert(var);
8905 auto & this_neighbor_mats =
8907 for (std::shared_ptr<MaterialBase> neighbor_mat : this_neighbor_mats)
8908 if (neighbor_mat->ghostable())
8910 neighbor_materials.push_back(neighbor_mat);
8912 auto & var_deps = neighbor_mat->getMooseVariableDependencies();
8913 for (
auto * var : var_deps)
8917 "Ghostable materials should only have finite volume variables coupled into them.");
8918 else if (neighbor_mat->hasStatefulProperties())
8919 mooseError(
"Finite volume materials do not currently support stateful properties.");
8920 auto pr = variables.insert(var);
8921 mooseAssert(!pr.second,
8922 "We should not have inserted any new variables dependencies from our " 8923 "neighbor materials that didn't exist for our face materials");
8932 const unsigned int nqp,
8943 "There must be one convergence object per nonlinear system");
8948 std::vector<ConvergenceName>
8954 mooseError(
"The nonlinear convergence name(s) have not been set.");
8965 _nl[i]->residualSetup();
8979 _nl[i]->jacobianSetup();
8999 return current_nl_sys_num;
9010 return current_linear_sys_num;
9027 std::vector<MortarUserObject *>
9030 const bool displaced,
9031 const std::vector<MortarUserObject *> & mortar_uo_superset)
9033 std::vector<MortarUserObject *> mortar_uos;
9035 : static_cast<SubProblem *>(
this);
9036 for (
auto *
const obj : mortar_uo_superset)
9037 if (obj->onInterface(primary_boundary_id, secondary_boundary_id) &&
9038 (&obj->getSubProblem() == subproblem))
9039 mortar_uos.push_back(obj);
9044 std::vector<MortarUserObject *>
9047 const bool displaced)
9049 std::vector<MortarUserObject *> mortar_uos;
9053 .queryInto(mortar_uos);
9054 return getMortarUserObjects(primary_boundary_id, secondary_boundary_id, displaced, mortar_uos);
9060 const bool displaced)
9062 const auto mortar_uos =
9064 for (
auto *
const mortar_uo : mortar_uos)
9066 mortar_uo->setNormals();
9067 mortar_uo->reinit();
9098 mooseAssert(nl_sys_num <
_nl.size(),
9099 "System number greater than the number of nonlinear systems");
9108 "System number greater than the number of linear systems");
9121 solver_sys->compute(
type);
9203 return solver_params;
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.
std::vector< libMesh::CouplingMatrix > _nonlocal_cm
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 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.
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.
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 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)
bool _requires_nonlocal_coupling
nonlocal coupling requirement flag
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.
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)
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.
std::vector< ConvergenceName > _nonlinear_convergence_names
Nonlinear system(s) convergence name(s)
bool hasActiveBlockObjects(THREAD_ID tid=0) const
QueryCache is a convenient way to construct and pass around (possible partially constructed) warehous...
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...
void meshChangedHelper(bool intermediate_change=false)
Helper method to update some or all data after a mesh change.
const std::set< BoundaryID > & getSubdomainBoundaryIds(const SubdomainID subdomain_id) const
Get the list of boundary ids associated with the given subdomain id.
void mooseDeprecated(Args &&... args) const
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 setResidualObjectParamsAndLog(const std::string &ro_name, const std::string &name, InputParameters ¶ms, 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.
const AutomaticMortarGeneration & getMortarInterface(const std::pair< BoundaryID, BoundaryID > &boundary_key, const std::pair< SubdomainID, SubdomainID > &, bool on_displaced) const
Getter to retrieve the AutomaticMortarGeneration object corresponding to the boundary and subdomain k...
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.
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.
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.
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)
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
void setPostprocessorValueByName(const PostprocessorName &name, const PostprocessorValue &value, std::size_t t_index=0)
Set the value of a PostprocessorValue.
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.
std::shared_ptr< CommandLine > commandLine() const
Get the command line.
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.
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.
void mooseInfo(Args &&... args) const
ExecuteMooseObjectWarehouse< Control > _control_warehouse
The control logic warehouse.
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
MaterialData & getMaterialData(Moose::MaterialDataType type, const THREAD_ID tid=0)
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
std::vector< ConvergenceName > getNonlinearConvergenceNames() const
Gets the nonlinear convergence object name(s).
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 uDotDotRequested()
Get boolean flag to check whether solution second time derivative needs to be stored.
void updateErrorVectors()
Update the ErrorVectors that have been requested through calls to getErrorVector().
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< 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 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.
void computeUserObjectsInternal(const ExecFlagType &type, const Moose::AuxGroup &group, TheWarehouse::Query &query)
TagID nonTimeVectorTag() const override
A class for "pretty printing" a table of data.
virtual void addCachedJacobian(const THREAD_ID tid)
const std::string & getBoundaryName(BoundaryID boundary_id)
Return the name of the boundary given the id.
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.
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.
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.
Base class for MOOSE-based applications.
void mooseInfoRepeated(Args &&... args)
Emit an informational message with the given stringified, concatenated args.
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
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)
virtual void timestepSetup(THREAD_ID tid=0) const
std::vector< VariableSecond > _second_zero
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.
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...
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)
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)
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
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
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
Base class for MeshDivision objects.
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...
const Positions & getPositionsObject(const std::string &name) const
Get the Positions object by its name.
libMesh::ConstNodeRange * getLocalNodeRange()
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)
Replaces "LATEST" placeholders with the latest checkpoint file name.
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.
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.
virtual const std::string & name() const
Get the name of the class.
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.
void mooseWarning(Args &&... args) const
Emits a warning prefixed with object name and type.
std::set< TagID > _linear_matrix_tags
Temporary storage for filtered matrix tags for linear systems.
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
void bumpAllQRuleOrder(libMesh::Order order, SubdomainID block)
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.
void projectInitialConditionOnCustomRange(libMesh::ConstElemRange &elem_range, ConstBndNodeRange &bnd_node_range)
Project initial conditions for custom elem_range and bnd_node_range This is needed when elements/boun...
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.
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.
ExecuteMooseObjectWarehouse< UserObject > _all_user_objects
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.
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
const std::unordered_map< std::pair< BoundaryID, BoundaryID >, AutomaticMortarGeneration > & getMortarInterfaces(bool on_displaced) const
Return all automatic mortar generation objects on either the displaced or undisplaced mesh...
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
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
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...
bool hasObjects() const
Returns whether we have any active AutomaticMortarGeneration objects.
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
virtual void jacobianSetup(THREAD_ID tid=0) const
const SubdomainID INVALID_BLOCK_ID
ScalarInitialConditionWarehouse _scalar_ics
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.
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 initialSetup(THREAD_ID tid)
Initial setup.
bool hasJacobian() const
Returns _has_jacobian.
void createTagSolutions()
Create extra tagged solution vectors.
virtual void execute(const ExecFlagType &exec_type)
Convenience function for performing execution of MOOSE systems.
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
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
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.
std::unique_ptr< libMesh::ConstElemRange > _current_algebraic_elem_range
FunctorMaterials compute functor material properties.
const std::string _type
The type of this class.
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.
MooseObjectWarehouse< InternalSideIndicator > _internal_side_indicators
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.
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.
virtual std::unique_ptr< Base > create()=0
void createMortarInterface(const std::pair< BoundaryID, BoundaryID > &boundary_key, const std::pair< SubdomainID, SubdomainID > &subdomain_key, SubProblem &subproblem, bool on_displaced, bool periodic, const bool debug, const bool correct_edge_dropping, const Real minimum_projection_angle)
Create mortar generation object.
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.
void min(const T &r, T &o, Request &req) const
bool _fail_next_nonlinear_convergence_check
virtual void reinitElem(const Elem *elem, const THREAD_ID tid) override
bool needSubdomainMaterialOnSide(SubdomainID subdomain_id, const THREAD_ID tid)
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
Moose::CouplingType _coupling
Type of variable coupling.
Every object that can be built by the factory should be derived from this class.
void parallelBarrierNotify(const libMesh::Parallel::Communicator &comm, bool messaging=true)
This function implements a parallel barrier function but writes progress to stdout.
virtual bool shouldUpdateSolution()
Check to see whether the problem should update the solution.
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...
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).
std::optional< std::string > queryStatefulPropName(const unsigned int id) 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.
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 meshChanged() override
Update data after a mesh change.
virtual void setActiveScalarVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid) override
virtual void updateActive(THREAD_ID tid=0)
Update the active status of Kernels.
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()
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
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
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.
virtual const SystemBase & systemBaseAuxiliary() const override
Return the auxiliary system object as a base class reference.
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 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.
const std::set< SubdomainID > & getMortarSubdomainIDs() const
Returns the mortar covered subdomains.
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.
MooseApp & _app
The MOOSE application this is associated with.
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 ...
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 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.
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
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 updateBoundaryMatPropDependency(std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
void uniformRefineWithProjection()
Performs uniform refinement on the meshes in the current object.
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 computeLinearSystemTags(const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &system_matrix, NumericVector< libMesh::Number > &rhs, 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 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.
std::vector< std::string > _solver_sys_names
The union of nonlinear and linear system names.
virtual void initialSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods that handle the extra neighbor and face objects...
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 NonlinearSystem & getNonlinearSystem(const unsigned int sys_num)
void solveSetup()
Calls the timestepSetup function for each of the output objects.
void sort(THREAD_ID tid=0)
virtual bool reinitDirac(const Elem *elem, const THREAD_ID tid) override
Returns true if the Problem has Dirac kernels it needs to compute on elem.
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
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...
void update()
Builds mortar segment meshes for each mortar interface.
virtual void addHDGIntegratedBC(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
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.
std::set< TagID > _fe_matrix_tags
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
const T & getParam(const std::string &name)
Retrieve a parameter for the object.
void removeSubstring(std::string &main, const std::string &sub)
find, erase, length algorithm for removing a substring from a string
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.
The InternalSideIndicator class is responsible for calculating the residuals for various physics on i...
void updateBlockMatPropDependency(SubdomainID id, std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
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()
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
bool _set_nonlinear_convergence_names
Flag that the nonlinear convergence name has been set.
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 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.
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::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.
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 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.
bool hasDisplacedObjects() const
Returns whether any of the AutomaticMortarGeneration objects are running on a displaced mesh...
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.
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 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.
virtual void subdomainSetup(THREAD_ID tid=0) const
std::vector< VariableValue > _zero
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
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
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)
MaterialData & getMaterialData(const THREAD_ID tid)
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.
std::shared_ptr< DisplacedProblem > _displaced_problem
GeometricSearchData _geometric_search_data
const InputParameters & parameters() const
Get the parameters of the object.
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.
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.
std::vector< SubdomainID > getSubdomainIDs(const std::vector< SubdomainName > &subdomain_name) const
Get the associated subdomainIDs for the subdomain names that are passed in.
static InputParameters validParams()
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()
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}.
void paramWarning(const std::string ¶m, Args... args) const
Emits a warning prefixed with the file and line number of the given param (from the input file) along...
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
const std::unordered_map< std::pair< BoundaryID, BoundaryID >, AutomaticMortarGeneration > & getMortarInterfaces(bool on_displaced) 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
void doingPRefinement(bool doing_p_refinement)
Indicate whether the kind of adaptivity we're doing is 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.
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.
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.
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.
DiracKernelInfo _dirac_kernel_info
nonlocal coupling matrix;
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.
std::vector< T * > & queryIntoUnsorted(std::vector< T *> &results, Args &&... args)
queryInto executes the query and stores the results in the given vector.
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
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.
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
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)
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
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)
virtual void outputStep(ExecFlagType type)
Output the current step.
virtual unsigned int nlSysNum(const NonlinearSystemName &nl_sys_name) const override
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
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 meshChanged()
Declares that the MooseMesh has changed, invalidates cached data and rebuilds caches.
void buildPRefinementAndCoarseningMaps(Assembly *assembly)
virtual void ghostGhostedBoundaries() override
Causes the boundaries added using addGhostedBoundary to actually be ghosted.
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 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 residualSetup(THREAD_ID tid=0) const
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
bool _verbose_multiapps
Whether or not to be verbose with multiapps.
Key structure for APIs manipulating global vectors/matrices.