https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FEProblemBase.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#ifdef MOOSE_KOKKOS_ENABLED
13#include "KokkosAssembly.h"
14#include "KokkosFESystem.h"
15#endif
16
17// MOOSE includes
18#include "SubProblem.h"
19#include "GeometricSearchData.h"
20#include "MeshDivision.h"
21#include "ReporterData.h"
22#include "Adaptivity.h"
26#include "Restartable.h"
27#include "SolverParams.h"
28#include "PetscSupport.h"
29#include "MooseApp.h"
31#include "MaterialWarehouse.h"
34#include "MooseVariableFE.h"
35#include "MultiAppTransfer.h"
36#include "Postprocessor.h"
37#include "HashMap.h"
38#include "VectorPostprocessor.h"
39#include "PerfGraphInterface.h"
40#include "Attributes.h"
44#include "SolutionInvalidity.h"
45#include "PetscSupport.h"
46
47#include "libmesh/enum_quadrature_type.h"
48#include "libmesh/equation_systems.h"
49
50#include <unordered_map>
51#include <memory>
52
53// Forward declarations
54class AuxiliarySystem;
56class MooseMesh;
58class LinearSystem;
59class SolverSystem;
60class NonlinearSystem;
61class RandomInterface;
62class RandomData;
65class MultiMooseEnum;
67class MaterialData;
68class MooseEnum;
70class Assembly;
71class JacobianBlock;
72class Control;
73class MultiApp;
76class Indicator;
78class Marker;
79class Material;
80class Transfer;
81class XFEMInterface;
82class SideUserObject;
83class NodalUserObject;
88class Positions;
89class Function;
90class Distribution;
91class Sampler;
92class KernelBase;
94class LineSearch;
95class UserObject;
96class UserObjectBase;
103class Convergence;
105class MortarUserObject;
107
108namespace Moose
109{
110class FunctionBase;
111}
112
113#ifdef MOOSE_KOKKOS_ENABLED
114namespace Moose::Kokkos
115{
117class Function;
118class UserObject;
119}
120#endif
121
122// libMesh forward declarations
123namespace libMesh
124{
125class CouplingMatrix;
126class NonlinearImplicitSystem;
127class LinearImplicitSystem;
128} // namespace libMesh
129
131{
132 ITERATING = 0,
133 // CONVERGED_RTOL_NORMAL = 1,
134 // CONVERGED_ATOL_NORMAL = 9,
135 CONVERGED_RTOL = 2,
136 CONVERGED_ATOL = 3,
137 CONVERGED_ITS = 4,
138 // CONVERGED_CG_NEG_CURVE = 5,
139 // CONVERGED_CG_CONSTRAINED = 6,
140 // CONVERGED_STEP_LENGTH = 7,
141 // CONVERGED_HAPPY_BREAKDOWN = 8,
142 DIVERGED_NULL = -2,
143 // DIVERGED_ITS = -3,
144 // DIVERGED_DTOL = -4,
145 // DIVERGED_BREAKDOWN = -5,
146 // DIVERGED_BREAKDOWN_BICG = -6,
147 // DIVERGED_NONSYMMETRIC = -7,
148 // DIVERGED_INDEFINITE_PC = -8,
150 // DIVERGED_INDEFINITE_MAT = -10
152};
153
159{
160public:
162
164 virtual ~FEProblemBase();
165
169 [[nodiscard]] bool initialized() const { return _initialized; }
170
172 {
173 FALSE,
174 TRUE,
175 OFF,
176 ON,
177 SKIP_LIST,
178 ONLY_LIST,
179 };
180
181 virtual libMesh::EquationSystems & es() override { return _req.set().es(); }
182 virtual MooseMesh & mesh() override { return _mesh; }
183 virtual const MooseMesh & mesh() const override { return _mesh; }
184 const MooseMesh & mesh(bool use_displaced) const override;
185 MooseMesh & mesh(bool use_displaced);
186
187 void setCoordSystem(const std::vector<SubdomainName> & blocks, const MultiMooseEnum & coord_sys);
188 void setAxisymmetricCoordAxis(const MooseEnum & rz_coord_axis);
189
196
198
204 void setCouplingMatrix(std::unique_ptr<libMesh::CouplingMatrix> cm,
205 const unsigned int nl_sys_num);
206
207 // DEPRECATED METHOD
208 void setCouplingMatrix(libMesh::CouplingMatrix * cm, const unsigned int nl_sys_num);
209
210 const libMesh::CouplingMatrix * couplingMatrix(const unsigned int nl_sys_num) const override;
211
214
215 bool
216 areCoupled(const unsigned int ivar, const unsigned int jvar, const unsigned int nl_sys_num) const;
217
222
230
231#ifndef NDEBUG
232 virtual bool checkResidualForNans() const override { return _check_residual_for_nans; }
233
235 void setCheckResidualForNans(bool check_residual_for_nans)
236 {
237 _check_residual_for_nans = check_residual_for_nans;
238 }
239#endif
240
247
248 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
249 couplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num);
250 std::vector<std::pair<MooseVariableFieldBase *, MooseVariableFieldBase *>> &
251 nonlocalCouplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num);
252 const std::vector<std::pair<MooseVariableFieldBase *, MooseVariableScalar *>> &
253 fieldScalarCouplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num) const;
254
255 virtual bool hasVariable(const std::string & var_name) const override;
256 // NOTE: hasAuxiliaryVariable defined in parent class
257 bool hasSolverVariable(const std::string & var_name) const;
259 virtual const MooseVariableFieldBase &
260 getVariable(const THREAD_ID tid,
261 const std::string & var_name,
263 Moose::VarFieldType expected_var_field_type =
266 const std::string & var_name) override;
267 virtual MooseVariable & getStandardVariable(const THREAD_ID tid,
268 const std::string & var_name) override;
270 const std::string & var_name) override;
272 const std::string & var_name) override;
273
274 virtual bool hasScalarVariable(const std::string & var_name) const override;
276 const std::string & var_name) override;
277 virtual libMesh::System & getSystem(const std::string & var_name) override;
278
281
288 virtual void setActiveElementalMooseVariables(const std::set<MooseVariableFEBase *> & moose_vars,
289 const THREAD_ID tid) override;
290
298 virtual void clearActiveElementalMooseVariables(const THREAD_ID tid) override;
299
300 virtual void clearActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) override;
301
302 virtual void clearActiveFEVariableCoupleableVectorTags(const THREAD_ID tid) override;
303
304 virtual void setActiveFEVariableCoupleableVectorTags(std::set<TagID> & vtags,
305 const THREAD_ID tid) override;
306
307 virtual void setActiveFEVariableCoupleableMatrixTags(std::set<TagID> & mtags,
308 const THREAD_ID tid) override;
309
310 virtual void clearActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid) override;
311
312 virtual void clearActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid) override;
313
314 virtual void setActiveScalarVariableCoupleableVectorTags(std::set<TagID> & vtags,
315 const THREAD_ID tid) override;
316
317 virtual void setActiveScalarVariableCoupleableMatrixTags(std::set<TagID> & mtags,
318 const THREAD_ID tid) override;
319
321 libMesh::Order order,
325 bool allow_negative_qweights = true);
326
335
337
341 unsigned int getMaxQps() const;
342
347
353 void setVariableAllDoFMap(const std::vector<const MooseVariableFEBase *> & moose_vars);
354
355 const std::vector<const MooseVariableFEBase *> &
357 {
358 return _uo_jacobian_moose_vars[tid];
359 }
360
361 virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) override;
362 virtual const Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) const override;
363
364#ifdef MOOSE_KOKKOS_ENABLED
367#endif
368
372 virtual std::vector<VariableName> getVariableNames();
373
374 void initialSetup() override;
376 void timestepSetup() override;
377 void customSetup(const ExecFlagType & exec_type) override;
378 void residualSetup() override;
379 void jacobianSetup() override;
380
381 virtual void prepare(const Elem * elem, const THREAD_ID tid) override;
382 virtual void prepareFace(const Elem * elem, const THREAD_ID tid) override;
383 virtual void prepare(const Elem * elem,
384 unsigned int ivar,
385 unsigned int jvar,
386 const std::vector<dof_id_type> & dof_indices,
387 const THREAD_ID tid) override;
388
389 virtual void setCurrentSubdomainID(const Elem * elem, const THREAD_ID tid) override;
390 virtual void
391 setNeighborSubdomainID(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
392 virtual void setNeighborSubdomainID(const Elem * elem, const THREAD_ID tid);
393 virtual void prepareAssembly(const THREAD_ID tid) override;
397 virtual void prepareAssemblyNeighbor(const THREAD_ID tid);
398
399 virtual void addGhostedElem(dof_id_type elem_id) override;
400 virtual void addGhostedBoundary(BoundaryID boundary_id) override;
401 virtual void ghostGhostedBoundaries() override;
402
403 virtual void sizeZeroes(unsigned int size, const THREAD_ID tid);
404 virtual bool reinitDirac(const Elem * elem, const THREAD_ID tid) override;
405
406 virtual void reinitElem(const Elem * elem, const THREAD_ID tid) override;
407 virtual void reinitElemPhys(const Elem * elem,
408 const std::vector<Point> & phys_points_in_elem,
409 const THREAD_ID tid) override;
410 void reinitElemFace(const Elem * elem, unsigned int side, BoundaryID, const THREAD_ID tid);
411 virtual void reinitElemFace(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
412 virtual void reinitLowerDElem(const Elem * lower_d_elem,
413 const THREAD_ID tid,
414 const std::vector<Point> * const pts = nullptr,
415 const std::vector<Real> * const weights = nullptr) override;
416 virtual void reinitNode(const Node * node, const THREAD_ID tid) override;
417 virtual void reinitNodeFace(const Node * node, BoundaryID bnd_id, const THREAD_ID tid) override;
418 virtual void reinitNeighbor(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
419 virtual void reinitNeighborPhys(const Elem * neighbor,
420 unsigned int neighbor_side,
421 const std::vector<Point> & physical_points,
422 const THREAD_ID tid) override;
423 virtual void reinitNeighborPhys(const Elem * neighbor,
424 const std::vector<Point> & physical_points,
425 const THREAD_ID tid) override;
426 virtual void
427 reinitElemNeighborAndLowerD(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
428 virtual void reinitScalars(const THREAD_ID tid,
429 bool reinit_for_derivative_reordering = false) override;
430 virtual void reinitOffDiagScalars(const THREAD_ID tid) override;
431
433 virtual void getDiracElements(std::set<const Elem *> & elems) override;
434 virtual void clearDiracInfo() override;
435
436 virtual void subdomainSetup(SubdomainID subdomain, const THREAD_ID tid);
437 virtual void neighborSubdomainSetup(SubdomainID subdomain, const THREAD_ID tid);
438
439 virtual void newAssemblyArray(std::vector<std::shared_ptr<SolverSystem>> & solver_systems);
441 std::vector<std::shared_ptr<NonlinearSystemBase>> & nl);
442
443 virtual void init() override;
444 virtual void solve(const unsigned int nl_sys_num);
445
446#ifdef MOOSE_KOKKOS_ENABLED
451#endif
452
458 virtual void solveLinearSystem(const unsigned int linear_sys_num,
459 const Moose::PetscSupport::PetscOptions * po = nullptr);
460
462
481
483
498
500
521
530 virtual void setException(const std::string & message);
531
535 virtual bool hasException() { return _has_exception; }
536
553 virtual void checkExceptionAndStopSolve(bool print_message = true);
554
555 virtual bool solverSystemConverged(const unsigned int solver_sys_num) override;
556 virtual unsigned int nNonlinearIterations(const unsigned int nl_sys_num) const override;
557 virtual unsigned int nLinearIterations(const unsigned int nl_sys_num) const override;
558 virtual Real finalNonlinearResidual(const unsigned int nl_sys_num) const override;
559 virtual bool computingPreSMOResidual(const unsigned int nl_sys_num) const override;
560
564 virtual std::string solverTypeString(unsigned int solver_sys_num = 0);
565
570
571 virtual void onTimestepBegin() override;
572 virtual void onTimestepEnd() override;
573
574 virtual Real & time() const { return _time; }
575 virtual Real & timeOld() const { return _time_old; }
582 virtual Real & timeOlder() const { return _time_older; }
583 virtual int & timeStep() const { return _t_step; }
584 virtual Real & dt() const { return _dt; }
585 virtual Real & dtOld() const { return _dt_old; }
589 Real getTimeFromStateArg(const Moose::StateArg & state) const;
590
591 virtual void transient(bool trans) { _transient = trans; }
592 virtual bool isTransient() const override { return _transient; }
593
594 virtual void addTimeIntegrator(const std::string & type,
595 const std::string & name,
597 virtual void
598 addPredictor(const std::string & type, const std::string & name, InputParameters & parameters);
599
600 virtual void copySolutionsBackwards();
601
606
611 virtual void advanceState();
612
613 virtual void restoreSolutions();
614
621
629
633 virtual void saveOldSolutions();
634
638 virtual void restoreOldSolutions();
639
645 void needSolutionState(unsigned int oldest_needed, Moose::SolutionIterationType iteration_type);
646
652 bool hasSolutionState(unsigned int state, Moose::SolutionIterationType iteration_type) const;
653
660 virtual void outputStep(ExecFlagType type);
661
665 virtual void postExecute();
666
668
674 void allowOutput(bool state);
675 template <typename T>
676 void allowOutput(bool state);
678
687 void forceOutput();
688
694
699
703 void logAdd(const std::string & system,
704 const std::string & name,
705 const std::string & type,
706 const InputParameters & params) const;
707
708 // Function /////
709 virtual void
710 addFunction(const std::string & type, const std::string & name, InputParameters & parameters);
711 virtual bool hasFunction(const std::string & name, const THREAD_ID tid = 0);
712 virtual Function & getFunction(const std::string & name, const THREAD_ID tid = 0);
713
714#ifdef MOOSE_KOKKOS_ENABLED
721 virtual void addKokkosFunction(const std::string & type,
722 const std::string & name,
729 virtual bool hasKokkosFunction(const std::string & name) const;
735 virtual Moose::Kokkos::Function getKokkosFunction(const std::string & name);
742 template <typename T>
743 T & getKokkosFunction(const std::string & name);
744#endif
745
747 virtual void
748 addMeshDivision(const std::string & type, const std::string & name, InputParameters & params);
750 MeshDivision & getMeshDivision(const std::string & name, const THREAD_ID tid = 0) const;
751
753 virtual void
754 addConvergence(const std::string & type, const std::string & name, InputParameters & parameters);
756 virtual Convergence & getConvergence(const std::string & name, const THREAD_ID tid = 0) const;
758 virtual const std::vector<std::shared_ptr<Convergence>> &
759 getConvergenceObjects(const THREAD_ID tid = 0) const;
761 virtual bool hasConvergence(const std::string & name, const THREAD_ID tid = 0) const;
799 {
800 return _steady_state_convergence_name.has_value();
801 }
809 virtual void addDefaultNonlinearConvergence(const InputParameters & params);
817 virtual bool onlyAllowDefaultNonlinearConvergence() const { return false; }
834
838 virtual void addLineSearch(const InputParameters & /*parameters*/)
839 {
840 mooseError("Line search not implemented for this problem type yet.");
841 }
842
846 virtual void lineSearch();
847
851 LineSearch * getLineSearch() override { return _line_search.get(); }
852
856 virtual void
857 addDistribution(const std::string & type, const std::string & name, InputParameters & parameters);
858 virtual bool hasDistribution(const std::string & name) const;
859 virtual Distribution & getDistribution(const std::string & name);
860
864 virtual void
865 addSampler(const std::string & type, const std::string & name, InputParameters & parameters);
866 virtual Sampler & getSampler(const std::string & name, const THREAD_ID tid = 0);
867
868 // NL /////
869 NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num);
870 const NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num) const;
871 void setCurrentNonlinearSystem(const unsigned int nl_sys_num);
874
875 virtual const SystemBase & systemBaseNonlinear(const unsigned int sys_num) const override;
876 virtual SystemBase & systemBaseNonlinear(const unsigned int sys_num) override;
877
878 virtual const SystemBase & systemBaseSolver(const unsigned int sys_num) const override;
879 virtual SystemBase & systemBaseSolver(const unsigned int sys_num) override;
880
881 virtual const SystemBase & systemBaseAuxiliary() const override;
882 virtual SystemBase & systemBaseAuxiliary() override;
883
884 virtual NonlinearSystem & getNonlinearSystem(const unsigned int sys_num);
885
886#ifdef MOOSE_KOKKOS_ENABLED
898
913
920 Moose::Kokkos::System & getKokkosSystem(const unsigned int sys_num);
921 const Moose::Kokkos::System & getKokkosSystem(const unsigned int sys_num) const;
923
930 Moose::Kokkos::FESystem & getKokkosFESystem(const unsigned int sys_num);
931 const Moose::Kokkos::FESystem & getKokkosFESystem(const unsigned int sys_num) const;
933#endif
934
939 virtual const SystemBase & getSystemBase(const unsigned int sys_num) const;
940
945 virtual SystemBase & getSystemBase(const unsigned int sys_num);
946
951 SystemBase & getSystemBase(const std::string & sys_name);
952
957 LinearSystem & getLinearSystem(unsigned int sys_num);
958
963 const LinearSystem & getLinearSystem(unsigned int sys_num) const;
964
969 SolverSystem & getSolverSystem(unsigned int sys_num);
970
975 const SolverSystem & getSolverSystem(unsigned int sys_num) const;
976
981 void setCurrentLinearSystem(unsigned int sys_num);
982
986 const LinearSystem & currentLinearSystem() const;
987
992 virtual const SystemBase & systemBaseLinear(unsigned int sys_num) const override;
993
998 virtual SystemBase & systemBaseLinear(unsigned int sys_num) override;
999
1006 virtual void
1007 addVariable(const std::string & var_type, const std::string & var_name, InputParameters & params);
1008
1009 virtual void addKernel(const std::string & kernel_name,
1010 const std::string & name,
1012 virtual void addHDGKernel(const std::string & kernel_name,
1013 const std::string & name,
1015 virtual void addNodalKernel(const std::string & kernel_name,
1016 const std::string & name,
1018 virtual void addScalarKernel(const std::string & kernel_name,
1019 const std::string & name,
1021 virtual void addBoundaryCondition(const std::string & bc_name,
1022 const std::string & name,
1024
1025#ifdef MOOSE_KOKKOS_ENABLED
1026 virtual void addKokkosKernel(const std::string & kernel_name,
1027 const std::string & name,
1029 virtual void addKokkosNodalKernel(const std::string & kernel_name,
1030 const std::string & name,
1032 virtual void addKokkosBoundaryCondition(const std::string & bc_name,
1033 const std::string & name,
1035 virtual void addKokkosLinearFVKernel(const std::string & kernel_name,
1036 const std::string & name,
1038 virtual void addKokkosLinearFVBC(const std::string & bc_name,
1039 const std::string & name,
1041#endif
1042
1043 virtual void
1044 addConstraint(const std::string & c_name, const std::string & name, InputParameters & parameters);
1045
1047 {
1048 parameters.set<FEProblemBase *>("_fe_problem_base") = this;
1049 }
1050
1051 // Aux /////
1052
1059 virtual void addAuxVariable(const std::string & var_type,
1060 const std::string & var_name,
1061 InputParameters & params);
1062
1066 virtual void addElementalFieldVariable(const std::string & var_type,
1067 const std::string & var_name,
1068 InputParameters & params);
1069
1070 virtual void addAuxVariable(const std::string & var_name,
1071 const libMesh::FEType & type,
1072 const std::set<SubdomainID> * const active_subdomains = NULL);
1073 virtual void addAuxArrayVariable(const std::string & var_name,
1074 const libMesh::FEType & type,
1075 unsigned int components,
1076 const std::set<SubdomainID> * const active_subdomains = NULL);
1077 virtual void addAuxScalarVariable(const std::string & var_name,
1078 libMesh::Order order,
1079 Real scale_factor = 1.,
1080 const std::set<SubdomainID> * const active_subdomains = NULL);
1081 virtual void addAuxKernel(const std::string & kernel_name,
1082 const std::string & name,
1084 virtual void addAuxScalarKernel(const std::string & kernel_name,
1085 const std::string & name,
1087
1088#ifdef MOOSE_KOKKOS_ENABLED
1089 virtual void addKokkosAuxKernel(const std::string & kernel_name,
1090 const std::string & name,
1092#endif
1093
1095
1096 // Dirac /////
1097 virtual void addDiracKernel(const std::string & kernel_name,
1098 const std::string & name,
1100
1101 // DG /////
1102 virtual void addDGKernel(const std::string & kernel_name,
1103 const std::string & name,
1105 // FV /////
1106 virtual void addFVKernel(const std::string & kernel_name,
1107 const std::string & name,
1109
1110 virtual void addLinearFVKernel(const std::string & kernel_name,
1111 const std::string & name,
1113 virtual void
1114 addFVBC(const std::string & fv_bc_name, const std::string & name, InputParameters & parameters);
1115 virtual void addLinearFVBC(const std::string & fv_bc_name,
1116 const std::string & name,
1118
1119 virtual void addFVInterfaceKernel(const std::string & fv_ik_name,
1120 const std::string & name,
1122
1123 // Interface /////
1124 virtual void addInterfaceKernel(const std::string & kernel_name,
1125 const std::string & name,
1127
1128 // IC /////
1129 virtual void addInitialCondition(const std::string & ic_name,
1130 const std::string & name,
1138 virtual void addFVInitialCondition(const std::string & ic_name,
1139 const std::string & name,
1141
1142 void projectSolution();
1143
1148 unsigned short getCurrentICState();
1149
1159 libMesh::ConstElemRange & elem_range,
1160 ConstBndNodeRange & bnd_node_range,
1161 const std::optional<std::set<VariableName>> & target_vars = std::nullopt);
1162
1172 void projectFunctionOnCustomRange(ConstElemRange & elem_range,
1173 Number (*func)(const Point &,
1174 const libMesh::Parameters &,
1175 const std::string &,
1176 const std::string &),
1177 Gradient (*func_grad)(const Point &,
1178 const libMesh::Parameters &,
1179 const std::string &,
1180 const std::string &),
1181 const libMesh::Parameters & params,
1182 const std::vector<VariableName> & target_vars);
1183
1184 // Materials
1185 virtual void addMaterial(const std::string & material_name,
1186 const std::string & name,
1188 virtual void addMaterialHelper(std::vector<MaterialWarehouse *> warehouse,
1189 const std::string & material_name,
1190 const std::string & name,
1192 virtual void addInterfaceMaterial(const std::string & material_name,
1193 const std::string & name,
1195 virtual void addFunctorMaterial(const std::string & functor_material_name,
1196 const std::string & name,
1198
1199#ifdef MOOSE_KOKKOS_ENABLED
1200 virtual void addKokkosMaterial(const std::string & material_name,
1201 const std::string & name,
1203#endif
1204
1216 void prepareMaterials(const std::unordered_set<unsigned int> & consumer_needed_mat_props,
1217 const SubdomainID blk_id,
1218 const THREAD_ID tid);
1219
1220 void reinitMaterials(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful = true);
1221
1231 void reinitMaterialsFace(SubdomainID blk_id,
1232 const THREAD_ID tid,
1233 bool swap_stateful = true,
1234 const std::deque<MaterialBase *> * reinit_mats = nullptr);
1235
1247 void
1248 reinitMaterialsFaceOnBoundary(const BoundaryID boundary_id,
1249 const SubdomainID blk_id,
1250 const THREAD_ID tid,
1251 const bool swap_stateful = true,
1252 const std::deque<MaterialBase *> * const reinit_mats = nullptr);
1253
1265 void
1267 const SubdomainID blk_id,
1268 const THREAD_ID tid,
1269 const bool swap_stateful = true,
1270 const std::deque<MaterialBase *> * const reinit_mats = nullptr);
1271
1282 const THREAD_ID tid,
1283 bool swap_stateful = true,
1284 const std::deque<MaterialBase *> * reinit_mats = nullptr);
1285
1298 void reinitMaterialsBoundary(BoundaryID boundary_id,
1299 const THREAD_ID tid,
1300 bool swap_stateful = true,
1301 const std::deque<MaterialBase *> * reinit_mats = nullptr);
1302
1303 void
1304 reinitMaterialsInterface(BoundaryID boundary_id, const THREAD_ID tid, bool swap_stateful = true);
1305
1306#ifdef MOOSE_KOKKOS_ENABLED
1307 void prepareKokkosMaterials(const std::unordered_set<unsigned int> & consumer_needed_mat_props);
1309#endif
1310
1311 /*
1312 * Swap back underlying data storing stateful material properties
1313 */
1314 virtual void swapBackMaterials(const THREAD_ID tid);
1315 virtual void swapBackMaterialsFace(const THREAD_ID tid);
1316 virtual void swapBackMaterialsNeighbor(const THREAD_ID tid);
1317
1324 void setActiveMaterialProperties(const std::unordered_set<unsigned int> & mat_prop_ids,
1325 const THREAD_ID tid);
1326
1335 bool hasActiveMaterialProperties(const THREAD_ID tid) const;
1336
1343
1355 template <typename T>
1356 std::vector<std::shared_ptr<T>> addObject(const std::string & type,
1357 const std::string & name,
1359 const bool threaded = true,
1360 const std::string & var_param_name = "variable");
1361
1362 // Postprocessors /////
1363 virtual void addPostprocessor(const std::string & pp_name,
1364 const std::string & name,
1366
1367 // VectorPostprocessors /////
1368 virtual void addVectorPostprocessor(const std::string & pp_name,
1369 const std::string & name,
1371
1380 virtual void
1381 addReporter(const std::string & type, const std::string & name, InputParameters & parameters);
1382
1383#ifdef MOOSE_KOKKOS_ENABLED
1384 virtual void addKokkosPostprocessor(const std::string & pp_name,
1385 const std::string & name,
1387 virtual void addKokkosVectorPostprocessor(const std::string & pp_name,
1388 const std::string & name,
1390 virtual void addKokkosReporter(const std::string & type,
1391 const std::string & name,
1393#endif
1394
1402 const ReporterData & getReporterData() const { return _reporter_data; }
1403
1410
1411 // UserObjects /////
1412 virtual std::vector<std::shared_ptr<UserObject>> addUserObject(
1413 const std::string & user_object_name, const std::string & name, InputParameters & parameters);
1414
1420 template <class T>
1421 T & getUserObject(const std::string & name, unsigned int tid = 0) const
1422 {
1423 std::vector<T *> objs;
1424 theWarehouse()
1425 .query()
1426 .condition<AttribSystem>("UserObject")
1427 .condition<AttribThread>(tid)
1428 .condition<AttribName>(name)
1429 .queryInto(objs);
1430 if (objs.empty())
1431 mooseError("Unable to find user object with name '" + name + "'");
1432 return *(objs[0]);
1433 }
1434
1441 const UserObject & getUserObjectBase(const std::string & name, const THREAD_ID tid = 0) const;
1442
1448 bool hasUserObject(const std::string & name) const;
1449
1450#ifdef MOOSE_KOKKOS_ENABLED
1451 virtual void addKokkosUserObject(const std::string & user_object_name,
1452 const std::string & name,
1454
1460 template <class T>
1461 const T & getKokkosUserObject(const std::string & name) const
1462 {
1463 std::vector<T *> objs;
1464 theWarehouse()
1465 .query()
1466 .condition<AttribSystem>("KokkosUserObject")
1467 .condition<AttribName>(name)
1468 .queryInto(objs);
1469 if (objs.empty())
1470 mooseError("Unable to find Kokkos user object with name '" + name + "'");
1471 return *(objs[0]);
1472 }
1473
1479 bool hasKokkosUserObject(const std::string & name) const;
1480#endif
1481
1487 void checkUserObjectNameCollision(const std::string & name, const std::string & type) const;
1488
1494 const Positions & getPositionsObject(const std::string & name) const;
1495
1502 virtual void addFVInterpolationMethod(const std::string & method_type,
1503 const std::string & name,
1505
1512 virtual void addFVGradientMethod(const std::string & method_type,
1513 const std::string & name,
1515
1521 FVGradientMethod & getFVGradientMethod(const GradientMethodName & name, const THREAD_ID tid = 0);
1522
1528 const FVGradientMethod & getFVGradientMethod(const GradientMethodName & name,
1529 const THREAD_ID tid = 0) const;
1530
1534 bool hasFVGradientMethod(const GradientMethodName & name) const;
1535
1541 const FVInterpolationMethod & getFVInterpolationMethod(const InterpolationMethodName & name,
1542 const THREAD_ID tid = 0) const;
1543
1550 getFVFaceInterpolationMethod(const InterpolationMethodName & name, const THREAD_ID tid = 0) const;
1551
1558 getFVAdvectedInterpolationMethod(const InterpolationMethodName & name,
1559 const THREAD_ID tid = 0) const;
1560
1564 bool hasFVInterpolationMethod(const InterpolationMethodName & name) const;
1565
1574 bool hasPostprocessorValueByName(const PostprocessorName & name) const;
1575
1581 const Postprocessor & getPostprocessorObjectByName(const PostprocessorName & object_name,
1582 const THREAD_ID tid = 0) const;
1583
1594 const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName & name,
1595 std::size_t t_index = 0) const;
1596
1611 void setPostprocessorValueByName(const PostprocessorName & name,
1612 const PostprocessorValue & value,
1613 std::size_t t_index = 0);
1614
1618 bool hasPostprocessor(const std::string & name) const;
1619
1631 getVectorPostprocessorValueByName(const std::string & object_name,
1632 const std::string & vector_name,
1633 std::size_t t_index = 0) const;
1634
1642 void setVectorPostprocessorValueByName(const std::string & object_name,
1643 const std::string & vector_name,
1644 const VectorPostprocessorValue & value,
1645 std::size_t t_index = 0);
1646
1655 const VectorPostprocessor & getVectorPostprocessorObjectByName(const std::string & object_name,
1656 const THREAD_ID tid = 0) const;
1657
1659
1662 bool hasMultiApps() const { return _multi_apps.hasActiveObjects(); }
1663 bool hasMultiApps(ExecFlagType type) const;
1664 bool hasMultiApp(const std::string & name) const;
1666
1667 // Dampers /////
1668 virtual void addDamper(const std::string & damper_name,
1669 const std::string & name,
1671 void setupDampers();
1672
1676 bool hasDampers() { return _has_dampers; }
1677
1678 // Indicators /////
1679 virtual void addIndicator(const std::string & indicator_name,
1680 const std::string & name,
1682
1683 // Markers //////
1684 virtual void addMarker(const std::string & marker_name,
1685 const std::string & name,
1687
1691 virtual void addMultiApp(const std::string & multi_app_name,
1692 const std::string & name,
1694
1698 std::shared_ptr<MultiApp> getMultiApp(const std::string & multi_app_name) const;
1699
1703 std::vector<std::shared_ptr<Transfer>> getTransfers(ExecFlagType type,
1704 Transfer::DIRECTION direction) const;
1705 std::vector<std::shared_ptr<Transfer>> getTransfers(Transfer::DIRECTION direction) const;
1706
1712
1720 Transfer::DIRECTION direction,
1721 const MultiAppName & source_app = "");
1722
1726 bool execMultiApps(ExecFlagType type, bool auto_advance = true);
1727
1732 unsigned int numConcurrentMultiApps() const { return _num_concurrent_multiapps; }
1733
1743
1744 void finalizeMultiApps();
1745
1750
1756 {
1757 mooseDeprecated("Deprecated method; use finishMultiAppStep and/or incrementMultiAppTStep "
1758 "depending on your purpose");
1760 }
1761
1766 void finishMultiAppStep(ExecFlagType type, bool recurse_through_multiapp_levels = false);
1767
1772
1777 void restoreMultiApps(ExecFlagType type, bool force = false);
1778
1783
1787 virtual void addTransfer(const std::string & transfer_name,
1788 const std::string & name,
1790
1796
1802
1809 virtual Real computeResidualL2Norm();
1810
1815 const NumericVector<libMesh::Number> & soln,
1816 NumericVector<libMesh::Number> & residual);
1822 const NumericVector<libMesh::Number> & soln,
1823 NumericVector<libMesh::Number> & residual);
1824
1828 virtual void computeResidual(const NumericVector<libMesh::Number> & soln,
1829 NumericVector<libMesh::Number> & residual,
1830 const unsigned int nl_sys_num);
1831
1835 void computeResidualAndJacobian(const NumericVector<libMesh::Number> & soln,
1836 NumericVector<libMesh::Number> & residual,
1838
1842 virtual void computeResidualTag(const NumericVector<libMesh::Number> & soln,
1843 NumericVector<libMesh::Number> & residual,
1844 TagID tag);
1848 virtual void computeResidualType(const NumericVector<libMesh::Number> & soln,
1849 NumericVector<libMesh::Number> & residual,
1850 TagID tag);
1851
1856 virtual void computeResidualInternal(const NumericVector<libMesh::Number> & soln,
1857 NumericVector<libMesh::Number> & residual,
1858 const std::set<TagID> & tags);
1862 virtual void computeResidualTags(const std::set<TagID> & tags);
1863
1868 const NumericVector<libMesh::Number> & soln,
1873 virtual void computeJacobian(const NumericVector<libMesh::Number> & soln,
1875 const unsigned int nl_sys_num);
1876
1880 virtual void computeJacobianTag(const NumericVector<libMesh::Number> & soln,
1882 TagID tag);
1883
1887 virtual void computeJacobianInternal(const NumericVector<libMesh::Number> & soln,
1889 const std::set<TagID> & tags);
1890
1894 virtual void computeJacobianTags(const std::set<TagID> & tags);
1895
1904 virtual void computeJacobianBlocks(std::vector<JacobianBlock *> & blocks,
1905 const unsigned int nl_sys_num);
1906
1921 libMesh::System & precond_system,
1922 unsigned int ivar,
1923 unsigned int jvar);
1924
1936 NumericVector<libMesh::Number> & rhs,
1937 const bool compute_gradients = true);
1938
1948 void computeLinearSystemTags(const NumericVector<libMesh::Number> & soln,
1949 const std::set<TagID> & vector_tags,
1950 const std::set<TagID> & matrix_tags,
1951 const bool compute_gradients = true);
1952
1953 virtual Real computeDamping(const NumericVector<libMesh::Number> & soln,
1954 const NumericVector<libMesh::Number> & update);
1955
1960 virtual bool shouldUpdateSolution();
1961
1968 virtual bool updateSolution(NumericVector<libMesh::Number> & vec_solution,
1969 NumericVector<libMesh::Number> & ghosted_solution);
1970
1975 virtual void predictorCleanup(NumericVector<libMesh::Number> & ghosted_solution);
1976
1978 NumericVector<libMesh::Number> & lower,
1979 NumericVector<libMesh::Number> & upper);
1981 std::vector<NumericVector<libMesh::Number> *> & sp);
1983 std::vector<NumericVector<libMesh::Number> *> & sp);
1985 std::vector<NumericVector<libMesh::Number> *> & sp);
1999 void appendConstantModes(const std::vector<VariableName> & vars,
2000 const std::string & prefix,
2001 std::vector<NumericVector<libMesh::Number> *> & sp);
2003 const NumericVector<libMesh::Number> & old_soln,
2004 NumericVector<libMesh::Number> & search_direction,
2005 NumericVector<libMesh::Number> & new_soln,
2006 bool & changed_search_direction,
2007 bool & changed_new_soln);
2008
2009 virtual void computeIndicatorsAndMarkers();
2010 virtual void computeIndicators();
2011 virtual void computeMarkers();
2012
2013 virtual void addResidual(const THREAD_ID tid) override;
2014 virtual void addResidualNeighbor(const THREAD_ID tid) override;
2015 virtual void addResidualLower(const THREAD_ID tid) override;
2016 virtual void addResidualScalar(const THREAD_ID tid = 0);
2017
2018 virtual void cacheResidual(const THREAD_ID tid) override;
2019 virtual void cacheResidualNeighbor(const THREAD_ID tid) override;
2020 virtual void addCachedResidual(const THREAD_ID tid) override;
2021
2029 virtual void addCachedResidualDirectly(NumericVector<libMesh::Number> & residual,
2030 const THREAD_ID tid);
2031
2032 virtual void setResidual(NumericVector<libMesh::Number> & residual, const THREAD_ID tid) override;
2033 virtual void setResidualNeighbor(NumericVector<libMesh::Number> & residual,
2034 const THREAD_ID tid) override;
2035
2036 virtual void addJacobian(const THREAD_ID tid) override;
2037 virtual void addJacobianNeighbor(const THREAD_ID tid) override;
2038 virtual void addJacobianNeighborLowerD(const THREAD_ID tid) override;
2039 virtual void addJacobianLowerD(const THREAD_ID tid) override;
2041 unsigned int ivar,
2042 unsigned int jvar,
2043 const DofMap & dof_map,
2044 std::vector<dof_id_type> & dof_indices,
2045 const std::set<TagID> & tags,
2046 const THREAD_ID tid);
2048 unsigned int ivar,
2049 unsigned int jvar,
2050 const DofMap & dof_map,
2051 std::vector<dof_id_type> & dof_indices,
2052 std::vector<dof_id_type> & neighbor_dof_indices,
2053 const std::set<TagID> & tags,
2054 const THREAD_ID tid) override;
2055 virtual void addJacobianScalar(const THREAD_ID tid = 0);
2056 virtual void addJacobianOffDiagScalar(unsigned int ivar, const THREAD_ID tid = 0);
2057
2058 virtual void cacheJacobian(const THREAD_ID tid) override;
2059 virtual void cacheJacobianNeighbor(const THREAD_ID tid) override;
2060 virtual void addCachedJacobian(const THREAD_ID tid) override;
2061
2062 virtual void prepareShapes(unsigned int var, const THREAD_ID tid) override;
2063 virtual void prepareFaceShapes(unsigned int var, const THREAD_ID tid) override;
2064 virtual void prepareNeighborShapes(unsigned int var, const THREAD_ID tid) override;
2065
2066 // Displaced problem /////
2067 virtual void addDisplacedProblem(std::shared_ptr<DisplacedProblem> displaced_problem);
2068 virtual std::shared_ptr<const DisplacedProblem> getDisplacedProblem() const
2069 {
2070 return _displaced_problem;
2071 }
2072 virtual std::shared_ptr<DisplacedProblem> getDisplacedProblem() { return _displaced_problem; }
2073
2077 virtual void updateGeomSearch(
2079 virtual void updateMortarMesh();
2080
2082 const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
2083 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
2084 bool on_displaced,
2085 bool periodic,
2086 const bool debug,
2087 const bool correct_edge_dropping,
2088 const Real minimum_projection_angle,
2089 const Mortar3DSubpatchPlane mortar_3d_subpatch_plane,
2090 const MooseEnum & triangulation,
2091 const bool triangulate_triangles,
2092 const Mortar3DQuadraturePointMapping mortar_3d_qp_mapping =
2093 Mortar3DQuadraturePointMapping::NORMAL_PROJECTION);
2094
2101 getMortarInterface(const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
2102 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
2103 bool on_displaced) const;
2104
2106 getMortarInterface(const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
2107 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
2108 bool on_displaced);
2110
2111 const std::unordered_map<std::pair<BoundaryID, BoundaryID>, MortarInterfaceConfig> &
2112 getMortarInterfaces(bool on_displaced) const;
2113
2114 virtual void possiblyRebuildGeomSearchPatches();
2115
2117
2122 void setRestartFile(const std::string & file_name);
2123
2131
2143
2144#ifdef MOOSE_KOKKOS_ENABLED
2157#endif
2159
2171
2176
2181
2185 SolverParams & solverParams(unsigned int solver_sys_num = 0);
2186
2190 const SolverParams & solverParams(unsigned int solver_sys_num = 0) const;
2191
2192#ifdef LIBMESH_ENABLE_AMR
2193 // Adaptivity /////
2195 virtual void initialAdaptMesh();
2196
2200 virtual bool adaptMesh();
2201
2205 unsigned int getNumCyclesCompleted() { return _cycles_completed; }
2206
2210 bool hasInitialAdaptivity() const { return _adaptivity.getInitialSteps() > 0; }
2211#else
2215 bool hasInitialAdaptivity() const { return false; }
2216#endif // LIBMESH_ENABLE_AMR
2217
2219 void initXFEM(std::shared_ptr<XFEMInterface> xfem);
2220
2222 std::shared_ptr<XFEMInterface> getXFEM() { return _xfem; }
2223
2225 bool haveXFEM() { return _xfem != nullptr; }
2226
2228 virtual bool updateMeshXFEM();
2229
2235 virtual bool allowMeshContractionAfterMeshChanged() const { return true; }
2236
2253 virtual void
2254 meshChanged(bool intermediate_change, bool contract_mesh, bool clean_refinement_flags);
2255
2261
2267
2273 void initElementStatefulProps(const libMesh::ConstElemRange & elem_range, const bool threaded);
2274
2275#ifdef MOOSE_KOKKOS_ENABLED
2277#endif
2278
2283 virtual void checkProblemIntegrity();
2284
2285 void registerRandomInterface(RandomInterface & random_interface, const std::string & name);
2286
2291 void setConstJacobian(bool state) { _const_jacobian = state; }
2292
2298
2307
2315
2326
2331
2333 void setVerboseProblem(bool verbose);
2334
2338 bool verboseMultiApps() const { return _verbose_multiapps; }
2339
2344
2346
2363 bool needBoundaryMaterialOnSide(BoundaryID bnd_id, const THREAD_ID tid);
2364 bool needInterfaceMaterialOnSide(BoundaryID bnd_id, const THREAD_ID tid);
2365 bool needInternalNeighborSideMaterial(SubdomainID subdomain_id, const THREAD_ID tid);
2367
2372 unsigned int subspaceDim(const std::string & prefix) const
2373 {
2374 if (_subspace_dim.count(prefix))
2375 return _subspace_dim.find(prefix)->second;
2376 else
2377 return 0;
2378 }
2379
2380 /*
2381 * Return reference to function warehouse.
2382 */
2384
2385 /*
2386 * Return a reference to the material warehouse of *all* Material objects.
2387 */
2389
2390 /*
2391 * Return a reference to the material warehouse of Material objects to be computed.
2392 */
2396
2397#ifdef MOOSE_KOKKOS_ENABLED
2398 /*
2399 * Return a reference to the material warehouse of Kokkos Material objects to be computed.
2400 */
2402#endif
2403
2411 std::shared_ptr<MaterialBase> getMaterial(std::string name,
2413 const THREAD_ID tid = 0,
2414 bool no_warn = false);
2415
2420 const THREAD_ID tid = 0,
2421 const MooseObject * object = nullptr) const;
2422
2423#ifdef MOOSE_KOKKOS_ENABLED
2428 const MooseObject * object = nullptr) const;
2429#endif
2430
2434 const std::set<const MooseObject *> &
2436
2437#ifdef MOOSE_KOKKOS_ENABLED
2441 const std::set<const MooseObject *> &
2443#endif
2444
2449
2458
2463
2469
2473 void setPreserveMatrixSparsityPattern(bool preserve);
2474
2480
2483
2490 bool acceptInvalidSolution() const;
2495
2500
2505
2508
2510
2516 const ExecFlagType & getCurrentExecuteOnFlag() const;
2519
2523 virtual void execute(const ExecFlagType & exec_type);
2524 virtual void executeAllObjects(const ExecFlagType & exec_type);
2525
2526 virtual Executor & getExecutor(const std::string & name) { return _app.getExecutor(name); }
2527
2531 virtual void computeUserObjects(const ExecFlagType & type, const Moose::AuxGroup & group);
2532
2536 virtual void computeUserObjectByName(const ExecFlagType & type,
2537 const Moose::AuxGroup & group,
2538 const std::string & name);
2539
2543 void needsPreviousNewtonIteration(bool state);
2544
2549 bool needsPreviousNewtonIteration() const;
2550
2558 const unsigned int solver_sys_num);
2559
2566 bool needsPreviousMultiAppFixedPointIterationSolution(const unsigned int solver_sys_num) const;
2567
2573
2581
2589 const unsigned int solver_sys_num);
2590
2597 bool needsPreviousMultiSystemFixedPointIterationSolution(const unsigned int solver_sys_num) const;
2598
2604
2612
2614
2617 std::vector<Real> _real_zero;
2618 std::vector<VariableValue> _scalar_zero;
2619 std::vector<VariableValue> _zero;
2620 std::vector<VariablePhiValue> _phi_zero;
2621 std::vector<MooseArray<ADReal>> _ad_zero;
2622 std::vector<VariableGradient> _grad_zero;
2623 std::vector<MooseArray<ADRealVectorValue>> _ad_grad_zero;
2624 std::vector<VariablePhiGradient> _grad_phi_zero;
2625 std::vector<VariableSecond> _second_zero;
2626 std::vector<MooseArray<ADRealTensorValue>> _ad_second_zero;
2627 std::vector<VariablePhiSecond> _second_phi_zero;
2628 std::vector<Point> _point_zero;
2629 std::vector<VectorVariableValue> _vector_zero;
2630 std::vector<VectorVariableCurl> _vector_curl_zero;
2632
2637
2641 void executeControls(const ExecFlagType & exec_type);
2642
2646 void executeSamplers(const ExecFlagType & exec_type);
2647
2651 virtual void updateActiveObjects();
2652
2659
2661
2665 bool hasJacobian() const;
2666
2671 bool constJacobian() const;
2672
2676 void addOutput(const std::string &, const std::string &, InputParameters &);
2677
2678 inline TheWarehouse & theWarehouse() const { return _app.theWarehouse(); }
2679
2683 void setSNESMFReuseBase(bool reuse, bool set_by_user)
2684 {
2686 }
2687
2692
2696 void skipExceptionCheck(bool skip_exception_check)
2697 {
2698 _skip_exception_check = skip_exception_check;
2699 }
2700
2705
2710
2711#if !PETSC_RELEASE_LESS_THAN(3, 12, 0)
2713#endif
2714
2716 virtual void setUDotRequested(const bool u_dot_requested) { _u_dot_requested = u_dot_requested; }
2717
2719 virtual void setUDotDotRequested(const bool u_dotdot_requested)
2720 {
2721 _u_dotdot_requested = u_dotdot_requested;
2722 }
2723
2725 virtual void setUDotOldRequested(const bool u_dot_old_requested)
2726 {
2727 _u_dot_old_requested = u_dot_old_requested;
2728 }
2729
2731 virtual void setUDotDotOldRequested(const bool u_dotdot_old_requested)
2732 {
2733 _u_dotdot_old_requested = u_dotdot_old_requested;
2734 }
2735
2737 virtual bool uDotRequested() { return _u_dot_requested; }
2738
2740 virtual bool uDotDotRequested() { return _u_dotdot_requested; }
2741
2743 virtual bool uDotOldRequested()
2744 {
2746 mooseError("FEProblemBase: When requesting old time derivative of solution, current time "
2747 "derivative of solution should also be stored. Please set `u_dot_requested` to "
2748 "true using setUDotRequested.");
2749
2750 return _u_dot_old_requested;
2751 }
2752
2754 virtual bool uDotDotOldRequested()
2755 {
2757 mooseError("FEProblemBase: When requesting old second time derivative of solution, current "
2758 "second time derivation of solution should also be stored. Please set "
2759 "`u_dotdot_requested` to true using setUDotDotRequested.");
2761 }
2762
2764 void haveADObjects(bool have_ad_objects) override;
2765
2766 // Whether or not we should solve this system
2767 bool shouldSolve() const { return _solve; }
2768
2774
2779
2783 virtual bool hasMortarCoupling() const { return _has_mortar; }
2784
2786 void computingNonlinearResid(bool computing_nonlinear_residual) final;
2787
2789 void setCurrentlyComputingResidual(bool currently_computing_residual) final;
2790
2794 void numGridSteps(unsigned int num_grid_steps) { _num_grid_steps = num_grid_steps; }
2795
2800 void uniformRefine();
2801
2803 void automaticScaling(bool automatic_scaling) override;
2804
2806
2809 template <typename T>
2810 static void objectSetupHelper(const std::vector<T *> & objects, const ExecFlagType & exec_flag);
2811 template <typename T>
2812 static void objectExecuteHelper(const std::vector<T *> & objects);
2814
2821 virtual void reinitElemFaceRef(const Elem * elem,
2822 unsigned int side,
2823 Real tolerance,
2824 const std::vector<Point> * const pts,
2825 const std::vector<Real> * const weights = nullptr,
2826 const THREAD_ID tid = 0) override;
2827
2834 virtual void reinitNeighborFaceRef(const Elem * neighbor_elem,
2835 unsigned int neighbor_side,
2836 Real tolerance,
2837 const std::vector<Point> * const pts,
2838 const std::vector<Real> * const weights = nullptr,
2839 const THREAD_ID tid = 0) override;
2840
2845
2854
2859 void fvBCsIntegrityCheck(bool fv_bcs_integrity_check);
2860
2870 std::vector<std::shared_ptr<MaterialBase>> & face_materials,
2871 std::vector<std::shared_ptr<MaterialBase>> & neighbor_materials,
2872 std::set<MooseVariableFieldBase *> & variables,
2873 const THREAD_ID tid);
2874
2881 void resizeMaterialData(Moose::MaterialDataType data_type, unsigned int nqp, const THREAD_ID tid);
2882
2883 bool haveDisplaced() const override final { return _displaced_problem.get(); }
2884
2886 bool hasLinearConvergenceObjects() const;
2890 void setNonlinearConvergenceNames(const std::vector<ConvergenceName> & convergence_names);
2894 void setLinearConvergenceNames(const std::vector<ConvergenceName> & convergence_names);
2898 void setMultiAppFixedPointConvergenceName(const ConvergenceName & convergence_name);
2902 void setSteadyStateConvergenceName(const ConvergenceName & convergence_name);
2903
2907 const std::vector<ConvergenceName> & getNonlinearConvergenceNames() const;
2911 const std::vector<ConvergenceName> & getLinearConvergenceNames() const;
2915 const ConvergenceName & getMultiAppFixedPointConvergenceName() const;
2919 const ConvergenceName & getSteadyStateConvergenceName() const;
2920
2924 void computingScalingJacobian(bool computing_scaling_jacobian)
2925 {
2926 _computing_scaling_jacobian = computing_scaling_jacobian;
2927 }
2928
2929 bool computingScalingJacobian() const override final { return _computing_scaling_jacobian; }
2930
2934 void computingScalingResidual(bool computing_scaling_residual)
2935 {
2936 _computing_scaling_residual = computing_scaling_residual;
2937 }
2938
2942 bool computingScalingResidual() const override final { return _computing_scaling_residual; }
2943
2949
2950 virtual std::size_t numNonlinearSystems() const override { return _num_nl_sys; }
2951
2952 virtual std::size_t numLinearSystems() const override { return _num_linear_sys; }
2953
2954 virtual std::size_t numSolverSystems() const override { return _num_nl_sys + _num_linear_sys; }
2955
2957 bool isSolverSystemNonlinear(const unsigned int sys_num) { return sys_num < _num_nl_sys; }
2958
2959 virtual unsigned int currentNlSysNum() const override;
2960
2961 virtual unsigned int currentLinearSysNum() const override;
2962
2966 virtual unsigned int nlSysNum(const NonlinearSystemName & nl_sys_name) const override;
2967
2971 unsigned int linearSysNum(const LinearSystemName & linear_sys_name) const override;
2972
2976 unsigned int solverSysNum(const SolverSystemName & solver_sys_name) const override;
2977
2982 unsigned int systemNumForVariable(const VariableName & variable_name) const;
2983
2988
2993
2998
2999 /*
3000 * Set the status of loop order of execution printing
3001 * @param print_exec set of execution flags to print on
3002 */
3003 void setExecutionPrinting(const ExecFlagEnum & print_exec) { _print_execution_on = print_exec; }
3004
3008 bool shouldPrintExecution(const THREAD_ID tid) const;
3013 void reinitMortarUserObjects(BoundaryID primary_boundary_id,
3014 BoundaryID secondary_boundary_id,
3015 bool displaced);
3016
3017 virtual const std::vector<VectorTag> & currentResidualVectorTags() const override;
3018
3030
3034 void setCurrentResidualVectorTags(const std::set<TagID> & vector_tags);
3035
3040
3045
3046 virtual void needFV() override { _have_fv = true; }
3047 virtual bool haveFV() const override { return _have_fv; }
3048
3049 virtual bool hasNonlocalCoupling() const override { return _has_nonlocal_coupling; }
3050
3055
3056 virtual void setCurrentLowerDElem(const Elem * const lower_d_elem, const THREAD_ID tid) override;
3057 virtual void setCurrentBoundaryID(BoundaryID bid, const THREAD_ID tid) override;
3058
3062 const std::vector<NonlinearSystemName> & getNonlinearSystemNames() const { return _nl_sys_names; }
3066 const std::vector<LinearSystemName> & getLinearSystemNames() const { return _linear_sys_names; }
3070 const std::vector<SolverSystemName> & getSolverSystemNames() const { return _solver_sys_names; }
3071
3072 virtual const libMesh::CouplingMatrix & nonlocalCouplingMatrix(const unsigned i) const override;
3073
3074 virtual bool checkNonlocalCouplingRequirement() const override;
3075
3077
3085
3087
3089
3090#ifdef MOOSE_KOKKOS_ENABLED
3094 bool hasKokkosObjects() const { return _has_kokkos_objects; }
3103 void addKokkosMeshInitializationHook(std::function<void()> function)
3104 {
3105 _kokkos_mesh_initialization_hooks.push_back(function);
3106 }
3107#endif
3108
3109protected:
3113 virtual void meshChanged() {}
3114
3116 void createTagVectors();
3117
3119 void createTagSolutions();
3120
3124 virtual void meshDisplaced();
3125
3129 void computeSystems(const ExecFlagType & type);
3130
3132
3133private:
3136
3148 void setResidualObjectParamsAndLog(const std::string & ro_name,
3149 const std::string & name,
3151 const unsigned int nl_sys_num,
3152 const std::string & base_name,
3153 bool & reinit_displaced);
3154
3162 void setAuxKernelParamsAndLog(const std::string & ak_name,
3163 const std::string & name,
3165 const std::string & base_name);
3166
3171
3172 TheWarehouse::Query getUOQuery(const std::string & system,
3173 const ExecFlagType & type,
3174 const Moose::AuxGroup & group) const;
3175
3176 void getUOExecutionGroups(TheWarehouse::Query & query, std::set<int> & execution_groups) const;
3177
3178protected:
3180
3182 std::optional<std::vector<ConvergenceName>> _nonlinear_convergence_names;
3184 std::optional<std::vector<ConvergenceName>> _linear_convergence_names;
3186 std::optional<ConvergenceName> _multiapp_fixed_point_convergence_name;
3188 std::optional<ConvergenceName> _steady_state_convergence_name;
3189
3190 std::set<TagID> _fe_vector_tags;
3191
3192 std::set<TagID> _fe_matrix_tags;
3193
3195 std::set<TagID> _linear_vector_tags;
3196
3198 std::set<TagID> _linear_matrix_tags;
3199
3201 const bool & _solve;
3202
3204 Real & _time;
3207 int & _t_step;
3208 Real & _dt;
3209 Real & _dt_old;
3210
3217
3219 const std::vector<LinearSystemName> _linear_sys_names;
3220
3222 const std::size_t _num_linear_sys;
3223
3225 std::vector<std::shared_ptr<LinearSystem>> _linear_systems;
3226
3228 std::map<LinearSystemName, unsigned int> _linear_sys_name_to_num;
3229
3232
3235
3237 const std::vector<NonlinearSystemName> _nl_sys_names;
3238
3240 const std::size_t _num_nl_sys;
3241
3243 std::vector<std::shared_ptr<NonlinearSystemBase>> _nl;
3244
3246 std::map<NonlinearSystemName, unsigned int> _nl_sys_name_to_num;
3247
3250
3253
3255 std::vector<std::shared_ptr<SolverSystem>> _solver_systems;
3256
3258 std::map<SolverVariableName, unsigned int> _solver_var_to_sys_num;
3259
3261 std::map<SolverSystemName, unsigned int> _solver_sys_name_to_num;
3262
3264 std::vector<SolverSystemName> _solver_sys_names;
3265
3267 std::shared_ptr<AuxiliarySystem> _aux;
3268
3270 std::vector<std::unique_ptr<libMesh::CouplingMatrix>> _cm;
3271
3272#ifdef MOOSE_KOKKOS_ENABLED
3277#endif
3278
3280 std::map<std::string, unsigned int> _subspace_dim;
3281
3284 std::vector<std::vector<std::unique_ptr<Assembly>>> _assembly;
3285
3286#ifdef MOOSE_KOKKOS_ENABLED
3288#endif
3289
3294
3297
3298#ifdef MOOSE_KOKKOS_ENABLED
3300#endif
3301
3304
3307
3310
3315 ScalarInitialConditionWarehouse _scalar_ics; // use base b/c of setup methods
3317
3318 // material properties
3323
3324#ifdef MOOSE_KOKKOS_ENABLED
3328#endif
3330 // Material Warehouses
3331 MaterialWarehouse _materials; // regular materials
3333 MaterialWarehouse _discrete_materials; // Materials that the user must compute
3334 MaterialWarehouse _all_materials; // All materials for error checking and MaterialData storage
3335
3336#ifdef MOOSE_KOKKOS_ENABLED
3338#endif
3340
3342 // Indicator Warehouses
3346
3347 // Marker Warehouse
3349
3350 // Helper class to access Reporter object values
3352
3355
3358
3361
3364
3367
3370
3372 const unsigned int _num_concurrent_multiapps;
3373
3375 std::map<std::string, std::unique_ptr<RandomData>> _random_data_objects;
3376
3378 std::vector<std::unordered_map<SubdomainID, bool>> _block_mat_side_cache;
3379
3381 std::vector<std::unordered_map<BoundaryID, bool>> _bnd_mat_side_cache;
3382
3384 std::vector<std::unordered_map<BoundaryID, bool>> _interface_mat_side_cache;
3385
3387 std::vector<MeshChangedInterface *> _notify_when_mesh_changes;
3388
3390 std::vector<MeshDisplacedInterface *> _notify_when_mesh_displaces;
3391
3393 bool duplicateVariableCheck(const std::string & var_name,
3394 const libMesh::FEType & type,
3395 bool is_aux,
3396 const std::set<SubdomainID> * const active_subdomains);
3397
3399
3400#ifdef MOOSE_KOKKOS_ENABLED
3402#endif
3403
3406
3407 void checkUserObjects();
3408
3410 void checkGradientMethods();
3411
3418 const std::map<SubdomainID, std::vector<std::shared_ptr<MaterialBase>>> & materials_map);
3419
3422
3428 void reinitBecauseOfGhostingOrNewGeomObjects(bool mortar_changed = false);
3429
3437 const std::string & object_name,
3438 const std::string & var_param_name = "variable");
3439
3440#ifdef LIBMESH_ENABLE_AMR
3442 unsigned int _cycles_completed;
3443#endif
3444
3446 std::shared_ptr<XFEMInterface> _xfem;
3447
3448 // Displaced mesh /////
3450 std::shared_ptr<DisplacedProblem> _displaced_problem;
3452 std::unique_ptr<MortarInterfaceWarehouse> _mortar_data;
3453
3460
3463
3466
3469
3472
3475
3478
3481
3484
3487
3490
3501
3505
3506 std::vector<std::vector<const MooseVariableFEBase *>> _uo_jacobian_moose_vars;
3507
3509 std::vector<unsigned char> _has_active_material_properties;
3510
3511 std::vector<SolverParams> _solver_params;
3512
3515 std::vector<SubdomainName> _kernel_coverage_blocks;
3516
3520
3524
3527
3530
3533 std::vector<SubdomainName> _material_coverage_blocks;
3534
3537
3540
3543
3546
3547#ifndef NDEBUG
3550#endif
3551
3553 unsigned int _max_qps;
3554
3557
3560
3563
3566
3569
3572
3575
3578
3581
3584
3587#if !PETSC_RELEASE_LESS_THAN(3, 12, 0)
3589#endif
3590
3593
3594 std::shared_ptr<LineSearch> _line_search;
3595
3596 std::unique_ptr<libMesh::ConstElemRange> _evaluable_local_elem_range;
3597 std::unique_ptr<libMesh::ConstElemRange> _nl_evaluable_local_elem_range;
3598 std::unique_ptr<libMesh::ConstElemRange> _aux_evaluable_local_elem_range;
3599
3600 std::unique_ptr<libMesh::ConstElemRange> _current_algebraic_elem_range;
3601 std::unique_ptr<libMesh::ConstNodeRange> _current_algebraic_node_range;
3602 std::unique_ptr<ConstBndNodeRange> _current_algebraic_bnd_node_range;
3603
3607
3608 // loop state during projection of initial conditions
3609 unsigned short _current_ic_state;
3610
3612 const std::vector<VariableName> _constant_null_space_vars;
3614 const std::vector<VariableName> _constant_transpose_null_space_vars;
3615
3619
3620private:
3627 void translateCaughtException(const std::string & calling_method);
3628
3633 void handleException(const std::string & calling_method);
3634
3641 void translateUserObjectExceptions(const std::function<void()> & work);
3642
3647 std::vector<MortarUserObject *>
3648 getMortarUserObjects(BoundaryID primary_boundary_id,
3649 BoundaryID secondary_boundary_id,
3650 bool displaced,
3651 const std::vector<MortarUserObject *> & mortar_uo_superset);
3652
3657 std::vector<MortarUserObject *> getMortarUserObjects(BoundaryID primary_boundary_id,
3658 BoundaryID secondary_boundary_id,
3659 bool displaced);
3660
3670 virtual std::pair<bool, unsigned int>
3671 determineSolverSystem(const std::string & var_name,
3672 bool error_if_not_found = false) const override;
3673
3680 void checkICRestartError(const std::string & ic_name,
3681 const std::string & name,
3682 const VariableName & var_name);
3683
3684 /*
3685 * Test if stateful property redistribution is expected to be
3686 * necessary, and set it up if so.
3687 */
3688 void addAnyRedistributers();
3689
3690 void updateMaxQps();
3691
3692 void joinAndFinalize(TheWarehouse::Query query, bool isgen = false);
3693
3694#ifdef MOOSE_KOKKOS_ENABLED
3695 void kokkosJoinAndFinalize(const std::vector<Moose::Kokkos::UserObject *> & userobjs);
3696#endif
3697
3701 virtual void resetState();
3702
3703 // Parameters handling Jacobian sparsity pattern behavior
3715
3716 const bool _force_restart;
3723
3726
3729
3732
3735
3738
3741
3742 friend class AuxiliarySystem;
3744 friend class MooseEigenSystem;
3745 friend class Resurrector;
3746 friend class Restartable;
3747 friend class DisplacedProblem;
3748
3751
3753 unsigned int _num_grid_steps;
3754
3758
3761
3764
3767
3770
3773
3777 std::vector<VectorTag> _current_residual_vector_tags;
3778
3780 bool _have_fv = false;
3781
3785
3787 std::vector<libMesh::CouplingMatrix> _nonlocal_cm;
3788
3791
3792#ifdef MOOSE_KOKKOS_ENABLED
3795
3798
3800 std::vector<std::function<void()>> _kokkos_mesh_initialization_hooks;
3801#endif
3802
3803 friend void Moose::PetscSupport::setSinglePetscOption(const std::string & name,
3804 const std::string & value,
3805 FEProblemBase * const problem);
3806};
3807
3809
3810template <typename T>
3811void
3813{
3815}
3816
3817template <typename T>
3818void
3819FEProblemBase::objectSetupHelper(const std::vector<T *> & objects, const ExecFlagType & exec_flag)
3820{
3821 if (exec_flag == EXEC_INITIAL)
3822 {
3823 for (T * obj_ptr : objects)
3824 obj_ptr->initialSetup();
3825 }
3826
3827 else if (exec_flag == EXEC_TIMESTEP_BEGIN)
3828 {
3829 for (const auto obj_ptr : objects)
3830 obj_ptr->timestepSetup();
3831 }
3832 else if (exec_flag == EXEC_SUBDOMAIN)
3833 {
3834 for (const auto obj_ptr : objects)
3835 obj_ptr->subdomainSetup();
3836 }
3837
3838 else if (exec_flag == EXEC_NONLINEAR)
3839 {
3840 for (const auto obj_ptr : objects)
3841 obj_ptr->jacobianSetup();
3842 }
3843
3844 else if (exec_flag == EXEC_LINEAR)
3845 {
3846 for (const auto obj_ptr : objects)
3847 obj_ptr->residualSetup();
3848 }
3849}
3850
3851template <typename T>
3852void
3853FEProblemBase::objectExecuteHelper(const std::vector<T *> & objects)
3854{
3855 for (T * obj_ptr : objects)
3856 obj_ptr->execute();
3857}
3858
3859template <typename T>
3860std::vector<std::shared_ptr<T>>
3861FEProblemBase::addObject(const std::string & type,
3862 const std::string & name,
3864 const bool threaded,
3865 const std::string & var_param_name)
3866{
3867 parallel_object_only();
3868
3869 logAdd(MooseUtils::prettyCppType<T>(), name, type, parameters);
3870 // Add the _subproblem and _sys parameters depending on use_displaced_mesh
3871 addObjectParamsHelper(parameters, name, var_param_name);
3872
3873 const auto n_threads = threaded ? this->numThreads() : 1;
3874 std::vector<std::shared_ptr<T>> objects(n_threads);
3875 for (THREAD_ID tid = 0; tid < n_threads; ++tid)
3876 {
3877 std::shared_ptr<T> obj = _factory.create<T>(type, name, parameters, tid);
3878 theWarehouse().add(obj);
3879 objects[tid] = std::move(obj);
3880 }
3881
3882 return objects;
3883}
3884
3885inline NonlinearSystemBase &
3886FEProblemBase::getNonlinearSystemBase(const unsigned int sys_num)
3887{
3888 mooseAssert(sys_num < _nl.size(), "System number greater than the number of nonlinear systems");
3889 return *_nl[sys_num];
3890}
3891
3892inline const NonlinearSystemBase &
3893FEProblemBase::getNonlinearSystemBase(const unsigned int sys_num) const
3894{
3895 mooseAssert(sys_num < _nl.size(), "System number greater than the number of nonlinear systems");
3896 return *_nl[sys_num];
3897}
3898
3899inline SolverSystem &
3900FEProblemBase::getSolverSystem(const unsigned int sys_num)
3901{
3902 mooseAssert(sys_num < _solver_systems.size(),
3903 "System number greater than the number of solver systems");
3904 return *_solver_systems[sys_num];
3905}
3906
3907inline const SolverSystem &
3908FEProblemBase::getSolverSystem(const unsigned int sys_num) const
3909{
3910 mooseAssert(sys_num < _solver_systems.size(),
3911 "System number greater than the number of solver systems");
3912 return *_solver_systems[sys_num];
3913}
3914
3915inline NonlinearSystemBase &
3917{
3918 mooseAssert(_current_nl_sys, "The nonlinear system is not currently set");
3919 return *_current_nl_sys;
3920}
3921
3922inline const NonlinearSystemBase &
3924{
3925 mooseAssert(_current_nl_sys, "The nonlinear system is not currently set");
3926 return *_current_nl_sys;
3927}
3928
3929inline LinearSystem &
3930FEProblemBase::getLinearSystem(const unsigned int sys_num)
3931{
3932 mooseAssert(sys_num < _linear_systems.size(),
3933 "System number greater than the number of linear systems");
3934 return *_linear_systems[sys_num];
3935}
3936
3937inline const LinearSystem &
3938FEProblemBase::getLinearSystem(const unsigned int sys_num) const
3939{
3940 mooseAssert(sys_num < _linear_systems.size(),
3941 "System number greater than the number of linear systems");
3942 return *_linear_systems[sys_num];
3943}
3944
3945inline LinearSystem &
3947{
3948 mooseAssert(_current_linear_sys, "The linear system is not currently set");
3949 return *_current_linear_sys;
3950}
3951
3952inline const LinearSystem &
3954{
3955 mooseAssert(_current_linear_sys, "The linear system is not currently set");
3956 return *_current_linear_sys;
3957}
3958
3959inline Assembly &
3960FEProblemBase::assembly(const THREAD_ID tid, const unsigned int sys_num)
3961{
3962 mooseAssert(tid < _assembly.size(), "Assembly objects not initialized");
3963 mooseAssert(sys_num < _assembly[tid].size(),
3964 "System number larger than the assembly container size");
3965 return *_assembly[tid][sys_num];
3966}
3967
3968inline const Assembly &
3969FEProblemBase::assembly(const THREAD_ID tid, const unsigned int sys_num) const
3970{
3971 mooseAssert(tid < _assembly.size(), "Assembly objects not initialized");
3972 mooseAssert(sys_num < _assembly[tid].size(),
3973 "System number larger than the assembly container size");
3974 return *_assembly[tid][sys_num];
3975}
3976
3977inline const libMesh::CouplingMatrix *
3978FEProblemBase::couplingMatrix(const unsigned int i) const
3979{
3980 return _cm[i].get();
3981}
3982
3983inline void
3984FEProblemBase::fvBCsIntegrityCheck(const bool fv_bcs_integrity_check)
3985{
3987 // the user has requested that we don't check integrity so we will honor that
3988 return;
3989
3990 _fv_bcs_integrity_check = fv_bcs_integrity_check;
3991}
3992
3993inline const std::vector<VectorTag> &
3998
3999inline void
4000FEProblemBase::setCurrentResidualVectorTags(const std::set<TagID> & vector_tags)
4001{
4003}
4004
4005inline void
4010
4011#ifdef MOOSE_KOKKOS_ENABLED
4012template <typename T>
4013T &
4015{
4016 if (!hasKokkosFunction(name))
4017 {
4018 // If we didn't find a function, it might be a default function, attempt to construct one now
4019 std::istringstream ss(name);
4020 Real real_value;
4021
4022 // First see if it's just a constant. If it is, build a ConstantFunction
4023 if (ss >> real_value && ss.eof())
4024 {
4025 InputParameters params = _factory.getValidParams("KokkosConstantFunction");
4026 params.set<Real>("value") = real_value;
4027 addKokkosFunction("KokkosConstantFunction", ss.str(), params);
4028 }
4029
4030 // Try once more
4031 if (!hasKokkosFunction(name))
4032 mooseError("Unable to find Kokkos function '" + name, "'");
4033 }
4034
4035 auto * const ret = dynamic_cast<T *>(_kokkos_functions.getActiveObject(name).get());
4036 if (!ret)
4037 mooseError("No Kokkos function named '", name, "' of appropriate type");
4038
4039 return *ret;
4040}
4041#endif
boundary_id_type BoundaryID
subdomain_id_type SubdomainID
MooseLinearConvergenceReason
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition MooseError.h:363
unsigned int TagID
Definition MooseTypes.h:238
Real PostprocessorValue
various MOOSE typedefs
Definition MooseTypes.h:230
unsigned int THREAD_ID
Definition MooseTypes.h:237
std::vector< Real > VectorPostprocessorValue
Definition MooseTypes.h:231
const ExecFlagType EXEC_SUBDOMAIN
Definition Moose.C:53
const ExecFlagType EXEC_TIMESTEP_BEGIN
Definition Moose.C:38
const ExecFlagType EXEC_INITIAL
Definition Moose.C:31
const ExecFlagType EXEC_LINEAR
Definition Moose.C:32
const ExecFlagType EXEC_NONLINEAR
Definition Moose.C:34
std::shared_ptr< DisplacedProblem > displaced_problem
char ** vars
char ** blocks
Takes care of everything related to mesh adaptivity.
Definition Adaptivity.h:64
unsigned int getInitialSteps() const
Pull out the number of initial steps previously set by calling init()
Definition Adaptivity.h:112
Keeps track of stuff related to assembling.
Definition Assembly.h:102
This class is a container/interface for the objects involved in automatic generation of mortar spaces...
A system that holds auxiliary variables.
Base class for Control objects.
Definition Control.h:44
Base class for convergence criteria.
Definition Convergence.h:26
Crank-Nicolson time integrator.
All Distributions should inherit from this class.
A MultiMooseEnum object to hold "execute_on" flags.
A class for storing MooseObjects based on execution flag.
The Executor class directs the execution flow of simulations.
Definition Executor.h:27
CreateTaggedMatrixKey(const CreateTaggedMatrixKey &)
Class that is used as a parameter to set/clearCurrentResidualVectorTags that allows only blessed clas...
CurrentResidualVectorTagsKey(const CurrentResidualVectorTagsKey &)
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual void addJacobianScalar(const THREAD_ID tid=0)
virtual bool reinitDirac(const Elem *elem, const THREAD_ID tid) override
Returns true if the Problem has Dirac kernels it needs to compute on elem.
virtual void addJacobianLowerD(const THREAD_ID tid) override
const FVInterpolationMethod & getFVInterpolationMethod(const InterpolationMethodName &name, const THREAD_ID tid=0) const
Retrieve an FV interpolation method.
virtual void addKokkosAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
MaterialData & getMaterialData(Moose::MaterialDataType type, const THREAD_ID tid=0, const MooseObject *object=nullptr) const
std::unique_ptr< libMesh::ConstElemRange > _nl_evaluable_local_elem_range
void prepareKokkosMaterials(const std::unordered_set< unsigned int > &consumer_needed_mat_props)
bool _previous_nl_solution_required
Indicates we need to save the previous NL iteration variable values.
virtual void addKokkosBoundaryCondition(const std::string &bc_name, const std::string &name, InputParameters &parameters)
std::shared_ptr< AuxiliarySystem > _aux
The auxiliary system.
std::vector< SubdomainName > _material_coverage_blocks
bool _have_fv
Whether we are performing some calculations with finite volume discretizations.
bool hasLinearConvergenceObjects() const
Whether we have linear convergence objects.
bool hasPostprocessor(const std::string &name) const
Deprecated.
std::vector< VariablePhiSecond > _second_phi_zero
void appendConstantModes(const std::vector< VariableName > &vars, const std::string &prefix, std::vector< NumericVector< libMesh::Number > * > &sp)
Append one mode per variable of vars in the current nonlinear system to sp.
unsigned int subspaceDim(const std::string &prefix) const
Dimension of the subspace spanned by vectors with a given prefix.
MooseObjectWarehouse< IntegratedBCBase > _nonlocal_integrated_bcs
nonlocal integrated_bcs
virtual void clearDiracInfo() override
Gets called before Dirac Kernels are asked to add the points they are supposed to be evaluated in.
MaterialWarehouse _materials
virtual void addJacobianBlockTags(libMesh::SparseMatrix< libMesh::Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, std::vector< dof_id_type > &dof_indices, const std::set< TagID > &tags, const THREAD_ID tid)
PetscOptions & petscOptionsDatabase()
LinearSystem * _current_linear_sys
The current linear system that we are solving.
std::set< TagID > _fe_vector_tags
std::vector< VariablePhiGradient > _grad_phi_zero
virtual void computeJacobian(const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian, const unsigned int nl_sys_num)
Form a Jacobian matrix with the default tag (system).
void advanceMultiApps(ExecFlagType type)
Deprecated method; use finishMultiAppStep and/or incrementMultiAppTStep depending on your purpose.
ReporterData & getReporterData(ReporterData::WriteKey)
Provides non-const access the ReporterData object that is used to store reporter values.
bool verboseMultiApps() const
Whether or not to use verbose printing for MultiApps.
virtual void computeNearNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > * > &sp)
Moose::Kokkos::MaterialPropertyStorage & getKokkosBndMaterialPropertyStorage()
const bool _using_default_nl
Boolean to check if we have the default nonlinear system.
void numGridSteps(unsigned int num_grid_steps)
Set the number of steps in a grid sequences.
ExecuteMooseObjectWarehouse< Transfer > _between_multi_app_transfers
Transfers executed just before MultiApps to transfer data between them.
bool _trust_user_coupling_matrix
Whether to trust the user coupling matrix no matter what.
virtual Sampler & getSampler(const std::string &name, const THREAD_ID tid=0)
virtual void reinitElemPhys(const Elem *elem, const std::vector< Point > &phys_points_in_elem, const THREAD_ID tid) override
virtual void init() override
const MortarInterfaceWarehouse & mortarData() const
Returns the mortar data object.
virtual const std::vector< std::shared_ptr< Convergence > > & getConvergenceObjects(const THREAD_ID tid=0) const
Gets the Convergence objects.
SolverSystem * _current_solver_sys
The current solver system.
void needSolutionState(unsigned int oldest_needed, Moose::SolutionIterationType iteration_type)
Declare that we need up to old (1) or older (2) solution states for a given type of iteration.
virtual void cacheResidual(const THREAD_ID tid) override
void checkDependMaterialsHelper(const std::map< SubdomainID, std::vector< std::shared_ptr< MaterialBase > > > &materials_map)
Helper method for checking Material object dependency.
virtual void addMaterialHelper(std::vector< MaterialWarehouse * > warehouse, const std::string &material_name, const std::string &name, InputParameters &parameters)
const std::vector< ConvergenceName > & getNonlinearConvergenceNames() const
Gets the nonlinear system convergence object name(s).
void resizeMaterialData(Moose::MaterialDataType data_type, unsigned int nqp, const THREAD_ID tid)
Resize material data.
bool needsPreviousMultiAppFixedPointIterationAuxiliary() const
Check to see whether we need to compute the variable values of the previous multiapp fixed point iter...
virtual void checkProblemIntegrity()
Method called to perform a series of sanity checks before a simulation is run.
void setCouplingMatrix(std::unique_ptr< libMesh::CouplingMatrix > cm, const unsigned int nl_sys_num)
Set custom coupling matrix.
unsigned int getMaxQps() const
void setLinearConvergenceNames(const std::vector< ConvergenceName > &convergence_names)
Sets the linear convergence object name(s) if there is one.
std::string _exception_message
The error message to go with an exception.
std::vector< MooseArray< ADRealVectorValue > > _ad_grad_zero
const bool _allow_invalid_solution
bool hasJacobian() const
Returns _has_jacobian.
virtual void onTimestepEnd() override
const bool _skip_nl_system_check
std::vector< std::unordered_map< SubdomainID, bool > > _block_mat_side_cache
Cache for calculating materials on side.
std::vector< SolverParams > _solver_params
virtual NonlinearSystem & getNonlinearSystem(const unsigned int sys_num)
ScalarInitialConditionWarehouse _scalar_ics
virtual void addJacobianNeighbor(const THREAD_ID tid) override
virtual ArrayMooseVariable & getArrayVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested ArrayMooseVariable which may be in any system.
void createTagVectors()
Create extra tagged vectors and matrices.
bool hasKokkosUserObject(const std::string &name) const
Check if there if a Kokkos user object of given name.
virtual void addResidualLower(const THREAD_ID tid) override
virtual void lineSearch()
execute MOOSE line search
bool _verbose_multiapps
Whether or not to be verbose with multiapps.
TheWarehouse::Query getUOQuery(const std::string &system, const ExecFlagType &type, const Moose::AuxGroup &group) const
virtual void reinitNeighborPhys(const Elem *neighbor, unsigned int neighbor_side, const std::vector< Point > &physical_points, const THREAD_ID tid) override
virtual void addPredictor(const std::string &type, const std::string &name, InputParameters &parameters)
bool _computing_scaling_jacobian
Flag used to indicate whether we are computing the scaling Jacobian.
const VectorPostprocessor & getVectorPostprocessorObjectByName(const std::string &object_name, const THREAD_ID tid=0) const
Return the VPP object given the name.
void clearCurrentJacobianMatrixTags()
Clear the current Jacobian matrix tag data structure ... if someone creates it.
virtual void addDistribution(const std::string &type, const std::string &name, InputParameters &parameters)
The following functions will enable MOOSE to have the capability to import distributions.
virtual void setActiveScalarVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid) override
const AutomaticMortarGeneration & getMortarInterface(const std::pair< BoundaryID, BoundaryID > &primary_secondary_boundary_pair, const std::pair< SubdomainID, SubdomainID > &primary_secondary_subdomain_pair, bool on_displaced) const
Return the undisplaced or displaced mortar generation object associated with the provided boundaries ...
const bool & _solve
Whether or not to actually solve the nonlinear system.
bool _parallel_barrier_messaging
Whether or not information about how many transfers have completed is printed.
virtual bool hasScalarVariable(const std::string &var_name) const override
Returns a Boolean indicating whether any system contains a variable with the name provided.
T & getUserObject(const std::string &name, unsigned int tid=0) const
Get the user object by its name.
const MaterialWarehouse & getInterfaceMaterialsWarehouse() const
void skipNextForwardSolutionCopyToOld()
Prevents the copy of the solution vector to the old solution vector in each system.
MaterialWarehouse _interface_materials
void addObjectParamsHelper(InputParameters &params, const std::string &object_name, const std::string &var_param_name="variable")
Helper for setting the "_subproblem" and "_sys" parameters in addObject() and in addUserObject().
const Postprocessor & getPostprocessorObjectByName(const PostprocessorName &object_name, const THREAD_ID tid=0) const
Return the Postprocessor object registered under the supplied object name.
const bool _identify_variable_groups_in_nl
Whether to identify variable groups in nonlinear systems. This affects dof ordering.
void reportMooseObjectDependency(MooseObject *a, MooseObject *b)
Register a MOOSE object dependency so we can either order operations properly or report when we canno...
void checkDisplacementOrders()
Verify that SECOND order mesh uses SECOND order displacements.
std::unique_ptr< MortarInterfaceWarehouse > _mortar_data
void customSetup(const ExecFlagType &exec_type) override
MaterialData & getKokkosMaterialData(Moose::MaterialDataType type, const MooseObject *object=nullptr) const
virtual void computeResidualTags(const std::set< TagID > &tags)
Form multiple residual vectors and each is associated with one tag.
virtual void reinitElemFaceRef(const Elem *elem, unsigned int side, Real tolerance, const std::vector< Point > *const pts, const std::vector< Real > *const weights=nullptr, const THREAD_ID tid=0) override
reinitialize FE objects on a given element on a given side at a given set of reference points and the...
bool _has_dampers
Whether or not this system has any Dampers associated with it.
virtual bool hasException()
Whether or not an exception has occurred.
virtual void computeUserObjects(const ExecFlagType &type, const Moose::AuxGroup &group)
Call compute methods on UserObjects.
std::shared_ptr< MultiApp > getMultiApp(const std::string &multi_app_name) const
Get a MultiApp object by name.
bool _checking_uo_aux_state
Flag used to indicate whether we are doing the uo/aux state check in execute.
virtual bool hasMortarCoupling() const
Whether the simulation has mortar coupling.
bool needInternalNeighborSideMaterial(SubdomainID subdomain_id, const THREAD_ID tid)
virtual MooseVariable & getStandardVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested MooseVariable which may be in any system.
bool hasSetSteadyStateConvergenceName() const
Returns true if the problem has set the steady-state detection convergence name.
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters &parameters)
const MaterialPropertyStorage & getMaterialPropertyStorage()
Return a reference to the material property storage.
virtual bool hasDistribution(const std::string &name) const
void restoreGeometricSearchState()
Restore geometric search state captured by the most recent backupGeometricSearchState().
virtual std::size_t numLinearSystems() const override
void createTagMatrices(CreateTaggedMatrixKey)
bool hasFVInterpolationMethod(const InterpolationMethodName &name) const
Check if an FV interpolation method with a given name exists.
static void objectExecuteHelper(const std::vector< T * > &objects)
virtual bool haveFV() const override
returns true if this problem includes/needs finite volume functionality.
bool _computing_scaling_residual
Flag used to indicate whether we are computing the scaling Residual.
Moose::Kokkos::MaterialPropertyStorage & _kokkos_neighbor_material_props
libMesh::Order getMaxScalarOrder() const
void reinitMaterialsFace(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true, const std::deque< MaterialBase * > *reinit_mats=nullptr)
reinit materials on element faces
virtual void addSampler(const std::string &type, const std::string &name, InputParameters &parameters)
The following functions will enable MOOSE to have the capability to import Samplers.
void notifyWhenMeshDisplaces(MeshDisplacedInterface *mdi)
Register an object that derives from MeshDisplacedInterface to be notified when the displaced mesh ge...
void jacobianSetup() override
virtual bool updateMeshXFEM()
Update the mesh due to changing XFEM cuts.
virtual void prepareFaceShapes(unsigned int var, const THREAD_ID tid) override
virtual void resetState()
Reset state of this object in preparation for the next evaluation.
virtual unsigned int currentLinearSysNum() const override
bool areCoupled(const unsigned int ivar, const unsigned int jvar, const unsigned int nl_sys_num) const
virtual void addResidual(const THREAD_ID tid) override
void setNeedToAddDefaultNonlinearConvergence()
Sets _need_to_add_default_nonlinear_convergence to true.
virtual void addInterfaceMaterial(const std::string &material_name, const std::string &name, InputParameters &parameters)
MortarInterfaceWarehouse & mortarData()
virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the scalar variable reference from whichever system contains it.
MooseObjectWarehouse< KernelBase > _nonlocal_kernels
nonlocal kernels
ReporterData _reporter_data
const ConvergenceName & getSteadyStateConvergenceName() const
Gets the steady-state detection convergence object name.
std::vector< VariableGradient > _grad_zero
virtual void addConvergence(const std::string &type, const std::string &name, InputParameters &parameters)
Adds a Convergence object.
virtual bool allowMeshContractionAfterMeshChanged() const
Whether meshChanged() should allow the mesh to be contracted (deletes children of coarsened elements ...
void setKernelCoverageCheck(CoverageCheckMode mode)
Set flag to indicate whether kernel coverage checks should be performed.
virtual libMesh::EquationSystems & es() override
bool needInterfaceMaterialOnSide(BoundaryID bnd_id, const THREAD_ID tid)
void setCurrentAlgebraicNodeRange(libMesh::ConstNodeRange *range)
ExecuteMooseObjectWarehouse< MultiApp > _multi_apps
MultiApp Warehouse.
std::vector< bool > _previous_multisystem_fp_nl_solution_required
Indicates we need to save the previous multi-system fixed-point iteration solver variable values.
const FVFaceInterpolationMethod & getFVFaceInterpolationMethod(const InterpolationMethodName &name, const THREAD_ID tid=0) const
Retrieve a scalar face interpolation method.
virtual void setCurrentBoundaryID(BoundaryID bid, const THREAD_ID tid) override
sets the current boundary ID in assembly
virtual void addLineSearch(const InputParameters &)
add a MOOSE line search
static void objectSetupHelper(const std::vector< T * > &objects, const ExecFlagType &exec_flag)
Helpers for calling the necessary setup/execute functions for the supplied objects.
bool _need_to_add_default_nonlinear_convergence
Flag that the problem needs to add the default nonlinear convergence.
virtual void addResidualScalar(const THREAD_ID tid=0)
std::shared_ptr< XFEMInterface > getXFEM()
Get a pointer to the XFEM controller object.
void projectInitialConditionOnCustomRange(libMesh::ConstElemRange &elem_range, ConstBndNodeRange &bnd_node_range, const std::optional< std::set< VariableName > > &target_vars=std::nullopt)
Project initial conditions for custom elem_range and bnd_node_range This is needed when elements/boun...
const bool _boundary_restricted_node_integrity_check
whether to perform checking of boundary restricted nodal object variable dependencies,...
virtual void addHDGKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
std::shared_ptr< LineSearch > _line_search
virtual bool uDotRequested()
Get boolean flag to check whether solution time derivative needs to be stored.
bool restoreOriginalNonzeroPattern() const
virtual bool checkResidualForNans() const override
Whether to check residual for NaN/Inf values.
Moose::Kokkos::Array< Moose::Kokkos::System > & getKokkosSystems()
Get the Kokkos System array (always populated when any Kokkos object exists)
virtual void prepareShapes(unsigned int var, const THREAD_ID tid) override
std::vector< VariableSecond > _second_zero
virtual void addCachedResidual(const THREAD_ID tid) override
AuxiliarySystem & getAuxiliarySystem()
MaterialPropertyStorage & _material_props
void setCouplingMatrix(libMesh::CouplingMatrix *cm, const unsigned int nl_sys_num)
void trustUserCouplingMatrix()
Whether to trust the user coupling matrix even if we want to do things like be paranoid and create a ...
void joinAndFinalize(TheWarehouse::Query query, bool isgen=false)
void setAxisymmetricCoordAxis(const MooseEnum &rz_coord_axis)
virtual void reinitScalars(const THREAD_ID tid, bool reinit_for_derivative_reordering=false) override
fills the VariableValue arrays for scalar variables from the solution vector
const MaterialPropertyStorage & getNeighborMaterialPropertyStorage()
virtual void neighborSubdomainSetup(SubdomainID subdomain, const THREAD_ID tid)
virtual const libMesh::CouplingMatrix & nonlocalCouplingMatrix(const unsigned i) const override
const RestartableEquationSystems & getRestartableEquationSystems() const
Get the RestartableEquationSystems object.
void setNonlinearConvergenceNames(const std::vector< ConvergenceName > &convergence_names)
Sets the nonlinear convergence object name(s) if there is one.
unsigned int numConcurrentMultiApps() const
bool haveXFEM()
Find out whether the current analysis is using XFEM.
virtual std::size_t numSolverSystems() const override
bool _needs_old_newton_iter
Indicates that we need to compute variable values for previous Newton iteration.
bool needsPreviousNewtonIteration() const
Check to see whether we need to compute the variable values of the previous Newton iterate.
bool _reinit_displaced_neighbor
Whether to call DisplacedProblem::reinitNeighbor when this->reinitNeighbor is called.
virtual const MooseMesh & mesh() const override
bool & petscOptionsInserted()
If PETSc options are already inserted.
virtual void cacheJacobianNeighbor(const THREAD_ID tid) override
virtual void addResidualNeighbor(const THREAD_ID tid) override
virtual const SystemBase & systemBaseAuxiliary() const override
Return the auxiliary system object as a base class reference.
bool immediatelyPrintInvalidSolution() const
Whether or not the solution invalid warnings are printed out immediately.
std::vector< libMesh::CouplingMatrix > _nonlocal_cm
nonlocal coupling matrix
virtual void setUDotOldRequested(const bool u_dot_old_requested)
Set boolean flag to true to store old solution time derivative.
unsigned int systemNumForVariable(const VariableName &variable_name) const
virtual void sizeZeroes(unsigned int size, const THREAD_ID tid)
MaterialPropertyStorage & _neighbor_material_props
virtual void addCachedJacobian(const THREAD_ID tid) override
Moose::Kokkos::System & getKokkosSystem(const unsigned int sys_num)
Get the Kokkos System of a specified number.
virtual const SystemBase & systemBaseLinear(unsigned int sys_num) const override
Get a constant base class reference to a linear system.
virtual void addGhostedElem(dof_id_type elem_id) override
Will make sure that all dofs connected to elem_id are ghosted to this processor.
MooseMesh & _mesh
virtual void reinitOffDiagScalars(const THREAD_ID tid) override
void setIgnoreZerosInJacobian(bool state)
Set whether the zeros in the Jacobian should be dropped from the sparsity pattern.
virtual bool hasKokkosFunction(const std::string &name) const
Get whether a Kokkos function exists.
const Moose::Kokkos::Array< Moose::Kokkos::FESystem > & getKokkosFESystems() const
virtual bool shouldUpdateSolution()
Check to see whether the problem should update the solution.
void setMaterialCoverageCheck(bool flag)
Set flag to indicate whether material coverage checks should be performed.
const MaterialPropertyRegistry & getMaterialPropertyRegistry() const
virtual void setException(const std::string &message)
Set an exception, which is stored at this point by toggling a member variable in this class,...
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & nonlocalCouplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num)
virtual void addTimeIntegrator(const std::string &type, const std::string &name, InputParameters &parameters)
virtual std::size_t numNonlinearSystems() const override
unsigned short getCurrentICState()
Retrieves the current initial condition state.
std::vector< std::shared_ptr< LinearSystem > > _linear_systems
The vector of linear systems.
ExecuteMooseObjectWarehouse< Transfer > _to_multi_app_transfers
Transfers executed just before MultiApps to transfer data to them.
const Moose::Kokkos::Assembly & kokkosAssembly() const
std::optional< ConvergenceName > _multiapp_fixed_point_convergence_name
MultiApp fixed point convergence name.
void addAnyRedistributers()
void initElementStatefulProps(const libMesh::ConstElemRange &elem_range, const bool threaded)
Initialize stateful properties for elements in a specific elem_range This is needed when elements/bou...
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
virtual bool uDotOldRequested()
Get boolean flag to check whether old solution time derivative needs to be stored.
ExecuteMooseObjectWarehouse< Transfer > _transfers
Normal Transfers.
virtual const std::vector< VectorTag > & currentResidualVectorTags() const override
Return the residual vector tags we are currently computing.
void setRestartFile(const std::string &file_name)
Communicate to the Resurector the name of the restart filer.
MooseVariableFieldBase & getActualFieldVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested MooseVariableField which may be in any system.
virtual void computeResidualInternal(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, const std::set< TagID > &tags)
Form a residual vector for a set of tags.
const MooseObjectWarehouse< Indicator > & getIndicatorWarehouse()
Return indicator/marker storage.
virtual void updateActiveObjects()
Update the active objects in the warehouses.
void reinitKokkosMaterials()
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters &parameters)
void setMaterialCoverageCheck(CoverageCheckMode mode)
Set flag to indicate whether material coverage checks should be performed.
virtual VectorMooseVariable & getVectorVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested VectorMooseVariable which may be in any system.
void computeSystems(const ExecFlagType &type)
Do generic system computations.
void incrementMultiAppTStep(ExecFlagType type)
Advance the MultiApps t_step (incrementStepOrReject) associated with the ExecFlagType.
virtual void computeLinearSystemSys(libMesh::LinearImplicitSystem &sys, libMesh::SparseMatrix< libMesh::Number > &system_matrix, NumericVector< libMesh::Number > &rhs, const bool compute_gradients=true)
Assemble both the right hand side and the system matrix of a given linear system.
std::unique_ptr< libMesh::ConstElemRange > _current_algebraic_elem_range
virtual void addElementalFieldVariable(const std::string &var_type, const std::string &var_name, InputParameters &params)
Add an elemental field variable for use in the adaptivity system.
const MooseObjectWarehouse< InternalSideIndicatorBase > & getInternalSideIndicatorWarehouse()
virtual void clearActiveFEVariableCoupleableVectorTags(const THREAD_ID tid) override
void setCurrentAlgebraicElementRange(libMesh::ConstElemRange *range)
These functions allow setting custom ranges for the algebraic elements, nodes, and boundary nodes tha...
virtual void computeJacobianSys(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian)
Form a Jacobian matrix.
std::map< NonlinearSystemName, unsigned int > _nl_sys_name_to_num
Map from nonlinear system name to number.
bool _has_kokkos_objects
Whether we have any Kokkos objects.
std::vector< std::unique_ptr< libMesh::CouplingMatrix > > _cm
Coupling matrix for variables.
virtual void reinitElem(const Elem *elem, const THREAD_ID tid) override
virtual void cacheJacobian(const THREAD_ID tid) override
virtual void swapBackMaterialsFace(const THREAD_ID tid)
const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName &name, std::size_t t_index=0) const
Get a read-only reference to the value associated with a Postprocessor that exists.
virtual void addJacobian(const THREAD_ID tid) override
std::vector< VectorVariableValue > _vector_zero
void checkNonlocalCoupling()
virtual void possiblyRebuildGeomSearchPatches()
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters &params)
Canonical method for adding a non-linear variable.
bool sideUOInterfaceMatPropIntegrityCheck() const
LinearSystem & currentLinearSystem()
Get a non-constant reference to the current linear system.
LineSearch * getLineSearch() override
getter for the MOOSE line search
virtual void addJacobianOffDiagScalar(unsigned int ivar, const THREAD_ID tid=0)
ExecuteMooseObjectWarehouse< Control > _control_warehouse
The control logic warehouse.
virtual void addFunction(const std::string &type, const std::string &name, InputParameters &parameters)
const std::vector< const MooseVariableFEBase * > & getUserObjectJacobianVariables(const THREAD_ID tid) const
void residualSetup() override
virtual void setActiveFEVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid) override
void setSteadyStateConvergenceName(const ConvergenceName &convergence_name)
Sets the steady-state detection convergence object name if there is one.
std::vector< VectorTag > _current_residual_vector_tags
A data member to store the residual vector tag(s) passed into computeResidualTag(s).
bool _preserve_matrix_sparsity_pattern
Whether to preserve the system matrix / Jacobian sparsity pattern, using 0-valued entries usually.
bool _snesmf_reuse_base_set_by_user
If or not _snesmf_reuse_base is set by user.
virtual Real computeDamping(const NumericVector< libMesh::Number > &soln, const NumericVector< libMesh::Number > &update)
virtual void addKokkosPostprocessor(const std::string &pp_name, const std::string &name, InputParameters &parameters)
virtual ~FEProblemBase()
virtual bool updateSolution(NumericVector< libMesh::Number > &vec_solution, NumericVector< libMesh::Number > &ghosted_solution)
Update the solution.
std::vector< VariablePhiValue > _phi_zero
bool acceptInvalidSolution() const
Whether or not to accept the solution based on its invalidity.
libMesh::Order _max_scalar_order
Maximum scalar variable order.
unsigned int getNumCyclesCompleted()
Moose::Kokkos::MaterialPropertyStorage & getKokkosMaterialPropertyStorage()
virtual bool hasNeighborCoupling() const
Whether the simulation has neighbor coupling.
bool hasPostprocessorValueByName(const PostprocessorName &name) const
Whether or not a Postprocessor value exists by a given name.
CoverageCheckMode _kernel_coverage_check
Determines whether and which subdomains are to be checked to ensure that they have an active kernel.
std::set< TagID > _linear_vector_tags
Temporary storage for filtered vector tags for linear systems.
Moose::Kokkos::Array< Moose::Kokkos::FESystem > _kokkos_fe_systems
FESystem array - sparsely populated (only slots for systems needing a Kokkos::FESystem)
GeometricSearchData _geometric_search_data
const MooseObjectWarehouse< Marker > & getMarkerWarehouse()
bool shouldSolve() const
const T & getKokkosUserObject(const std::string &name) const
Get the Kokkos user object by its name.
virtual void reinitNodeFace(const Node *node, BoundaryID bnd_id, const THREAD_ID tid) override
ExecFlagType _current_execute_on_flag
Current execute_on flag.
virtual void needFV() override
marks this problem as including/needing finite volume functionality.
void setCoordSystem(const std::vector< SubdomainName > &blocks, const MultiMooseEnum &coord_sys)
ExecuteMooseObjectWarehouse< TransientMultiApp > _transient_multi_apps
Storage for TransientMultiApps (only needed for calling 'computeDT')
const ExecuteMooseObjectWarehouse< Transfer > & getMultiAppTransferWarehouse(Transfer::DIRECTION direction) const
Return the complete warehouse for MultiAppTransfer object for the given direction.
Moose::Kokkos::MaterialPropertyStorage & _kokkos_bnd_material_props
void bumpVolumeQRuleOrder(libMesh::Order order, SubdomainID block)
Increases the element/volume quadrature order for the specified mesh block if and only if the current...
void clearCurrentResidualVectorTags()
Clear the current residual vector tag data structure.
virtual void addInitialCondition(const std::string &ic_name, const std::string &name, InputParameters &parameters)
virtual std::shared_ptr< const DisplacedProblem > getDisplacedProblem() const
const bool _use_hash_table_matrix_assembly
Whether to assemble matrices using hash tables instead of preallocating matrix memory.
void translateUserObjectExceptions(const std::function< void()> &work)
Execute work, user object computations local to this process, and register any exception it raises wi...
virtual void computeUserObjectByName(const ExecFlagType &type, const Moose::AuxGroup &group, const std::string &name)
Compute an user object with the given name.
virtual void addFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters &parameters)
bool getFailNextNonlinearConvergenceCheck() const
Whether it will skip further residual evaluations and fail the next nonlinear convergence check(s)
void skipExceptionCheck(bool skip_exception_check)
Set a flag that indicates if we want to skip exception and stop solve.
virtual void addTransfer(const std::string &transfer_name, const std::string &name, InputParameters &parameters)
Add a Transfer to the problem.
std::shared_ptr< MaterialBase > getMaterial(std::string name, Moose::MaterialDataType type, const THREAD_ID tid=0, bool no_warn=false)
Return a pointer to a MaterialBase object.
void checkUserObjects()
virtual void addFVGradientMethod(const std::string &method_type, const std::string &name, InputParameters &parameters)
Add an FV gradient method.
virtual void setCurrentSubdomainID(const Elem *elem, const THREAD_ID tid) override
virtual void restoreOldSolutions()
Restore old solutions from the backup vectors and deallocate them.
void setFailNextNonlinearConvergenceCheck()
Skip further residual evaluations and fail the next nonlinear convergence check(s)
std::map< std::string, unsigned int > _subspace_dim
Dimension of the subspace spanned by the vectors with a given prefix.
virtual void predictorCleanup(NumericVector< libMesh::Number > &ghosted_solution)
Perform cleanup tasks after application of predictor to solution vector.
virtual void addKokkosUserObject(const std::string &user_object_name, const std::string &name, InputParameters &parameters)
virtual void getDiracElements(std::set< const Elem * > &elems) override
Fills "elems" with the elements that should be looped over for Dirac Kernels.
bool _ignore_zeros_in_jacobian
Whether to ignore zeros in the Jacobian, thereby leading to a reduced sparsity pattern.
unsigned int _num_grid_steps
Number of steps in a grid sequence.
bool _need_to_add_default_multiapp_fixed_point_convergence
Flag that the problem needs to add the default fixed point convergence.
std::shared_ptr< XFEMInterface > _xfem
Pointer to XFEM controller.
void setErrorOnJacobianNonzeroReallocation(bool state)
void checkUserObjectNameCollision(const std::string &name, const std::string &type) const
Check for name collision between different user objects.
const ReporterData & getReporterData() const
Provides const access the ReporterData object.
void registerRandomInterface(RandomInterface &random_interface, const std::string &name)
virtual void addVectorPostprocessor(const std::string &pp_name, const std::string &name, InputParameters &parameters)
void reinitBecauseOfGhostingOrNewGeomObjects(bool mortar_changed=false)
Call when it is possible that the needs for ghosted elements has changed.
const InitialConditionWarehouse & getInitialConditionWarehouse() const
Return InitialCondition storage.
MooseObjectWarehouse< Indicator > _indicators
const MooseObjectWarehouse< Function > & getFunctionWarehouse()
void setCoupling(Moose::CouplingType type)
Set the coupling between variables TODO: allow user-defined coupling.
virtual void setUDotDotRequested(const bool u_dotdot_requested)
Set boolean flag to true to store solution second time derivative.
const MaterialWarehouse & getMaterialWarehouse() const
std::map< SolverSystemName, unsigned int > _solver_sys_name_to_num
Map connecting solver system names with their respective systems.
virtual GeometricSearchData & geomSearchData() override
bool identifyVariableGroupsInNL() const
Whether to identify variable groups in nonlinear systems.
LinearSystem & getLinearSystem(unsigned int sys_num)
Get non-constant reference to a linear system.
void setAuxKernelParamsAndLog(const std::string &ak_name, const std::string &name, InputParameters &parameters, const std::string &base_name)
Set the subproblem and system parameters for auxiliary kernels and log their addition.
virtual void addBoundaryCondition(const std::string &bc_name, const std::string &name, InputParameters &parameters)
std::map< std::string, std::unique_ptr< RandomData > > _random_data_objects
A map of objects that consume random numbers.
void reinitMaterials(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true)
void parentOutputPositionChanged()
Calls parentOutputPositionChanged() on all sub apps.
bool hasSolverVariable(const std::string &var_name) const
void computingScalingJacobian(bool computing_scaling_jacobian)
Setter for whether we're computing the scaling jacobian.
virtual void newAssemblyArray(std::vector< std::shared_ptr< SolverSystem > > &solver_systems)
bool hasDampers()
Whether or not this system has dampers.
bool hasSolutionState(unsigned int state, Moose::SolutionIterationType iteration_type) const
Whether we need up to old (1) or older (2) solution states for a given type of iteration.
bool isSolverSystemNonlinear(const unsigned int sys_num)
Check if the solver system is nonlinear.
std::set< TagID > _fe_matrix_tags
FVGradientMethod & getFVGradientMethod(const GradientMethodName &name, const THREAD_ID tid=0)
Retrieve a writable FV gradient method owned by this problem.
std::vector< MeshDisplacedInterface * > _notify_when_mesh_displaces
Objects to be notified when the mesh displaces.
bool _has_nonlocal_coupling
Indicates if nonlocal coupling is required/exists.
virtual bool solverSystemConverged(const unsigned int solver_sys_num) override
bool hasFVGradientMethod(const GradientMethodName &name) const
Check if an FV gradient method with a given name exists.
virtual void addAuxScalarVariable(const std::string &var_name, libMesh::Order order, Real scale_factor=1., const std::set< SubdomainID > *const active_subdomains=NULL)
virtual void addJacobianNeighborLowerD(const THREAD_ID tid) override
virtual Real & dt() const
virtual std::shared_ptr< DisplacedProblem > getDisplacedProblem()
void addKokkosMeshInitializationHook(std::function< void()> function)
Add a function hook that needs to be called after Kokkos mesh initialization.
bool needsPreviousMultiSystemFixedPointIterationAuxiliary() const
Check to see whether we need to compute the variable values of the previous multi-system fixed point ...
ExecuteMooseObjectWarehouse< MultiApp > & getMultiAppWarehouse()
void getFVMatsAndDependencies(SubdomainID block_id, std::vector< std::shared_ptr< MaterialBase > > &face_materials, std::vector< std::shared_ptr< MaterialBase > > &neighbor_materials, std::set< MooseVariableFieldBase * > &variables, const THREAD_ID tid)
Get the materials and variables potentially needed for FV.
Restartable::ManagedValue< RestartableEquationSystems > _req
The EquationSystems object, wrapped for restart.
const bool _force_restart
virtual void advanceState()
Advance all of the state holding vectors / datastructures so that we can move to the next timestep.
bool isSNESMFReuseBaseSetbyUser()
Return a flag to indicate if _snesmf_reuse_base is set by users.
virtual bool uDotDotRequested()
Get boolean flag to check whether solution second time derivative needs to be stored.
virtual void restoreSolutions()
virtual void solveLinearSystem(const unsigned int linear_sys_num, const Moose::PetscSupport::PetscOptions *po=nullptr)
Build and solve a linear system.
virtual void prepareAssembly(const THREAD_ID tid) override
virtual void addFVInterpolationMethod(const std::string &method_type, const std::string &name, InputParameters &parameters)
Add an FV interpolation method.
const bool _material_dependency_check
Determines whether a check to verify material dependencies on every subdomain.
const Positions & getPositionsObject(const std::string &name) const
Get the Positions object by its name.
Moose::Kokkos::FESystem & getKokkosFESystem(const unsigned int sys_num)
Get the Kokkos FESystem of a specified number.
void setConstJacobian(bool state)
Set flag that Jacobian is constant (for optimization purposes)
virtual void executeAllObjects(const ExecFlagType &exec_type)
void executeControls(const ExecFlagType &exec_type)
Performs setup and execute calls for Control objects.
virtual void postExecute()
Method called at the end of the simulation.
ExecuteMooseObjectWarehouse< Control > & getControlWarehouse()
Reference to the control logic warehouse.
virtual void addNodalKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
void setVerboseProblem(bool verbose)
Make the problem be verbose.
bool needToAddDefaultMultiAppFixedPointConvergence() const
Returns true if the problem needs to add the default fixed point convergence.
bool hasKokkosResidualObjects() const
const bool _regard_general_exceptions_as_errors
If we catch an exception during residual/Jacobian evaluaton for which we don't have specific handling...
std::vector< std::shared_ptr< Transfer > > getTransfers(ExecFlagType type, Transfer::DIRECTION direction) const
Get Transfers by ExecFlagType and direction.
bool hasMultiApps() const
Returns whether or not the current simulation has any multiapps.
void setCurrentNonlinearSystem(const unsigned int nl_sys_num)
void addOutput(const std::string &, const std::string &, InputParameters &)
Adds an Output object.
virtual void addKokkosLinearFVBC(const std::string &bc_name, const std::string &name, InputParameters &parameters)
const std::vector< LinearSystemName > _linear_sys_names
The linear system names.
MaterialWarehouse _discrete_materials
bool computingScalingJacobian() const override final
Getter for whether we're computing the scaling jacobian.
virtual void computeJacobianBlock(libMesh::SparseMatrix< libMesh::Number > &jacobian, libMesh::System &precond_system, unsigned int ivar, unsigned int jvar)
Really not a good idea to use this.
Real computeMultiAppsDT(ExecFlagType type)
Find the smallest timestep over all MultiApps.
const MaterialWarehouse & getRegularMaterialsWarehouse() const
void setKernelCoverageCheck(bool flag)
Set flag to indicate whether kernel coverage checks should be performed.
bool _skip_exception_check
If or not skip 'exception and stop solve'.
const ConstBndNodeRange & getCurrentAlgebraicBndNodeRange()
SolverParams & solverParams(unsigned int solver_sys_num=0)
Get the solver parameters.
void setCurrentLinearSystem(unsigned int sys_num)
Set the current linear system pointer.
std::vector< std::vector< std::unique_ptr< Assembly > > > _assembly
The Assembly objects.
unsigned short _current_ic_state
std::map< LinearSystemName, unsigned int > _linear_sys_name_to_num
Map from linear system name to number.
virtual Convergence & getConvergence(const std::string &name, const THREAD_ID tid=0) const
Gets a Convergence object.
virtual void computeNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > * > &sp)
virtual void reinitElemNeighborAndLowerD(const Elem *elem, unsigned int side, const THREAD_ID tid) override
void setSNESMFReuseBase(bool reuse, bool set_by_user)
If or not to reuse the base vector for matrix-free calculation.
virtual void prepare(const Elem *elem, const THREAD_ID tid) override
std::vector< std::shared_ptr< T > > addObject(const std::string &type, const std::string &name, InputParameters &parameters, const bool threaded=true, const std::string &var_param_name="variable")
Method for creating and adding an object to the warehouse.
const Moose::Kokkos::Array< Moose::Kokkos::System > & getKokkosSystems() const
void computeLinearSystemTags(const NumericVector< libMesh::Number > &soln, const std::set< TagID > &vector_tags, const std::set< TagID > &matrix_tags, const bool compute_gradients=true)
Assemble the current linear system given a set of vector and matrix tags.
const std::size_t _num_linear_sys
The number of linear systems.
void handleException(const std::string &calling_method)
Handle exceptions.
virtual void addPostprocessor(const std::string &pp_name, const std::string &name, InputParameters &parameters)
void setNonlocalCouplingMatrix()
Set custom coupling matrix for variables requiring nonlocal contribution.
unsigned int solverSysNum(const SolverSystemName &solver_sys_name) const override
bool _u_dotdot_old_requested
Whether old solution second time derivative needs to be stored.
Moose::Kokkos::MaterialPropertyStorage & _kokkos_material_props
const std::vector< VariableName > _constant_null_space_vars
Variables whose constant fields span part of the Jacobian nullspace.
const libMesh::ConstElemRange & getCurrentAlgebraicElementRange()
These are the element and nodes that contribute to the jacobian and residual for this local processor...
const MaterialPropertyStorage & getBndMaterialPropertyStorage()
std::map< SolverVariableName, unsigned int > _solver_var_to_sys_num
Map connecting variable names with their respective solver systems.
virtual void setActiveScalarVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid) override
bool getFailNextSystemConvergenceCheck() const
Whether it will fail the next system convergence check(s), triggering failed step behavior.
const bool _side_uo_interface_mat_prop_integrity_check
Whether to check that side user objects do not consume interface material properties.
MooseObjectWarehouse< InternalSideIndicatorBase > _internal_side_indicators
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const override
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
bool _requires_nonlocal_coupling
nonlocal coupling requirement flag
const MaterialWarehouse & getKokkosMaterialsWarehouse() const
const bool _restore_original_nonzero_pattern
Whether we should restore the original nonzero pattern for every Jacobian evaluation.
void reinitMaterialsNeighbor(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true, const std::deque< MaterialBase * > *reinit_mats=nullptr)
reinit materials on the neighboring element face
const VectorPostprocessorValue & getVectorPostprocessorValueByName(const std::string &object_name, const std::string &vector_name, std::size_t t_index=0) const
Get a read-only reference to the vector value associated with the VectorPostprocessor.
virtual void swapBackMaterialsNeighbor(const THREAD_ID tid)
void clearActiveMaterialProperties(const THREAD_ID tid)
Clear the active material properties.
virtual void clearActiveElementalMooseVariables(const THREAD_ID tid) override
Clear the active elemental MooseVariableFEBase.
void setMultiAppFixedPointConvergenceName(const ConvergenceName &convergence_name)
Sets the MultiApp fixed point convergence object name if there is one.
bool _fail_next_system_convergence_check
bool hasUserObject(const std::string &name) const
Check if there if a user object of given name.
bool _reinit_displaced_elem
Whether to call DisplacedProblem::reinitElem when this->reinitElem is called.
std::vector< VariableValue > _scalar_zero
unsigned int linearSysNum(const LinearSystemName &linear_sys_name) const override
const std::vector< LinearSystemName > & getLinearSystemNames() const
bool hasKokkosObjects() const
virtual void transient(bool trans)
virtual void addJacobianNeighbor(libMesh::SparseMatrix< libMesh::Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, std::vector< dof_id_type > &dof_indices, std::vector< dof_id_type > &neighbor_dof_indices, const std::set< TagID > &tags, const THREAD_ID tid) override
bool _fv_bcs_integrity_check
Whether to check overlapping Dirichlet and Flux BCs and/or multiple DirichletBCs per sideset.
bool _const_jacobian
true if the Jacobian is constant
virtual bool hasVariable(const std::string &var_name) const override
Whether or not this problem has the variable.
virtual void reinitNode(const Node *node, const THREAD_ID tid) override
void resetFailNextNonlinearConvergenceCheck()
Tell the problem that the nonlinear convergence check(s) may proceed as normal.
void createMortarInterface(const std::pair< BoundaryID, BoundaryID > &primary_secondary_boundary_pair, const std::pair< SubdomainID, SubdomainID > &primary_secondary_subdomain_pair, bool on_displaced, bool periodic, const bool debug, const bool correct_edge_dropping, const Real minimum_projection_angle, const Mortar3DSubpatchPlane mortar_3d_subpatch_plane, const MooseEnum &triangulation, const bool triangulate_triangles, const Mortar3DQuadraturePointMapping mortar_3d_qp_mapping=Mortar3DQuadraturePointMapping::NORMAL_PROJECTION)
virtual void addKokkosReporter(const std::string &type, const std::string &name, InputParameters &parameters)
bool _has_internal_edge_residual_objects
Whether the problem has dgkernels or interface kernels.
bool _error_on_jacobian_nonzero_reallocation
Whether to error when the Jacobian is re-allocated, usually because the sparsity pattern changed.
const libMesh::CouplingMatrix * couplingMatrix(const unsigned int nl_sys_num) const override
The coupling matrix defining what blocks exist in the preconditioning matrix.
void setExecutionPrinting(const ExecFlagEnum &print_exec)
virtual void addGhostedBoundary(BoundaryID boundary_id) override
Will make sure that all necessary elements from boundary_id are ghosted to this processor.
virtual void addKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
const libMesh::ConstElemRange & getEvaluableElementRange()
In general, {evaluable elements} >= {local elements} U {algebraic ghosting elements}.
virtual void addAuxScalarKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
virtual void addKokkosMaterial(const std::string &material_name, const std::string &name, InputParameters &parameters)
std::unique_ptr< libMesh::ConstNodeRange > _current_algebraic_node_range
virtual void addDGKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
bool _u_dot_requested
Whether solution time derivative needs to be stored.
virtual bool hasNonlocalCoupling() const override
Whether the simulation has active nonlocal coupling which should be accounted for in the Jacobian.
void setCurrentAlgebraicBndNodeRange(ConstBndNodeRange *range)
virtual void prepareFace(const Elem *elem, const THREAD_ID tid) override
const FVAdvectedInterpolationMethod & getFVAdvectedInterpolationMethod(const InterpolationMethodName &name, const THREAD_ID tid=0) const
Retrieve an advected interpolation method.
virtual void addKokkosKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
void prepareMaterials(const std::unordered_set< unsigned int > &consumer_needed_mat_props, const SubdomainID blk_id, const THREAD_ID tid)
Add the MooseVariables and the material properties that the current materials depend on to the depend...
void checkCoordinateSystems()
Verify that there are no element type/coordinate type conflicts.
MaterialPropertyStorage & _bnd_material_props
void logAdd(const std::string &system, const std::string &name, const std::string &type, const InputParameters &params) const
Output information about the object just added to the problem.
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
virtual Real & dtOld() const
void initKokkos()
Construct Kokkos assembly and systems and allocate Kokkos material property storages.
virtual void initNullSpaceVectors(const InputParameters &parameters, std::vector< std::shared_ptr< NonlinearSystemBase > > &nl)
bool preserveMatrixSparsityPattern() const
Will return True if the executioner in use requires preserving the sparsity pattern of the matrices b...
void reinitElemFace(const Elem *elem, unsigned int side, BoundaryID, const THREAD_ID tid)
unsigned int _max_qps
Maximum number of quadrature points used in the problem.
void checkDuplicatePostprocessorVariableNames()
virtual void reinitLowerDElem(const Elem *lower_d_elem, const THREAD_ID tid, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr) override
virtual void addDiracKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
void forceOutput()
Indicates that the next call to outputStep should be forced.
void backupGeometricSearchState()
Snapshot geometric search state (both on the regular and, if present, the displaced mesh) so it can b...
virtual void solve(const unsigned int nl_sys_num)
std::optional< ConvergenceName > _steady_state_convergence_name
Steady-state detection convergence name.
Moose::CouplingType coupling() const
bool _has_kokkos_residual_objects
Whether we have any Kokkos residual objects.
virtual void addDefaultNonlinearConvergence(const InputParameters &params)
Adds the default nonlinear Convergence associated with the problem.
const std::unordered_map< std::pair< BoundaryID, BoundaryID >, MortarInterfaceConfig > & getMortarInterfaces(bool on_displaced) const
void setVariableAllDoFMap(const std::vector< const MooseVariableFEBase * > &moose_vars)
void projectFunctionOnCustomRange(ConstElemRange &elem_range, Number(*func)(const Point &, const libMesh::Parameters &, const std::string &, const std::string &), Gradient(*func_grad)(const Point &, const libMesh::Parameters &, const std::string &, const std::string &), const libMesh::Parameters &params, const std::vector< VariableName > &target_vars)
Project a function onto a range of elements for a given variable.
InitialConditionWarehouse _ics
virtual void checkExceptionAndStopSolve(bool print_message=true)
Check to see if an exception has occurred on any processor and, if possible, force the solve to fail,...
NonlinearSystemBase & currentNonlinearSystem()
const ExecFlagType & getCurrentExecuteOnFlag() const
Return/set the current execution flag.
void checkUserObjectJacobianRequirement(THREAD_ID tid)
bool hasUOAuxStateCheck() const
Whether or not MOOSE will perform a user object/auxiliary kernel state check.
bool duplicateVariableCheck(const std::string &var_name, const libMesh::FEType &type, bool is_aux, const std::set< SubdomainID > *const active_subdomains)
Helper to check for duplicate variable names across systems or within a single system.
void restoreMultiApps(ExecFlagType type, bool force=false)
Restore the MultiApps associated with the ExecFlagType.
void needsPreviousMultiAppFixedPointIterationSolution(bool needed, const unsigned int solver_sys_num)
Set a flag that indicated that user required values for the previous multiapp fixed point iterate for...
virtual unsigned int currentNlSysNum() const override
bool execMultiApps(ExecFlagType type, bool auto_advance=true)
Execute the MultiApps associated with the ExecFlagType.
void setPostprocessorValueByName(const PostprocessorName &name, const PostprocessorValue &value, std::size_t t_index=0)
Set the value of a PostprocessorValue.
void computeResidual(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual)
This function is called by Libmesh to form a residual.
virtual Real & timeOld() const
virtual void computeBounds(libMesh::NonlinearImplicitSystem &sys, NumericVector< libMesh::Number > &lower, NumericVector< libMesh::Number > &upper)
MaterialWarehouse _all_materials
void setVectorPostprocessorValueByName(const std::string &object_name, const std::string &vector_name, const VectorPostprocessorValue &value, std::size_t t_index=0)
Set the value of a VectorPostprocessor vector.
virtual unsigned int nlSysNum(const NonlinearSystemName &nl_sys_name) const override
const libMesh::ConstElemRange & getNonlinearEvaluableElementRange()
PetscOptions _petsc_option_data_base
bool fvBCsIntegrityCheck() const
virtual unsigned int nNonlinearIterations(const unsigned int nl_sys_num) const override
void setPreserveMatrixSparsityPattern(bool preserve)
Set whether the sparsity pattern of the matrices being formed during the solve (usually the Jacobian)...
bool _has_time_integrator
Indicates whether or not this executioner has a time integrator (during setup)
bool _input_file_saved
whether input file has been written
void computeResidualAndJacobian(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, libMesh::SparseMatrix< libMesh::Number > &jacobian)
Form a residual and Jacobian with default tags.
void timestepSetup() override
virtual void computeIndicators()
virtual void onTimestepBegin() override
virtual MooseMesh & mesh() override
MaterialWarehouse _kokkos_materials
Moose::Kokkos::MaterialPropertyStorage & getKokkosNeighborMaterialPropertyStorage()
virtual void setResidualNeighbor(NumericVector< libMesh::Number > &residual, const THREAD_ID tid) override
void setCurrentResidualVectorTags(const std::set< TagID > &vector_tags)
Set the current residual vector tag data structure based on the passed in tag IDs.
virtual void addIndicator(const std::string &indicator_name, const std::string &name, InputParameters &parameters)
bool _previous_multiapp_fp_aux_solution_required
Indicates we need to save the previous multiapp fixed-point iteration auxiliary variable values.
const std::vector< NonlinearSystemName > & getNonlinearSystemNames() const
std::set< TagID > _linear_matrix_tags
Temporary storage for filtered matrix tags for linear systems.
std::vector< std::unordered_map< BoundaryID, bool > > _interface_mat_side_cache
Cache for calculating materials on interface.
virtual void createQRules(libMesh::QuadratureType type, libMesh::Order order, libMesh::Order volume_order=libMesh::INVALID_ORDER, libMesh::Order face_order=libMesh::INVALID_ORDER, SubdomainID block=Moose::ANY_BLOCK_ID, bool allow_negative_qweights=true)
MooseObjectWarehouse< MeshDivision > _mesh_divisions
Warehouse to store mesh divisions NOTE: this could probably be moved to the MooseMesh instead of the ...
virtual void computePostCheck(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &old_soln, NumericVector< libMesh::Number > &search_direction, NumericVector< libMesh::Number > &new_soln, bool &changed_search_direction, bool &changed_new_soln)
SolverSystem & getSolverSystem(unsigned int sys_num)
Get non-constant reference to a solver system.
Real getTimeFromStateArg(const Moose::StateArg &state) const
Returns the time associated with the requested state.
void setActiveMaterialProperties(const std::unordered_set< unsigned int > &mat_prop_ids, const THREAD_ID tid)
Record and set the material properties required by the current computing thread.
const bool _interface_kernel_integrity_check
Whether to check that interface kernel variables match the orientation of their boundaries.
const UserObject & getUserObjectBase(const std::string &name, const THREAD_ID tid=0) const
Get the user object by its name.
Moose::Kokkos::Assembly _kokkos_assembly
std::optional< std::vector< ConvergenceName > > _linear_convergence_names
Linear system(s) convergence name(s) (if any)
MooseObjectWarehouse< Moose::FunctionBase > _kokkos_functions
MooseEnum _verbose_setup
Whether or not to be verbose during setup.
void addDefaultSteadyStateConvergence(const InputParameters &params)
Adds the default steady-state detection Convergence.
virtual void reinitNeighborFaceRef(const Elem *neighbor_elem, unsigned int neighbor_side, Real tolerance, const std::vector< Point > *const pts, const std::vector< Real > *const weights=nullptr, const THREAD_ID tid=0) override
reinitialize FE objects on a given neighbor element on a given side at a given set of reference point...
FVInitialConditionWarehouse _fv_ics
virtual void addDisplacedProblem(std::shared_ptr< DisplacedProblem > displaced_problem)
const bool _boundary_restricted_elem_integrity_check
whether to perform checking of boundary restricted elemental object variable dependencies,...
virtual void addKokkosFunction(const std::string &type, const std::string &name, InputParameters &parameters)
Add a Kokkos function to the problem.
virtual void updateMortarMesh()
virtual bool hasFunction(const std::string &name, const THREAD_ID tid=0)
const std::vector< SolverSystemName > & getSolverSystemNames() const
bool computingNonlinearResid() const
Returns true if the problem is in the process of computing the nonlinear residual.
Definition SubProblem.h:718
virtual void computeResidualTag(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, TagID tag)
Form a residual vector for a given tag.
std::vector< std::unordered_map< BoundaryID, bool > > _bnd_mat_side_cache
Cache for calculating materials on side.
void reinitMaterialsFaceOnBoundary(const BoundaryID boundary_id, const SubdomainID blk_id, const THREAD_ID tid, const bool swap_stateful=true, const std::deque< MaterialBase * > *const reinit_mats=nullptr)
reinit materials on element faces on a boundary (internal or external) This specific routine helps us...
NonlinearSystemBase * _current_nl_sys
The current nonlinear system that we are solving.
const bool _uo_aux_state_check
Whether or not checking the state of uo/aux evaluation.
virtual void computeResidual(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, const unsigned int nl_sys_num)
Form a residual with default tags (nontime, time, residual).
bool computingScalingResidual() const override final
bool hasSetMultiAppFixedPointConvergenceName() const
Returns true if the problem has set the fixed point convergence name.
bool _started_initial_setup
At or beyond initialSteup stage.
bool hasInitialAdaptivity() const
Return a Boolean indicating whether initial AMR is turned on.
Adaptivity _adaptivity
std::vector< SolverSystemName > _solver_sys_names
The union of nonlinear and linear system names.
void reinitMaterialsBoundary(BoundaryID boundary_id, const THREAD_ID tid, bool swap_stateful=true, const std::deque< MaterialBase * > *reinit_mats=nullptr)
reinit materials on a boundary
virtual void addLinearFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters &parameters)
virtual void saveOldSolutions()
Allocate vectors and save old solutions into them.
const std::vector< ConvergenceName > & getLinearConvergenceNames() const
Gets the linear convergence object name(s).
void checkICRestartError(const std::string &ic_name, const std::string &name, const VariableName &var_name)
Checks if the variable of the initial condition is getting restarted and errors for specific cases.
std::vector< MeshChangedInterface * > _notify_when_mesh_changes
Objects to be notified when the mesh changes.
virtual void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters &params)
Canonical method for adding an auxiliary variable.
std::shared_ptr< DisplacedProblem > _displaced_problem
virtual Executor & getExecutor(const std::string &name)
void finalizeMultiApps()
void computeUserObjectsInternal(const ExecFlagType &type, TheWarehouse::Query &query)
virtual void setActiveElementalMooseVariables(const std::set< MooseVariableFEBase * > &moose_vars, const THREAD_ID tid) override
Set the MOOSE variables to be reinited on each element.
bool _verbose_restore
Whether or not to be verbose on solution restoration post a failed time step.
virtual void computeJacobianBlocks(std::vector< JacobianBlock * > &blocks, const unsigned int nl_sys_num)
Computes several Jacobian blocks simultaneously, summing their contributions into smaller preconditio...
void reinitMortarUserObjects(BoundaryID primary_boundary_id, BoundaryID secondary_boundary_id, bool displaced)
Call reinit on mortar user objects with matching primary boundary ID, secondary boundary ID,...
bool haveADObjects() const
Method for reading wehther we have any ad objects.
Definition SubProblem.h:782
virtual void swapBackMaterials(const THREAD_ID tid)
virtual void initialAdaptMesh()
void executeSamplers(const ExecFlagType &exec_type)
Performs setup and execute calls for Sampler objects.
void backupMultiApps(ExecFlagType type)
Backup the MultiApps associated with the ExecFlagType.
bool needToAddDefaultNonlinearConvergence() const
Returns true if the problem needs to add the default nonlinear convergence.
const std::size_t _num_nl_sys
The number of nonlinear systems.
virtual std::string solverTypeString(unsigned int solver_sys_num=0)
Return solver type as a human readable string.
const std::vector< VariableName > _constant_transpose_null_space_vars
Variables whose constant fields span part of the Jacobian transpose nullspace.
virtual void clearActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid) override
std::vector< VectorVariableCurl > _vector_curl_zero
virtual bool checkNonlocalCouplingRequirement() const override
void setCurrentExecuteOnFlag(const ExecFlagType &)
virtual void setActiveFEVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid) override
bool shouldPrintExecution(const THREAD_ID tid) const
Check whether the problem should output execution orders at this time.
void setNeedToAddDefaultMultiAppFixedPointConvergence()
Sets _need_to_add_default_multiapp_fixed_point_convergence to true.
bool _has_mortar
Whether the simulation requires mortar coupling.
std::vector< bool > _previous_multiapp_fp_nl_solution_required
Indicates we need to save the previous multiapp fixed-point iteration solver variable values.
virtual void addAuxArrayVariable(const std::string &var_name, const libMesh::FEType &type, unsigned int components, const std::set< SubdomainID > *const active_subdomains=NULL)
void setCurrentlyComputingResidual(bool currently_computing_residual) final
Set whether or not the problem is in the process of computing the residual.
const unsigned int _num_concurrent_multiapps
Number of concurrent applications being solved at the same time.
virtual std::vector< VariableName > getVariableNames()
Returns a list of all the variables in the problem (both from the NL and Aux systems.
virtual void updateGeomSearch(GeometricSearchData::GeometricSearchType type=GeometricSearchData::ALL) override
Update this object's geometric search data as well as the displaced problem's if it exists.
std::vector< std::function< void()> > _kokkos_mesh_initialization_hooks
Container holding hooks for functions that need to be called after Kokkos mesh initialization.
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) override
void partitionConcurrentMultiApps()
Assign each multiapp that shares an 'execution_order_group' with others a disjoint subset of the rank...
std::vector< std::pair< MooseVariableFieldBase *, MooseVariableFieldBase * > > & couplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num)
bool _need_to_add_default_steady_state_convergence
Flag that the problem needs to add the default steady convergence.
bool _calculate_jacobian_in_uo
MeshDivision & getMeshDivision(const std::string &name, const THREAD_ID tid=0) const
Get a MeshDivision.
virtual void execute(const ExecFlagType &exec_type)
Convenience function for performing execution of MOOSE systems.
bool _reinit_displaced_face
Whether to call DisplacedProblem::reinitElemFace when this->reinitElemFace is called.
bool _has_initialized_stateful
Whether nor not stateful materials have been initialized.
bool useHashTableMatrixAssembly() const
bool _has_constraints
Whether or not this system has any Constraints.
std::vector< MortarUserObject * > getMortarUserObjects(BoundaryID primary_boundary_id, BoundaryID secondary_boundary_id, bool displaced, const std::vector< MortarUserObject * > &mortar_uo_superset)
Helper for getting mortar objects corresponding to primary boundary ID, secondary boundary ID,...
std::vector< std::shared_ptr< NonlinearSystemBase > > _nl
The nonlinear systems.
void finishMultiAppStep(ExecFlagType type, bool recurse_through_multiapp_levels=false)
Finish the MultiApp time step (endStep, postStep) associated with the ExecFlagType.
virtual void addKokkosLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
Moose::PetscSupport::PetscOptions & getPetscOptions()
Retrieve a writable reference the PETSc options (used by PetscSupport)
virtual void computeJacobianTags(const std::set< TagID > &tags)
Form multiple matrices, and each is associated with a tag.
Moose::PetscSupport::PetscOptions _petsc_options
PETSc option storage.
void checkGradientMethods()
Let every FVGradientMethod resolve its dependencies on other gradient methods.
bool haveDisplaced() const override final
Whether we have a displaced problem in our simulation.
virtual void addMultiApp(const std::string &multi_app_name, const std::string &name, InputParameters &parameters)
Add a MultiApp to the problem.
void setResidualObjectParamsAndLog(const std::string &ro_name, const std::string &name, InputParameters &parameters, const unsigned int nl_sys_num, const std::string &base_name, bool &reinit_displaced)
Set the subproblem and system parameters for residual objects and log their addition.
virtual void addMarker(const std::string &marker_name, const std::string &name, InputParameters &parameters)
bool _snesmf_reuse_base
If or not to resuse the base vector for matrix-free calculation.
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...
void kokkosJoinAndFinalize(const std::vector< Moose::Kokkos::UserObject * > &userobjs)
void setFailNextSystemConvergenceCheck()
Tell the problem that the system(s) cannot be considered converged next time convergence is checked.
bool useSNESMFReuseBase()
Return a flag that indicates if we are reusing the vector base.
virtual Distribution & getDistribution(const std::string &name)
bool errorOnJacobianNonzeroReallocation() const
Will return True if the user wants to get an error when a nonzero is reallocated in the Jacobian by P...
TheWarehouse & theWarehouse() const
virtual void addScalarKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
virtual void addKokkosNodalKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
virtual Real finalNonlinearResidual(const unsigned int nl_sys_num) const override
MooseObjectWarehouse< Convergence > _convergences
convergence warehouse
virtual bool hasConvergence(const std::string &name, const THREAD_ID tid=0) const
Returns true if the problem has a Convergence object of the given name.
virtual Real & time() const
bool _has_jacobian
Indicates if the Jacobian was computed.
virtual const SystemBase & systemBaseSolver(const unsigned int sys_num) const override
Return the solver system object as a base class reference given the system number.
bool hasTimeIntegrator() const
Returns whether or not this Problem has a TimeIntegrator.
virtual void subdomainSetup(SubdomainID subdomain, const THREAD_ID tid)
void translateCaughtException(const std::string &calling_method)
Classify the exception currently being handled and register its message with setException(),...
virtual bool adaptMesh()
virtual void addFVInterfaceKernel(const std::string &fv_ik_name, const std::string &name, InputParameters &parameters)
void bumpAllQRuleOrder(libMesh::Order order, SubdomainID block)
virtual void addFVInitialCondition(const std::string &ic_name, const std::string &name, InputParameters &parameters)
Add an initial condition for a finite volume variables.
virtual void setInputParametersFEProblem(InputParameters &parameters)
const std::vector< std::pair< MooseVariableFieldBase *, MooseVariableScalar * > > & fieldScalarCouplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num) const
std::vector< std::vector< const MooseVariableFEBase * > > _uo_jacobian_moose_vars
Adaptivity & adaptivity()
virtual void computeResidualType(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, TagID tag)
Form a residual vector for a given tag and "residual" tag.
virtual Real & timeOlder() const
The time two steps back.
void reinitMaterialsNeighborOnBoundary(const BoundaryID boundary_id, const SubdomainID blk_id, const THREAD_ID tid, const bool swap_stateful=true, const std::deque< MaterialBase * > *const reinit_mats=nullptr)
reinit materials on neighbor element (usually faces) on a boundary (internal or external) This specif...
friend class Resurrector
virtual void addInterfaceKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
const Moose::Kokkos::System & getKokkosSystem(const unsigned int sys_num) const
virtual void addReporter(const std::string &type, const std::string &name, InputParameters &parameters)
Add a Reporter object to the simulation.
const libMesh::ConstNodeRange & getCurrentAlgebraicNodeRange()
std::vector< unsigned char > _has_active_material_properties
Whether there are active material properties on each thread.
virtual bool uDotDotOldRequested()
Get boolean flag to check whether old solution second time derivative needs to be stored.
void execMultiAppTransfers(ExecFlagType type, Transfer::DIRECTION direction, const MultiAppName &source_app="")
Execute MultiAppTransfers associated with execution flag and direction.
bool needToAddDefaultSteadyStateConvergence() const
Returns true if the problem needs to add the default steady-state detection convergence.
Moose::CouplingType _coupling
Type of variable coupling.
bool _has_exception
Whether or not an exception has occurred.
MooseAppCoordTransform & coordTransform()
virtual void copySolutionsBackwards()
std::vector< Real > _real_zero
Convenience zeros.
void reinitMaterialsInterface(BoundaryID boundary_id, const THREAD_ID tid, bool swap_stateful=true)
virtual void addConstraint(const std::string &c_name, const std::string &name, InputParameters &parameters)
virtual void setCurrentLowerDElem(const Elem *const lower_d_elem, const THREAD_ID tid) override
Set the current lower dimensional element.
virtual void initPetscOutputAndSomeSolverSettings()
Reinitialize PETSc output for proper linear/nonlinear iteration display.
void allowOutput(bool state)
Ability to enable/disable all output calls.
void computeKokkosUserObjectsInternal(const ExecFlagType &type, TheWarehouse::Query &query)
bool hasMultiApp(const std::string &name) const
const bool & _immediately_print_invalid_solution
virtual void meshDisplaced()
Update data after a mesh displaced.
bool _u_dot_old_requested
Whether old solution time derivative needs to be stored.
std::unique_ptr< libMesh::ConstElemRange > _evaluable_local_elem_range
std::vector< MooseArray< ADRealTensorValue > > _ad_second_zero
virtual void setResidual(NumericVector< libMesh::Number > &residual, const THREAD_ID tid) override
bool _using_ad_mat_props
Automatic differentiaion (AD) flag which indicates whether any consumer has requested an AD material ...
virtual bool onlyAllowDefaultNonlinearConvergence() const
Returns true if an error will result if the user supplies 'nonlinear_convergence'.
virtual int & timeStep() const
void initKokkosStatefulProps()
virtual bool isTransient() const override
std::unique_ptr< libMesh::ConstElemRange > _aux_evaluable_local_elem_range
virtual void addCachedResidualDirectly(NumericVector< libMesh::Number > &residual, const THREAD_ID tid)
Allows for all the residual contributions that are currently cached to be added directly into the vec...
virtual Moose::FEBackend feBackend() const
void computingScalingResidual(bool computing_scaling_residual)
Setter for whether we're computing the scaling residual.
virtual void addFunctorMaterial(const std::string &functor_material_name, const std::string &name, InputParameters &parameters)
virtual void setUDotRequested(const bool u_dot_requested)
Set boolean flag to true to store solution time derivative.
virtual void addDamper(const std::string &damper_name, const std::string &name, InputParameters &parameters)
virtual void computeMarkers()
const ConvergenceName & getMultiAppFixedPointConvergenceName() const
Gets the MultiApp fixed point convergence object name.
static SolverParams makeLinearSolverParams()
Make basic solver params for linear solves.
virtual Function & getFunction(const std::string &name, const THREAD_ID tid=0)
unsigned int _cycles_completed
virtual void setUDotDotOldRequested(const bool u_dotdot_old_requested)
Set boolean flag to true to store old solution second time derivative.
ExecFlagEnum _print_execution_on
When to print the execution of loops.
bool initialized() const
virtual void clearActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid) override
std::vector< Point > _point_zero
std::vector< MooseArray< ADReal > > _ad_zero
virtual void computeJacobianTag(const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian, TagID tag)
Form a Jacobian matrix for a given tag.
void createTagSolutions()
Create extra tagged solution vectors.
Moose::Kokkos::Array< Moose::Kokkos::System > _kokkos_systems
System array - sparsely populated (only slots for systems needing a Kokkos::System)
virtual void prepareAssemblyNeighbor(const THREAD_ID tid)
Begin a fresh neighbor accumulation phase by sizing and zeroing the neighbor blocks.
MooseObjectWarehouse< Function > _functions
functions
virtual const SystemBase & systemBaseNonlinear(const unsigned int sys_num) const override
Return the nonlinear system object as a base class reference given the system number.
CoverageCheckMode _material_coverage_check
Determines whether and which subdomains are to be checked to ensure that they have an active material...
const std::set< const MooseObject * > & getMaterialPropertyStorageConsumers(Moose::MaterialDataType type) const
virtual void clearActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) override
virtual const SystemBase & getSystemBase(const unsigned int sys_num) const
Get constant reference to a system in this problem.
bool allowInvalidSolution() const
Whether to accept / allow an invalid solution.
const std::set< const MooseObject * > & getKokkosMaterialPropertyStorageConsumers(Moose::MaterialDataType type) const
const MaterialWarehouse & getDiscreteMaterialWarehouse() const
void needsPreviousMultiSystemFixedPointIterationSolution(bool needed, const unsigned int solver_sys_num)
Set a flag that indicates that user requires values for the previous multi-system fixed point iterate...
void addDefaultMultiAppFixedPointConvergence(const InputParameters &params)
Adds the default fixed point Convergence associated with the problem.
bool _u_dotdot_requested
Whether solution second time derivative needs to be stored.
bool hasActiveMaterialProperties(const THREAD_ID tid) const
Method to check whether or not a list of active material roperties has been set.
virtual unsigned int nLinearIterations(const unsigned int nl_sys_num) const override
std::optional< std::vector< ConvergenceName > > _nonlinear_convergence_names
Nonlinear system(s) convergence name(s)
virtual Real computeResidualL2Norm()
Computes the residual using whatever is sitting in the current solution vector then returns the L2 no...
std::unique_ptr< ConstBndNodeRange > _current_algebraic_bnd_node_range
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
virtual void computeTransposeNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > * > &sp)
void initialSetup() override
bool _previous_multisystem_fp_aux_solution_required
Indicates we need to save the previous multi-system fixed-point iteration auxiliary variable values.
std::vector< VariableValue > _zero
virtual bool startedInitialSetup()
Returns true if we are in or beyond the initialSetup stage.
virtual void outputStep(ExecFlagType type)
Output the current step.
MooseObjectWarehouse< Marker > _markers
std::vector< std::shared_ptr< SolverSystem > > _solver_systems
Combined container to base pointer of every solver system.
void setParallelBarrierMessaging(bool flag)
Toggle parallel barrier messaging (defaults to on).
Moose::Kokkos::Array< Moose::Kokkos::FESystem > & getKokkosFESystems()
Get the Kokkos FESystem array (populated only when FE Kokkos objects exist)
void getUOExecutionGroups(TheWarehouse::Query &query, std::set< int > &execution_groups) const
bool _is_petsc_options_inserted
If or not PETSc options have been added to database.
bool _check_residual_for_nans
Whether to check the residual for NaN or Inf values.
void notifyWhenMeshChanges(MeshChangedInterface *mci)
Register an object that derives from MeshChangedInterface to be notified when the mesh changes.
bool showInvalidSolutionConsole() const
Whether or not to print out the invalid solutions summary table in console.
virtual void ghostGhostedBoundaries() override
Causes the boundaries added using addGhostedBoundary to actually be ghosted.
virtual void computeJacobianInternal(const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian, const std::set< TagID > &tags)
Form a Jacobian matrix for multiple tags.
virtual void cacheResidualNeighbor(const THREAD_ID tid) override
const FVInitialConditionWarehouse & getFVInitialConditionWarehouse() const
Return FVInitialCondition storage.
virtual void computeResidualSys(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual)
This function is called by Libmesh to form a residual.
virtual void computeIndicatorsAndMarkers()
virtual void reinitNeighbor(const Elem *elem, unsigned int side, const THREAD_ID tid) override
const std::vector< NonlinearSystemName > _nl_sys_names
The nonlinear system names.
virtual void setNeighborSubdomainID(const Elem *elem, unsigned int side, const THREAD_ID tid) override
Moose::Kokkos::Assembly & kokkosAssembly()
bool ignoreZerosInJacobian() const
Will return true if zeros in the Jacobian are to be dropped from the sparsity pattern.
const bool _fv_face_integrity_check
Whether to check FV boundary and interface objects against the faces on which they execute.
virtual void addAuxVariable(const std::string &var_name, const libMesh::FEType &type, const std::set< SubdomainID > *const active_subdomains=NULL)
virtual void meshChanged()
Deprecated.
virtual std::pair< bool, unsigned int > determineSolverSystem(const std::string &var_name, bool error_if_not_found=false) const override
Determine what solver system the provided variable name lies in.
virtual libMesh::System & getSystem(const std::string &var_name) override
Returns the equation system containing the variable provided.
void uniformRefine()
uniformly refine the problem mesh(es).
MooseMesh * _displaced_mesh
void setNeedToAddDefaultSteadyStateConvergence()
Sets _need_to_add_default_steady_state_convergence to true.
ExecuteMooseObjectWarehouse< Transfer > _from_multi_app_transfers
Transfers executed just after MultiApps to transfer data from them.
const Moose::Kokkos::FESystem & getKokkosFESystem(const unsigned int sys_num) const
void initXFEM(std::shared_ptr< XFEMInterface > xfem)
Create XFEM controller object.
std::vector< SubdomainName > _kernel_coverage_blocks
static InputParameters validParams()
MaterialPropertyRegistry _material_prop_registry
virtual bool computingPreSMOResidual(const unsigned int nl_sys_num) const override
Returns true if the problem is in the process of computing it's initial residual.
bool automaticScaling() const
Automatic scaling getter.
bool constJacobian() const
Returns _const_jacobian (whether a MOOSE object has specified that the Jacobian is the same as the pr...
virtual void addMeshDivision(const std::string &type, const std::string &name, InputParameters &params)
Add a MeshDivision.
bool checkingUOAuxState() const
Return a flag to indicate whether we are executing user objects and auxliary kernels for state check ...
void resetFailNextSystemConvergenceCheck()
Tell the problem that the system convergence check(s) may proceed as normal.
const bool _show_invalid_solution_console
void setCheckResidualForNans(bool check_residual_for_nans)
Setter for residual NaN/Inf checking.
virtual void prepareNeighborShapes(unsigned int var, const THREAD_ID tid) override
const bool _allow_ics_during_restart
virtual void addKokkosVectorPostprocessor(const std::string &pp_name, const std::string &name, InputParameters &parameters)
virtual Moose::Kokkos::Function getKokkosFunction(const std::string &name)
Get a Kokkos function in an abstract type.
Interface for interpolation methods that provide matrix and RHS contributions for advected face value...
Abstract base class for interpolation methods that produce a scalar face value from adjacent cell val...
Base class for linear finite-volume cell-gradient methods.
Warehouse for storing finite volume initial conditions.
Registered base class for linear FV interpolation objects.
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters &parameters, THREAD_ID tid=0, bool print_deprecated=true)
Definition Factory.C:142
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
Definition Factory.C:68
Base class for function objects.
Definition Function.h:30
GeometricSearchType
Used to select groups of geometric search objects to update.
Warehouse for storing initial conditions.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Base class for deriving any boundary condition of a integrated type.
Base class for implementing interface user objects.
Base class for user objects executed on all element sides internal to one or more blocks,...
Helper class for holding the preconditioning blocks to fill.
This is the common base class for the three main kernel types implemented in MOOSE,...
Definition KernelBase.h:29
Linear system to be solved.
Proxy for accessing MaterialPropertyStorage.
Registry class for material property IDs and names.
Stores the stateful material properties computed by materials.
MaterialBase objects are special in that they have additional objects created automatically (see FEPr...
Materials compute MaterialProperties.
Definition Material.h:36
Interface for notifications that the mesh has changed.
Interface for objects acting when the mesh has been displaced.
Base class for MeshDivision objects.
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition MooseApp.C:2418
Executor * getExecutor() const
Definition MooseApp.h:338
TheWarehouse & theWarehouse()
Definition MooseApp.h:140
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
const std::string & type() const
Get the type of this class.
Definition MooseBase.h:93
const std::string & name() const
Get the name of the class.
Definition MooseBase.h:103
Class for containing MooseEnum item information.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
std::shared_ptr< T > getActiveObject(const std::string &name, THREAD_ID tid=0) const
bool hasActiveObjects(THREAD_ID tid=0) const
A storage container for MooseObjects that inherit from SetupInterface.
Every object that can be built by the factory should be derived from this class.
Definition MooseObject.h:31
MooseApp & _app
The MOOSE application this is associated with.
Definition MooseBase.h:375
This class provides an interface for common operations on field variables of both FE and FV types wit...
Class for scalar variables (they are different).
The Kokkos array class.
The Kokkos assembly class.
The Kokkos FE system class.
The abstract class that provides polymorphic interfaces for a function.
The Kokkos class responsible for allocating and storing Kokkos material properties.
The Kokkos base system class.
A struct for storing the various types of petsc options and values.
Base class for creating new nodally-based mortar user objects.
A MultiApp represents one or more MOOSE applications that are running simultaneously.
Definition MultiApp.h:140
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type.
A user object that runs over all the nodes and does an aggregation step to compute a single value.
Nonlinear system to be solved.
Nonlinear system to be solved.
void allowOutput(bool state)
Ability to enable/disable output calls This is private, users should utilize FEProblemBase::allowOutp...
Positions objects are under the hood Reporters.
Definition Positions.h:21
Base class for all Postprocessors.
Interface for objects that need parallel consistent random numbers without patterns over the course o...
This is a helper class for managing the storage of declared Reporter object values.
Wrapper class that owns a libMesh EquationSystem and adds advanced restart capability to it.
libMesh::EquationSystems & es()
Wrapper class for restartable data that is "managed.
Definition Restartable.h:43
A class for creating restricted objects.
Definition Restartable.h:29
This is the base class for Samplers as used within the Stochastic Tools module.
Definition Sampler.h:52
Warehouse for storing scalar initial conditions.
InitialConditions are objects that set the initial value of variables.
Base class for user objects executed one or more sidesets, which may be on the outer boundary of the ...
The SolutionInvalidity will contain all the information about the occurrence(s) of solution invalidit...
Generic class for solving transient nonlinear problems.
Definition SubProblem.h:79
THREAD_ID numThreads() const
Definition SubProblem.C:81
Factory & _factory
The Factory for building objects.
std::vector< VectorTag > getVectorTags(const std::set< TagID > &tag_ids) const
Definition SubProblem.C:164
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 =0
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
bool computingNonlinearResid() const
Returns true if the problem is in the process of computing the nonlinear residual.
Definition SubProblem.h:718
bool haveADObjects() const
Method for reading wehther we have any ad objects.
Definition SubProblem.h:782
const bool & currentlyComputingResidual() const
Returns true if the problem is in the process of computing the residual.
Definition SubProblem.h:731
bool automaticScaling() const
Automatic scaling getter.
Base class for a system (of equations)
Definition SystemBase.h:87
QueryCache is a convenient way to construct and pass around (possible partially constructed) warehous...
QueryCache & condition(Args &&... args)
Adds a new condition to the query.
TheWarehouse is a container for MooseObjects that allows querying/filtering over various customizeabl...
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse.
void add(std::shared_ptr< MooseObject > obj)
add adds a new object to the warehouse and stores attributes/metadata about it for running queries/fi...
Base class for all Transfer objects.
Definition Transfer.h:40
MultiApp Implementation for Transient Apps.
Base class for user-specific data.
Definition UserObject.h:20
Base class for Postprocessors that produce a vector of values.
This is the XFEMInterface class.
void setSinglePetscOption(const std::string &name, const std::string &value="", FEProblemBase *const problem=nullptr)
A wrapper function for dealing with different versions of PetscOptionsSetValue.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
@ VAR_FIELD_ANY
Definition MooseTypes.h:785
AuxGroup
Flag for AuxKernel related execution type.
Definition MooseTypes.h:762
const SubdomainID ANY_BLOCK_ID
Definition MooseTypes.C:19
MaterialDataType
MaterialData types.
Definition MooseTypes.h:750
SolutionIterationType
Definition MooseTypes.h:270
VarKindType
Framework-wide stuff.
Definition MooseTypes.h:773
@ VAR_ANY
Definition MooseTypes.h:776
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
State argument for evaluating functors.
Per-mortar-interface configuration.