https://mooseframework.inl.gov
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 "KokkosSystem.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"
33 #include "MooseVariableFE.h"
34 #include "MultiAppTransfer.h"
35 #include "Postprocessor.h"
36 #include "HashMap.h"
37 #include "VectorPostprocessor.h"
38 #include "PerfGraphInterface.h"
39 #include "Attributes.h"
40 #include "MooseObjectWarehouse.h"
43 #include "SolutionInvalidity.h"
44 #include "PetscSupport.h"
45 
46 #include "libmesh/enum_quadrature_type.h"
47 #include "libmesh/equation_systems.h"
48 
49 #include <unordered_map>
50 #include <memory>
51 
52 // Forward declarations
53 class AuxiliarySystem;
54 class DisplacedProblem;
55 class MooseMesh;
57 class LinearSystem;
58 class SolverSystem;
59 class NonlinearSystem;
60 class RandomInterface;
61 class RandomData;
64 class MultiMooseEnum;
66 class MaterialData;
67 class MooseEnum;
69 class Assembly;
70 class JacobianBlock;
71 class Control;
72 class MultiApp;
73 class TransientMultiApp;
75 class Indicator;
77 class Marker;
78 class Material;
79 class Transfer;
80 class XFEMInterface;
81 class SideUserObject;
82 class NodalUserObject;
83 class ElementUserObject;
86 class GeneralUserObject;
87 class Positions;
88 class Function;
89 class Distribution;
90 class Sampler;
91 class KernelBase;
92 class IntegratedBCBase;
93 class LineSearch;
94 class UserObject;
95 class UserObjectBase;
100 class VectorPostprocessor;
101 class Convergence;
103 class MortarUserObject;
104 class SolutionInvalidity;
105 
106 namespace Moose
107 {
108 class FunctionBase;
109 }
110 
111 #ifdef MOOSE_KOKKOS_ENABLED
112 namespace Moose::Kokkos
113 {
115 class Function;
116 class UserObject;
117 }
118 #endif
119 
120 // libMesh forward declarations
121 namespace libMesh
122 {
123 class CouplingMatrix;
124 class NonlinearImplicitSystem;
125 class LinearImplicitSystem;
126 } // namespace libMesh
127 
129 {
130  ITERATING = 0,
131  // CONVERGED_RTOL_NORMAL = 1,
132  // CONVERGED_ATOL_NORMAL = 9,
133  CONVERGED_RTOL = 2,
134  CONVERGED_ATOL = 3,
135  CONVERGED_ITS = 4,
136  // CONVERGED_CG_NEG_CURVE = 5,
137  // CONVERGED_CG_CONSTRAINED = 6,
138  // CONVERGED_STEP_LENGTH = 7,
139  // CONVERGED_HAPPY_BREAKDOWN = 8,
140  DIVERGED_NULL = -2,
141  // DIVERGED_ITS = -3,
142  // DIVERGED_DTOL = -4,
143  // DIVERGED_BREAKDOWN = -5,
144  // DIVERGED_BREAKDOWN_BICG = -6,
145  // DIVERGED_NONSYMMETRIC = -7,
146  // DIVERGED_INDEFINITE_PC = -8,
147  DIVERGED_NANORINF = -9,
148  // DIVERGED_INDEFINITE_MAT = -10
150 };
151 
156 class FEProblemBase : public SubProblem, public Restartable
157 {
158 public:
159  static InputParameters validParams();
160 
162  virtual ~FEProblemBase();
163 
167  [[nodiscard]] bool initialized() const { return _initialized; }
168 
169  enum class CoverageCheckMode
170  {
171  FALSE,
172  TRUE,
173  OFF,
174  ON,
175  SKIP_LIST,
176  ONLY_LIST,
177  };
178 
179  virtual libMesh::EquationSystems & es() override { return _req.set().es(); }
180  virtual MooseMesh & mesh() override { return _mesh; }
181  virtual const MooseMesh & mesh() const override { return _mesh; }
182  const MooseMesh & mesh(bool use_displaced) const override;
183  MooseMesh & mesh(bool use_displaced);
184 
185  void setCoordSystem(const std::vector<SubdomainName> & blocks, const MultiMooseEnum & coord_sys);
186  void setAxisymmetricCoordAxis(const MooseEnum & rz_coord_axis);
187 
194 
196 
202  void setCouplingMatrix(std::unique_ptr<libMesh::CouplingMatrix> cm,
203  const unsigned int nl_sys_num);
204 
205  // DEPRECATED METHOD
206  void setCouplingMatrix(libMesh::CouplingMatrix * cm, const unsigned int nl_sys_num);
207 
208  const libMesh::CouplingMatrix * couplingMatrix(const unsigned int nl_sys_num) const override;
209 
212 
213  bool
214  areCoupled(const unsigned int ivar, const unsigned int jvar, const unsigned int nl_sys_num) const;
215 
219  bool hasUOAuxStateCheck() const { return _uo_aux_state_check; }
220 
228 
229 #ifndef NDEBUG
230  virtual bool checkResidualForNans() const override { return _check_residual_for_nans; }
231 
233  void setCheckResidualForNans(bool check_residual_for_nans)
234  {
235  _check_residual_for_nans = check_residual_for_nans;
236  }
237 #endif
238 
245 
246  std::vector<std::pair<MooseVariableFEBase *, MooseVariableFEBase *>> &
247  couplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num);
248  std::vector<std::pair<MooseVariableFEBase *, MooseVariableFEBase *>> &
249  nonlocalCouplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num);
250 
251  virtual bool hasVariable(const std::string & var_name) const override;
252  // NOTE: hasAuxiliaryVariable defined in parent class
253  bool hasSolverVariable(const std::string & var_name) const;
255  virtual const MooseVariableFieldBase &
256  getVariable(const THREAD_ID tid,
257  const std::string & var_name,
259  Moose::VarFieldType expected_var_field_type =
260  Moose::VarFieldType::VAR_FIELD_ANY) const override;
262  const std::string & var_name) override;
263  virtual MooseVariable & getStandardVariable(const THREAD_ID tid,
264  const std::string & var_name) override;
265  virtual VectorMooseVariable & getVectorVariable(const THREAD_ID tid,
266  const std::string & var_name) override;
267  virtual ArrayMooseVariable & getArrayVariable(const THREAD_ID tid,
268  const std::string & var_name) override;
269 
270  virtual bool hasScalarVariable(const std::string & var_name) const override;
271  virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid,
272  const std::string & var_name) override;
273  virtual libMesh::System & getSystem(const std::string & var_name) override;
274 
277 
284  virtual void setActiveElementalMooseVariables(const std::set<MooseVariableFEBase *> & moose_vars,
285  const THREAD_ID tid) override;
286 
294  virtual void clearActiveElementalMooseVariables(const THREAD_ID tid) override;
295 
296  virtual void clearActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) override;
297 
298  virtual void clearActiveFEVariableCoupleableVectorTags(const THREAD_ID tid) override;
299 
300  virtual void setActiveFEVariableCoupleableVectorTags(std::set<TagID> & vtags,
301  const THREAD_ID tid) override;
302 
303  virtual void setActiveFEVariableCoupleableMatrixTags(std::set<TagID> & mtags,
304  const THREAD_ID tid) override;
305 
306  virtual void clearActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid) override;
307 
308  virtual void clearActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid) override;
309 
310  virtual void setActiveScalarVariableCoupleableVectorTags(std::set<TagID> & vtags,
311  const THREAD_ID tid) override;
312 
313  virtual void setActiveScalarVariableCoupleableMatrixTags(std::set<TagID> & mtags,
314  const THREAD_ID tid) override;
315 
317  libMesh::Order order,
318  libMesh::Order volume_order = libMesh::INVALID_ORDER,
321  bool allow_negative_qweights = true);
322 
331 
332  void bumpAllQRuleOrder(libMesh::Order order, SubdomainID block);
333 
337  unsigned int getMaxQps() const;
338 
343 
347  void checkNonlocalCoupling();
349  void setVariableAllDoFMap(const std::vector<const MooseVariableFEBase *> & moose_vars);
350 
351  const std::vector<const MooseVariableFEBase *> &
353  {
354  return _uo_jacobian_moose_vars[tid];
355  }
356 
357  virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) override;
358  virtual const Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) const override;
359 
360 #ifdef MOOSE_KOKKOS_ENABLED
363 #endif
364 
368  virtual std::vector<VariableName> getVariableNames();
369 
370  void initialSetup() override;
372  void timestepSetup() override;
373  void customSetup(const ExecFlagType & exec_type) override;
374  void residualSetup() override;
375  void jacobianSetup() override;
376 
377  virtual void prepare(const Elem * elem, const THREAD_ID tid) override;
378  virtual void prepareFace(const Elem * elem, const THREAD_ID tid) override;
379  virtual void prepare(const Elem * elem,
380  unsigned int ivar,
381  unsigned int jvar,
382  const std::vector<dof_id_type> & dof_indices,
383  const THREAD_ID tid) override;
384 
385  virtual void setCurrentSubdomainID(const Elem * elem, const THREAD_ID tid) override;
386  virtual void
387  setNeighborSubdomainID(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
388  virtual void setNeighborSubdomainID(const Elem * elem, const THREAD_ID tid);
389  virtual void prepareAssembly(const THREAD_ID tid) override;
390 
391  virtual void addGhostedElem(dof_id_type elem_id) override;
392  virtual void addGhostedBoundary(BoundaryID boundary_id) override;
393  virtual void ghostGhostedBoundaries() override;
394 
395  virtual void sizeZeroes(unsigned int size, const THREAD_ID tid);
396  virtual bool reinitDirac(const Elem * elem, const THREAD_ID tid) override;
397 
398  virtual void reinitElem(const Elem * elem, const THREAD_ID tid) override;
399  virtual void reinitElemPhys(const Elem * elem,
400  const std::vector<Point> & phys_points_in_elem,
401  const THREAD_ID tid) override;
402  void reinitElemFace(const Elem * elem, unsigned int side, BoundaryID, const THREAD_ID tid);
403  virtual void reinitElemFace(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
404  virtual void reinitLowerDElem(const Elem * lower_d_elem,
405  const THREAD_ID tid,
406  const std::vector<Point> * const pts = nullptr,
407  const std::vector<Real> * const weights = nullptr) override;
408  virtual void reinitNode(const Node * node, const THREAD_ID tid) override;
409  virtual void reinitNodeFace(const Node * node, BoundaryID bnd_id, const THREAD_ID tid) override;
410  virtual void reinitNodes(const std::vector<dof_id_type> & nodes, const THREAD_ID tid) override;
411  virtual void reinitNodesNeighbor(const std::vector<dof_id_type> & nodes,
412  const THREAD_ID tid) override;
413  virtual void reinitNeighbor(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
414  virtual void reinitNeighborPhys(const Elem * neighbor,
415  unsigned int neighbor_side,
416  const std::vector<Point> & physical_points,
417  const THREAD_ID tid) override;
418  virtual void reinitNeighborPhys(const Elem * neighbor,
419  const std::vector<Point> & physical_points,
420  const THREAD_ID tid) override;
421  virtual void
422  reinitElemNeighborAndLowerD(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
423  virtual void reinitScalars(const THREAD_ID tid,
424  bool reinit_for_derivative_reordering = false) override;
425  virtual void reinitOffDiagScalars(const THREAD_ID tid) override;
426 
428  virtual void getDiracElements(std::set<const Elem *> & elems) override;
429  virtual void clearDiracInfo() override;
430 
431  virtual void subdomainSetup(SubdomainID subdomain, const THREAD_ID tid);
432  virtual void neighborSubdomainSetup(SubdomainID subdomain, const THREAD_ID tid);
433 
434  virtual void newAssemblyArray(std::vector<std::shared_ptr<SolverSystem>> & solver_systems);
435  virtual void initNullSpaceVectors(const InputParameters & parameters,
436  std::vector<std::shared_ptr<NonlinearSystemBase>> & nl);
437 
438  virtual void init() override;
439  virtual void solve(const unsigned int nl_sys_num);
440 
441 #ifdef MOOSE_KOKKOS_ENABLED
442 
445  void initKokkos();
446 #endif
447 
453  virtual void solveLinearSystem(const unsigned int linear_sys_num,
454  const Moose::PetscSupport::PetscOptions * po = nullptr);
455 
457 
476 
478 
493 
495 
516 
525  virtual void setException(const std::string & message);
526 
530  virtual bool hasException() { return _has_exception; }
531 
548  virtual void checkExceptionAndStopSolve(bool print_message = true);
549 
550  virtual bool solverSystemConverged(const unsigned int solver_sys_num) override;
551  virtual unsigned int nNonlinearIterations(const unsigned int nl_sys_num) const override;
552  virtual unsigned int nLinearIterations(const unsigned int nl_sys_num) const override;
553  virtual Real finalNonlinearResidual(const unsigned int nl_sys_num) const override;
554  virtual bool computingPreSMOResidual(const unsigned int nl_sys_num) const override;
555 
559  virtual std::string solverTypeString(unsigned int solver_sys_num = 0);
560 
564  virtual bool startedInitialSetup() { return _started_initial_setup; }
565 
566  virtual void onTimestepBegin() override;
567  virtual void onTimestepEnd() override;
568 
569  virtual Real & time() const { return _time; }
570  virtual Real & timeOld() const { return _time_old; }
571  virtual int & timeStep() const { return _t_step; }
572  virtual Real & dt() const { return _dt; }
573  virtual Real & dtOld() const { return _dt_old; }
577  Real getTimeFromStateArg(const Moose::StateArg & state) const;
578 
579  virtual void transient(bool trans) { _transient = trans; }
580  virtual bool isTransient() const override { return _transient; }
581 
582  virtual void addTimeIntegrator(const std::string & type,
583  const std::string & name,
585  virtual void
586  addPredictor(const std::string & type, const std::string & name, InputParameters & parameters);
587 
588  virtual void copySolutionsBackwards();
589 
594 
599  virtual void advanceState();
600 
601  virtual void restoreSolutions();
602 
606  virtual void saveOldSolutions();
607 
611  virtual void restoreOldSolutions();
612 
618  void needSolutionState(unsigned int oldest_needed, Moose::SolutionIterationType iteration_type);
619 
625  bool hasSolutionState(unsigned int state, Moose::SolutionIterationType iteration_type) const;
626 
633  virtual void outputStep(ExecFlagType type);
634 
638  virtual void postExecute();
639 
641 
647  void allowOutput(bool state);
648  template <typename T>
649  void allowOutput(bool state);
651 
660  void forceOutput();
661 
667 
672 
676  void logAdd(const std::string & system,
677  const std::string & name,
678  const std::string & type,
679  const InputParameters & params) const;
680 
681  // Function /////
682  virtual void
683  addFunction(const std::string & type, const std::string & name, InputParameters & parameters);
684  virtual bool hasFunction(const std::string & name, const THREAD_ID tid = 0);
685  virtual Function & getFunction(const std::string & name, const THREAD_ID tid = 0);
686 
687 #ifdef MOOSE_KOKKOS_ENABLED
688 
694  virtual void addKokkosFunction(const std::string & type,
695  const std::string & name,
702  virtual bool hasKokkosFunction(const std::string & name) const;
708  virtual Moose::Kokkos::Function getKokkosFunction(const std::string & name);
715  template <typename T>
716  T & getKokkosFunction(const std::string & name);
717 #endif
718 
720  virtual void
721  addMeshDivision(const std::string & type, const std::string & name, InputParameters & params);
723  MeshDivision & getMeshDivision(const std::string & name, const THREAD_ID tid = 0) const;
724 
726  virtual void
727  addConvergence(const std::string & type, const std::string & name, InputParameters & parameters);
729  virtual Convergence & getConvergence(const std::string & name, const THREAD_ID tid = 0) const;
731  virtual const std::vector<std::shared_ptr<Convergence>> &
732  getConvergenceObjects(const THREAD_ID tid = 0) const;
734  virtual bool hasConvergence(const std::string & name, const THREAD_ID tid = 0) const;
737  {
739  }
742  {
744  }
747  {
749  }
752  {
754  }
757  {
759  }
762  {
764  }
767  {
768  return _multiapp_fixed_point_convergence_name.has_value();
769  }
772  {
773  return _steady_state_convergence_name.has_value();
774  }
782  virtual void addDefaultNonlinearConvergence(const InputParameters & params);
790  virtual bool onlyAllowDefaultNonlinearConvergence() const { return false; }
807 
811  virtual void addLineSearch(const InputParameters & /*parameters*/)
812  {
813  mooseError("Line search not implemented for this problem type yet.");
814  }
815 
819  virtual void lineSearch();
820 
824  LineSearch * getLineSearch() override { return _line_search.get(); }
825 
829  virtual void
830  addDistribution(const std::string & type, const std::string & name, InputParameters & parameters);
831  virtual bool hasDistribution(const std::string & name) const;
832  virtual Distribution & getDistribution(const std::string & name);
833 
837  virtual void
838  addSampler(const std::string & type, const std::string & name, InputParameters & parameters);
839  virtual Sampler & getSampler(const std::string & name, const THREAD_ID tid = 0);
840 
841  // NL /////
842  NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num);
843  const NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num) const;
844  void setCurrentNonlinearSystem(const unsigned int nl_sys_num);
847 
848  virtual const SystemBase & systemBaseNonlinear(const unsigned int sys_num) const override;
849  virtual SystemBase & systemBaseNonlinear(const unsigned int sys_num) override;
850 
851  virtual const SystemBase & systemBaseSolver(const unsigned int sys_num) const override;
852  virtual SystemBase & systemBaseSolver(const unsigned int sys_num) override;
853 
854  virtual const SystemBase & systemBaseAuxiliary() const override;
855  virtual SystemBase & systemBaseAuxiliary() override;
856 
857  virtual NonlinearSystem & getNonlinearSystem(const unsigned int sys_num);
858 
859 #ifdef MOOSE_KOKKOS_ENABLED
860 
867  {
868  return _kokkos_systems;
869  }
871 
877  Moose::Kokkos::System & getKokkosSystem(const unsigned int sys_num);
879  const Moose::Kokkos::System & getKokkosSystem(const unsigned int sys_num) const;
881 #endif
882 
887  virtual const SystemBase & getSystemBase(const unsigned int sys_num) const;
888 
893  virtual SystemBase & getSystemBase(const unsigned int sys_num);
894 
899  SystemBase & getSystemBase(const std::string & sys_name);
900 
905  LinearSystem & getLinearSystem(unsigned int sys_num);
906 
911  const LinearSystem & getLinearSystem(unsigned int sys_num) const;
912 
917  SolverSystem & getSolverSystem(unsigned int sys_num);
918 
923  const SolverSystem & getSolverSystem(unsigned int sys_num) const;
924 
929  void setCurrentLinearSystem(unsigned int sys_num);
930 
934  const LinearSystem & currentLinearSystem() const;
935 
940  virtual const SystemBase & systemBaseLinear(unsigned int sys_num) const override;
941 
946  virtual SystemBase & systemBaseLinear(unsigned int sys_num) override;
947 
954  virtual void
955  addVariable(const std::string & var_type, const std::string & var_name, InputParameters & params);
956 
957  virtual void addKernel(const std::string & kernel_name,
958  const std::string & name,
960  virtual void addHDGKernel(const std::string & kernel_name,
961  const std::string & name,
963  virtual void addNodalKernel(const std::string & kernel_name,
964  const std::string & name,
966  virtual void addScalarKernel(const std::string & kernel_name,
967  const std::string & name,
969  virtual void addBoundaryCondition(const std::string & bc_name,
970  const std::string & name,
972 
973 #ifdef MOOSE_KOKKOS_ENABLED
974  virtual void addKokkosKernel(const std::string & kernel_name,
975  const std::string & name,
977  virtual void addKokkosNodalKernel(const std::string & kernel_name,
978  const std::string & name,
980  virtual void addKokkosBoundaryCondition(const std::string & bc_name,
981  const std::string & name,
983 #endif
984 
985  virtual void
986  addConstraint(const std::string & c_name, const std::string & name, InputParameters & parameters);
987 
989  {
990  parameters.set<FEProblemBase *>("_fe_problem_base") = this;
991  }
992 
993  // Aux /////
994 
1001  virtual void addAuxVariable(const std::string & var_type,
1002  const std::string & var_name,
1003  InputParameters & params);
1004 
1008  virtual void addElementalFieldVariable(const std::string & var_type,
1009  const std::string & var_name,
1010  InputParameters & params);
1011 
1012  virtual void addAuxVariable(const std::string & var_name,
1013  const libMesh::FEType & type,
1014  const std::set<SubdomainID> * const active_subdomains = NULL);
1015  virtual void addAuxArrayVariable(const std::string & var_name,
1016  const libMesh::FEType & type,
1017  unsigned int components,
1018  const std::set<SubdomainID> * const active_subdomains = NULL);
1019  virtual void addAuxScalarVariable(const std::string & var_name,
1020  libMesh::Order order,
1021  Real scale_factor = 1.,
1022  const std::set<SubdomainID> * const active_subdomains = NULL);
1023  virtual void addAuxKernel(const std::string & kernel_name,
1024  const std::string & name,
1026  virtual void addAuxScalarKernel(const std::string & kernel_name,
1027  const std::string & name,
1029 
1030 #ifdef MOOSE_KOKKOS_ENABLED
1031  virtual void addKokkosAuxKernel(const std::string & kernel_name,
1032  const std::string & name,
1034 #endif
1035 
1037 
1038  // Dirac /////
1039  virtual void addDiracKernel(const std::string & kernel_name,
1040  const std::string & name,
1042 
1043  // DG /////
1044  virtual void addDGKernel(const std::string & kernel_name,
1045  const std::string & name,
1047  // FV /////
1048  virtual void addFVKernel(const std::string & kernel_name,
1049  const std::string & name,
1051 
1052  virtual void addLinearFVKernel(const std::string & kernel_name,
1053  const std::string & name,
1055  virtual void
1056  addFVBC(const std::string & fv_bc_name, const std::string & name, InputParameters & parameters);
1057  virtual void addLinearFVBC(const std::string & fv_bc_name,
1058  const std::string & name,
1060 
1061  virtual void addFVInterfaceKernel(const std::string & fv_ik_name,
1062  const std::string & name,
1064 
1065  // Interface /////
1066  virtual void addInterfaceKernel(const std::string & kernel_name,
1067  const std::string & name,
1069 
1070  // IC /////
1071  virtual void addInitialCondition(const std::string & ic_name,
1072  const std::string & name,
1080  virtual void addFVInitialCondition(const std::string & ic_name,
1081  const std::string & name,
1083 
1084  void projectSolution();
1085 
1090  unsigned short getCurrentICState();
1091 
1101  libMesh::ConstElemRange & elem_range,
1102  ConstBndNodeRange & bnd_node_range,
1103  const std::optional<std::set<VariableName>> & target_vars = std::nullopt);
1104 
1114  void projectFunctionOnCustomRange(ConstElemRange & elem_range,
1115  Number (*func)(const Point &,
1116  const libMesh::Parameters &,
1117  const std::string &,
1118  const std::string &),
1119  Gradient (*func_grad)(const Point &,
1120  const libMesh::Parameters &,
1121  const std::string &,
1122  const std::string &),
1123  const libMesh::Parameters & params,
1124  const std::vector<VariableName> & target_vars);
1125 
1126  // Materials
1127  virtual void addMaterial(const std::string & material_name,
1128  const std::string & name,
1130  virtual void addMaterialHelper(std::vector<MaterialWarehouse *> warehouse,
1131  const std::string & material_name,
1132  const std::string & name,
1134  virtual void addInterfaceMaterial(const std::string & material_name,
1135  const std::string & name,
1137  virtual void addFunctorMaterial(const std::string & functor_material_name,
1138  const std::string & name,
1140 
1141 #ifdef MOOSE_KOKKOS_ENABLED
1142  virtual void addKokkosMaterial(const std::string & material_name,
1143  const std::string & name,
1145 #endif
1146 
1158  void prepareMaterials(const std::unordered_set<unsigned int> & consumer_needed_mat_props,
1159  const SubdomainID blk_id,
1160  const THREAD_ID tid);
1161 
1162  void reinitMaterials(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful = true);
1163 
1173  void reinitMaterialsFace(SubdomainID blk_id,
1174  const THREAD_ID tid,
1175  bool swap_stateful = true,
1176  const std::deque<MaterialBase *> * reinit_mats = nullptr);
1177 
1189  void
1190  reinitMaterialsFaceOnBoundary(const BoundaryID boundary_id,
1191  const SubdomainID blk_id,
1192  const THREAD_ID tid,
1193  const bool swap_stateful = true,
1194  const std::deque<MaterialBase *> * const reinit_mats = nullptr);
1195 
1207  void
1209  const SubdomainID blk_id,
1210  const THREAD_ID tid,
1211  const bool swap_stateful = true,
1212  const std::deque<MaterialBase *> * const reinit_mats = nullptr);
1213 
1224  const THREAD_ID tid,
1225  bool swap_stateful = true,
1226  const std::deque<MaterialBase *> * reinit_mats = nullptr);
1227 
1240  void reinitMaterialsBoundary(BoundaryID boundary_id,
1241  const THREAD_ID tid,
1242  bool swap_stateful = true,
1243  const std::deque<MaterialBase *> * reinit_mats = nullptr);
1244 
1245  void
1246  reinitMaterialsInterface(BoundaryID boundary_id, const THREAD_ID tid, bool swap_stateful = true);
1247 
1248 #ifdef MOOSE_KOKKOS_ENABLED
1249  void prepareKokkosMaterials(const std::unordered_set<unsigned int> & consumer_needed_mat_props);
1250  void reinitKokkosMaterials();
1251 #endif
1252 
1253  /*
1254  * Swap back underlying data storing stateful material properties
1255  */
1256  virtual void swapBackMaterials(const THREAD_ID tid);
1257  virtual void swapBackMaterialsFace(const THREAD_ID tid);
1258  virtual void swapBackMaterialsNeighbor(const THREAD_ID tid);
1259 
1266  void setActiveMaterialProperties(const std::unordered_set<unsigned int> & mat_prop_ids,
1267  const THREAD_ID tid);
1268 
1277  bool hasActiveMaterialProperties(const THREAD_ID tid) const;
1278 
1284  void clearActiveMaterialProperties(const THREAD_ID tid);
1285 
1297  template <typename T>
1298  std::vector<std::shared_ptr<T>> addObject(const std::string & type,
1299  const std::string & name,
1301  const bool threaded = true,
1302  const std::string & var_param_name = "variable");
1303 
1304  // Postprocessors /////
1305  virtual void addPostprocessor(const std::string & pp_name,
1306  const std::string & name,
1308 
1309  // VectorPostprocessors /////
1310  virtual void addVectorPostprocessor(const std::string & pp_name,
1311  const std::string & name,
1313 
1322  virtual void
1323  addReporter(const std::string & type, const std::string & name, InputParameters & parameters);
1324 
1325 #ifdef MOOSE_KOKKOS_ENABLED
1326  virtual void addKokkosPostprocessor(const std::string & pp_name,
1327  const std::string & name,
1329  virtual void addKokkosVectorPostprocessor(const std::string & pp_name,
1330  const std::string & name,
1332  virtual void addKokkosReporter(const std::string & type,
1333  const std::string & name,
1335 #endif
1336 
1344  const ReporterData & getReporterData() const { return _reporter_data; }
1345 
1352 
1353  // UserObjects /////
1354  virtual std::vector<std::shared_ptr<UserObject>> addUserObject(
1355  const std::string & user_object_name, const std::string & name, InputParameters & parameters);
1356 
1362  template <class T>
1363  T & getUserObject(const std::string & name, unsigned int tid = 0) const
1364  {
1365  std::vector<T *> objs;
1366  theWarehouse()
1367  .query()
1368  .condition<AttribSystem>("UserObject")
1369  .condition<AttribThread>(tid)
1370  .condition<AttribName>(name)
1371  .queryInto(objs);
1372  if (objs.empty())
1373  mooseError("Unable to find user object with name '" + name + "'");
1374  return *(objs[0]);
1375  }
1376 
1383  const UserObject & getUserObjectBase(const std::string & name, const THREAD_ID tid = 0) const;
1384 
1390  bool hasUserObject(const std::string & name) const;
1391 
1392 #ifdef MOOSE_KOKKOS_ENABLED
1393  virtual void addKokkosUserObject(const std::string & user_object_name,
1394  const std::string & name,
1396 
1402  template <class T>
1403  const T & getKokkosUserObject(const std::string & name) const
1404  {
1405  std::vector<T *> objs;
1406  theWarehouse()
1407  .query()
1408  .condition<AttribSystem>("KokkosUserObject")
1409  .condition<AttribName>(name)
1410  .queryInto(objs);
1411  if (objs.empty())
1412  mooseError("Unable to find Kokkos user object with name '" + name + "'");
1413  return *(objs[0]);
1414  }
1415 
1421  bool hasKokkosUserObject(const std::string & name) const;
1422 #endif
1423 
1429  void checkUserObjectNameCollision(const std::string & name, const std::string & type) const;
1430 
1436  const Positions & getPositionsObject(const std::string & name) const;
1437 
1444  virtual void addFVInterpolationMethod(const std::string & method_type,
1445  const std::string & name,
1447 
1453  const FVInterpolationMethod & getFVInterpolationMethod(const InterpolationMethodName & name,
1454  const THREAD_ID tid = 0) const;
1455 
1462  getFVFaceInterpolationMethod(const InterpolationMethodName & name, const THREAD_ID tid = 0) const;
1463 
1470  getFVAdvectedInterpolationMethod(const InterpolationMethodName & name,
1471  const THREAD_ID tid = 0) const;
1472 
1476  bool hasFVInterpolationMethod(const InterpolationMethodName & name) const;
1477 
1486  bool hasPostprocessorValueByName(const PostprocessorName & name) const;
1487 
1493  const Postprocessor & getPostprocessorObjectByName(const PostprocessorName & object_name,
1494  const THREAD_ID tid = 0) const;
1495 
1506  const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName & name,
1507  std::size_t t_index = 0) const;
1508 
1523  void setPostprocessorValueByName(const PostprocessorName & name,
1524  const PostprocessorValue & value,
1525  std::size_t t_index = 0);
1526 
1530  bool hasPostprocessor(const std::string & name) const;
1531 
1542  const VectorPostprocessorValue &
1543  getVectorPostprocessorValueByName(const std::string & object_name,
1544  const std::string & vector_name,
1545  std::size_t t_index = 0) const;
1546 
1554  void setVectorPostprocessorValueByName(const std::string & object_name,
1555  const std::string & vector_name,
1556  const VectorPostprocessorValue & value,
1557  std::size_t t_index = 0);
1558 
1567  const VectorPostprocessor & getVectorPostprocessorObjectByName(const std::string & object_name,
1568  const THREAD_ID tid = 0) const;
1569 
1571 
1574  bool hasMultiApps() const { return _multi_apps.hasActiveObjects(); }
1575  bool hasMultiApps(ExecFlagType type) const;
1576  bool hasMultiApp(const std::string & name) const;
1578 
1579  // Dampers /////
1580  virtual void addDamper(const std::string & damper_name,
1581  const std::string & name,
1583  void setupDampers();
1584 
1588  bool hasDampers() { return _has_dampers; }
1589 
1590  // Indicators /////
1591  virtual void addIndicator(const std::string & indicator_name,
1592  const std::string & name,
1594 
1595  // Markers //////
1596  virtual void addMarker(const std::string & marker_name,
1597  const std::string & name,
1599 
1603  virtual void addMultiApp(const std::string & multi_app_name,
1604  const std::string & name,
1606 
1610  std::shared_ptr<MultiApp> getMultiApp(const std::string & multi_app_name) const;
1611 
1615  std::vector<std::shared_ptr<Transfer>> getTransfers(ExecFlagType type,
1616  Transfer::DIRECTION direction) const;
1617  std::vector<std::shared_ptr<Transfer>> getTransfers(Transfer::DIRECTION direction) const;
1618 
1624 
1631 
1635  bool execMultiApps(ExecFlagType type, bool auto_advance = true);
1636 
1637  void finalizeMultiApps();
1638 
1643 
1649  {
1650  mooseDeprecated("Deprecated method; use finishMultiAppStep and/or incrementMultiAppTStep "
1651  "depending on your purpose");
1653  }
1654 
1659  void finishMultiAppStep(ExecFlagType type, bool recurse_through_multiapp_levels = false);
1660 
1665 
1670  void restoreMultiApps(ExecFlagType type, bool force = false);
1671 
1676 
1680  virtual void addTransfer(const std::string & transfer_name,
1681  const std::string & name,
1683 
1691 
1697 
1703 
1710  virtual Real computeResidualL2Norm();
1711 
1716  const NumericVector<libMesh::Number> & soln,
1717  NumericVector<libMesh::Number> & residual);
1723  const NumericVector<libMesh::Number> & soln,
1724  NumericVector<libMesh::Number> & residual);
1725 
1729  virtual void computeResidual(const NumericVector<libMesh::Number> & soln,
1730  NumericVector<libMesh::Number> & residual,
1731  const unsigned int nl_sys_num);
1732 
1736  void computeResidualAndJacobian(const NumericVector<libMesh::Number> & soln,
1737  NumericVector<libMesh::Number> & residual,
1739 
1743  virtual void computeResidualTag(const NumericVector<libMesh::Number> & soln,
1744  NumericVector<libMesh::Number> & residual,
1745  TagID tag);
1749  virtual void computeResidualType(const NumericVector<libMesh::Number> & soln,
1750  NumericVector<libMesh::Number> & residual,
1751  TagID tag);
1752 
1757  virtual void computeResidualInternal(const NumericVector<libMesh::Number> & soln,
1758  NumericVector<libMesh::Number> & residual,
1759  const std::set<TagID> & tags);
1763  virtual void computeResidualTags(const std::set<TagID> & tags);
1764 
1769  const NumericVector<libMesh::Number> & soln,
1774  virtual void computeJacobian(const NumericVector<libMesh::Number> & soln,
1776  const unsigned int nl_sys_num);
1777 
1781  virtual void computeJacobianTag(const NumericVector<libMesh::Number> & soln,
1783  TagID tag);
1784 
1788  virtual void computeJacobianInternal(const NumericVector<libMesh::Number> & soln,
1790  const std::set<TagID> & tags);
1791 
1795  virtual void computeJacobianTags(const std::set<TagID> & tags);
1796 
1805  virtual void computeJacobianBlocks(std::vector<JacobianBlock *> & blocks,
1806  const unsigned int nl_sys_num);
1807 
1822  libMesh::System & precond_system,
1823  unsigned int ivar,
1824  unsigned int jvar);
1825 
1837  NumericVector<libMesh::Number> & rhs,
1838  const bool compute_gradients = true);
1839 
1849  void computeLinearSystemTags(const NumericVector<libMesh::Number> & soln,
1850  const std::set<TagID> & vector_tags,
1851  const std::set<TagID> & matrix_tags,
1852  const bool compute_gradients = true);
1853 
1854  virtual Real computeDamping(const NumericVector<libMesh::Number> & soln,
1855  const NumericVector<libMesh::Number> & update);
1856 
1861  virtual bool shouldUpdateSolution();
1862 
1869  virtual bool updateSolution(NumericVector<libMesh::Number> & vec_solution,
1870  NumericVector<libMesh::Number> & ghosted_solution);
1871 
1876  virtual void predictorCleanup(NumericVector<libMesh::Number> & ghosted_solution);
1877 
1879  NumericVector<libMesh::Number> & lower,
1880  NumericVector<libMesh::Number> & upper);
1882  std::vector<NumericVector<libMesh::Number> *> & sp);
1884  std::vector<NumericVector<libMesh::Number> *> & sp);
1886  std::vector<NumericVector<libMesh::Number> *> & sp);
1888  const NumericVector<libMesh::Number> & old_soln,
1889  NumericVector<libMesh::Number> & search_direction,
1890  NumericVector<libMesh::Number> & new_soln,
1891  bool & changed_search_direction,
1892  bool & changed_new_soln);
1893 
1894  virtual void computeIndicatorsAndMarkers();
1895  virtual void computeIndicators();
1896  virtual void computeMarkers();
1897 
1898  virtual void addResidual(const THREAD_ID tid) override;
1899  virtual void addResidualNeighbor(const THREAD_ID tid) override;
1900  virtual void addResidualLower(const THREAD_ID tid) override;
1901  virtual void addResidualScalar(const THREAD_ID tid = 0);
1902 
1903  virtual void cacheResidual(const THREAD_ID tid) override;
1904  virtual void cacheResidualNeighbor(const THREAD_ID tid) override;
1905  virtual void addCachedResidual(const THREAD_ID tid) override;
1906 
1914  virtual void addCachedResidualDirectly(NumericVector<libMesh::Number> & residual,
1915  const THREAD_ID tid);
1916 
1917  virtual void setResidual(NumericVector<libMesh::Number> & residual, const THREAD_ID tid) override;
1918  virtual void setResidualNeighbor(NumericVector<libMesh::Number> & residual,
1919  const THREAD_ID tid) override;
1920 
1921  virtual void addJacobian(const THREAD_ID tid) override;
1922  virtual void addJacobianNeighbor(const THREAD_ID tid) override;
1923  virtual void addJacobianNeighborLowerD(const THREAD_ID tid) override;
1924  virtual void addJacobianLowerD(const THREAD_ID tid) override;
1926  unsigned int ivar,
1927  unsigned int jvar,
1928  const DofMap & dof_map,
1929  std::vector<dof_id_type> & dof_indices,
1930  const std::set<TagID> & tags,
1931  const THREAD_ID tid);
1933  unsigned int ivar,
1934  unsigned int jvar,
1935  const DofMap & dof_map,
1936  std::vector<dof_id_type> & dof_indices,
1937  std::vector<dof_id_type> & neighbor_dof_indices,
1938  const std::set<TagID> & tags,
1939  const THREAD_ID tid) override;
1940  virtual void addJacobianScalar(const THREAD_ID tid = 0);
1941  virtual void addJacobianOffDiagScalar(unsigned int ivar, const THREAD_ID tid = 0);
1942 
1943  virtual void cacheJacobian(const THREAD_ID tid) override;
1944  virtual void cacheJacobianNeighbor(const THREAD_ID tid) override;
1945  virtual void addCachedJacobian(const THREAD_ID tid) override;
1946 
1947  virtual void prepareShapes(unsigned int var, const THREAD_ID tid) override;
1948  virtual void prepareFaceShapes(unsigned int var, const THREAD_ID tid) override;
1949  virtual void prepareNeighborShapes(unsigned int var, const THREAD_ID tid) override;
1950 
1951  // Displaced problem /////
1952  virtual void addDisplacedProblem(std::shared_ptr<DisplacedProblem> displaced_problem);
1953  virtual std::shared_ptr<const DisplacedProblem> getDisplacedProblem() const
1954  {
1955  return _displaced_problem;
1956  }
1957  virtual std::shared_ptr<DisplacedProblem> getDisplacedProblem() { return _displaced_problem; }
1958 
1962  virtual void updateGeomSearch(
1964  virtual void updateMortarMesh();
1965 
1966  void createMortarInterface(
1967  const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
1968  const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
1969  bool on_displaced,
1970  bool periodic,
1971  const bool debug,
1972  const bool correct_edge_dropping,
1973  const Real minimum_projection_angle,
1974  const MooseEnum & triangulation,
1975  const bool triangulate_triangles);
1976 
1983  getMortarInterface(const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
1984  const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
1985  bool on_displaced) const;
1986 
1988  getMortarInterface(const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
1989  const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
1990  bool on_displaced);
1992 
1993  const std::unordered_map<std::pair<BoundaryID, BoundaryID>, MortarInterfaceConfig> &
1994  getMortarInterfaces(bool on_displaced) const;
1995 
1996  virtual void possiblyRebuildGeomSearchPatches();
1997 
1999 
2004  void setRestartFile(const std::string & file_name);
2005 
2010  {
2011  return _material_prop_registry;
2012  }
2013 
2022  {
2023  return _neighbor_material_props;
2024  }
2025 
2026 #ifdef MOOSE_KOKKOS_ENABLED
2028  {
2029  return _kokkos_material_props;
2030  }
2032  {
2034  }
2036  {
2038  }
2039 #endif
2040 
2048  {
2050  }
2053 
2058 
2063 
2067  SolverParams & solverParams(unsigned int solver_sys_num = 0);
2068 
2072  const SolverParams & solverParams(unsigned int solver_sys_num = 0) const;
2073 
2074 #ifdef LIBMESH_ENABLE_AMR
2075  // Adaptivity /////
2077  virtual void initialAdaptMesh();
2078 
2082  virtual bool adaptMesh();
2083 
2087  unsigned int getNumCyclesCompleted() { return _cycles_completed; }
2088 
2092  bool hasInitialAdaptivity() const { return _adaptivity.getInitialSteps() > 0; }
2093 #else
2094 
2097  bool hasInitialAdaptivity() const { return false; }
2098 #endif // LIBMESH_ENABLE_AMR
2099 
2101  void initXFEM(std::shared_ptr<XFEMInterface> xfem);
2102 
2104  std::shared_ptr<XFEMInterface> getXFEM() { return _xfem; }
2105 
2107  bool haveXFEM() { return _xfem != nullptr; }
2108 
2110  virtual bool updateMeshXFEM();
2111 
2126  virtual void
2127  meshChanged(bool intermediate_change, bool contract_mesh, bool clean_refinement_flags);
2128 
2134 
2140 
2146  void initElementStatefulProps(const libMesh::ConstElemRange & elem_range, const bool threaded);
2147 
2148 #ifdef MOOSE_KOKKOS_ENABLED
2149  void initKokkosStatefulProps();
2150 #endif
2151 
2156  virtual void checkProblemIntegrity();
2157 
2158  void registerRandomInterface(RandomInterface & random_interface, const std::string & name);
2159 
2164  void setConstJacobian(bool state) { _const_jacobian = state; }
2165 
2171 
2176  void setKernelCoverageCheck(bool flag)
2177  {
2179  }
2180 
2188 
2196  {
2198  }
2199 
2204 
2206  void setVerboseProblem(bool verbose);
2207 
2211  bool verboseMultiApps() const { return _verbose_multiapps; }
2212 
2217 
2219 
2236  bool needBoundaryMaterialOnSide(BoundaryID bnd_id, const THREAD_ID tid);
2237  bool needInterfaceMaterialOnSide(BoundaryID bnd_id, const THREAD_ID tid);
2238  bool needInternalNeighborSideMaterial(SubdomainID subdomain_id, const THREAD_ID tid);
2240 
2245  unsigned int subspaceDim(const std::string & prefix) const
2246  {
2247  if (_subspace_dim.count(prefix))
2248  return _subspace_dim.find(prefix)->second;
2249  else
2250  return 0;
2251  }
2252 
2253  /*
2254  * Return reference to function warehouse.
2255  */
2257 
2258  /*
2259  * Return a reference to the material warehouse of *all* Material objects.
2260  */
2262 
2263  /*
2264  * Return a reference to the material warehouse of Material objects to be computed.
2265  */
2269 
2270 #ifdef MOOSE_KOKKOS_ENABLED
2271  /*
2272  * Return a reference to the material warehouse of Kokkos Material objects to be computed.
2273  */
2275 #endif
2276 
2284  std::shared_ptr<MaterialBase> getMaterial(std::string name,
2286  const THREAD_ID tid = 0,
2287  bool no_warn = false);
2288 
2293  const THREAD_ID tid = 0,
2294  const MooseObject * object = nullptr) const;
2295 
2296 #ifdef MOOSE_KOKKOS_ENABLED
2297 
2301  const MooseObject * object = nullptr) const;
2302 #endif
2303 
2307  const std::set<const MooseObject *> &
2309 
2310 #ifdef MOOSE_KOKKOS_ENABLED
2311 
2314  const std::set<const MooseObject *> &
2316 #endif
2317 
2322 
2328  {
2330  }
2331 
2333  {
2335  }
2336 
2342 
2346  void setPreserveMatrixSparsityPattern(bool preserve);
2347 
2353 
2356 
2363  bool acceptInvalidSolution() const;
2368 
2373 
2378 
2380  bool hasTimeIntegrator() const { return _has_time_integrator; }
2381 
2383 
2389  const ExecFlagType & getCurrentExecuteOnFlag() const;
2390  void setCurrentExecuteOnFlag(const ExecFlagType &);
2392 
2396  virtual void execute(const ExecFlagType & exec_type);
2397  virtual void executeAllObjects(const ExecFlagType & exec_type);
2398 
2399  virtual Executor & getExecutor(const std::string & name) { return _app.getExecutor(name); }
2400 
2404  virtual void computeUserObjects(const ExecFlagType & type, const Moose::AuxGroup & group);
2405 
2409  virtual void computeUserObjectByName(const ExecFlagType & type,
2410  const Moose::AuxGroup & group,
2411  const std::string & name);
2412 
2416  void needsPreviousNewtonIteration(bool state);
2417 
2422  bool needsPreviousNewtonIteration() const;
2423 
2431  const unsigned int solver_sys_num);
2432 
2439  bool needsPreviousMultiAppFixedPointIterationSolution(const unsigned int solver_sys_num) const;
2440 
2446 
2454 
2456 
2459  std::vector<Real> _real_zero;
2460  std::vector<VariableValue> _scalar_zero;
2461  std::vector<VariableValue> _zero;
2462  std::vector<VariablePhiValue> _phi_zero;
2463  std::vector<MooseArray<ADReal>> _ad_zero;
2464  std::vector<VariableGradient> _grad_zero;
2465  std::vector<MooseArray<ADRealVectorValue>> _ad_grad_zero;
2466  std::vector<VariablePhiGradient> _grad_phi_zero;
2467  std::vector<VariableSecond> _second_zero;
2468  std::vector<MooseArray<ADRealTensorValue>> _ad_second_zero;
2469  std::vector<VariablePhiSecond> _second_phi_zero;
2470  std::vector<Point> _point_zero;
2471  std::vector<VectorVariableValue> _vector_zero;
2472  std::vector<VectorVariableCurl> _vector_curl_zero;
2474 
2479 
2483  void executeControls(const ExecFlagType & exec_type);
2484 
2488  void executeSamplers(const ExecFlagType & exec_type);
2489 
2493  virtual void updateActiveObjects();
2494 
2501 
2503 
2507  bool hasJacobian() const;
2508 
2513  bool constJacobian() const;
2514 
2518  void addOutput(const std::string &, const std::string &, InputParameters &);
2519 
2520  inline TheWarehouse & theWarehouse() const { return _app.theWarehouse(); }
2521 
2525  void setSNESMFReuseBase(bool reuse, bool set_by_user)
2526  {
2527  _snesmf_reuse_base = reuse, _snesmf_reuse_base_set_by_user = set_by_user;
2528  }
2529 
2534 
2538  void skipExceptionCheck(bool skip_exception_check)
2539  {
2540  _skip_exception_check = skip_exception_check;
2541  }
2542 
2547 
2552 
2553 #if !PETSC_RELEASE_LESS_THAN(3, 12, 0)
2554  PetscOptions & petscOptionsDatabase() { return _petsc_option_data_base; }
2555 #endif
2556 
2558  virtual void setUDotRequested(const bool u_dot_requested) { _u_dot_requested = u_dot_requested; }
2559 
2561  virtual void setUDotDotRequested(const bool u_dotdot_requested)
2562  {
2563  _u_dotdot_requested = u_dotdot_requested;
2564  }
2565 
2567  virtual void setUDotOldRequested(const bool u_dot_old_requested)
2568  {
2569  _u_dot_old_requested = u_dot_old_requested;
2570  }
2571 
2573  virtual void setUDotDotOldRequested(const bool u_dotdot_old_requested)
2574  {
2575  _u_dotdot_old_requested = u_dotdot_old_requested;
2576  }
2577 
2579  virtual bool uDotRequested() { return _u_dot_requested; }
2580 
2582  virtual bool uDotDotRequested() { return _u_dotdot_requested; }
2583 
2585  virtual bool uDotOldRequested()
2586  {
2588  mooseError("FEProblemBase: When requesting old time derivative of solution, current time "
2589  "derivative of solution should also be stored. Please set `u_dot_requested` to "
2590  "true using setUDotRequested.");
2591 
2592  return _u_dot_old_requested;
2593  }
2594 
2596  virtual bool uDotDotOldRequested()
2597  {
2599  mooseError("FEProblemBase: When requesting old second time derivative of solution, current "
2600  "second time derivation of solution should also be stored. Please set "
2601  "`u_dotdot_requested` to true using setUDotDotRequested.");
2602  return _u_dotdot_old_requested;
2603  }
2604 
2606  void haveADObjects(bool have_ad_objects) override;
2607 
2608  // Whether or not we should solve this system
2609  bool shouldSolve() const { return _solve; }
2610 
2614  const MortarInterfaceWarehouse & mortarData() const { return *_mortar_data; }
2616 
2621 
2625  virtual bool hasMortarCoupling() const { return _has_mortar; }
2626 
2628  void computingNonlinearResid(bool computing_nonlinear_residual) final;
2629 
2631  void setCurrentlyComputingResidual(bool currently_computing_residual) final;
2632 
2636  void numGridSteps(unsigned int num_grid_steps) { _num_grid_steps = num_grid_steps; }
2637 
2642  void uniformRefine();
2643 
2645  void automaticScaling(bool automatic_scaling) override;
2646 
2648 
2651  template <typename T>
2652  static void objectSetupHelper(const std::vector<T *> & objects, const ExecFlagType & exec_flag);
2653  template <typename T>
2654  static void objectExecuteHelper(const std::vector<T *> & objects);
2656 
2663  virtual void reinitElemFaceRef(const Elem * elem,
2664  unsigned int side,
2665  Real tolerance,
2666  const std::vector<Point> * const pts,
2667  const std::vector<Real> * const weights = nullptr,
2668  const THREAD_ID tid = 0) override;
2669 
2676  virtual void reinitNeighborFaceRef(const Elem * neighbor_elem,
2677  unsigned int neighbor_side,
2678  Real tolerance,
2679  const std::vector<Point> * const pts,
2680  const std::vector<Real> * const weights = nullptr,
2681  const THREAD_ID tid = 0) override;
2682 
2687 
2692  void fvBCsIntegrityCheck(bool fv_bcs_integrity_check);
2693 
2702  void getFVMatsAndDependencies(SubdomainID block_id,
2703  std::vector<std::shared_ptr<MaterialBase>> & face_materials,
2704  std::vector<std::shared_ptr<MaterialBase>> & neighbor_materials,
2705  std::set<MooseVariableFieldBase *> & variables,
2706  const THREAD_ID tid);
2707 
2714  void resizeMaterialData(Moose::MaterialDataType data_type, unsigned int nqp, const THREAD_ID tid);
2715 
2716  bool haveDisplaced() const override final { return _displaced_problem.get(); }
2717 
2719  bool hasLinearConvergenceObjects() const;
2723  void setNonlinearConvergenceNames(const std::vector<ConvergenceName> & convergence_names);
2727  void setLinearConvergenceNames(const std::vector<ConvergenceName> & convergence_names);
2731  void setMultiAppFixedPointConvergenceName(const ConvergenceName & convergence_name);
2735  void setSteadyStateConvergenceName(const ConvergenceName & convergence_name);
2736 
2740  const std::vector<ConvergenceName> & getNonlinearConvergenceNames() const;
2744  const std::vector<ConvergenceName> & getLinearConvergenceNames() const;
2748  const ConvergenceName & getMultiAppFixedPointConvergenceName() const;
2752  const ConvergenceName & getSteadyStateConvergenceName() const;
2753 
2757  void computingScalingJacobian(bool computing_scaling_jacobian)
2758  {
2759  _computing_scaling_jacobian = computing_scaling_jacobian;
2760  }
2761 
2762  bool computingScalingJacobian() const override final { return _computing_scaling_jacobian; }
2763 
2767  void computingScalingResidual(bool computing_scaling_residual)
2768  {
2769  _computing_scaling_residual = computing_scaling_residual;
2770  }
2771 
2775  bool computingScalingResidual() const override final { return _computing_scaling_residual; }
2776 
2782 
2783  virtual std::size_t numNonlinearSystems() const override { return _num_nl_sys; }
2784 
2785  virtual std::size_t numLinearSystems() const override { return _num_linear_sys; }
2786 
2787  virtual std::size_t numSolverSystems() const override { return _num_nl_sys + _num_linear_sys; }
2788 
2790  bool isSolverSystemNonlinear(const unsigned int sys_num) { return sys_num < _num_nl_sys; }
2791 
2792  virtual unsigned int currentNlSysNum() const override;
2793 
2794  virtual unsigned int currentLinearSysNum() const override;
2795 
2799  virtual unsigned int nlSysNum(const NonlinearSystemName & nl_sys_name) const override;
2800 
2804  unsigned int linearSysNum(const LinearSystemName & linear_sys_name) const override;
2805 
2809  unsigned int solverSysNum(const SolverSystemName & solver_sys_name) const override;
2810 
2815  unsigned int systemNumForVariable(const VariableName & variable_name) const;
2816 
2821 
2826 
2831 
2832  /*
2833  * Set the status of loop order of execution printing
2834  * @param print_exec set of execution flags to print on
2835  */
2836  void setExecutionPrinting(const ExecFlagEnum & print_exec) { _print_execution_on = print_exec; }
2837 
2841  bool shouldPrintExecution(const THREAD_ID tid) const;
2846  void reinitMortarUserObjects(BoundaryID primary_boundary_id,
2847  BoundaryID secondary_boundary_id,
2848  bool displaced);
2849 
2850  virtual const std::vector<VectorTag> & currentResidualVectorTags() const override;
2851 
2857  {
2858  friend class CrankNicolson;
2859  friend class FEProblemBase;
2862  };
2863 
2867  void setCurrentResidualVectorTags(const std::set<TagID> & vector_tags);
2868 
2873 
2878 
2879  virtual void needFV() override { _have_fv = true; }
2880  virtual bool haveFV() const override { return _have_fv; }
2881 
2882  virtual bool hasNonlocalCoupling() const override { return _has_nonlocal_coupling; }
2883 
2888 
2889  virtual void setCurrentLowerDElem(const Elem * const lower_d_elem, const THREAD_ID tid) override;
2890  virtual void setCurrentBoundaryID(BoundaryID bid, const THREAD_ID tid) override;
2891 
2895  const std::vector<NonlinearSystemName> & getNonlinearSystemNames() const { return _nl_sys_names; }
2899  const std::vector<LinearSystemName> & getLinearSystemNames() const { return _linear_sys_names; }
2903  const std::vector<SolverSystemName> & getSolverSystemNames() const { return _solver_sys_names; }
2904 
2905  virtual const libMesh::CouplingMatrix & nonlocalCouplingMatrix(const unsigned i) const override;
2906 
2907  virtual bool checkNonlocalCouplingRequirement() const override;
2908 
2910 
2912  {
2915 
2917  };
2918 
2920 
2922 
2923 #ifdef MOOSE_KOKKOS_ENABLED
2924 
2927  bool hasKokkosObjects() const { return _has_kokkos_objects; }
2936  void addKokkosMeshInitializationHook(std::function<void()> function)
2937  {
2938  _kokkos_mesh_initialization_hooks.push_back(function);
2939  }
2940 #endif
2941 
2942 protected:
2946  virtual void meshChanged() {}
2947 
2949  void createTagVectors();
2950 
2952  void createTagSolutions();
2953 
2957  virtual void meshDisplaced();
2958 
2962  void computeSystems(const ExecFlagType & type);
2963 
2965 
2966 private:
2969 
2981  void setResidualObjectParamsAndLog(const std::string & ro_name,
2982  const std::string & name,
2984  const unsigned int nl_sys_num,
2985  const std::string & base_name,
2986  bool & reinit_displaced);
2987 
2995  void setAuxKernelParamsAndLog(const std::string & ak_name,
2996  const std::string & name,
2998  const std::string & base_name);
2999 
3004 
3005  TheWarehouse::Query getUOQuery(const std::string & system,
3006  const ExecFlagType & type,
3007  const Moose::AuxGroup & group) const;
3008 
3009  void getUOExecutionGroups(TheWarehouse::Query & query, std::set<int> & execution_groups) const;
3010 
3011 protected:
3013 
3015  std::optional<std::vector<ConvergenceName>> _nonlinear_convergence_names;
3017  std::optional<std::vector<ConvergenceName>> _linear_convergence_names;
3019  std::optional<ConvergenceName> _multiapp_fixed_point_convergence_name;
3021  std::optional<ConvergenceName> _steady_state_convergence_name;
3022 
3023  std::set<TagID> _fe_vector_tags;
3024 
3025  std::set<TagID> _fe_matrix_tags;
3026 
3028  std::set<TagID> _linear_vector_tags;
3029 
3031  std::set<TagID> _linear_matrix_tags;
3032 
3034  const bool & _solve;
3035 
3039  int & _t_step;
3042 
3049 
3051  const std::vector<LinearSystemName> _linear_sys_names;
3052 
3054  const std::size_t _num_linear_sys;
3055 
3057  std::vector<std::shared_ptr<LinearSystem>> _linear_systems;
3058 
3060  std::map<LinearSystemName, unsigned int> _linear_sys_name_to_num;
3061 
3064 
3066  const bool _using_default_nl;
3067 
3069  const std::vector<NonlinearSystemName> _nl_sys_names;
3070 
3072  const std::size_t _num_nl_sys;
3073 
3075  std::vector<std::shared_ptr<NonlinearSystemBase>> _nl;
3076 
3078  std::map<NonlinearSystemName, unsigned int> _nl_sys_name_to_num;
3079 
3082 
3085 
3087  std::vector<std::shared_ptr<SolverSystem>> _solver_systems;
3088 
3090  std::map<SolverVariableName, unsigned int> _solver_var_to_sys_num;
3091 
3093  std::map<SolverSystemName, unsigned int> _solver_sys_name_to_num;
3094 
3096  std::vector<SolverSystemName> _solver_sys_names;
3097 
3099  std::shared_ptr<AuxiliarySystem> _aux;
3100 
3102  std::vector<std::unique_ptr<libMesh::CouplingMatrix>> _cm;
3103 
3104 #ifdef MOOSE_KOKKOS_ENABLED
3106 #endif
3107 
3109  std::map<std::string, unsigned int> _subspace_dim;
3110 
3113  std::vector<std::vector<std::unique_ptr<Assembly>>> _assembly;
3114 
3115 #ifdef MOOSE_KOKKOS_ENABLED
3117 #endif
3118 
3123 
3126 
3127 #ifdef MOOSE_KOKKOS_ENABLED
3129 #endif
3130 
3133 
3136 
3139 
3144  ScalarInitialConditionWarehouse _scalar_ics; // use base b/c of setup methods
3146 
3147  // material properties
3152 
3153 #ifdef MOOSE_KOKKOS_ENABLED
3157 #endif
3158  // Material Warehouses
3160  MaterialWarehouse _materials; // regular materials
3161  MaterialWarehouse _interface_materials; // interface materials
3162  MaterialWarehouse _discrete_materials; // Materials that the user must compute
3163  MaterialWarehouse _all_materials; // All materials for error checking and MaterialData storage
3164 
3165 #ifdef MOOSE_KOKKOS_ENABLED
3167 #endif
3168 
3171  // Indicator Warehouses
3175 
3176  // Marker Warehouse
3178 
3179  // Helper class to access Reporter object values
3181 
3184 
3187 
3190 
3193 
3196 
3199 
3201  std::map<std::string, std::unique_ptr<RandomData>> _random_data_objects;
3202 
3204  std::vector<std::unordered_map<SubdomainID, bool>> _block_mat_side_cache;
3205 
3207  std::vector<std::unordered_map<BoundaryID, bool>> _bnd_mat_side_cache;
3208 
3210  std::vector<std::unordered_map<BoundaryID, bool>> _interface_mat_side_cache;
3211 
3213  std::vector<MeshChangedInterface *> _notify_when_mesh_changes;
3214 
3216  std::vector<MeshDisplacedInterface *> _notify_when_mesh_displaces;
3217 
3219  bool duplicateVariableCheck(const std::string & var_name,
3220  const libMesh::FEType & type,
3221  bool is_aux,
3222  const std::set<SubdomainID> * const active_subdomains);
3223 
3225 
3226 #ifdef MOOSE_KOKKOS_ENABLED
3228 #endif
3229 
3231  void checkDisplacementOrders();
3232 
3233  void checkUserObjects();
3234 
3241  const std::map<SubdomainID, std::vector<std::shared_ptr<MaterialBase>>> & materials_map);
3242 
3244  void checkCoordinateSystems();
3245 
3251  void reinitBecauseOfGhostingOrNewGeomObjects(bool mortar_changed = false);
3252 
3259  void addObjectParamsHelper(InputParameters & params,
3260  const std::string & object_name,
3261  const std::string & var_param_name = "variable");
3262 
3263 #ifdef LIBMESH_ENABLE_AMR
3265  unsigned int _cycles_completed;
3266 #endif
3267 
3269  std::shared_ptr<XFEMInterface> _xfem;
3270 
3271  // Displaced mesh /////
3273  std::shared_ptr<DisplacedProblem> _displaced_problem;
3275  std::unique_ptr<MortarInterfaceWarehouse> _mortar_data;
3276 
3283 
3286 
3289 
3292 
3295 
3298 
3301 
3304 
3307 
3310 
3313 
3320 
3324 
3325  std::vector<std::vector<const MooseVariableFEBase *>> _uo_jacobian_moose_vars;
3326 
3328  std::vector<unsigned char> _has_active_material_properties;
3329 
3330  std::vector<SolverParams> _solver_params;
3331 
3334  std::vector<SubdomainName> _kernel_coverage_blocks;
3335 
3339 
3343 
3346  std::vector<SubdomainName> _material_coverage_blocks;
3347 
3350 
3353 
3356 
3357 #ifndef NDEBUG
3360 #endif
3361 
3363  unsigned int _max_qps;
3364 
3367 
3370 
3373 
3376 
3379 
3382 
3385 
3387  std::string _exception_message;
3388 
3391 
3394 
3397 #if !PETSC_RELEASE_LESS_THAN(3, 12, 0)
3399 #endif
3400 
3403 
3404  std::shared_ptr<LineSearch> _line_search;
3405 
3406  std::unique_ptr<libMesh::ConstElemRange> _evaluable_local_elem_range;
3407  std::unique_ptr<libMesh::ConstElemRange> _nl_evaluable_local_elem_range;
3408  std::unique_ptr<libMesh::ConstElemRange> _aux_evaluable_local_elem_range;
3409 
3410  std::unique_ptr<libMesh::ConstElemRange> _current_algebraic_elem_range;
3411  std::unique_ptr<libMesh::ConstNodeRange> _current_algebraic_node_range;
3412  std::unique_ptr<ConstBndNodeRange> _current_algebraic_bnd_node_range;
3413 
3417 
3418  // loop state during projection of initial conditions
3419  unsigned short _current_ic_state;
3420 
3424 
3425 private:
3430  void handleException(const std::string & calling_method);
3431 
3436  std::vector<MortarUserObject *>
3437  getMortarUserObjects(BoundaryID primary_boundary_id,
3438  BoundaryID secondary_boundary_id,
3439  bool displaced,
3440  const std::vector<MortarUserObject *> & mortar_uo_superset);
3441 
3446  std::vector<MortarUserObject *> getMortarUserObjects(BoundaryID primary_boundary_id,
3447  BoundaryID secondary_boundary_id,
3448  bool displaced);
3449 
3459  virtual std::pair<bool, unsigned int>
3460  determineSolverSystem(const std::string & var_name,
3461  bool error_if_not_found = false) const override;
3462 
3469  void checkICRestartError(const std::string & ic_name,
3470  const std::string & name,
3471  const VariableName & var_name);
3472 
3473  /*
3474  * Test if stateful property redistribution is expected to be
3475  * necessary, and set it up if so.
3476  */
3477  void addAnyRedistributers();
3478 
3479  void updateMaxQps();
3480 
3481  void joinAndFinalize(TheWarehouse::Query query, bool isgen = false);
3482 
3483 #ifdef MOOSE_KOKKOS_ENABLED
3484  void kokkosJoinAndFinalize(const std::vector<Moose::Kokkos::UserObject *> & userobjs);
3485 #endif
3486 
3490  virtual void resetState();
3491 
3492  // Parameters handling Jacobian sparsity pattern behavior
3504 
3505  const bool _force_restart;
3512 
3515 
3518 
3521 
3524 
3527 
3530 
3531  friend class AuxiliarySystem;
3532  friend class NonlinearSystemBase;
3533  friend class MooseEigenSystem;
3534  friend class Resurrector;
3535  friend class Restartable;
3536  friend class DisplacedProblem;
3537 
3540 
3542  unsigned int _num_grid_steps;
3543 
3547 
3550 
3553 
3556 
3559 
3562 
3566  std::vector<VectorTag> _current_residual_vector_tags;
3567 
3569  bool _have_fv = false;
3570 
3574 
3576  std::vector<libMesh::CouplingMatrix> _nonlocal_cm;
3577 
3580 
3581 #ifdef MOOSE_KOKKOS_ENABLED
3582  bool _has_kokkos_objects = false;
3584 
3587 
3589  std::vector<std::function<void()>> _kokkos_mesh_initialization_hooks;
3590 #endif
3591 
3592  friend void Moose::PetscSupport::setSinglePetscOption(const std::string & name,
3593  const std::string & value,
3594  FEProblemBase * const problem);
3595 };
3596 
3598 
3599 template <typename T>
3600 void
3602 {
3603  _app.getOutputWarehouse().allowOutput<T>(state);
3604 }
3605 
3606 template <typename T>
3607 void
3608 FEProblemBase::objectSetupHelper(const std::vector<T *> & objects, const ExecFlagType & exec_flag)
3609 {
3610  if (exec_flag == EXEC_INITIAL)
3611  {
3612  for (T * obj_ptr : objects)
3613  obj_ptr->initialSetup();
3614  }
3615 
3616  else if (exec_flag == EXEC_TIMESTEP_BEGIN)
3617  {
3618  for (const auto obj_ptr : objects)
3619  obj_ptr->timestepSetup();
3620  }
3621  else if (exec_flag == EXEC_SUBDOMAIN)
3622  {
3623  for (const auto obj_ptr : objects)
3624  obj_ptr->subdomainSetup();
3625  }
3626 
3627  else if (exec_flag == EXEC_NONLINEAR)
3628  {
3629  for (const auto obj_ptr : objects)
3630  obj_ptr->jacobianSetup();
3631  }
3632 
3633  else if (exec_flag == EXEC_LINEAR)
3634  {
3635  for (const auto obj_ptr : objects)
3636  obj_ptr->residualSetup();
3637  }
3638 }
3639 
3640 template <typename T>
3641 void
3642 FEProblemBase::objectExecuteHelper(const std::vector<T *> & objects)
3643 {
3644  for (T * obj_ptr : objects)
3645  obj_ptr->execute();
3646 }
3647 
3648 template <typename T>
3649 std::vector<std::shared_ptr<T>>
3650 FEProblemBase::addObject(const std::string & type,
3651  const std::string & name,
3653  const bool threaded,
3654  const std::string & var_param_name)
3655 {
3656  parallel_object_only();
3657 
3658  logAdd(MooseUtils::prettyCppType<T>(), name, type, parameters);
3659  // Add the _subproblem and _sys parameters depending on use_displaced_mesh
3660  addObjectParamsHelper(parameters, name, var_param_name);
3661 
3662  const auto n_threads = threaded ? libMesh::n_threads() : 1;
3663  std::vector<std::shared_ptr<T>> objects(n_threads);
3664  for (THREAD_ID tid = 0; tid < n_threads; ++tid)
3665  {
3666  std::shared_ptr<T> obj = _factory.create<T>(type, name, parameters, tid);
3667  theWarehouse().add(obj);
3668  objects[tid] = std::move(obj);
3669  }
3670 
3671  return objects;
3672 }
3673 
3674 inline NonlinearSystemBase &
3675 FEProblemBase::getNonlinearSystemBase(const unsigned int sys_num)
3676 {
3677  mooseAssert(sys_num < _nl.size(), "System number greater than the number of nonlinear systems");
3678  return *_nl[sys_num];
3679 }
3680 
3681 inline const NonlinearSystemBase &
3682 FEProblemBase::getNonlinearSystemBase(const unsigned int sys_num) const
3683 {
3684  mooseAssert(sys_num < _nl.size(), "System number greater than the number of nonlinear systems");
3685  return *_nl[sys_num];
3686 }
3687 
3688 inline SolverSystem &
3689 FEProblemBase::getSolverSystem(const unsigned int sys_num)
3690 {
3691  mooseAssert(sys_num < _solver_systems.size(),
3692  "System number greater than the number of solver systems");
3693  return *_solver_systems[sys_num];
3694 }
3695 
3696 inline const SolverSystem &
3697 FEProblemBase::getSolverSystem(const unsigned int sys_num) const
3698 {
3699  mooseAssert(sys_num < _solver_systems.size(),
3700  "System number greater than the number of solver systems");
3701  return *_solver_systems[sys_num];
3702 }
3703 
3704 inline NonlinearSystemBase &
3706 {
3707  mooseAssert(_current_nl_sys, "The nonlinear system is not currently set");
3708  return *_current_nl_sys;
3709 }
3710 
3711 inline const NonlinearSystemBase &
3713 {
3714  mooseAssert(_current_nl_sys, "The nonlinear system is not currently set");
3715  return *_current_nl_sys;
3716 }
3717 
3718 inline LinearSystem &
3719 FEProblemBase::getLinearSystem(const unsigned int sys_num)
3720 {
3721  mooseAssert(sys_num < _linear_systems.size(),
3722  "System number greater than the number of linear systems");
3723  return *_linear_systems[sys_num];
3724 }
3725 
3726 inline const LinearSystem &
3727 FEProblemBase::getLinearSystem(const unsigned int sys_num) const
3728 {
3729  mooseAssert(sys_num < _linear_systems.size(),
3730  "System number greater than the number of linear systems");
3731  return *_linear_systems[sys_num];
3732 }
3733 
3734 inline LinearSystem &
3736 {
3737  mooseAssert(_current_linear_sys, "The linear system is not currently set");
3738  return *_current_linear_sys;
3739 }
3740 
3741 inline const LinearSystem &
3743 {
3744  mooseAssert(_current_linear_sys, "The linear system is not currently set");
3745  return *_current_linear_sys;
3746 }
3747 
3748 inline Assembly &
3749 FEProblemBase::assembly(const THREAD_ID tid, const unsigned int sys_num)
3750 {
3751  mooseAssert(tid < _assembly.size(), "Assembly objects not initialized");
3752  mooseAssert(sys_num < _assembly[tid].size(),
3753  "System number larger than the assembly container size");
3754  return *_assembly[tid][sys_num];
3755 }
3756 
3757 inline const Assembly &
3758 FEProblemBase::assembly(const THREAD_ID tid, const unsigned int sys_num) const
3759 {
3760  mooseAssert(tid < _assembly.size(), "Assembly objects not initialized");
3761  mooseAssert(sys_num < _assembly[tid].size(),
3762  "System number larger than the assembly container size");
3763  return *_assembly[tid][sys_num];
3764 }
3765 
3766 inline const libMesh::CouplingMatrix *
3767 FEProblemBase::couplingMatrix(const unsigned int i) const
3768 {
3769  return _cm[i].get();
3770 }
3771 
3772 inline void
3773 FEProblemBase::fvBCsIntegrityCheck(const bool fv_bcs_integrity_check)
3774 {
3776  // the user has requested that we don't check integrity so we will honor that
3777  return;
3778 
3779  _fv_bcs_integrity_check = fv_bcs_integrity_check;
3780 }
3781 
3782 inline const std::vector<VectorTag> &
3784 {
3786 }
3787 
3788 inline void
3789 FEProblemBase::setCurrentResidualVectorTags(const std::set<TagID> & vector_tags)
3790 {
3792 }
3793 
3794 inline void
3796 {
3798 }
3799 
3800 #ifdef MOOSE_KOKKOS_ENABLED
3801 template <typename T>
3802 T &
3804 {
3805  if (!hasKokkosFunction(name))
3806  {
3807  // If we didn't find a function, it might be a default function, attempt to construct one now
3808  std::istringstream ss(name);
3809  Real real_value;
3810 
3811  // First see if it's just a constant. If it is, build a ConstantFunction
3812  if (ss >> real_value && ss.eof())
3813  {
3814  InputParameters params = _factory.getValidParams("KokkosConstantFunction");
3815  params.set<Real>("value") = real_value;
3816  addKokkosFunction("KokkosConstantFunction", ss.str(), params);
3817  }
3818 
3819  // Try once more
3820  if (!hasKokkosFunction(name))
3821  mooseError("Unable to find Kokkos function '" + name, "'");
3822  }
3823 
3824  auto * const ret = dynamic_cast<T *>(_kokkos_functions.getActiveObject(name).get());
3825  if (!ret)
3826  mooseError("No Kokkos function named '", name, "' of appropriate type");
3827 
3828  return *ret;
3829 }
3830 #endif
bool _reinit_displaced_elem
Whether to call DisplacedProblem::reinitElem when this->reinitElem is called.
bool initialized() const
virtual void addInterfaceMaterial(const std::string &material_name, const std::string &name, InputParameters &parameters)
std::map< NonlinearSystemName, unsigned int > _nl_sys_name_to_num
Map from nonlinear system name to number.
void setCurrentAlgebraicElementRange(libMesh::ConstElemRange *range)
These functions allow setting custom ranges for the algebraic elements, nodes, and boundary nodes tha...
std::vector< Point > _point_zero
Interface for objects that need parallel consistent random numbers without patterns over the course o...
virtual void computeJacobianTag(const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian, TagID tag)
Form a Jacobian matrix for a given tag.
unsigned short getCurrentICState()
Retrieves the current initial condition state.
void resetFailNextNonlinearConvergenceCheck()
Tell the problem that the nonlinear convergence check(s) may proceed as normal.
bool _u_dot_requested
Whether solution time derivative needs to be stored.
void finalizeMultiApps()
Warehouse for storing scalar initial conditions.
virtual void addFVInitialCondition(const std::string &ic_name, const std::string &name, InputParameters &parameters)
Add an initial condition for a finite volume variables.
VarFieldType
Definition: MooseTypes.h:770
virtual void addMaterialHelper(std::vector< MaterialWarehouse *> warehouse, const std::string &material_name, const std::string &name, InputParameters &parameters)
virtual bool hasNeighborCoupling() const
Whether the simulation has neighbor coupling.
virtual bool hasVariable(const std::string &var_name) const override
Whether or not this problem has the variable.
MortarInterfaceWarehouse & mortarData()
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.
bool shouldSolve() const
const bool _regard_general_exceptions_as_errors
If we catch an exception during residual/Jacobian evaluaton for which we don&#39;t have specific handling...
const std::vector< NonlinearSystemName > & getNonlinearSystemNames() const
const std::size_t _num_nl_sys
The number of nonlinear systems.
void setVariableAllDoFMap(const std::vector< const MooseVariableFEBase *> &moose_vars)
virtual void initPetscOutputAndSomeSolverSettings()
Reinitialize PETSc output for proper linear/nonlinear iteration display.
void setKernelCoverageCheck(CoverageCheckMode mode)
Set flag to indicate whether kernel coverage checks should be performed.
const std::vector< ConvergenceName > & getNonlinearConvergenceNames() const
Gets the nonlinear system convergence object name(s).
void timestepSetup() override
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.
bool _skip_exception_check
If or not skip &#39;exception and stop solve&#39;.
virtual void setUDotDotOldRequested(const bool u_dotdot_old_requested)
Set boolean flag to true to store old solution second time derivative.
Helper class for holding the preconditioning blocks to fill.
bool _reinit_displaced_neighbor
Whether to call DisplacedProblem::reinitNeighbor when this->reinitNeighbor is called.
virtual void meshChanged()
Deprecated.
virtual void addDamper(const std::string &damper_name, const std::string &name, InputParameters &parameters)
std::map< LinearSystemName, unsigned int > _linear_sys_name_to_num
Map from linear system name to number.
The Kokkos assembly class.
Moose::PetscSupport::PetscOptions & getPetscOptions()
Retrieve a writable reference the PETSc options (used by PetscSupport)
void getFVMatsAndDependencies(SubdomainID block_id, std::vector< std::shared_ptr< MaterialBase >> &face_materials, std::vector< std::shared_ptr< MaterialBase >> &neighbor_materials, std::set< MooseVariableFieldBase *> &variables, const THREAD_ID tid)
Get the materials and variables potentially needed for FV.
std::vector< MooseArray< ADRealTensorValue > > _ad_second_zero
virtual Real & dtOld() const
bool _need_to_add_default_steady_state_convergence
Flag that the problem needs to add the default steady convergence.
virtual void prepareFace(const Elem *elem, const THREAD_ID tid) override
Base class for function objects.
Definition: Function.h:29
void setPreserveMatrixSparsityPattern(bool preserve)
Set whether the sparsity pattern of the matrices being formed during the solve (usually the Jacobian)...
void reinitBecauseOfGhostingOrNewGeomObjects(bool mortar_changed=false)
Call when it is possible that the needs for ghosted elements has changed.
virtual void addTransfer(const std::string &transfer_name, const std::string &name, InputParameters &parameters)
Add a Transfer to the problem.
virtual libMesh::System & getSystem(const std::string &var_name) override
Returns the equation system containing the variable provided.
A MultiMooseEnum object to hold "execute_on" flags.
Definition: ExecFlagEnum.h:21
static SolverParams makeLinearSolverParams()
Make basic solver params for linear solves.
bool _snesmf_reuse_base_set_by_user
If or not _snesmf_reuse_base is set by user.
bool _parallel_barrier_messaging
Whether or not information about how many transfers have completed is printed.
virtual void addResidualLower(const THREAD_ID tid) override
bool _computing_scaling_jacobian
Flag used to indicate whether we are computing the scaling Jacobian.
A class for creating restricted objects.
Definition: Restartable.h:28
virtual void addJacobianLowerD(const THREAD_ID tid) override
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:1062
virtual void clearActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid) override
MaterialPropertyStorage & _bnd_material_props
virtual void addGhostedElem(dof_id_type elem_id) override
Will make sure that all dofs connected to elem_id are ghosted to this processor.
void setNonlocalCouplingMatrix()
Set custom coupling matrix for variables requiring nonlocal contribution.
void setExecutionPrinting(const ExecFlagEnum &print_exec)
virtual Real & time() const
std::vector< std::pair< MooseVariableFEBase *, MooseVariableFEBase * > > & couplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num)
void checkDependMaterialsHelper(const std::map< SubdomainID, std::vector< std::shared_ptr< MaterialBase >>> &materials_map)
Helper method for checking Material object dependency.
unsigned int n_threads()
void setNeedToAddDefaultSteadyStateConvergence()
Sets _need_to_add_default_steady_state_convergence to true.
virtual void cacheResidualNeighbor(const THREAD_ID tid) override
virtual void setInputParametersFEProblem(InputParameters &parameters)
bool identifyVariableGroupsInNL() const
Whether to identify variable groups in nonlinear systems.
ExecFlagType _current_execute_on_flag
Current execute_on flag.
void clearCurrentResidualVectorTags()
Clear the current residual vector tag data structure.
QueryCache is a convenient way to construct and pass around (possible partially constructed) warehous...
Definition: TheWarehouse.h:209
T & getUserObject(const std::string &name, unsigned int tid=0) const
Get the user object by its name.
std::shared_ptr< DisplacedProblem > displaced_problem
virtual bool hasNonlocalCoupling() const override
Whether the simulation has active nonlocal coupling which should be accounted for in the Jacobian...
void setNeedToAddDefaultMultiAppFixedPointConvergence()
Sets _need_to_add_default_multiapp_fixed_point_convergence to true.
virtual void checkExceptionAndStopSolve(bool print_message=true)
Check to see if an exception has occurred on any processor and, if possible, force the solve to fail...
virtual void meshDisplaced()
Update data after a mesh displaced.
virtual bool uDotDotOldRequested()
Get boolean flag to check whether old solution second time derivative needs to be stored...
std::optional< ConvergenceName > _multiapp_fixed_point_convergence_name
MultiApp fixed point convergence name.
Keeps track of stuff related to assembling.
Definition: Assembly.h:109
MooseAppCoordTransform & coordTransform()
virtual void setActiveFEVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid) override
void setCurrentAlgebraicNodeRange(libMesh::ConstNodeRange *range)
bool _error_on_jacobian_nonzero_reallocation
Whether to error when the Jacobian is re-allocated, usually because the sparsity pattern changed...
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.
unsigned int TagID
Definition: MooseTypes.h:238
virtual void reinitNode(const Node *node, const THREAD_ID tid) override
virtual std::size_t numNonlinearSystems() const override
virtual void predictorCleanup(NumericVector< libMesh::Number > &ghosted_solution)
Perform cleanup tasks after application of predictor to solution vector.
virtual void prepare(const Elem *elem, const THREAD_ID tid) override
MPI_Datatype data_type
bool verboseMultiApps() const
Whether or not to use verbose printing for MultiApps.
const MooseObjectWarehouse< Function > & getFunctionWarehouse()
bool _has_jacobian
Indicates if the Jacobian was computed.
virtual bool haveFV() const override
returns true if this problem includes/needs finite volume functionality.
char ** blocks
Interface for objects acting when the mesh has been displaced.
virtual void addKokkosMaterial(const std::string &material_name, const std::string &name, InputParameters &parameters)
const Moose::Kokkos::Assembly & kokkosAssembly() const
MooseObjectWarehouse< InternalSideIndicatorBase > _internal_side_indicators
bool _has_dampers
Whether or not this system has any Dampers associated with it.
std::vector< SubdomainName > _kernel_coverage_blocks
virtual void setUDotDotRequested(const bool u_dotdot_requested)
Set boolean flag to true to store solution second time derivative.
virtual Distribution & getDistribution(const std::string &name)
void needsPreviousMultiAppFixedPointIterationSolution(bool needed, const unsigned int solver_sys_num)
Set a flag that indicated that user required values for the previous multiapp fixed point iterate for...
bool haveDisplaced() const override final
Whether we have a displaced problem in our simulation.
bool _has_nonlocal_coupling
Indicates if nonlocal coupling is required/exists.
bool useHashTableMatrixAssembly() const
std::vector< std::function< void()> > _kokkos_mesh_initialization_hooks
Container holding hooks for functions that need to be called after Kokkos mesh initialization.
void setCurrentAlgebraicBndNodeRange(ConstBndNodeRange *range)
This is the base class for Samplers as used within the Stochastic Tools module.
Definition: Sampler.h:45
bool areCoupled(const unsigned int ivar, const unsigned int jvar, const unsigned int nl_sys_num) const
Registry class for material property IDs and names.
void setPostprocessorValueByName(const PostprocessorName &name, const PostprocessorValue &value, std::size_t t_index=0)
Set the value of a PostprocessorValue.
virtual void addKokkosNodalKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
virtual void clearActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid) override
virtual void postExecute()
Method called at the end of the simulation.
virtual void addKokkosReporter(const std::string &type, const std::string &name, InputParameters &parameters)
bool isSolverSystemNonlinear(const unsigned int sys_num)
Check if the solver system is nonlinear.
void prepareKokkosMaterials(const std::unordered_set< unsigned int > &consumer_needed_mat_props)
void joinAndFinalize(TheWarehouse::Query query, bool isgen=false)
std::vector< MooseArray< ADRealVectorValue > > _ad_grad_zero
Warehouse for storing initial conditions.
std::vector< SolverParams > _solver_params
virtual void addKokkosBoundaryCondition(const std::string &bc_name, const std::string &name, InputParameters &parameters)
const std::vector< SolverSystemName > & getSolverSystemNames() const
ExecuteMooseObjectWarehouse< Control > _control_warehouse
The control logic warehouse.
void reinitMaterialsFaceOnBoundary(const BoundaryID boundary_id, const SubdomainID blk_id, const THREAD_ID tid, const bool swap_stateful=true, const std::deque< MaterialBase *> *const reinit_mats=nullptr)
reinit materials on element faces on a boundary (internal or external) This specific routine helps us...
virtual std::pair< bool, unsigned int > determineSolverSystem(const std::string &var_name, bool error_if_not_found=false) const override
Determine what solver system the provided variable name lies in.
std::unique_ptr< libMesh::ConstNodeRange > _current_algebraic_node_range
virtual void setActiveScalarVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid) override
void setCoupling(Moose::CouplingType type)
Set the coupling between variables TODO: allow user-defined coupling.
const ExecFlagType & getCurrentExecuteOnFlag() const
Return/set the current execution flag.
unsigned int _cycles_completed
virtual void reinitScalars(const THREAD_ID tid, bool reinit_for_derivative_reordering=false) override
fills the VariableValue arrays for scalar variables from the solution vector
virtual bool uDotRequested()
Get boolean flag to check whether solution time derivative needs to be stored.
virtual void init() override
void add(std::shared_ptr< MooseObject > obj)
add adds a new object to the warehouse and stores attributes/metadata about it for running queries/fi...
Definition: TheWarehouse.C:116
virtual void needFV() override
marks this problem as including/needing finite volume functionality.
virtual void getDiracElements(std::set< const Elem *> &elems) override
Fills "elems" with the elements that should be looped over for Dirac Kernels.
void parentOutputPositionChanged()
Calls parentOutputPositionChanged() on all sub apps.
virtual void addInterfaceKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
bool _is_petsc_options_inserted
If or not PETSc options have been added to database.
void setCurrentlyComputingResidual(bool currently_computing_residual) final
Set whether or not the problem is in the process of computing the residual.
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters &parameters)
virtual void lineSearch()
execute MOOSE line search
virtual bool checkNonlocalCouplingRequirement() const override
virtual bool uDotDotRequested()
Get boolean flag to check whether solution second time derivative needs to be stored.
bool _has_kokkos_objects
Whether we have any Kokkos objects.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
unsigned short _current_ic_state
const MortarInterfaceWarehouse & mortarData() const
Returns the mortar data object.
virtual void reinitNeighborPhys(const Elem *neighbor, unsigned int neighbor_side, const std::vector< Point > &physical_points, const THREAD_ID tid) override
std::vector< MeshDisplacedInterface * > _notify_when_mesh_displaces
Objects to be notified when the mesh displaces.
void trustUserCouplingMatrix()
Whether to trust the user coupling matrix even if we want to do things like be paranoid and create a ...
virtual void newAssemblyArray(std::vector< std::shared_ptr< SolverSystem >> &solver_systems)
const bool _uo_aux_state_check
Whether or not checking the state of uo/aux evaluation.
virtual void addMeshDivision(const std::string &type, const std::string &name, InputParameters &params)
Add a MeshDivision.
bool _computing_scaling_residual
Flag used to indicate whether we are computing the scaling Residual.
A struct for storing the various types of petsc options and values.
Definition: PetscSupport.h:44
virtual void computeMarkers()
void reportMooseObjectDependency(MooseObject *a, MooseObject *b)
Register a MOOSE object dependency so we can either order operations properly or report when we canno...
void residualSetup() override
MaterialDataType
MaterialData types.
Definition: MooseTypes.h:740
virtual bool onlyAllowDefaultNonlinearConvergence() const
Returns true if an error will result if the user supplies &#39;nonlinear_convergence&#39;.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Positions objects are under the hood Reporters.
Definition: Positions.h:20
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...
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
virtual void reinitNodes(const std::vector< dof_id_type > &nodes, const THREAD_ID tid) override
virtual void updateActiveObjects()
Update the active objects in the warehouses.
Stores the stateful material properties computed by materials.
const RestartableEquationSystems & getRestartableEquationSystems() const
Get the RestartableEquationSystems object.
virtual void computeIndicatorsAndMarkers()
void reinitMaterialsBoundary(BoundaryID boundary_id, const THREAD_ID tid, bool swap_stateful=true, const std::deque< MaterialBase *> *reinit_mats=nullptr)
reinit materials on a boundary
Definition: Marker.h:41
virtual void addJacobianOffDiagScalar(unsigned int ivar, const THREAD_ID tid=0)
void setCheckResidualForNans(bool check_residual_for_nans)
Setter for residual NaN/Inf checking.
virtual void setException(const std::string &message)
Set an exception, which is stored at this point by toggling a member variable in this class...
virtual void addJacobian(const THREAD_ID tid) override
CreateTaggedMatrixKey(const CreateTaggedMatrixKey &)
virtual void addAuxScalarKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
Definition: Factory.C:68
Interface for interpolation methods that provide matrix and RHS contributions for advected face value...
void setErrorOnJacobianNonzeroReallocation(bool state)
bool _has_kokkos_residual_objects
Whether we have any Kokkos residual objects.
PetscOptions _petsc_option_data_base
virtual const std::vector< VectorTag > & currentResidualVectorTags() const override
Return the residual vector tags we are currently computing.
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...
Moose::Kokkos::MaterialPropertyStorage & getKokkosNeighborMaterialPropertyStorage()
std::vector< VectorTag > _current_residual_vector_tags
A data member to store the residual vector tag(s) passed into computeResidualTag(s).
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::vector< SubdomainName > _material_coverage_blocks
void setSteadyStateConvergenceName(const ConvergenceName &convergence_name)
Sets the steady-state detection convergence object name if there is one.
virtual void addAuxScalarVariable(const std::string &var_name, libMesh::Order order, Real scale_factor=1., const std::set< SubdomainID > *const active_subdomains=NULL)
virtual const SystemBase & systemBaseLinear(unsigned int sys_num) const override
Get a constant base class reference to a linear system.
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 bool hasScalarVariable(const std::string &var_name) const override
Returns a Boolean indicating whether any system contains a variable with the name provided...
MultiApp Implementation for Transient Apps.
Moose::Kokkos::MaterialPropertyStorage & getKokkosBndMaterialPropertyStorage()
void resizeMaterialData(Moose::MaterialDataType data_type, unsigned int nqp, const THREAD_ID tid)
Resize material data.
Warehouse for storing finite volume initial conditions.
void finishMultiAppStep(ExecFlagType type, bool recurse_through_multiapp_levels=false)
Finish the MultiApp time step (endStep, postStep) associated with the ExecFlagType.
virtual void addFunctorMaterial(const std::string &functor_material_name, const std::string &name, InputParameters &parameters)
virtual void addKokkosUserObject(const std::string &user_object_name, const std::string &name, InputParameters &parameters)
virtual bool hasKokkosFunction(const std::string &name) const
Get whether a Kokkos function exists.
Registered base class for linear FV interpolation objects.
std::vector< VariableSecond > _second_zero
std::map< SolverVariableName, unsigned int > _solver_var_to_sys_num
Map connecting variable names with their respective solver systems.
std::vector< MooseArray< ADReal > > _ad_zero
Moose::Kokkos::MaterialPropertyStorage & getKokkosMaterialPropertyStorage()
bool _requires_nonlocal_coupling
nonlocal coupling requirement flag
virtual void onTimestepEnd() override
virtual void computeNearNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > *> &sp)
virtual void addNodalKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
std::vector< std::shared_ptr< SolverSystem > > _solver_systems
Combined container to base pointer of every solver system.
All Distributions should inherit from this class.
Definition: Distribution.h:18
MaterialWarehouse _kokkos_materials
bool hasKokkosUserObject(const std::string &name) const
Check if there if a Kokkos user object of given name.
std::vector< VectorVariableCurl > _vector_curl_zero
virtual bool hasMortarCoupling() const
Whether the simulation has mortar coupling.
Base class for user objects executed one or more sidesets, which may be on the outer boundary of the ...
bool _has_exception
Whether or not an exception has occurred.
unsigned int _num_grid_steps
Number of steps in a grid sequence.
bool _needs_old_newton_iter
Indicates that we need to compute variable values for previous Newton iteration.
bool haveXFEM()
Find out whether the current analysis is using XFEM.
virtual void addJacobianBlockTags(libMesh::SparseMatrix< libMesh::Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, std::vector< dof_id_type > &dof_indices, const std::set< TagID > &tags, const THREAD_ID tid)
void registerRandomInterface(RandomInterface &random_interface, const std::string &name)
bool _has_time_integrator
Indicates whether or not this executioner has a time integrator (during setup)
void computeUserObjectsInternal(const ExecFlagType &type, TheWarehouse::Query &query)
This class provides an interface for common operations on field variables of both FE and FV types wit...
ExecuteMooseObjectWarehouse< MultiApp > & getMultiAppWarehouse()
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
MaterialPropertyRegistry _material_prop_registry
Moose::Kokkos::Assembly & kokkosAssembly()
void clearActiveMaterialProperties(const THREAD_ID tid)
Clear the active material properties.
virtual unsigned int nLinearIterations(const unsigned int nl_sys_num) const override
MaterialBase objects are special in that they have additional objects created automatically (see FEPr...
ExecuteMooseObjectWarehouse< TransientMultiApp > _transient_multi_apps
Storage for TransientMultiApps (only needed for calling &#39;computeDT&#39;)
Moose::Kokkos::Assembly _kokkos_assembly
MaterialWarehouse _interface_materials
bool hasUserObject(const std::string &name) const
Check if there if a user object of given name.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
bool _ignore_zeros_in_jacobian
Whether to ignore zeros in the Jacobian, thereby leading to a reduced sparsity pattern.
void kokkosJoinAndFinalize(const std::vector< Moose::Kokkos::UserObject *> &userobjs)
const libMesh::ConstElemRange & getCurrentAlgebraicElementRange()
These are the element and nodes that contribute to the jacobian and residual for this local processor...
void setCurrentExecuteOnFlag(const ExecFlagType &)
const MaterialWarehouse & getMaterialWarehouse() const
virtual void computeResidualInternal(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, const std::set< TagID > &tags)
Form a residual vector for a set of tags.
void initElementStatefulProps(const libMesh::ConstElemRange &elem_range, const bool threaded)
Initialize stateful properties for elements in a specific elem_range This is needed when elements/bou...
const libMesh::ConstNodeRange & getCurrentAlgebraicNodeRange()
void computingScalingJacobian(bool computing_scaling_jacobian)
Setter for whether we&#39;re computing the scaling jacobian.
ExecuteMooseObjectWarehouse< Transfer > _from_multi_app_transfers
Transfers executed just after MultiApps to transfer data from them.
virtual bool checkResidualForNans() const override
Whether to check residual for NaN/Inf values.
virtual void addKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
Base class for a system (of equations)
Definition: SystemBase.h:85
const InitialConditionWarehouse & getInitialConditionWarehouse() const
Return InitialCondition storage.
const std::set< const MooseObject * > & getKokkosMaterialPropertyStorageConsumers(Moose::MaterialDataType type) const
virtual void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters &params)
Canonical method for adding an auxiliary variable.
The Kokkos system class.
Definition: KokkosSystem.h:34
std::optional< ConvergenceName > _steady_state_convergence_name
Steady-state detection convergence name.
Base class for MeshDivision objects.
Definition: MeshDivision.h:35
const MaterialPropertyStorage & getBndMaterialPropertyStorage()
std::vector< bool > _previous_multiapp_fp_nl_solution_required
Indicates we need to save the previous multiapp fixed-point iteration solver variable values...
MooseObjectWarehouse< Moose::FunctionBase > _kokkos_functions
bool computingNonlinearResid() const
Returns true if the problem is in the process of computing the nonlinear residual.
Definition: SubProblem.h:715
virtual void addFVInterfaceKernel(const std::string &fv_ik_name, const std::string &name, InputParameters &parameters)
MeshDivision & getMeshDivision(const std::string &name, const THREAD_ID tid=0) const
Get a MeshDivision.
unsigned int getNumCyclesCompleted()
Base class for creating new nodally-based mortar user objects.
bool hasDampers()
Whether or not this system has dampers.
const Positions & getPositionsObject(const std::string &name) const
Get the Positions object by its name.
std::map< SolverSystemName, unsigned int > _solver_sys_name_to_num
Map connecting solver system names with their respective systems.
FEProblemBase(const InputParameters &parameters)
void setFailNextNonlinearConvergenceCheck()
Skip further residual evaluations and fail the next nonlinear convergence check(s) ...
virtual Executor & getExecutor(const std::string &name)
virtual void cacheJacobianNeighbor(const THREAD_ID tid) override
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
bool needToAddDefaultSteadyStateConvergence() const
Returns true if the problem needs to add the default steady-state detection convergence.
std::vector< std::unordered_map< BoundaryID, bool > > _bnd_mat_side_cache
Cache for calculating materials on side.
bool _have_fv
Whether we are performing some calculations with finite volume discretizations.
bool hasLinearConvergenceObjects() const
Whether we have linear convergence objects.
ExecFlagEnum _print_execution_on
When to print the execution of loops.
bool needsPreviousMultiAppFixedPointIterationAuxiliary() const
Check to see whether we need to compute the variable values of the previous multiapp fixed point iter...
virtual void setResidual(NumericVector< libMesh::Number > &residual, const THREAD_ID tid) override
bool & petscOptionsInserted()
If PETSc options are already inserted.
virtual void solve(const unsigned int nl_sys_num)
virtual void setCurrentLowerDElem(const Elem *const lower_d_elem, const THREAD_ID tid) override
Set the current lower dimensional element.
std::set< TagID > _linear_matrix_tags
Temporary storage for filtered matrix tags for linear systems.
void bumpAllQRuleOrder(libMesh::Order order, SubdomainID block)
Real computeMultiAppsDT(ExecFlagType type)
Find the smallest timestep over all MultiApps.
void setParallelBarrierMessaging(bool flag)
Toggle parallel barrier messaging (defaults to on).
void projectSolution()
const MaterialWarehouse & getRegularMaterialsWarehouse() const
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const override
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
void reinitMaterialsFace(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true, const std::deque< MaterialBase *> *reinit_mats=nullptr)
reinit materials on element faces
std::unique_ptr< libMesh::ConstElemRange > _nl_evaluable_local_elem_range
virtual void computeResidualTags(const std::set< TagID > &tags)
Form multiple residual vectors and each is associated with one tag.
const bool & currentlyComputingResidual() const
Returns true if the problem is in the process of computing the residual.
Definition: SubProblem.h:728
void setMaterialCoverageCheck(CoverageCheckMode mode)
Set flag to indicate whether material coverage checks should be performed.
virtual void computeJacobianSys(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian)
Form a Jacobian matrix.
void skipNextForwardSolutionCopyToOld()
Prevents the copy of the solution vector to the old solution vector in each system.
std::shared_ptr< MultiApp > getMultiApp(const std::string &multi_app_name) const
Get a MultiApp object by name.
virtual void reinitElemNeighborAndLowerD(const Elem *elem, unsigned int side, const THREAD_ID tid) override
bool hasSolverVariable(const std::string &var_name) const
AuxGroup
Flag for AuxKernel related execution type.
Definition: MooseTypes.h:752
virtual void addMarker(const std::string &marker_name, const std::string &name, InputParameters &parameters)
Per-mortar-interface configuration.
unsigned int subspaceDim(const std::string &prefix) const
Dimension of the subspace spanned by vectors with a given prefix.
virtual GeometricSearchData & geomSearchData() override
virtual void setUDotOldRequested(const bool u_dot_old_requested)
Set boolean flag to true to store old solution time derivative.
bool needsPreviousNewtonIteration() const
Check to see whether we need to compute the variable values of the previous Newton iterate...
virtual void addBoundaryCondition(const std::string &bc_name, const std::string &name, InputParameters &parameters)
const libMesh::CouplingMatrix * couplingMatrix(const unsigned int nl_sys_num) const override
The coupling matrix defining what blocks exist in the preconditioning matrix.
virtual bool computingPreSMOResidual(const unsigned int nl_sys_num) const override
Returns true if the problem is in the process of computing it&#39;s initial residual. ...
This class is a container/interface for the objects involved in automatic generation of mortar spaces...
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) override
The abstract class that provides polymorphic interfaces for a function.
void createTagMatrices(CreateTaggedMatrixKey)
const bool _skip_nl_system_check
virtual void resetState()
Reset state of this object in preparation for the next evaluation.
virtual void addCachedResidualDirectly(NumericVector< libMesh::Number > &residual, const THREAD_ID tid)
Allows for all the residual contributions that are currently cached to be added directly into the vec...
virtual void addInitialCondition(const std::string &ic_name, const std::string &name, InputParameters &parameters)
virtual void addKokkosPostprocessor(const std::string &pp_name, const std::string &name, InputParameters &parameters)
ScalarInitialConditionWarehouse _scalar_ics
virtual void computeLinearSystemSys(libMesh::LinearImplicitSystem &sys, libMesh::SparseMatrix< libMesh::Number > &system_matrix, NumericVector< libMesh::Number > &rhs, const bool compute_gradients=true)
Assemble both the right hand side and the system matrix of a given linear system. ...
Nonlinear system to be solved.
void skipExceptionCheck(bool skip_exception_check)
Set a flag that indicates if we want to skip exception and stop solve.
Moose::Kokkos::System & getKokkosSystem(const unsigned int sys_num)
Get the Kokkos system of a specified number that is associated with MOOSE nonlinear and auxiliary sys...
virtual void swapBackMaterialsFace(const THREAD_ID tid)
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 advanceState()
Advance all of the state holding vectors / datastructures so that we can move to the next timestep...
A user object that runs over all the nodes and does an aggregation step to compute a single value...
ExecuteMooseObjectWarehouse< Transfer > _transfers
Normal Transfers.
void 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.
void checkUserObjectNameCollision(const std::string &name, const std::string &type) const
Check for name collision between different user objects.
const VectorPostprocessorValue & getVectorPostprocessorValueByName(const std::string &object_name, const std::string &vector_name, std::size_t t_index=0) const
Get a read-only reference to the vector value associated with the VectorPostprocessor.
MooseLinearConvergenceReason
virtual Function & getFunction(const std::string &name, const THREAD_ID tid=0)
virtual void addPredictor(const std::string &type, const std::string &name, InputParameters &parameters)
virtual void computeJacobianBlocks(std::vector< JacobianBlock *> &blocks, const unsigned int nl_sys_num)
Computes several Jacobian blocks simultaneously, summing their contributions into smaller preconditio...
virtual void addLineSearch(const InputParameters &)
add a MOOSE line search
virtual void copySolutionsBackwards()
const ConstBndNodeRange & getCurrentAlgebraicBndNodeRange()
bool _calculate_jacobian_in_uo
virtual void reinitElemFaceRef(const Elem *elem, unsigned int side, Real tolerance, const std::vector< Point > *const pts, const std::vector< Real > *const weights=nullptr, const THREAD_ID tid=0) override
reinitialize FE objects on a given element on a given side at a given set of reference points and the...
virtual void prepareFaceShapes(unsigned int var, const THREAD_ID tid) override
virtual void addPostprocessor(const std::string &pp_name, const std::string &name, InputParameters &parameters)
virtual Real finalNonlinearResidual(const unsigned int nl_sys_num) const override
std::vector< std::shared_ptr< NonlinearSystemBase > > _nl
The nonlinear systems.
bool automaticScaling() const
Automatic scaling getter.
Definition: SubProblem.C:1163
virtual void computeUserObjects(const ExecFlagType &type, const Moose::AuxGroup &group)
Call compute methods on UserObjects.
virtual void setActiveElementalMooseVariables(const std::set< MooseVariableFEBase *> &moose_vars, const THREAD_ID tid) override
Set the MOOSE variables to be reinited on each element.
const MaterialWarehouse & getInterfaceMaterialsWarehouse() const
std::vector< VariablePhiGradient > _grad_phi_zero
const std::vector< const MooseVariableFEBase * > & getUserObjectJacobianVariables(const THREAD_ID tid) const
const MaterialWarehouse & getDiscreteMaterialWarehouse() const
bool hasJacobian() const
Returns _has_jacobian.
void notifyWhenMeshDisplaces(MeshDisplacedInterface *mdi)
Register an object that derives from MeshDisplacedInterface to be notified when the displaced mesh ge...
void createTagSolutions()
Create extra tagged solution vectors.
std::vector< SolverSystemName > _solver_sys_names
The union of nonlinear and linear system names.
virtual void execute(const ExecFlagType &exec_type)
Convenience function for performing execution of MOOSE systems.
bool _verbose_restore
Whether or not to be verbose on solution restoration post a failed time step.
bool _previous_nl_solution_required
Indicates we need to save the previous NL iteration variable values.
bool _trust_user_coupling_matrix
Whether to trust the user coupling matrix no matter what.
const ConvergenceName & getSteadyStateConvergenceName() const
Gets the steady-state detection convergence object name.
void handleException(const std::string &calling_method)
Handle exceptions.
virtual std::vector< VariableName > getVariableNames()
Returns a list of all the variables in the problem (both from the NL and Aux systems.
ReporterData _reporter_data
const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:103
void uniformRefine()
uniformly refine the problem mesh(es).
bool hasSetMultiAppFixedPointConvergenceName() const
Returns true if the problem has set the fixed point convergence name.
virtual void computeResidualSys(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual)
This function is called by Libmesh to form a residual.
const ReporterData & getReporterData() const
Provides const access the ReporterData object.
virtual const libMesh::CouplingMatrix & nonlocalCouplingMatrix(const unsigned i) const override
std::unique_ptr< libMesh::ConstElemRange > _current_algebraic_elem_range
const bool & _immediately_print_invalid_solution
std::vector< std::shared_ptr< Transfer > > getTransfers(ExecFlagType type, Transfer::DIRECTION direction) const
Get Transfers by ExecFlagType and direction.
bool hasSetSteadyStateConvergenceName() const
Returns true if the problem has set the steady-state detection convergence name.
virtual void addConvergence(const std::string &type, const std::string &name, InputParameters &parameters)
Adds a Convergence object.
bool shouldPrintExecution(const THREAD_ID tid) const
Check whether the problem should output execution orders at this time.
const bool & _solve
Whether or not to actually solve the nonlinear system.
virtual const SystemBase & systemBaseSolver(const unsigned int sys_num) const override
Return the solver system object as a base class reference given the system number.
ExecuteMooseObjectWarehouse< Transfer > _to_multi_app_transfers
Transfers executed just before MultiApps to transfer data to them.
NonlinearSystemBase * _current_nl_sys
The current nonlinear system that we are solving.
bool _check_residual_for_nans
Whether to check the residual for NaN or Inf values.
MooseObjectWarehouse< Convergence > _convergences
convergence warehouse
Interface for notifications that the mesh has changed.
void setCurrentNonlinearSystem(const unsigned int nl_sys_num)
virtual std::shared_ptr< DisplacedProblem > getDisplacedProblem()
std::shared_ptr< T > getActiveObject(const std::string &name, THREAD_ID tid=0) const
This is the common base class for the three main kernel types implemented in MOOSE, Kernel, VectorKernel and ArrayKernel.
Definition: KernelBase.h:23
void numGridSteps(unsigned int num_grid_steps)
Set the number of steps in a grid sequences.
Base class for convergence criteria.
Definition: Convergence.h:21
bool hasFVInterpolationMethod(const InterpolationMethodName &name) const
Check if an FV interpolation method with a given name exists.
bool _input_file_saved
whether input file has been written
virtual void reinitElem(const Elem *elem, const THREAD_ID tid) override
virtual Convergence & getConvergence(const std::string &name, const THREAD_ID tid=0) const
Gets a Convergence object.
TheWarehouse & theWarehouse() const
void createTagVectors()
Create extra tagged vectors and matrices.
virtual void createQRules(libMesh::QuadratureType type, libMesh::Order order, libMesh::Order volume_order=libMesh::INVALID_ORDER, libMesh::Order face_order=libMesh::INVALID_ORDER, SubdomainID block=Moose::ANY_BLOCK_ID, bool allow_negative_qweights=true)
void reinitMaterialsNeighbor(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true, const std::deque< MaterialBase *> *reinit_mats=nullptr)
reinit materials on the neighboring element face
void setMultiAppFixedPointConvergenceName(const ConvergenceName &convergence_name)
Sets the MultiApp fixed point convergence object name if there is one.
void addKokkosMeshInitializationHook(std::function< void()> function)
Add a function hook that needs to be called after Kokkos mesh initialization.
void computeKokkosUserObjectsInternal(const ExecFlagType &type, TheWarehouse::Query &query)
void checkUserObjects()
Moose::CouplingType _coupling
Type of variable coupling.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:28
const T & getKokkosUserObject(const std::string &name) const
Get the Kokkos user object by its name.
virtual bool shouldUpdateSolution()
Check to see whether the problem should update the solution.
const FVInterpolationMethod & getFVInterpolationMethod(const InterpolationMethodName &name, const THREAD_ID tid=0) const
Retrieve an FV interpolation method.
const ConvergenceName & getMultiAppFixedPointConvergenceName() const
Gets the MultiApp fixed point convergence object name.
Real getTimeFromStateArg(const Moose::StateArg &state) const
Returns the time associated with the requested state.
virtual std::string solverTypeString(unsigned int solver_sys_num=0)
Return solver type as a human readable string.
const ExecFlagType EXEC_TIMESTEP_BEGIN
Definition: Moose.C:37
void executeSamplers(const ExecFlagType &exec_type)
Performs setup and execute calls for Sampler objects.
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 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 reinitMaterialsNeighborOnBoundary(const BoundaryID boundary_id, const SubdomainID blk_id, const THREAD_ID tid, const bool swap_stateful=true, const std::deque< MaterialBase *> *const reinit_mats=nullptr)
reinit materials on neighbor element (usually faces) on a boundary (internal or external) This specif...
void getUOExecutionGroups(TheWarehouse::Query &query, std::set< int > &execution_groups) const
void addOutput(const std::string &, const std::string &, InputParameters &)
Adds an Output object.
boundary_id_type BoundaryID
const MooseObjectWarehouse< InternalSideIndicatorBase > & getInternalSideIndicatorWarehouse()
virtual void setUDotRequested(const bool u_dot_requested)
Set boolean flag to true to store solution time derivative.
const bool _allow_ics_during_restart
bool constJacobian() const
Returns _const_jacobian (whether a MOOSE object has specified that the Jacobian is the same as the pr...
virtual void clearActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) override
std::vector< MeshChangedInterface * > _notify_when_mesh_changes
Objects to be notified when the mesh changes.
void checkNonlocalCoupling()
void addDefaultSteadyStateConvergence(const InputParameters &params)
Adds the default steady-state detection Convergence.
VarKindType
Framework-wide stuff.
Definition: MooseTypes.h:763
NonlinearSystemBase & currentNonlinearSystem()
void computingScalingResidual(bool computing_scaling_residual)
Setter for whether we&#39;re computing the scaling residual.
void checkDisplacementOrders()
Verify that SECOND order mesh uses SECOND order displacements.
virtual void addFunction(const std::string &type, const std::string &name, InputParameters &parameters)
Real PostprocessorValue
various MOOSE typedefs
Definition: MooseTypes.h:230
virtual void addJacobianNeighbor(const THREAD_ID tid) override
virtual libMesh::EquationSystems & es() override
std::vector< std::unordered_map< SubdomainID, bool > > _block_mat_side_cache
Cache for calculating materials on side.
bool hasTimeIntegrator() const
Returns whether or not this Problem has a TimeIntegrator.
std::shared_ptr< AuxiliarySystem > _aux
The auxiliary system.
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 MooseEnum &triangulation, const bool triangulate_triangles)
NumberVectorValue Gradient
TheWarehouse is a container for MooseObjects that allows querying/filtering over various customizeabl...
Definition: TheWarehouse.h:186
virtual void addVectorPostprocessor(const std::string &pp_name, const std::string &name, InputParameters &parameters)
const bool _allow_invalid_solution
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:93
virtual unsigned int currentNlSysNum() const override
const MaterialPropertyStorage & getMaterialPropertyStorage()
Return a reference to the material property storage.
virtual void computeIndicators()
bool hasInitialAdaptivity() const
Return a Boolean indicating whether initial AMR is turned on.
virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the scalar variable reference from whichever system contains it.
static void objectSetupHelper(const std::vector< T *> &objects, const ExecFlagType &exec_flag)
Helpers for calling the necessary setup/execute functions for the supplied objects.
const bool _boundary_restricted_node_integrity_check
whether to perform checking of boundary restricted nodal object variable dependencies, e.g.
virtual void setActiveScalarVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid) override
MooseMesh & _mesh
virtual bool uDotOldRequested()
Get boolean flag to check whether old solution time derivative needs to be stored.
virtual bool updateMeshXFEM()
Update the mesh due to changing XFEM cuts.
virtual const SystemBase & systemBaseNonlinear(const unsigned int sys_num) const override
Return the nonlinear system object as a base class reference given the system number.
std::vector< MortarUserObject * > getMortarUserObjects(BoundaryID primary_boundary_id, BoundaryID secondary_boundary_id, bool displaced, const std::vector< MortarUserObject *> &mortar_uo_superset)
Helper for getting mortar objects corresponding to primary boundary ID, secondary boundary ID...
virtual void restoreSolutions()
bool fvBCsIntegrityCheck() const
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.
bool _u_dotdot_old_requested
Whether old solution second time derivative needs to be stored.
void setFailNextSystemConvergenceCheck()
Tell the problem that the system(s) cannot be considered converged next time convergence is checked...
void addAnyRedistributers()
void mooseDeprecated(Args &&... args) const
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:93
bool hasPostprocessorValueByName(const PostprocessorName &name) const
Whether or not a Postprocessor value exists by a given name.
void setAxisymmetricCoordAxis(const MooseEnum &rz_coord_axis)
void initialSetup() override
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:54
Adaptivity _adaptivity
std::vector< VectorTag > getVectorTags(const std::set< TagID > &tag_ids) const
Definition: SubProblem.C:173
bool allowInvalidSolution() const
Whether to accept / allow an invalid solution.
bool needInternalNeighborSideMaterial(SubdomainID subdomain_id, const THREAD_ID tid)
virtual const SystemBase & systemBaseAuxiliary() const override
Return the auxiliary system object as a base class reference.
void setLinearConvergenceNames(const std::vector< ConvergenceName > &convergence_names)
Sets the linear convergence object name(s) if there is one.
void checkUserObjectJacobianRequirement(THREAD_ID tid)
MooseVariableFieldBase & getActualFieldVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested MooseVariableField which may be in any system...
LineSearch * getLineSearch() override
getter for the MOOSE line search
virtual bool hasDistribution(const std::string &name) const
void reinitKokkosMaterials()
virtual void computeNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > *> &sp)
virtual void addTimeIntegrator(const std::string &type, const std::string &name, InputParameters &parameters)
LinearSystem * _current_linear_sys
The current linear system that we are solving.
virtual void cacheResidual(const THREAD_ID tid) override
virtual void computeResidualType(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, TagID tag)
Form a residual vector for a given tag and "residual" tag.
const bool _force_restart
void forceOutput()
Indicates that the next call to outputStep should be forced.
const VectorPostprocessor & getVectorPostprocessorObjectByName(const std::string &object_name, const THREAD_ID tid=0) const
Return the VPP object given the name.
std::vector< VariablePhiSecond > _second_phi_zero
bool _started_initial_setup
At or beyond initialSteup stage.
std::map< std::string, std::unique_ptr< RandomData > > _random_data_objects
A map of objects that consume random numbers.
bool errorOnJacobianNonzeroReallocation() const
Will return True if the user wants to get an error when a nonzero is reallocated in the Jacobian by P...
std::unique_ptr< ConstBndNodeRange > _current_algebraic_bnd_node_range
virtual void addResidual(const THREAD_ID tid) override
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
virtual void addResidualNeighbor(const THREAD_ID tid) override
virtual void addKokkosAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
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...
Base class for all Postprocessors.
Definition: Postprocessor.h:23
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...
MooseApp & _app
The MOOSE application this is associated with.
Definition: MooseBase.h:385
Moose::CouplingType coupling() const
virtual void clearActiveFEVariableCoupleableVectorTags(const THREAD_ID tid) override
void setCouplingMatrix(std::unique_ptr< libMesh::CouplingMatrix > cm, const unsigned int nl_sys_num)
Set custom coupling matrix.
virtual void addDefaultNonlinearConvergence(const InputParameters &params)
Adds the default nonlinear Convergence associated with the problem.
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...
void setNonlinearConvergenceNames(const std::vector< ConvergenceName > &convergence_names)
Sets the nonlinear convergence object name(s) if there is one.
const ExecFlagType EXEC_LINEAR
Definition: Moose.C:31
virtual bool solverSystemConverged(const unsigned int solver_sys_num) override
std::string _exception_message
The error message to go with an exception.
void setNeedToAddDefaultNonlinearConvergence()
Sets _need_to_add_default_nonlinear_convergence to true.
virtual void checkProblemIntegrity()
Method called to perform a series of sanity checks before a simulation is run.
AuxiliarySystem & getAuxiliarySystem()
virtual void updateGeomSearch(GeometricSearchData::GeometricSearchType type=GeometricSearchData::ALL) override
Update this object&#39;s geometric search data as well as the displaced problem&#39;s if it exists...
MooseObjectWarehouse< MeshDivision > _mesh_divisions
Warehouse to store mesh divisions NOTE: this could probably be moved to the MooseMesh instead of the ...
virtual void addConstraint(const std::string &c_name, const std::string &name, InputParameters &parameters)
MooseObjectWarehouse< Indicator > _indicators
virtual void addMultiApp(const std::string &multi_app_name, const std::string &name, InputParameters &parameters)
Add a MultiApp to the problem.
The Kokkos class responsible for allocating and storing Kokkos material properties.
virtual void prepareAssembly(const THREAD_ID tid) override
bool haveADObjects() const
Method for reading wehther we have any ad objects.
Definition: SubProblem.h:779
unsigned int systemNumForVariable(const VariableName &variable_name) const
bool _checking_uo_aux_state
Flag used to indicate whether we are doing the uo/aux state check in execute.
const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName &name, std::size_t t_index=0) const
Get a read-only reference to the value associated with a Postprocessor that exists.
bool _fv_bcs_integrity_check
Whether to check overlapping Dirichlet and Flux BCs and/or multiple DirichletBCs per sideset...
const MooseObjectWarehouse< Indicator > & getIndicatorWarehouse()
Return indicator/marker storage.
InitialConditions are objects that set the initial value of variables.
bool showInvalidSolutionConsole() const
Whether or not to print out the invalid solutions summary table in console.
Base class for user objects executed on all element sides internal to one or more blocks...
virtual void initNullSpaceVectors(const InputParameters &parameters, std::vector< std::shared_ptr< NonlinearSystemBase >> &nl)
virtual void setCurrentSubdomainID(const Elem *elem, const THREAD_ID tid) override
MaterialData & getMaterialData(Moose::MaterialDataType type, const THREAD_ID tid=0, const MooseObject *object=nullptr) const
bool getFailNextSystemConvergenceCheck() const
Whether it will fail the next system convergence check(s), triggering failed step behavior...
virtual void clearDiracInfo() override
Gets called before Dirac Kernels are asked to add the points they are supposed to be evaluated in...
virtual void addIndicator(const std::string &indicator_name, const std::string &name, InputParameters &parameters)
virtual void reinitNodesNeighbor(const std::vector< dof_id_type > &nodes, const THREAD_ID tid) override
bool duplicateVariableCheck(const std::string &var_name, const libMesh::FEType &type, bool is_aux, const std::set< SubdomainID > *const active_subdomains)
Helper to check for duplicate variable names across systems or within a single system.
GeometricSearchType
Used to select groups of geometric search objects to update.
void backupMultiApps(ExecFlagType type)
Backup the MultiApps associated with the ExecFlagType.
virtual ~FEProblemBase()
The SolutionInvalidity will contain all the information about the occurrence(s) of solution invalidit...
MaterialData & getKokkosMaterialData(Moose::MaterialDataType type, const MooseObject *object=nullptr) const
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters &params)
Canonical method for adding a non-linear variable.
const std::vector< LinearSystemName > & getLinearSystemNames() const
ExecuteMooseObjectWarehouse< MultiApp > _multi_apps
MultiApp Warehouse.
virtual int & timeStep() const
virtual Moose::FEBackend feBackend() const
LinearSystem & getLinearSystem(unsigned int sys_num)
Get non-constant reference to a linear system.
std::vector< std::vector< std::unique_ptr< Assembly > > > _assembly
The Assembly objects.
virtual void addDisplacedProblem(std::shared_ptr< DisplacedProblem > displaced_problem)
void computeResidual(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual)
This function is called by Libmesh to form a residual.
static void objectExecuteHelper(const std::vector< T *> &objects)
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.
void setVectorPostprocessorValueByName(const std::string &object_name, const std::string &vector_name, const VectorPostprocessorValue &value, std::size_t t_index=0)
Set the value of a VectorPostprocessor vector.
virtual MooseVariable & getStandardVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested MooseVariable which may be in any system.
void setCoordSystem(const std::vector< SubdomainName > &blocks, const MultiMooseEnum &coord_sys)
Materials compute MaterialProperties.
Definition: Material.h:35
virtual void swapBackMaterialsNeighbor(const THREAD_ID tid)
const bool _show_invalid_solution_console
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
std::unique_ptr< libMesh::ConstElemRange > _aux_evaluable_local_elem_range
virtual NonlinearSystem & getNonlinearSystem(const unsigned int sys_num)
bool _snesmf_reuse_base
If or not to resuse the base vector for matrix-free calculation.
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.
void setKernelCoverageCheck(bool flag)
Set flag to indicate whether kernel coverage checks should be performed.
This is the XFEMInterface class.
Definition: XFEMInterface.h:37
bool _need_to_add_default_multiapp_fixed_point_convergence
Flag that the problem needs to add the default fixed point convergence.
const std::vector< NonlinearSystemName > _nl_sys_names
The nonlinear system names.
const ExecFlagType EXEC_NONLINEAR
Definition: Moose.C:33
const FVAdvectedInterpolationMethod & getFVAdvectedInterpolationMethod(const InterpolationMethodName &name, const THREAD_ID tid=0) const
Retrieve an advected interpolation method.
std::vector< Real > VectorPostprocessorValue
Definition: MooseTypes.h:231
const FVInitialConditionWarehouse & getFVInitialConditionWarehouse() const
Return FVInitialCondition storage.
virtual void updateMortarMesh()
Adds tagged matrices.
virtual void addKokkosVectorPostprocessor(const std::string &pp_name, const std::string &name, InputParameters &parameters)
TheWarehouse::Query getUOQuery(const std::string &system, const ExecFlagType &type, const Moose::AuxGroup &group) const
void addDefaultMultiAppFixedPointConvergence(const InputParameters &params)
Adds the default fixed point Convergence associated with the problem.
std::set< TagID > _fe_matrix_tags
Moose::Kokkos::MaterialPropertyStorage & _kokkos_material_props
virtual void addAuxArrayVariable(const std::string &var_name, const libMesh::FEType &type, unsigned int components, const std::set< SubdomainID > *const active_subdomains=NULL)
const ExecuteMooseObjectWarehouse< Transfer > & getMultiAppTransferWarehouse(Transfer::DIRECTION direction) const
Return the complete warehouse for MultiAppTransfer object for the given direction.
virtual const SystemBase & getSystemBase(const unsigned int sys_num) const
Get constant reference to a system in this problem.
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
bool isSNESMFReuseBaseSetbyUser()
Return a flag to indicate if _snesmf_reuse_base is set by users.
virtual void addReporter(const std::string &type, const std::string &name, InputParameters &parameters)
Add a Reporter object to the simulation.
virtual void swapBackMaterials(const THREAD_ID tid)
std::vector< VariablePhiValue > _phi_zero
InitialConditionWarehouse _ics
std::vector< unsigned char > _has_active_material_properties
Whether there are active material properties on each thread.
const SubdomainID ANY_BLOCK_ID
Definition: MooseTypes.C:19
MaterialWarehouse _discrete_materials
bool _reinit_displaced_face
Whether to call DisplacedProblem::reinitElemFace when this->reinitElemFace is called.
void setSinglePetscOption(const std::string &name, const std::string &value="", FEProblemBase *const problem=nullptr)
A wrapper function for dealing with different versions of PetscOptionsSetValue.
std::unique_ptr< MortarInterfaceWarehouse > _mortar_data
virtual void addDGKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
virtual void setCurrentBoundaryID(BoundaryID bid, const THREAD_ID tid) override
sets the current boundary ID in assembly
SolverSystem * _current_solver_sys
The current solver system.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::shared_ptr< const DisplacedProblem > getDisplacedProblem() const
Takes care of everything related to mesh adaptivity.
Definition: Adaptivity.h:61
std::optional< std::vector< ConvergenceName > > _nonlinear_convergence_names
Nonlinear system(s) convergence name(s)
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:78
void setConstJacobian(bool state)
Set flag that Jacobian is constant (for optimization purposes)
const Postprocessor & getPostprocessorObjectByName(const PostprocessorName &object_name, const THREAD_ID tid=0) const
Return the Postprocessor object registered under the supplied object name.
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:18
unsigned int solverSysNum(const SolverSystemName &solver_sys_name) const override
Class that is used as a parameter to set/clearCurrentResidualVectorTags that allows only blessed clas...
Base class for Control objects.
Definition: Control.h:34
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.
std::vector< VariableGradient > _grad_zero
bool hasActiveObjects(THREAD_ID tid=0) const
void clearCurrentJacobianMatrixTags()
Clear the current Jacobian matrix tag data structure ...
virtual void subdomainSetup(SubdomainID subdomain, const THREAD_ID tid)
virtual void restoreOldSolutions()
Restore old solutions from the backup vectors and deallocate them.
unsigned int getInitialSteps() const
Pull out the number of initial steps previously set by calling init()
Definition: Adaptivity.h:112
void reinitMaterials(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true)
const bool _identify_variable_groups_in_nl
Whether to identify variable groups in nonlinear systems. This affects dof ordering.
PetscOptions & petscOptionsDatabase()
bool acceptInvalidSolution() const
Whether or not to accept the solution based on its invalidity.
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 _restore_original_nonzero_pattern
Whether we should restore the original nonzero pattern for every Jacobian evaluation.
void execMultiAppTransfers(ExecFlagType type, Transfer::DIRECTION direction)
Execute MultiAppTransfers associated with execution flag and direction.
bool hasKokkosResidualObjects() const
Wrapper class that owns a libMesh EquationSystem and adds advanced restart capability to it...
void restoreMultiApps(ExecFlagType type, bool force=false)
Restore the MultiApps associated with the ExecFlagType.
virtual void addLinearFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters &parameters)
void customSetup(const ExecFlagType &exec_type) override
void setRestartFile(const std::string &file_name)
Communicate to the Resurector the name of the restart filer.
void setCurrentLinearSystem(unsigned int sys_num)
Set the current linear system pointer.
void executeControls(const ExecFlagType &exec_type)
Performs setup and execute calls for Control objects.
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters &parameters)
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse...
Definition: TheWarehouse.h:467
void allowOutput(bool state)
Ability to enable/disable output calls This is private, users should utilize FEProblemBase::allowOutp...
virtual void onTimestepBegin() override
virtual void computeBounds(libMesh::NonlinearImplicitSystem &sys, NumericVector< libMesh::Number > &lower, NumericVector< libMesh::Number > &upper)
Nonlinear system to be solved.
virtual void addKokkosFunction(const std::string &type, const std::string &name, InputParameters &parameters)
Add a Kokkos function to the problem.
void initKokkos()
Construct Kokkos assembly and systems and allocate Kokkos material property storages.
virtual void computePostCheck(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &old_soln, NumericVector< libMesh::Number > &search_direction, NumericVector< libMesh::Number > &new_soln, bool &changed_search_direction, bool &changed_new_soln)
void checkDuplicatePostprocessorVariableNames()
void computeResidualAndJacobian(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, libMesh::SparseMatrix< libMesh::Number > &jacobian)
Form a residual and Jacobian with default tags.
std::vector< std::pair< MooseVariableFEBase *, MooseVariableFEBase * > > & nonlocalCouplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num)
bool _using_ad_mat_props
Automatic differentiaion (AD) flag which indicates whether any consumer has requested an AD material ...
std::vector< VariableValue > _scalar_zero
virtual Real computeResidualL2Norm()
Computes the residual using whatever is sitting in the current solution vector then returns the L2 no...
const std::vector< LinearSystemName > _linear_sys_names
The linear system names.
Moose::Kokkos::Array< Moose::Kokkos::System > & getKokkosSystems()
Get all Kokkos systems that are associated with MOOSE nonlinear and auxiliary systems.
std::shared_ptr< XFEMInterface > getXFEM()
Get a pointer to the XFEM controller object.
bool getFailNextNonlinearConvergenceCheck() const
Whether it will skip further residual evaluations and fail the next nonlinear convergence check(s) ...
void incrementMultiAppTStep(ExecFlagType type)
Advance the MultiApps t_step (incrementStepOrReject) associated with the ExecFlagType.
Class for scalar variables (they are different).
void computeLinearSystemTags(const NumericVector< libMesh::Number > &soln, const std::set< TagID > &vector_tags, const std::set< TagID > &matrix_tags, const bool compute_gradients=true)
Assemble the current linear system given a set of vector and matrix tags.
void bumpVolumeQRuleOrder(libMesh::Order order, SubdomainID block)
Increases the element/volume quadrature order for the specified mesh block if and only if the current...
const bool _material_dependency_check
Determines whether a check to verify material dependencies on every subdomain.
std::vector< std::vector< const MooseVariableFEBase * > > _uo_jacobian_moose_vars
virtual MooseMesh & mesh() override
std::vector< VariableValue > _zero
CouplingType
Definition: MooseTypes.h:779
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition: MooseBase.h:281
unsigned int linearSysNum(const LinearSystemName &linear_sys_name) const override
LinearSystem & currentLinearSystem()
Get a non-constant reference to the current linear system.
void resetFailNextSystemConvergenceCheck()
Tell the problem that the system convergence check(s) may proceed as normal.
libMesh::EquationSystems & es()
std::set< TagID > _fe_vector_tags
const std::set< const MooseObject * > & getMaterialPropertyStorageConsumers(Moose::MaterialDataType type) const
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().
Base class for deriving any boundary condition of a integrated type.
SolverParams & solverParams(unsigned int solver_sys_num=0)
Get the solver parameters.
SolverSystem & getSolverSystem(unsigned int sys_num)
Get non-constant reference to a solver system.
virtual void saveOldSolutions()
Allocate vectors and save old solutions into them.
virtual void computeTransposeNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > *> &sp)
bool hasPostprocessor(const std::string &name) const
Deprecated.
virtual bool updateSolution(NumericVector< libMesh::Number > &vec_solution, NumericVector< libMesh::Number > &ghosted_solution)
Update the solution.
bool _previous_multiapp_fp_aux_solution_required
Indicates we need to save the previous multiapp fixed-point iteration auxiliary variable values...
std::shared_ptr< DisplacedProblem > _displaced_problem
GeometricSearchData _geometric_search_data
State argument for evaluating functors.
void setCurrentResidualVectorTags(const std::set< TagID > &vector_tags)
Set the current residual vector tag data structure based on the passed in tag IDs.
MooseObjectWarehouse< Function > _functions
functions
virtual Real & timeOld() const
Proxy for accessing MaterialPropertyStorage.
Definition: MaterialData.h:37
std::vector< VectorVariableValue > _vector_zero
bool hasMultiApp(const std::string &name) const
bool _u_dot_old_requested
Whether old solution time derivative needs to be stored.
bool ignoreZerosInJacobian() const
Will return true if zeros in the Jacobian are to be dropped from the sparsity pattern.
std::vector< std::unique_ptr< libMesh::CouplingMatrix > > _cm
Coupling matrix for variables.
bool needInterfaceMaterialOnSide(BoundaryID bnd_id, const THREAD_ID tid)
void reinitElemFace(const Elem *elem, unsigned int side, BoundaryID, const THREAD_ID tid)
Linear system to be solved.
Definition: LinearSystem.h:39
bool needToAddDefaultNonlinearConvergence() const
Returns true if the problem needs to add the default nonlinear convergence.
std::optional< std::vector< ConvergenceName > > _linear_convergence_names
Linear system(s) convergence name(s) (if any)
bool useSNESMFReuseBase()
Return a flag that indicates if we are reusing the vector base.
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.
bool _has_initialized_stateful
Whether nor not stateful materials have been initialized.
void checkICRestartError(const std::string &ic_name, const std::string &name, const VariableName &var_name)
Checks if the variable of the initial condition is getting restarted and errors for specific cases...
virtual void setResidualNeighbor(NumericVector< libMesh::Number > &residual, const THREAD_ID tid) override
QueryCache & condition(Args &&... args)
Adds a new condition to the query.
Definition: TheWarehouse.h:285
unsigned int _max_qps
Maximum number of quadrature points used in the problem.
void setMaterialCoverageCheck(bool flag)
Set flag to indicate whether material coverage checks should be performed.
static InputParameters validParams()
virtual void addFVInterpolationMethod(const std::string &method_type, const std::string &name, InputParameters &parameters)
Add an FV interpolation method.
virtual void addScalarKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
TheWarehouse & theWarehouse()
Definition: MooseApp.h:143
bool _preserve_matrix_sparsity_pattern
Whether to preserve the system matrix / Jacobian sparsity pattern, using 0-valued entries usually...
Base class for implementing interface user objects.
virtual unsigned int nNonlinearIterations(const unsigned int nl_sys_num) const override
CoverageCheckMode _material_coverage_check
Determines whether and which subdomains are to be checked to ensure that they have an active material...
virtual std::size_t numLinearSystems() const override
MaterialPropertyStorage & _neighbor_material_props
Moose::Kokkos::Array< Moose::Kokkos::System > _kokkos_systems
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
const std::size_t _num_linear_sys
The number of linear systems.
bool hasKokkosObjects() const
std::map< std::string, unsigned int > _subspace_dim
Dimension of the subspace spanned by the vectors with a given prefix.
ReporterData & getReporterData(ReporterData::WriteKey)
Provides non-const access the ReporterData object that is used to store reporter values.
const libMesh::ConstElemRange & getEvaluableElementRange()
In general, {evaluable elements} >= {local elements} U {algebraic ghosting elements}.
const bool _use_hash_table_matrix_assembly
Whether to assemble matrices using hash tables instead of preallocating matrix memory.
friend class Resurrector
bool restoreOriginalNonzeroPattern() const
const UserObject & getUserObjectBase(const std::string &name, const THREAD_ID tid=0) const
Get the user object by its name.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type...
bool _has_internal_edge_residual_objects
Whether the problem has dgkernels or interface kernels.
virtual void addKokkosKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
bool computingScalingJacobian() const override final
Getter for whether we&#39;re computing the scaling jacobian.
bool execMultiApps(ExecFlagType type, bool auto_advance=true)
Execute the MultiApps associated with the ExecFlagType.
ExecuteMooseObjectWarehouse< Control > & getControlWarehouse()
Reference to the control logic warehouse.
const ExecFlagType EXEC_SUBDOMAIN
Definition: Moose.C:52
virtual ArrayMooseVariable & getArrayVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested ArrayMooseVariable which may be in any system...
const MooseObjectWarehouse< Marker > & getMarkerWarehouse()
bool _has_constraints
Whether or not this system has any Constraints.
virtual bool isTransient() const override
bool _need_to_add_default_nonlinear_convergence
Flag that the problem needs to add the default nonlinear convergence.
bool hasMultiApps() const
Returns whether or not the current simulation has any multiapps.
virtual void reinitNeighbor(const Elem *elem, unsigned int side, const THREAD_ID tid) override
void notifyWhenMeshChanges(MeshChangedInterface *mci)
Register an object that derives from MeshChangedInterface to be notified when the mesh changes...
void setSNESMFReuseBase(bool reuse, bool set_by_user)
If or not to reuse the base vector for matrix-free calculation.
std::unique_ptr< libMesh::ConstElemRange > _evaluable_local_elem_range
bool computingScalingResidual() const override final
const FVFaceInterpolationMethod & getFVFaceInterpolationMethod(const InterpolationMethodName &name, const THREAD_ID tid=0) const
Retrieve a scalar face interpolation method.
virtual void executeAllObjects(const ExecFlagType &exec_type)
CoverageCheckMode _kernel_coverage_check
Determines whether and which subdomains are to be checked to ensure that they have an active kernel...
virtual void setActiveFEVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid) override
Real Number
bool _fail_next_system_convergence_check
std::vector< std::shared_ptr< LinearSystem > > _linear_systems
The vector of linear systems.
std::shared_ptr< XFEMInterface > _xfem
Pointer to XFEM controller.
const bool _boundary_restricted_elem_integrity_check
whether to perform checking of boundary restricted elemental object variable dependencies, e.g.
virtual void prepareShapes(unsigned int var, const THREAD_ID tid) override
void reinitMaterialsInterface(BoundaryID boundary_id, const THREAD_ID tid, bool swap_stateful=true)
bool _const_jacobian
true if the Jacobian is constant
virtual void computeJacobianBlock(libMesh::SparseMatrix< libMesh::Number > &jacobian, libMesh::System &precond_system, unsigned int ivar, unsigned int jvar)
Really not a good idea to use this.
virtual void solveLinearSystem(const unsigned int linear_sys_num, const Moose::PetscSupport::PetscOptions *po=nullptr)
Build and solve a linear system.
virtual void computeUserObjectByName(const ExecFlagType &type, const Moose::AuxGroup &group, const std::string &name)
Compute an user object with the given name.
const MaterialPropertyRegistry & getMaterialPropertyRegistry() const
virtual void possiblyRebuildGeomSearchPatches()
std::set< TagID > _linear_vector_tags
Temporary storage for filtered vector tags for linear systems.
Moose::Kokkos::MaterialPropertyStorage & _kokkos_bnd_material_props
Abstract base class for interpolation methods that produce a scalar face value from adjacent cell val...
A MultiApp represents one or more MOOSE applications that are running simultaneously.
Definition: MultiApp.h:112
bool checkingUOAuxState() const
Return a flag to indicate whether we are executing user objects and auxliary kernels for state check ...
const libMesh::ConstElemRange & getNonlinearEvaluableElementRange()
MaterialPropertyStorage & _material_props
Base class for Postprocessors that produce a vector of values.
void prepareMaterials(const std::unordered_set< unsigned int > &consumer_needed_mat_props, const SubdomainID blk_id, const THREAD_ID tid)
Add the MooseVariables and the material properties that the current materials depend on to the depend...
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
virtual void addFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters &parameters)
libMesh::Order _max_scalar_order
Maximum scalar variable order.
virtual void addGhostedBoundary(BoundaryID boundary_id) override
Will make sure that all necessary elements from boundary_id are ghosted to this processor.
virtual bool hasFunction(const std::string &name, const THREAD_ID tid=0)
Adaptivity & adaptivity()
bool hasActiveMaterialProperties(const THREAD_ID tid) const
Method to check whether or not a list of active material roperties has been set.
ExecuteMooseObjectWarehouse< Transfer > _between_multi_app_transfers
Transfers executed just before MultiApps to transfer data between them.
bool hasUOAuxStateCheck() const
Whether or not MOOSE will perform a user object/auxiliary kernel state check.
virtual void cacheJacobian(const THREAD_ID tid) override
void jacobianSetup() override
virtual std::size_t numSolverSystems() const override
virtual void addHDGKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
Executor * getExecutor() const
Definition: MooseApp.h:341
const Moose::Kokkos::Array< Moose::Kokkos::System > & getKokkosSystems() const
virtual Real & dt() const
void advanceMultiApps(ExecFlagType type)
Deprecated method; use finishMultiAppStep and/or incrementMultiAppTStep depending on your purpose...
bool immediatelyPrintInvalidSolution() const
Whether or not the solution invalid warnings are printed out immediately.
Restartable::ManagedValue< RestartableEquationSystems > _req
The EquationSystems object, wrapped for restart.
virtual unsigned int currentLinearSysNum() const override
std::vector< libMesh::CouplingMatrix > _nonlocal_cm
nonlocal coupling matrix
virtual void reinitNodeFace(const Node *node, BoundaryID bnd_id, const THREAD_ID tid) override
virtual void reinitOffDiagScalars(const THREAD_ID tid) override
virtual void reinitElemPhys(const Elem *elem, const std::vector< Point > &phys_points_in_elem, const THREAD_ID tid) override
std::vector< std::unordered_map< BoundaryID, bool > > _interface_mat_side_cache
Cache for calculating materials on interface.
void initKokkosStatefulProps()
virtual void addJacobianNeighborLowerD(const THREAD_ID tid) override
virtual void prepareNeighborShapes(unsigned int var, const THREAD_ID tid) override
bool hasSolutionState(unsigned int state, Moose::SolutionIterationType iteration_type) const
Whether we need up to old (1) or older (2) solution states for a given type of iteration.
MooseObjectWarehouse< Marker > _markers
FVInitialConditionWarehouse _fv_ics
void setVerboseProblem(bool verbose)
Make the problem be verbose.
virtual void setNeighborSubdomainID(const Elem *elem, unsigned int side, const THREAD_ID tid) override
virtual bool hasException()
Whether or not an exception has occurred.
CurrentResidualVectorTagsKey(const CurrentResidualVectorTagsKey &)
virtual void initialAdaptMesh()
virtual void addResidualScalar(const THREAD_ID tid=0)
Moose::Kokkos::MaterialPropertyStorage & _kokkos_neighbor_material_props
const bool _using_default_nl
Boolean to check if we have the default nonlinear system.
MaterialWarehouse _all_materials
bool _u_dotdot_requested
Whether solution second time derivative needs to be stored.
virtual void addCachedResidual(const THREAD_ID tid) override
A system that holds auxiliary variables.
Moose::PetscSupport::PetscOptions _petsc_options
PETSc option storage.
Crank-Nicolson time integrator.
Definition: CrankNicolson.h:22
virtual const std::vector< std::shared_ptr< Convergence > > & getConvergenceObjects(const THREAD_ID tid=0) const
Gets the Convergence objects.
bool preserveMatrixSparsityPattern() const
Will return True if the executioner in use requires preserving the sparsity pattern of the matrices b...
virtual void clearActiveElementalMooseVariables(const THREAD_ID tid) override
Clear the active elemental MooseVariableFEBase.
Base class for user-specific data.
Definition: UserObject.h:19
void allowOutput(bool state)
Ability to enable/disable all output calls.
virtual Sampler & getSampler(const std::string &name, const THREAD_ID tid=0)
virtual void outputStep(ExecFlagType type)
Output the current step.
virtual Moose::Kokkos::Function getKokkosFunction(const std::string &name)
Get a Kokkos function in an abstract type.
void projectInitialConditionOnCustomRange(libMesh::ConstElemRange &elem_range, ConstBndNodeRange &bnd_node_range, const std::optional< std::set< VariableName >> &target_vars=std::nullopt)
Project initial conditions for custom elem_range and bnd_node_range This is needed when elements/boun...
virtual unsigned int nlSysNum(const NonlinearSystemName &nl_sys_name) const override
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:2408
MooseEnum _verbose_setup
Whether or not to be verbose during setup.
bool needToAddDefaultMultiAppFixedPointConvergence() const
Returns true if the problem needs to add the default fixed point convergence.
void setIgnoreZerosInJacobian(bool state)
Set whether the zeros in the Jacobian should be dropped from the sparsity pattern.
void computeSystems(const ExecFlagType &type)
Do generic system computations.
virtual void computeJacobianTags(const std::set< TagID > &tags)
Form multiple matrices, and each is associated with a tag.
SolutionIterationType
Definition: MooseTypes.h:269
MooseMesh * _displaced_mesh
const MaterialWarehouse & getKokkosMaterialsWarehouse() const
bool _has_mortar
Whether the simulation requires mortar coupling.
libMesh::Order getMaxScalarOrder() const
void execTransfers(ExecFlagType type)
Execute the Transfers associated with the ExecFlagType.
const std::unordered_map< std::pair< BoundaryID, BoundaryID >, MortarInterfaceConfig > & getMortarInterfaces(bool on_displaced) const
const std::vector< ConvergenceName > & getLinearConvergenceNames() const
Gets the linear convergence object name(s).
unsigned int THREAD_ID
Definition: MooseTypes.h:237
virtual void ghostGhostedBoundaries() override
Causes the boundaries added using addGhostedBoundary to actually be ghosted.
The Executor class directs the execution flow of simulations.
Definition: Executor.h:26
MaterialWarehouse _materials
uint8_t dof_id_type
virtual bool adaptMesh()
virtual void addJacobianScalar(const THREAD_ID tid=0)
const MaterialPropertyStorage & getNeighborMaterialPropertyStorage()
virtual void addDiracKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
MooseObjectWarehouse< IntegratedBCBase > _nonlocal_integrated_bcs
nonlocal integrated_bcs
virtual const MooseMesh & mesh() const override
virtual void computeResidualTag(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, TagID tag)
Form a residual vector for a given tag.
virtual bool startedInitialSetup()
Returns true if we are in or beyond the initialSetup stage.
virtual VectorMooseVariable & getVectorVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested VectorMooseVariable which may be in any system...
std::shared_ptr< LineSearch > _line_search
void initXFEM(std::shared_ptr< XFEMInterface > xfem)
Create XFEM controller object.
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.
Base class for all Transfer objects.
Definition: Transfer.h:36
virtual void neighborSubdomainSetup(SubdomainID subdomain, const THREAD_ID tid)
virtual void addCachedJacobian(const THREAD_ID tid) override
virtual void sizeZeroes(unsigned int size, const THREAD_ID tid)
virtual Real computeDamping(const NumericVector< libMesh::Number > &soln, const NumericVector< libMesh::Number > &update)
std::vector< Real > _real_zero
Convenience zeros.
MooseObjectWarehouse< KernelBase > _nonlocal_kernels
nonlocal kernels
void checkCoordinateSystems()
Verify that there are no element type/coordinate type conflicts.
unsigned int getMaxQps() const
const ExecFlagType EXEC_INITIAL
Definition: Moose.C:30
bool _verbose_multiapps
Whether or not to be verbose with multiapps.
This is a helper class for managing the storage of declared Reporter object values.
Definition: ReporterData.h:48