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 // MOOSE includes
13 #include "SubProblem.h"
14 #include "GeometricSearchData.h"
15 #include "MeshDivision.h"
16 #include "MortarData.h"
17 #include "ReporterData.h"
18 #include "Adaptivity.h"
22 #include "Restartable.h"
23 #include "SolverParams.h"
24 #include "PetscSupport.h"
25 #include "MooseApp.h"
27 #include "MaterialWarehouse.h"
28 #include "MooseVariableFE.h"
29 #include "MultiAppTransfer.h"
30 #include "Postprocessor.h"
31 #include "HashMap.h"
32 #include "VectorPostprocessor.h"
33 #include "PerfGraphInterface.h"
34 #include "Attributes.h"
35 #include "MooseObjectWarehouse.h"
38 #include "SolutionInvalidity.h"
39 #include "PetscSupport.h"
40 
41 #include "libmesh/enum_quadrature_type.h"
42 #include "libmesh/equation_systems.h"
43 
44 #include <unordered_map>
45 #include <memory>
46 
47 // Forward declarations
48 class AuxiliarySystem;
49 class DisplacedProblem;
50 class MooseMesh;
52 class LinearSystem;
53 class SolverSystem;
54 class NonlinearSystem;
55 class RandomInterface;
56 class RandomData;
59 class MultiMooseEnum;
61 class MaterialData;
62 class MooseEnum;
63 class Assembly;
64 class JacobianBlock;
65 class Control;
66 class MultiApp;
67 class TransientMultiApp;
69 class Indicator;
71 class Marker;
72 class Material;
73 class Transfer;
74 class XFEMInterface;
75 class SideUserObject;
76 class NodalUserObject;
77 class ElementUserObject;
80 class GeneralUserObject;
81 class Positions;
82 class Function;
83 class Distribution;
84 class Sampler;
85 class KernelBase;
86 class IntegratedBCBase;
87 class LineSearch;
88 class UserObject;
91 class Convergence;
93 class MortarUserObject;
94 class SolutionInvalidity;
95 
96 // libMesh forward declarations
97 namespace libMesh
98 {
99 class CouplingMatrix;
100 class NonlinearImplicitSystem;
101 class LinearImplicitSystem;
102 } // namespace libMesh
103 
105 {
106  ITERATING = 0,
107  // CONVERGED_RTOL_NORMAL = 1,
108  // CONVERGED_ATOL_NORMAL = 9,
109  CONVERGED_RTOL = 2,
110  CONVERGED_ATOL = 3,
111  CONVERGED_ITS = 4,
112  // CONVERGED_CG_NEG_CURVE = 5,
113  // CONVERGED_CG_CONSTRAINED = 6,
114  // CONVERGED_STEP_LENGTH = 7,
115  // CONVERGED_HAPPY_BREAKDOWN = 8,
116  DIVERGED_NULL = -2,
117  // DIVERGED_ITS = -3,
118  // DIVERGED_DTOL = -4,
119  // DIVERGED_BREAKDOWN = -5,
120  // DIVERGED_BREAKDOWN_BICG = -6,
121  // DIVERGED_NONSYMMETRIC = -7,
122  // DIVERGED_INDEFINITE_PC = -8,
123  DIVERGED_NANORINF = -9,
124  // DIVERGED_INDEFINITE_MAT = -10
126 };
127 
132 class FEProblemBase : public SubProblem, public Restartable
133 {
134 public:
135  static InputParameters validParams();
136 
138  virtual ~FEProblemBase();
139 
140  enum class CoverageCheckMode
141  {
142  FALSE,
143  TRUE,
144  OFF,
145  ON,
146  SKIP_LIST,
147  ONLY_LIST,
148  };
149 
150  virtual libMesh::EquationSystems & es() override { return _req.set().es(); }
151  virtual MooseMesh & mesh() override { return _mesh; }
152  virtual const MooseMesh & mesh() const override { return _mesh; }
153  const MooseMesh & mesh(bool use_displaced) const override;
154 
155  void setCoordSystem(const std::vector<SubdomainName> & blocks, const MultiMooseEnum & coord_sys);
156  void setAxisymmetricCoordAxis(const MooseEnum & rz_coord_axis);
157 
164 
166 
172  void setCouplingMatrix(std::unique_ptr<libMesh::CouplingMatrix> cm,
173  const unsigned int nl_sys_num);
174 
175  // DEPRECATED METHOD
176  void setCouplingMatrix(libMesh::CouplingMatrix * cm, const unsigned int nl_sys_num);
177 
178  const libMesh::CouplingMatrix * couplingMatrix(const unsigned int nl_sys_num) const override;
179 
182 
183  bool
184  areCoupled(const unsigned int ivar, const unsigned int jvar, const unsigned int nl_sys_num) const;
185 
189  bool hasUOAuxStateCheck() const { return _uo_aux_state_check; }
190 
198 
205 
206  std::vector<std::pair<MooseVariableFEBase *, MooseVariableFEBase *>> &
207  couplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num);
208  std::vector<std::pair<MooseVariableFEBase *, MooseVariableFEBase *>> &
209  nonlocalCouplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num);
210 
211  virtual bool hasVariable(const std::string & var_name) const override;
212  // NOTE: hasAuxiliaryVariable defined in parent class
213  bool hasSolverVariable(const std::string & var_name) const;
215  virtual const MooseVariableFieldBase &
216  getVariable(const THREAD_ID tid,
217  const std::string & var_name,
219  Moose::VarFieldType expected_var_field_type =
220  Moose::VarFieldType::VAR_FIELD_ANY) const override;
222  const std::string & var_name) override;
223  virtual MooseVariable & getStandardVariable(const THREAD_ID tid,
224  const std::string & var_name) override;
225  virtual VectorMooseVariable & getVectorVariable(const THREAD_ID tid,
226  const std::string & var_name) override;
227  virtual ArrayMooseVariable & getArrayVariable(const THREAD_ID tid,
228  const std::string & var_name) override;
229 
230  virtual bool hasScalarVariable(const std::string & var_name) const override;
231  virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid,
232  const std::string & var_name) override;
233  virtual libMesh::System & getSystem(const std::string & var_name) override;
234 
241  virtual void setActiveElementalMooseVariables(const std::set<MooseVariableFEBase *> & moose_vars,
242  const THREAD_ID tid) override;
243 
251  virtual void clearActiveElementalMooseVariables(const THREAD_ID tid) override;
252 
253  virtual void clearActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) override;
254 
255  virtual void clearActiveFEVariableCoupleableVectorTags(const THREAD_ID tid) override;
256 
257  virtual void setActiveFEVariableCoupleableVectorTags(std::set<TagID> & vtags,
258  const THREAD_ID tid) override;
259 
260  virtual void setActiveFEVariableCoupleableMatrixTags(std::set<TagID> & mtags,
261  const THREAD_ID tid) override;
262 
263  virtual void clearActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid) override;
264 
265  virtual void clearActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid) override;
266 
267  virtual void setActiveScalarVariableCoupleableVectorTags(std::set<TagID> & vtags,
268  const THREAD_ID tid) override;
269 
270  virtual void setActiveScalarVariableCoupleableMatrixTags(std::set<TagID> & mtags,
271  const THREAD_ID tid) override;
272 
274  libMesh::Order order,
275  libMesh::Order volume_order = libMesh::INVALID_ORDER,
278  bool allow_negative_qweights = true);
279 
288 
289  void bumpAllQRuleOrder(libMesh::Order order, SubdomainID block);
290 
294  unsigned int getMaxQps() const;
295 
300 
304  void checkNonlocalCoupling();
306  void setVariableAllDoFMap(const std::vector<const MooseVariableFEBase *> & moose_vars);
307 
308  const std::vector<const MooseVariableFEBase *> &
310  {
311  return _uo_jacobian_moose_vars[tid];
312  }
313 
314  virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) override;
315  virtual const Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num) const override;
316 
320  virtual std::vector<VariableName> getVariableNames();
321 
322  void initialSetup() override;
324  void timestepSetup() override;
325  void customSetup(const ExecFlagType & exec_type) override;
326  void residualSetup() override;
327  void jacobianSetup() override;
328 
329  virtual void prepare(const Elem * elem, const THREAD_ID tid) override;
330  virtual void prepareFace(const Elem * elem, const THREAD_ID tid) override;
331  virtual void prepare(const Elem * elem,
332  unsigned int ivar,
333  unsigned int jvar,
334  const std::vector<dof_id_type> & dof_indices,
335  const THREAD_ID tid) override;
336 
337  virtual void setCurrentSubdomainID(const Elem * elem, const THREAD_ID tid) override;
338  virtual void
339  setNeighborSubdomainID(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
340  virtual void setNeighborSubdomainID(const Elem * elem, const THREAD_ID tid);
341  virtual void prepareAssembly(const THREAD_ID tid) override;
342 
343  virtual void addGhostedElem(dof_id_type elem_id) override;
344  virtual void addGhostedBoundary(BoundaryID boundary_id) override;
345  virtual void ghostGhostedBoundaries() override;
346 
347  virtual void sizeZeroes(unsigned int size, const THREAD_ID tid);
348  virtual bool reinitDirac(const Elem * elem, const THREAD_ID tid) override;
349 
350  virtual void reinitElem(const Elem * elem, const THREAD_ID tid) override;
351  virtual void reinitElemPhys(const Elem * elem,
352  const std::vector<Point> & phys_points_in_elem,
353  const THREAD_ID tid) override;
354  void reinitElemFace(const Elem * elem, unsigned int side, BoundaryID, const THREAD_ID tid);
355  virtual void reinitElemFace(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
356  virtual void reinitLowerDElem(const Elem * lower_d_elem,
357  const THREAD_ID tid,
358  const std::vector<Point> * const pts = nullptr,
359  const std::vector<Real> * const weights = nullptr) override;
360  virtual void reinitNode(const Node * node, const THREAD_ID tid) override;
361  virtual void reinitNodeFace(const Node * node, BoundaryID bnd_id, const THREAD_ID tid) override;
362  virtual void reinitNodes(const std::vector<dof_id_type> & nodes, const THREAD_ID tid) override;
363  virtual void reinitNodesNeighbor(const std::vector<dof_id_type> & nodes,
364  const THREAD_ID tid) override;
365  virtual void reinitNeighbor(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
366  virtual void reinitNeighborPhys(const Elem * neighbor,
367  unsigned int neighbor_side,
368  const std::vector<Point> & physical_points,
369  const THREAD_ID tid) override;
370  virtual void reinitNeighborPhys(const Elem * neighbor,
371  const std::vector<Point> & physical_points,
372  const THREAD_ID tid) override;
373  virtual void
374  reinitElemNeighborAndLowerD(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
375  virtual void reinitScalars(const THREAD_ID tid,
376  bool reinit_for_derivative_reordering = false) override;
377  virtual void reinitOffDiagScalars(const THREAD_ID tid) override;
378 
380  virtual void getDiracElements(std::set<const Elem *> & elems) override;
381  virtual void clearDiracInfo() override;
382 
383  virtual void subdomainSetup(SubdomainID subdomain, const THREAD_ID tid);
384  virtual void neighborSubdomainSetup(SubdomainID subdomain, const THREAD_ID tid);
385 
386  virtual void newAssemblyArray(std::vector<std::shared_ptr<SolverSystem>> & solver_systems);
387  virtual void initNullSpaceVectors(const InputParameters & parameters,
388  std::vector<std::shared_ptr<NonlinearSystemBase>> & nl);
389 
390  virtual void init() override;
391  virtual void solve(const unsigned int nl_sys_num);
392 
398  virtual void solveLinearSystem(const unsigned int linear_sys_num,
399  const Moose::PetscSupport::PetscOptions * po = nullptr);
400 
402 
421 
423 
438 
440 
461 
470  virtual void setException(const std::string & message);
471 
475  virtual bool hasException() { return _has_exception; }
476 
493  virtual void checkExceptionAndStopSolve(bool print_message = true);
494 
495  virtual bool solverSystemConverged(const unsigned int solver_sys_num) override;
496  virtual unsigned int nNonlinearIterations(const unsigned int nl_sys_num) const override;
497  virtual unsigned int nLinearIterations(const unsigned int nl_sys_num) const override;
498  virtual Real finalNonlinearResidual(const unsigned int nl_sys_num) const override;
499  virtual bool computingPreSMOResidual(const unsigned int nl_sys_num) const override;
500 
504  virtual std::string solverTypeString(unsigned int solver_sys_num = 0);
505 
509  virtual bool startedInitialSetup() { return _started_initial_setup; }
510 
511  virtual void onTimestepBegin() override;
512  virtual void onTimestepEnd() override;
513 
514  virtual Real & time() const { return _time; }
515  virtual Real & timeOld() const { return _time_old; }
516  virtual int & timeStep() const { return _t_step; }
517  virtual Real & dt() const { return _dt; }
518  virtual Real & dtOld() const { return _dt_old; }
522  Real getTimeFromStateArg(const Moose::StateArg & state) const;
523 
524  virtual void transient(bool trans) { _transient = trans; }
525  virtual bool isTransient() const override { return _transient; }
526 
527  virtual void addTimeIntegrator(const std::string & type,
528  const std::string & name,
530  virtual void
531  addPredictor(const std::string & type, const std::string & name, InputParameters & parameters);
532 
533  virtual void copySolutionsBackwards();
534 
539  virtual void advanceState();
540 
541  virtual void restoreSolutions();
542 
546  virtual void saveOldSolutions();
547 
551  virtual void restoreOldSolutions();
552 
558  void needSolutionState(unsigned int oldest_needed, Moose::SolutionIterationType iteration_type);
559 
566  virtual void outputStep(ExecFlagType type);
567 
571  virtual void postExecute();
572 
574 
580  void allowOutput(bool state);
581  template <typename T>
582  void allowOutput(bool state);
584 
593  void forceOutput();
594 
600 
605 
609  void logAdd(const std::string & system,
610  const std::string & name,
611  const std::string & type,
612  const InputParameters & params) const;
613 
614  // Function /////
615  virtual void
616  addFunction(const std::string & type, const std::string & name, InputParameters & parameters);
617  virtual bool hasFunction(const std::string & name, const THREAD_ID tid = 0);
618  virtual Function & getFunction(const std::string & name, const THREAD_ID tid = 0);
619 
621  virtual void
622  addMeshDivision(const std::string & type, const std::string & name, InputParameters & params);
624  MeshDivision & getMeshDivision(const std::string & name, const THREAD_ID tid = 0) const;
625 
627  virtual void
628  addConvergence(const std::string & type, const std::string & name, InputParameters & parameters);
630  virtual Convergence & getConvergence(const std::string & name, const THREAD_ID tid = 0) const;
632  virtual const std::vector<std::shared_ptr<Convergence>> &
633  getConvergenceObjects(const THREAD_ID tid = 0) const;
635  virtual bool hasConvergence(const std::string & name, const THREAD_ID tid = 0) const;
638  {
640  }
643  {
645  }
648  {
650  }
653  {
655  }
658  {
660  }
663  {
665  }
668  {
669  return _multiapp_fixed_point_convergence_name.has_value();
670  }
673  {
674  return _steady_state_convergence_name.has_value();
675  }
683  virtual void addDefaultNonlinearConvergence(const InputParameters & params);
691  virtual bool onlyAllowDefaultNonlinearConvergence() const { return false; }
708 
712  virtual void addLineSearch(const InputParameters & /*parameters*/)
713  {
714  mooseError("Line search not implemented for this problem type yet.");
715  }
716 
720  virtual void lineSearch();
721 
725  LineSearch * getLineSearch() override { return _line_search.get(); }
726 
730  virtual void
731  addDistribution(const std::string & type, const std::string & name, InputParameters & parameters);
732  virtual Distribution & getDistribution(const std::string & name);
733 
737  virtual void
738  addSampler(const std::string & type, const std::string & name, InputParameters & parameters);
739  virtual Sampler & getSampler(const std::string & name, const THREAD_ID tid = 0);
740 
741  // NL /////
742  NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num);
743  const NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num) const;
744  void setCurrentNonlinearSystem(const unsigned int nl_sys_num);
747 
748  virtual const SystemBase & systemBaseNonlinear(const unsigned int sys_num) const override;
749  virtual SystemBase & systemBaseNonlinear(const unsigned int sys_num) override;
750 
751  virtual const SystemBase & systemBaseSolver(const unsigned int sys_num) const override;
752  virtual SystemBase & systemBaseSolver(const unsigned int sys_num) override;
753 
754  virtual const SystemBase & systemBaseAuxiliary() const override;
755  virtual SystemBase & systemBaseAuxiliary() override;
756 
757  virtual NonlinearSystem & getNonlinearSystem(const unsigned int sys_num);
758 
763  virtual const SystemBase & getSystemBase(const unsigned int sys_num) const;
764 
769  virtual SystemBase & getSystemBase(const unsigned int sys_num);
770 
775  SystemBase & getSystemBase(const std::string & sys_name);
776 
781  LinearSystem & getLinearSystem(unsigned int sys_num);
782 
787  const LinearSystem & getLinearSystem(unsigned int sys_num) const;
788 
793  SolverSystem & getSolverSystem(unsigned int sys_num);
794 
799  const SolverSystem & getSolverSystem(unsigned int sys_num) const;
800 
805  void setCurrentLinearSystem(unsigned int sys_num);
806 
810  const LinearSystem & currentLinearSystem() const;
811 
816  virtual const SystemBase & systemBaseLinear(unsigned int sys_num) const override;
817 
822  virtual SystemBase & systemBaseLinear(unsigned int sys_num) override;
823 
830  virtual void
831  addVariable(const std::string & var_type, const std::string & var_name, InputParameters & params);
832 
833  virtual void addKernel(const std::string & kernel_name,
834  const std::string & name,
836  virtual void addHDGKernel(const std::string & kernel_name,
837  const std::string & name,
839  virtual void addNodalKernel(const std::string & kernel_name,
840  const std::string & name,
842  virtual void addScalarKernel(const std::string & kernel_name,
843  const std::string & name,
845  virtual void addBoundaryCondition(const std::string & bc_name,
846  const std::string & name,
848  virtual void
849  addConstraint(const std::string & c_name, const std::string & name, InputParameters & parameters);
850 
852  {
853  parameters.set<FEProblemBase *>("_fe_problem_base") = this;
854  }
855 
856  // Aux /////
857 
864  virtual void addAuxVariable(const std::string & var_type,
865  const std::string & var_name,
866  InputParameters & params);
867 
868  virtual void addAuxVariable(const std::string & var_name,
869  const libMesh::FEType & type,
870  const std::set<SubdomainID> * const active_subdomains = NULL);
871  virtual void addAuxArrayVariable(const std::string & var_name,
872  const libMesh::FEType & type,
873  unsigned int components,
874  const std::set<SubdomainID> * const active_subdomains = NULL);
875  virtual void addAuxScalarVariable(const std::string & var_name,
876  libMesh::Order order,
877  Real scale_factor = 1.,
878  const std::set<SubdomainID> * const active_subdomains = NULL);
879  virtual void addAuxKernel(const std::string & kernel_name,
880  const std::string & name,
882  virtual void addAuxScalarKernel(const std::string & kernel_name,
883  const std::string & name,
885 
887 
888  // Dirac /////
889  virtual void addDiracKernel(const std::string & kernel_name,
890  const std::string & name,
892 
893  // DG /////
894  virtual void addDGKernel(const std::string & kernel_name,
895  const std::string & name,
897  // FV /////
898  virtual void addFVKernel(const std::string & kernel_name,
899  const std::string & name,
901 
902  virtual void addLinearFVKernel(const std::string & kernel_name,
903  const std::string & name,
905  virtual void
906  addFVBC(const std::string & fv_bc_name, const std::string & name, InputParameters & parameters);
907  virtual void addLinearFVBC(const std::string & fv_bc_name,
908  const std::string & name,
910 
911  virtual void addFVInterfaceKernel(const std::string & fv_ik_name,
912  const std::string & name,
914 
915  // Interface /////
916  virtual void addInterfaceKernel(const std::string & kernel_name,
917  const std::string & name,
919 
920  // IC /////
921  virtual void addInitialCondition(const std::string & ic_name,
922  const std::string & name,
930  virtual void addFVInitialCondition(const std::string & ic_name,
931  const std::string & name,
933 
934  void projectSolution();
935 
940  unsigned short getCurrentICState();
941 
951  libMesh::ConstElemRange & elem_range,
952  ConstBndNodeRange & bnd_node_range,
953  const std::optional<std::set<VariableName>> & target_vars = std::nullopt);
954 
970  Number (*func)(const Point &,
971  const libMesh::Parameters &,
972  const std::string &,
973  const std::string &),
974  Gradient (*func_grad)(const Point &,
975  const libMesh::Parameters &,
976  const std::string &,
977  const std::string &),
978  const libMesh::Parameters & params,
979  const VariableName & target_var);
980 
981  // Materials
982  virtual void addMaterial(const std::string & material_name,
983  const std::string & name,
985  virtual void addMaterialHelper(std::vector<MaterialWarehouse *> warehouse,
986  const std::string & material_name,
987  const std::string & name,
989  virtual void addInterfaceMaterial(const std::string & material_name,
990  const std::string & name,
992  virtual void addFunctorMaterial(const std::string & functor_material_name,
993  const std::string & name,
995 
1007  void prepareMaterials(const std::unordered_set<unsigned int> & consumer_needed_mat_props,
1008  const SubdomainID blk_id,
1009  const THREAD_ID tid);
1010 
1011  void reinitMaterials(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful = true);
1012 
1023  void reinitMaterialsFace(SubdomainID blk_id,
1024  const THREAD_ID tid,
1025  bool swap_stateful = true,
1026  const std::deque<MaterialBase *> * reinit_mats = nullptr);
1027 
1039  const THREAD_ID tid,
1040  bool swap_stateful = true,
1041  const std::deque<MaterialBase *> * reinit_mats = nullptr);
1042 
1053  void reinitMaterialsBoundary(BoundaryID boundary_id,
1054  const THREAD_ID tid,
1055  bool swap_stateful = true,
1056  const std::deque<MaterialBase *> * reinit_mats = nullptr);
1057 
1058  void
1059  reinitMaterialsInterface(BoundaryID boundary_id, const THREAD_ID tid, bool swap_stateful = true);
1060 
1061  /*
1062  * Swap back underlying data storing stateful material properties
1063  */
1064  virtual void swapBackMaterials(const THREAD_ID tid);
1065  virtual void swapBackMaterialsFace(const THREAD_ID tid);
1066  virtual void swapBackMaterialsNeighbor(const THREAD_ID tid);
1067 
1074  void setActiveMaterialProperties(const std::unordered_set<unsigned int> & mat_prop_ids,
1075  const THREAD_ID tid);
1076 
1085  bool hasActiveMaterialProperties(const THREAD_ID tid) const;
1086 
1092  void clearActiveMaterialProperties(const THREAD_ID tid);
1093 
1105  template <typename T>
1106  std::vector<std::shared_ptr<T>> addObject(const std::string & type,
1107  const std::string & name,
1109  const bool threaded = true,
1110  const std::string & var_param_name = "variable");
1111 
1112  // Postprocessors /////
1113  virtual void addPostprocessor(const std::string & pp_name,
1114  const std::string & name,
1116 
1117  // VectorPostprocessors /////
1118  virtual void addVectorPostprocessor(const std::string & pp_name,
1119  const std::string & name,
1121 
1130  virtual void
1131  addReporter(const std::string & type, const std::string & name, InputParameters & parameters);
1132 
1140  const ReporterData & getReporterData() const { return _reporter_data; }
1141 
1148 
1149  // UserObjects /////
1150  virtual std::vector<std::shared_ptr<UserObject>> addUserObject(
1151  const std::string & user_object_name, const std::string & name, InputParameters & parameters);
1152 
1153  // TODO: delete this function after apps have been updated to not call it
1155  {
1157  "This function is deprecated, use theWarehouse().query() to construct a query instead");
1158  return _all_user_objects;
1159  }
1160 
1166  template <class T>
1167  T & getUserObject(const std::string & name, unsigned int tid = 0) const
1168  {
1169  std::vector<T *> objs;
1170  theWarehouse()
1171  .query()
1172  .condition<AttribSystem>("UserObject")
1173  .condition<AttribThread>(tid)
1174  .condition<AttribName>(name)
1175  .queryInto(objs);
1176  if (objs.empty())
1177  mooseError("Unable to find user object with name '" + name + "'");
1178  return *(objs[0]);
1179  }
1186  const UserObject & getUserObjectBase(const std::string & name, const THREAD_ID tid = 0) const;
1187 
1193  const Positions & getPositionsObject(const std::string & name) const;
1194 
1200  bool hasUserObject(const std::string & name) const;
1201 
1210  bool hasPostprocessorValueByName(const PostprocessorName & name) const;
1211 
1222  const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName & name,
1223  std::size_t t_index = 0) const;
1224 
1239  void setPostprocessorValueByName(const PostprocessorName & name,
1240  const PostprocessorValue & value,
1241  std::size_t t_index = 0);
1242 
1246  bool hasPostprocessor(const std::string & name) const;
1247 
1258  const VectorPostprocessorValue &
1259  getVectorPostprocessorValueByName(const std::string & object_name,
1260  const std::string & vector_name,
1261  std::size_t t_index = 0) const;
1262 
1270  void setVectorPostprocessorValueByName(const std::string & object_name,
1271  const std::string & vector_name,
1272  const VectorPostprocessorValue & value,
1273  std::size_t t_index = 0);
1274 
1283  const VectorPostprocessor & getVectorPostprocessorObjectByName(const std::string & object_name,
1284  const THREAD_ID tid = 0) const;
1285 
1287 
1290  bool hasMultiApps() const { return _multi_apps.hasActiveObjects(); }
1291  bool hasMultiApps(ExecFlagType type) const;
1292  bool hasMultiApp(const std::string & name) const;
1294 
1295  // Dampers /////
1296  virtual void addDamper(const std::string & damper_name,
1297  const std::string & name,
1299  void setupDampers();
1300 
1304  bool hasDampers() { return _has_dampers; }
1305 
1306  // Indicators /////
1307  virtual void addIndicator(const std::string & indicator_name,
1308  const std::string & name,
1310 
1311  // Markers //////
1312  virtual void addMarker(const std::string & marker_name,
1313  const std::string & name,
1315 
1319  virtual void addMultiApp(const std::string & multi_app_name,
1320  const std::string & name,
1322 
1326  std::shared_ptr<MultiApp> getMultiApp(const std::string & multi_app_name) const;
1327 
1331  std::vector<std::shared_ptr<Transfer>> getTransfers(ExecFlagType type,
1332  Transfer::DIRECTION direction) const;
1333  std::vector<std::shared_ptr<Transfer>> getTransfers(Transfer::DIRECTION direction) const;
1334 
1340 
1347 
1351  bool execMultiApps(ExecFlagType type, bool auto_advance = true);
1352 
1353  void finalizeMultiApps();
1354 
1359 
1365  {
1366  mooseDeprecated("Deprecated method; use finishMultiAppStep and/or incrementMultiAppTStep "
1367  "depending on your purpose");
1369  }
1370 
1375  void finishMultiAppStep(ExecFlagType type, bool recurse_through_multiapp_levels = false);
1376 
1381 
1386  void restoreMultiApps(ExecFlagType type, bool force = false);
1387 
1392 
1396  virtual void addTransfer(const std::string & transfer_name,
1397  const std::string & name,
1399 
1407 
1413 
1419 
1426  virtual Real computeResidualL2Norm();
1427 
1432  const NumericVector<libMesh::Number> & soln,
1433  NumericVector<libMesh::Number> & residual);
1439  const NumericVector<libMesh::Number> & soln,
1440  NumericVector<libMesh::Number> & residual);
1441 
1445  virtual void computeResidual(const NumericVector<libMesh::Number> & soln,
1446  NumericVector<libMesh::Number> & residual,
1447  const unsigned int nl_sys_num);
1448 
1452  void computeResidualAndJacobian(const NumericVector<libMesh::Number> & soln,
1453  NumericVector<libMesh::Number> & residual,
1455 
1459  virtual void computeResidualTag(const NumericVector<libMesh::Number> & soln,
1460  NumericVector<libMesh::Number> & residual,
1461  TagID tag);
1465  virtual void computeResidualType(const NumericVector<libMesh::Number> & soln,
1466  NumericVector<libMesh::Number> & residual,
1467  TagID tag);
1468 
1473  virtual void computeResidualInternal(const NumericVector<libMesh::Number> & soln,
1474  NumericVector<libMesh::Number> & residual,
1475  const std::set<TagID> & tags);
1479  virtual void computeResidualTags(const std::set<TagID> & tags);
1480 
1485  const NumericVector<libMesh::Number> & soln,
1490  virtual void computeJacobian(const NumericVector<libMesh::Number> & soln,
1492  const unsigned int nl_sys_num);
1493 
1497  virtual void computeJacobianTag(const NumericVector<libMesh::Number> & soln,
1499  TagID tag);
1500 
1504  virtual void computeJacobianInternal(const NumericVector<libMesh::Number> & soln,
1506  const std::set<TagID> & tags);
1507 
1511  virtual void computeJacobianTags(const std::set<TagID> & tags);
1512 
1521  virtual void computeJacobianBlocks(std::vector<JacobianBlock *> & blocks,
1522  const unsigned int nl_sys_num);
1523 
1538  libMesh::System & precond_system,
1539  unsigned int ivar,
1540  unsigned int jvar);
1541 
1553  NumericVector<libMesh::Number> & rhs,
1554  const bool compute_gradients = true);
1555 
1565  void computeLinearSystemTags(const NumericVector<libMesh::Number> & soln,
1566  const std::set<TagID> & vector_tags,
1567  const std::set<TagID> & matrix_tags,
1568  const bool compute_gradients = true);
1569 
1570  virtual Real computeDamping(const NumericVector<libMesh::Number> & soln,
1571  const NumericVector<libMesh::Number> & update);
1572 
1577  virtual bool shouldUpdateSolution();
1578 
1585  virtual bool updateSolution(NumericVector<libMesh::Number> & vec_solution,
1586  NumericVector<libMesh::Number> & ghosted_solution);
1587 
1592  virtual void predictorCleanup(NumericVector<libMesh::Number> & ghosted_solution);
1593 
1595  NumericVector<libMesh::Number> & lower,
1596  NumericVector<libMesh::Number> & upper);
1598  std::vector<NumericVector<libMesh::Number> *> & sp);
1600  std::vector<NumericVector<libMesh::Number> *> & sp);
1602  std::vector<NumericVector<libMesh::Number> *> & sp);
1604  const NumericVector<libMesh::Number> & old_soln,
1605  NumericVector<libMesh::Number> & search_direction,
1606  NumericVector<libMesh::Number> & new_soln,
1607  bool & changed_search_direction,
1608  bool & changed_new_soln);
1609 
1610  virtual void computeIndicatorsAndMarkers();
1611  virtual void computeIndicators();
1612  virtual void computeMarkers();
1613 
1614  virtual void addResidual(const THREAD_ID tid) override;
1615  virtual void addResidualNeighbor(const THREAD_ID tid) override;
1616  virtual void addResidualLower(const THREAD_ID tid) override;
1617  virtual void addResidualScalar(const THREAD_ID tid = 0);
1618 
1619  virtual void cacheResidual(const THREAD_ID tid) override;
1620  virtual void cacheResidualNeighbor(const THREAD_ID tid) override;
1621  virtual void addCachedResidual(const THREAD_ID tid) override;
1622 
1630  virtual void addCachedResidualDirectly(NumericVector<libMesh::Number> & residual,
1631  const THREAD_ID tid);
1632 
1633  virtual void setResidual(NumericVector<libMesh::Number> & residual, const THREAD_ID tid) override;
1634  virtual void setResidualNeighbor(NumericVector<libMesh::Number> & residual,
1635  const THREAD_ID tid) override;
1636 
1637  virtual void addJacobian(const THREAD_ID tid) override;
1638  virtual void addJacobianNeighbor(const THREAD_ID tid) override;
1639  virtual void addJacobianNeighborLowerD(const THREAD_ID tid) override;
1640  virtual void addJacobianLowerD(const THREAD_ID tid) override;
1642  unsigned int ivar,
1643  unsigned int jvar,
1644  const DofMap & dof_map,
1645  std::vector<dof_id_type> & dof_indices,
1646  const std::set<TagID> & tags,
1647  const THREAD_ID tid);
1649  unsigned int ivar,
1650  unsigned int jvar,
1651  const DofMap & dof_map,
1652  std::vector<dof_id_type> & dof_indices,
1653  std::vector<dof_id_type> & neighbor_dof_indices,
1654  const std::set<TagID> & tags,
1655  const THREAD_ID tid) override;
1656  virtual void addJacobianScalar(const THREAD_ID tid = 0);
1657  virtual void addJacobianOffDiagScalar(unsigned int ivar, const THREAD_ID tid = 0);
1658 
1659  virtual void cacheJacobian(const THREAD_ID tid) override;
1660  virtual void cacheJacobianNeighbor(const THREAD_ID tid) override;
1661  virtual void addCachedJacobian(const THREAD_ID tid) override;
1662 
1663  virtual void prepareShapes(unsigned int var, const THREAD_ID tid) override;
1664  virtual void prepareFaceShapes(unsigned int var, const THREAD_ID tid) override;
1665  virtual void prepareNeighborShapes(unsigned int var, const THREAD_ID tid) override;
1666 
1667  // Displaced problem /////
1668  virtual void addDisplacedProblem(std::shared_ptr<DisplacedProblem> displaced_problem);
1669  virtual std::shared_ptr<const DisplacedProblem> getDisplacedProblem() const
1670  {
1671  return _displaced_problem;
1672  }
1673  virtual std::shared_ptr<DisplacedProblem> getDisplacedProblem() { return _displaced_problem; }
1674 
1675  virtual void updateGeomSearch(
1677  virtual void updateMortarMesh();
1678 
1679  void createMortarInterface(
1680  const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
1681  const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
1682  bool on_displaced,
1683  bool periodic,
1684  const bool debug,
1685  const bool correct_edge_dropping,
1686  const Real minimum_projection_angle);
1687 
1694  getMortarInterface(const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
1695  const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
1696  bool on_displaced) const;
1697 
1699  getMortarInterface(const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
1700  const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
1701  bool on_displaced);
1703 
1704  const std::unordered_map<std::pair<BoundaryID, BoundaryID>, AutomaticMortarGeneration> &
1705  getMortarInterfaces(bool on_displaced) const;
1706 
1707  virtual void possiblyRebuildGeomSearchPatches();
1708 
1710 
1715  void setRestartFile(const std::string & file_name);
1716 
1721  {
1722  return _material_prop_registry;
1723  }
1724 
1733  {
1734  return _neighbor_material_props;
1735  }
1737 
1744  {
1746  }
1749 
1754 
1759 
1763  SolverParams & solverParams(unsigned int solver_sys_num = 0);
1764 
1768  const SolverParams & solverParams(unsigned int solver_sys_num = 0) const;
1769 
1770 #ifdef LIBMESH_ENABLE_AMR
1771  // Adaptivity /////
1773  virtual void initialAdaptMesh();
1774 
1778  virtual bool adaptMesh();
1779 
1783  unsigned int getNumCyclesCompleted() { return _cycles_completed; }
1784 
1788  bool hasInitialAdaptivity() const { return _adaptivity.getInitialSteps() > 0; }
1789 #else
1790 
1793  bool hasInitialAdaptivity() const { return false; }
1794 #endif // LIBMESH_ENABLE_AMR
1795 
1797  void initXFEM(std::shared_ptr<XFEMInterface> xfem);
1798 
1800  std::shared_ptr<XFEMInterface> getXFEM() { return _xfem; }
1801 
1803  bool haveXFEM() { return _xfem != nullptr; }
1804 
1806  virtual bool updateMeshXFEM();
1807 
1822  virtual void
1823  meshChanged(bool intermediate_change, bool contract_mesh, bool clean_refinement_flags);
1824 
1830 
1836 
1842  void initElementStatefulProps(const libMesh::ConstElemRange & elem_range, const bool threaded);
1843 
1848  virtual void checkProblemIntegrity();
1849 
1850  void registerRandomInterface(RandomInterface & random_interface, const std::string & name);
1851 
1856  void setConstJacobian(bool state) { _const_jacobian = state; }
1857 
1863 
1868  void setKernelCoverageCheck(bool flag)
1869  {
1871  }
1872 
1880 
1888  {
1890  }
1891 
1896 
1898  void setVerboseProblem(bool verbose);
1899 
1903  bool verboseMultiApps() const { return _verbose_multiapps; }
1904 
1909 
1911 
1928  bool needBoundaryMaterialOnSide(BoundaryID bnd_id, const THREAD_ID tid);
1929  bool needInterfaceMaterialOnSide(BoundaryID bnd_id, const THREAD_ID tid);
1930  bool needSubdomainMaterialOnSide(SubdomainID subdomain_id, const THREAD_ID tid);
1932 
1937  unsigned int subspaceDim(const std::string & prefix) const
1938  {
1939  if (_subspace_dim.count(prefix))
1940  return _subspace_dim.find(prefix)->second;
1941  else
1942  return 0;
1943  }
1944 
1945  /*
1946  * Return a reference to the material warehouse of *all* Material objects.
1947  */
1949 
1950  /*
1951  * Return a reference to the material warehouse of Material objects to be computed.
1952  */
1956 
1964  std::shared_ptr<MaterialBase> getMaterial(std::string name,
1966  const THREAD_ID tid = 0,
1967  bool no_warn = false);
1968 
1969  /*
1970  * @return The MaterialData for the type \p type for thread \p tid
1971  */
1973 
1978 
1984  {
1986  }
1987 
1989  {
1991  }
1992 
1998 
2002  void setPreserveMatrixSparsityPattern(bool preserve);
2003 
2009 
2012 
2019  bool acceptInvalidSolution() const;
2024 
2029 
2034 
2036  bool hasTimeIntegrator() const { return _has_time_integrator; }
2037 
2039 
2045  const ExecFlagType & getCurrentExecuteOnFlag() const;
2046  void setCurrentExecuteOnFlag(const ExecFlagType &);
2048 
2052  virtual void execute(const ExecFlagType & exec_type);
2053  virtual void executeAllObjects(const ExecFlagType & exec_type);
2054 
2055  virtual Executor & getExecutor(const std::string & name) { return _app.getExecutor(name); }
2056 
2060  virtual void computeUserObjects(const ExecFlagType & type, const Moose::AuxGroup & group);
2061 
2065  virtual void computeUserObjectByName(const ExecFlagType & type,
2066  const Moose::AuxGroup & group,
2067  const std::string & name);
2068 
2072  void needsPreviousNewtonIteration(bool state);
2073 
2078  bool needsPreviousNewtonIteration() const;
2079 
2081 
2084  std::vector<Real> _real_zero;
2085  std::vector<VariableValue> _scalar_zero;
2086  std::vector<VariableValue> _zero;
2087  std::vector<VariablePhiValue> _phi_zero;
2088  std::vector<MooseArray<ADReal>> _ad_zero;
2089  std::vector<VariableGradient> _grad_zero;
2090  std::vector<MooseArray<ADRealVectorValue>> _ad_grad_zero;
2091  std::vector<VariablePhiGradient> _grad_phi_zero;
2092  std::vector<VariableSecond> _second_zero;
2093  std::vector<MooseArray<ADRealTensorValue>> _ad_second_zero;
2094  std::vector<VariablePhiSecond> _second_phi_zero;
2095  std::vector<Point> _point_zero;
2096  std::vector<VectorVariableValue> _vector_zero;
2097  std::vector<VectorVariableCurl> _vector_curl_zero;
2099 
2104 
2108  void executeControls(const ExecFlagType & exec_type);
2109 
2113  void executeSamplers(const ExecFlagType & exec_type);
2114 
2118  virtual void updateActiveObjects();
2119 
2126 
2128 
2132  bool hasJacobian() const;
2133 
2138  bool constJacobian() const;
2139 
2143  void addOutput(const std::string &, const std::string &, InputParameters &);
2144 
2145  inline TheWarehouse & theWarehouse() const { return _app.theWarehouse(); }
2146 
2150  void setSNESMFReuseBase(bool reuse, bool set_by_user)
2151  {
2152  _snesmf_reuse_base = reuse, _snesmf_reuse_base_set_by_user = set_by_user;
2153  }
2154 
2159 
2163  void skipExceptionCheck(bool skip_exception_check)
2164  {
2165  _skip_exception_check = skip_exception_check;
2166  }
2167 
2172 
2177 
2178 #if !PETSC_RELEASE_LESS_THAN(3, 12, 0)
2179  PetscOptions & petscOptionsDatabase() { return _petsc_option_data_base; }
2180 #endif
2181 
2183  virtual void setUDotRequested(const bool u_dot_requested) { _u_dot_requested = u_dot_requested; }
2184 
2186  virtual void setUDotDotRequested(const bool u_dotdot_requested)
2187  {
2188  _u_dotdot_requested = u_dotdot_requested;
2189  }
2190 
2192  virtual void setUDotOldRequested(const bool u_dot_old_requested)
2193  {
2194  _u_dot_old_requested = u_dot_old_requested;
2195  }
2196 
2198  virtual void setUDotDotOldRequested(const bool u_dotdot_old_requested)
2199  {
2200  _u_dotdot_old_requested = u_dotdot_old_requested;
2201  }
2202 
2204  virtual bool uDotRequested() { return _u_dot_requested; }
2205 
2207  virtual bool uDotDotRequested() { return _u_dotdot_requested; }
2208 
2210  virtual bool uDotOldRequested()
2211  {
2213  mooseError("FEProblemBase: When requesting old time derivative of solution, current time "
2214  "derivative of solution should also be stored. Please set `u_dot_requested` to "
2215  "true using setUDotRequested.");
2216 
2217  return _u_dot_old_requested;
2218  }
2219 
2221  virtual bool uDotDotOldRequested()
2222  {
2224  mooseError("FEProblemBase: When requesting old second time derivative of solution, current "
2225  "second time derivation of solution should also be stored. Please set "
2226  "`u_dotdot_requested` to true using setUDotDotRequested.");
2227  return _u_dotdot_old_requested;
2228  }
2229 
2231  void haveADObjects(bool have_ad_objects) override;
2232 
2233  // Whether or not we should solve this system
2234  bool shouldSolve() const { return _solve; }
2235 
2239  const MortarData & mortarData() const { return _mortar_data; }
2241 
2246 
2250  virtual bool hasMortarCoupling() const { return _has_mortar; }
2251 
2253  void computingNonlinearResid(bool computing_nonlinear_residual) final;
2254 
2256  void setCurrentlyComputingResidual(bool currently_computing_residual) final;
2257 
2261  void numGridSteps(unsigned int num_grid_steps) { _num_grid_steps = num_grid_steps; }
2262 
2267  void uniformRefine();
2268 
2270  void automaticScaling(bool automatic_scaling) override;
2271 
2273 
2276  template <typename T>
2277  static void objectSetupHelper(const std::vector<T *> & objects, const ExecFlagType & exec_flag);
2278  template <typename T>
2279  static void objectExecuteHelper(const std::vector<T *> & objects);
2281 
2288  virtual void reinitElemFaceRef(const Elem * elem,
2289  unsigned int side,
2290  Real tolerance,
2291  const std::vector<Point> * const pts,
2292  const std::vector<Real> * const weights = nullptr,
2293  const THREAD_ID tid = 0) override;
2294 
2301  virtual void reinitNeighborFaceRef(const Elem * neighbor_elem,
2302  unsigned int neighbor_side,
2303  Real tolerance,
2304  const std::vector<Point> * const pts,
2305  const std::vector<Real> * const weights = nullptr,
2306  const THREAD_ID tid = 0) override;
2307 
2312 
2317  void fvBCsIntegrityCheck(bool fv_bcs_integrity_check);
2318 
2327  void getFVMatsAndDependencies(SubdomainID block_id,
2328  std::vector<std::shared_ptr<MaterialBase>> & face_materials,
2329  std::vector<std::shared_ptr<MaterialBase>> & neighbor_materials,
2330  std::set<MooseVariableFieldBase *> & variables,
2331  const THREAD_ID tid);
2332 
2339  void resizeMaterialData(Moose::MaterialDataType data_type, unsigned int nqp, const THREAD_ID tid);
2340 
2341  bool haveDisplaced() const override final { return _displaced_problem.get(); }
2342 
2344  bool hasLinearConvergenceObjects() const;
2348  void setNonlinearConvergenceNames(const std::vector<ConvergenceName> & convergence_names);
2352  void setLinearConvergenceNames(const std::vector<ConvergenceName> & convergence_names);
2356  void setMultiAppFixedPointConvergenceName(const ConvergenceName & convergence_name);
2360  void setSteadyStateConvergenceName(const ConvergenceName & convergence_name);
2361 
2365  const std::vector<ConvergenceName> & getNonlinearConvergenceNames() const;
2369  const std::vector<ConvergenceName> & getLinearConvergenceNames() const;
2373  const ConvergenceName & getMultiAppFixedPointConvergenceName() const;
2377  const ConvergenceName & getSteadyStateConvergenceName() const;
2378 
2382  void computingScalingJacobian(bool computing_scaling_jacobian)
2383  {
2384  _computing_scaling_jacobian = computing_scaling_jacobian;
2385  }
2386 
2387  bool computingScalingJacobian() const override final { return _computing_scaling_jacobian; }
2388 
2392  void computingScalingResidual(bool computing_scaling_residual)
2393  {
2394  _computing_scaling_residual = computing_scaling_residual;
2395  }
2396 
2400  bool computingScalingResidual() const override final { return _computing_scaling_residual; }
2401 
2407 
2408  virtual std::size_t numNonlinearSystems() const override { return _num_nl_sys; }
2409 
2410  virtual std::size_t numLinearSystems() const override { return _num_linear_sys; }
2411 
2412  virtual std::size_t numSolverSystems() const override { return _num_nl_sys + _num_linear_sys; }
2413 
2415  bool isSolverSystemNonlinear(const unsigned int sys_num) { return sys_num < _num_nl_sys; }
2416 
2417  virtual unsigned int currentNlSysNum() const override;
2418 
2419  virtual unsigned int currentLinearSysNum() const override;
2420 
2424  virtual unsigned int nlSysNum(const NonlinearSystemName & nl_sys_name) const override;
2425 
2429  unsigned int linearSysNum(const LinearSystemName & linear_sys_name) const override;
2430 
2434  unsigned int solverSysNum(const SolverSystemName & solver_sys_name) const override;
2435 
2440  unsigned int systemNumForVariable(const VariableName & variable_name) const;
2441 
2446 
2451 
2456 
2457  /*
2458  * Set the status of loop order of execution printing
2459  * @param print_exec set of execution flags to print on
2460  */
2461  void setExecutionPrinting(const ExecFlagEnum & print_exec) { _print_execution_on = print_exec; }
2462 
2466  bool shouldPrintExecution(const THREAD_ID tid) const;
2471  void reinitMortarUserObjects(BoundaryID primary_boundary_id,
2472  BoundaryID secondary_boundary_id,
2473  bool displaced);
2474 
2475  virtual const std::vector<VectorTag> & currentResidualVectorTags() const override;
2476 
2482  {
2483  friend class CrankNicolson;
2484  friend class FEProblemBase;
2487  };
2488 
2492  void setCurrentResidualVectorTags(const std::set<TagID> & vector_tags);
2493 
2498 
2503 
2504  virtual void needFV() override { _have_fv = true; }
2505  virtual bool haveFV() const override { return _have_fv; }
2506 
2507  virtual bool hasNonlocalCoupling() const override { return _has_nonlocal_coupling; }
2508 
2513 
2514  virtual void setCurrentLowerDElem(const Elem * const lower_d_elem, const THREAD_ID tid) override;
2515  virtual void setCurrentBoundaryID(BoundaryID bid, const THREAD_ID tid) override;
2516 
2520  const std::vector<NonlinearSystemName> & getNonlinearSystemNames() const { return _nl_sys_names; }
2524  const std::vector<LinearSystemName> & getLinearSystemNames() const { return _linear_sys_names; }
2528  const std::vector<SolverSystemName> & getSolverSystemNames() const { return _solver_sys_names; }
2529 
2530  virtual const libMesh::CouplingMatrix & nonlocalCouplingMatrix(const unsigned i) const override;
2531 
2532  virtual bool checkNonlocalCouplingRequirement() const override;
2533 
2535 
2537  {
2540 
2542  };
2543 
2545 
2546 protected:
2550  virtual void meshChanged() {}
2551 
2553  void createTagVectors();
2554 
2556  void createTagSolutions();
2557 
2561  virtual void meshDisplaced();
2562 
2566  void computeSystems(const ExecFlagType & type);
2567 
2569 
2570 private:
2573 
2585  void setResidualObjectParamsAndLog(const std::string & ro_name,
2586  const std::string & name,
2587  InputParameters & params,
2588  const unsigned int nl_sys_num,
2589  const std::string & base_name,
2590  bool & reinit_displaced);
2591 
2596 
2597 protected:
2599 
2601  std::optional<std::vector<ConvergenceName>> _nonlinear_convergence_names;
2603  std::optional<std::vector<ConvergenceName>> _linear_convergence_names;
2605  std::optional<ConvergenceName> _multiapp_fixed_point_convergence_name;
2607  std::optional<ConvergenceName> _steady_state_convergence_name;
2608 
2609  std::set<TagID> _fe_vector_tags;
2610 
2611  std::set<TagID> _fe_matrix_tags;
2612 
2614  std::set<TagID> _linear_vector_tags;
2615 
2617  std::set<TagID> _linear_matrix_tags;
2618 
2620  const bool & _solve;
2621 
2625  int & _t_step;
2628 
2635 
2637  const std::vector<LinearSystemName> _linear_sys_names;
2638 
2640  const std::size_t _num_linear_sys;
2641 
2643  std::vector<std::shared_ptr<LinearSystem>> _linear_systems;
2644 
2646  std::map<LinearSystemName, unsigned int> _linear_sys_name_to_num;
2647 
2650 
2652  const bool _using_default_nl;
2653 
2655  const std::vector<NonlinearSystemName> _nl_sys_names;
2656 
2658  const std::size_t _num_nl_sys;
2659 
2661  std::vector<std::shared_ptr<NonlinearSystemBase>> _nl;
2662 
2664  std::map<NonlinearSystemName, unsigned int> _nl_sys_name_to_num;
2665 
2668 
2671 
2673  std::vector<std::shared_ptr<SolverSystem>> _solver_systems;
2674 
2676  std::map<SolverVariableName, unsigned int> _solver_var_to_sys_num;
2677 
2679  std::map<SolverSystemName, unsigned int> _solver_sys_name_to_num;
2680 
2682  std::vector<SolverSystemName> _solver_sys_names;
2683 
2685  std::shared_ptr<AuxiliarySystem> _aux;
2686 
2688  std::vector<std::unique_ptr<libMesh::CouplingMatrix>> _cm;
2689 
2691  std::map<std::string, unsigned int> _subspace_dim;
2692 
2695  std::vector<std::vector<std::unique_ptr<Assembly>>> _assembly;
2696 
2701 
2704 
2707 
2710 
2713 
2718  ScalarInitialConditionWarehouse _scalar_ics; // use base b/c of setup methods
2720 
2721  // material properties
2726 
2728  // Material Warehouses
2729  MaterialWarehouse _materials; // regular materials
2730  MaterialWarehouse _interface_materials; // interface materials
2731  MaterialWarehouse _discrete_materials; // Materials that the user must compute
2732  MaterialWarehouse _all_materials; // All materials for error checking and MaterialData storage
2734 
2736  // Indicator Warehouses
2740 
2741  // Marker Warehouse
2743 
2744  // Helper class to access Reporter object values
2746 
2747  // TODO: delete this after apps have been updated to not call getUserObjects
2749 
2752 
2755 
2758 
2761 
2764 
2767 
2769  std::map<std::string, std::unique_ptr<RandomData>> _random_data_objects;
2770 
2772  std::vector<std::unordered_map<SubdomainID, bool>> _block_mat_side_cache;
2773 
2775  std::vector<std::unordered_map<BoundaryID, bool>> _bnd_mat_side_cache;
2776 
2778  std::vector<std::unordered_map<BoundaryID, bool>> _interface_mat_side_cache;
2779 
2781  std::vector<MeshChangedInterface *> _notify_when_mesh_changes;
2782 
2784  std::vector<MeshDisplacedInterface *> _notify_when_mesh_displaces;
2785 
2787  bool duplicateVariableCheck(const std::string & var_name,
2788  const libMesh::FEType & type,
2789  bool is_aux,
2790  const std::set<SubdomainID> * const active_subdomains);
2791 
2793  const Moose::AuxGroup & group,
2794  TheWarehouse::Query & query);
2795 
2797  void checkDisplacementOrders();
2798 
2799  void checkUserObjects();
2800 
2807  const std::map<SubdomainID, std::vector<std::shared_ptr<MaterialBase>>> & materials_map);
2808 
2810  void checkCoordinateSystems();
2811 
2817  void reinitBecauseOfGhostingOrNewGeomObjects(bool mortar_changed = false);
2818 
2825  void addObjectParamsHelper(InputParameters & params,
2826  const std::string & object_name,
2827  const std::string & var_param_name = "variable");
2828 
2829 #ifdef LIBMESH_ENABLE_AMR
2831  unsigned int _cycles_completed;
2832 #endif
2833 
2835  std::shared_ptr<XFEMInterface> _xfem;
2836 
2837  // Displaced mesh /////
2839  std::shared_ptr<DisplacedProblem> _displaced_problem;
2842 
2849 
2852 
2855 
2858 
2861 
2864 
2867 
2870 
2873 
2876 
2879 
2882 
2886 
2887  std::vector<std::vector<const MooseVariableFEBase *>> _uo_jacobian_moose_vars;
2888 
2890  std::vector<unsigned char> _has_active_material_properties;
2891 
2892  std::vector<SolverParams> _solver_params;
2893 
2896  std::vector<SubdomainName> _kernel_coverage_blocks;
2897 
2901 
2905 
2908  std::vector<SubdomainName> _material_coverage_blocks;
2909 
2912 
2915 
2918 
2920  unsigned int _max_qps;
2921 
2924 
2927 
2930 
2933 
2936 
2939 
2942 
2944  std::string _exception_message;
2945 
2948 
2951 
2954 #if !PETSC_RELEASE_LESS_THAN(3, 12, 0)
2956 #endif
2957 
2960 
2961  std::shared_ptr<LineSearch> _line_search;
2962 
2963  std::unique_ptr<libMesh::ConstElemRange> _evaluable_local_elem_range;
2964  std::unique_ptr<libMesh::ConstElemRange> _nl_evaluable_local_elem_range;
2965  std::unique_ptr<libMesh::ConstElemRange> _aux_evaluable_local_elem_range;
2966 
2967  std::unique_ptr<libMesh::ConstElemRange> _current_algebraic_elem_range;
2968  std::unique_ptr<libMesh::ConstNodeRange> _current_algebraic_node_range;
2969  std::unique_ptr<ConstBndNodeRange> _current_algebraic_bnd_node_range;
2970 
2974 
2975  // loop state during projection of initial conditions
2976  unsigned short _current_ic_state;
2977 
2981 
2982 private:
2987  void handleException(const std::string & calling_method);
2988 
2993  std::vector<MortarUserObject *>
2994  getMortarUserObjects(BoundaryID primary_boundary_id,
2995  BoundaryID secondary_boundary_id,
2996  bool displaced,
2997  const std::vector<MortarUserObject *> & mortar_uo_superset);
2998 
3003  std::vector<MortarUserObject *> getMortarUserObjects(BoundaryID primary_boundary_id,
3004  BoundaryID secondary_boundary_id,
3005  bool displaced);
3006 
3016  virtual std::pair<bool, unsigned int>
3017  determineSolverSystem(const std::string & var_name,
3018  bool error_if_not_found = false) const override;
3019 
3026  void checkICRestartError(const std::string & ic_name,
3027  const std::string & name,
3028  const VariableName & var_name);
3029 
3030  /*
3031  * Test if stateful property redistribution is expected to be
3032  * necessary, and set it up if so.
3033  */
3034  void addAnyRedistributers();
3035 
3036  void updateMaxQps();
3037 
3038  void joinAndFinalize(TheWarehouse::Query query, bool isgen = false);
3039 
3043  virtual void resetState();
3044 
3045  // Parameters handling Jacobian sparsity pattern behavior
3057 
3058  const bool _force_restart;
3065 
3068 
3071 
3074 
3077 
3080 
3083 
3084  friend class AuxiliarySystem;
3085  friend class NonlinearSystemBase;
3086  friend class MooseEigenSystem;
3087  friend class Resurrector;
3088  friend class Restartable;
3089  friend class DisplacedProblem;
3090 
3093 
3095  unsigned int _num_grid_steps;
3096 
3100 
3103 
3106 
3109 
3112 
3115 
3119  std::vector<VectorTag> _current_residual_vector_tags;
3120 
3122  bool _have_fv = false;
3123 
3127 
3129  std::vector<libMesh::CouplingMatrix> _nonlocal_cm;
3130 
3133 
3134  friend void Moose::PetscSupport::setSinglePetscOption(const std::string & name,
3135  const std::string & value,
3136  FEProblemBase * const problem);
3137 };
3138 
3140 
3141 template <typename T>
3142 void
3144 {
3145  _app.getOutputWarehouse().allowOutput<T>(state);
3146 }
3147 
3148 template <typename T>
3149 void
3150 FEProblemBase::objectSetupHelper(const std::vector<T *> & objects, const ExecFlagType & exec_flag)
3151 {
3152  if (exec_flag == EXEC_INITIAL)
3153  {
3154  for (T * obj_ptr : objects)
3155  obj_ptr->initialSetup();
3156  }
3157 
3158  else if (exec_flag == EXEC_TIMESTEP_BEGIN)
3159  {
3160  for (const auto obj_ptr : objects)
3161  obj_ptr->timestepSetup();
3162  }
3163  else if (exec_flag == EXEC_SUBDOMAIN)
3164  {
3165  for (const auto obj_ptr : objects)
3166  obj_ptr->subdomainSetup();
3167  }
3168 
3169  else if (exec_flag == EXEC_NONLINEAR)
3170  {
3171  for (const auto obj_ptr : objects)
3172  obj_ptr->jacobianSetup();
3173  }
3174 
3175  else if (exec_flag == EXEC_LINEAR)
3176  {
3177  for (const auto obj_ptr : objects)
3178  obj_ptr->residualSetup();
3179  }
3180 }
3181 
3182 template <typename T>
3183 void
3184 FEProblemBase::objectExecuteHelper(const std::vector<T *> & objects)
3185 {
3186  for (T * obj_ptr : objects)
3187  obj_ptr->execute();
3188 }
3189 
3190 template <typename T>
3191 std::vector<std::shared_ptr<T>>
3192 FEProblemBase::addObject(const std::string & type,
3193  const std::string & name,
3195  const bool threaded,
3196  const std::string & var_param_name)
3197 {
3198  parallel_object_only();
3199 
3200  logAdd(MooseUtils::prettyCppType<T>(), name, type, parameters);
3201  // Add the _subproblem and _sys parameters depending on use_displaced_mesh
3202  addObjectParamsHelper(parameters, name, var_param_name);
3203 
3204  const auto n_threads = threaded ? libMesh::n_threads() : 1;
3205  std::vector<std::shared_ptr<T>> objects(n_threads);
3206  for (THREAD_ID tid = 0; tid < n_threads; ++tid)
3207  {
3208  std::shared_ptr<T> obj = _factory.create<T>(type, name, parameters, tid);
3209  theWarehouse().add(obj);
3210  objects[tid] = std::move(obj);
3211  }
3212 
3213  return objects;
3214 }
3215 
3216 inline NonlinearSystemBase &
3217 FEProblemBase::getNonlinearSystemBase(const unsigned int sys_num)
3218 {
3219  mooseAssert(sys_num < _nl.size(), "System number greater than the number of nonlinear systems");
3220  return *_nl[sys_num];
3221 }
3222 
3223 inline const NonlinearSystemBase &
3224 FEProblemBase::getNonlinearSystemBase(const unsigned int sys_num) const
3225 {
3226  mooseAssert(sys_num < _nl.size(), "System number greater than the number of nonlinear systems");
3227  return *_nl[sys_num];
3228 }
3229 
3230 inline SolverSystem &
3231 FEProblemBase::getSolverSystem(const unsigned int sys_num)
3232 {
3233  mooseAssert(sys_num < _solver_systems.size(),
3234  "System number greater than the number of solver systems");
3235  return *_solver_systems[sys_num];
3236 }
3237 
3238 inline const SolverSystem &
3239 FEProblemBase::getSolverSystem(const unsigned int sys_num) const
3240 {
3241  mooseAssert(sys_num < _solver_systems.size(),
3242  "System number greater than the number of solver systems");
3243  return *_solver_systems[sys_num];
3244 }
3245 
3246 inline NonlinearSystemBase &
3248 {
3249  mooseAssert(_current_nl_sys, "The nonlinear system is not currently set");
3250  return *_current_nl_sys;
3251 }
3252 
3253 inline const NonlinearSystemBase &
3255 {
3256  mooseAssert(_current_nl_sys, "The nonlinear system is not currently set");
3257  return *_current_nl_sys;
3258 }
3259 
3260 inline LinearSystem &
3261 FEProblemBase::getLinearSystem(const unsigned int sys_num)
3262 {
3263  mooseAssert(sys_num < _linear_systems.size(),
3264  "System number greater than the number of linear systems");
3265  return *_linear_systems[sys_num];
3266 }
3267 
3268 inline const LinearSystem &
3269 FEProblemBase::getLinearSystem(const unsigned int sys_num) const
3270 {
3271  mooseAssert(sys_num < _linear_systems.size(),
3272  "System number greater than the number of linear systems");
3273  return *_linear_systems[sys_num];
3274 }
3275 
3276 inline LinearSystem &
3278 {
3279  mooseAssert(_current_linear_sys, "The linear system is not currently set");
3280  return *_current_linear_sys;
3281 }
3282 
3283 inline const LinearSystem &
3285 {
3286  mooseAssert(_current_linear_sys, "The linear system is not currently set");
3287  return *_current_linear_sys;
3288 }
3289 
3290 inline Assembly &
3291 FEProblemBase::assembly(const THREAD_ID tid, const unsigned int sys_num)
3292 {
3293  mooseAssert(tid < _assembly.size(), "Assembly objects not initialized");
3294  mooseAssert(sys_num < _assembly[tid].size(),
3295  "System number larger than the assembly container size");
3296  return *_assembly[tid][sys_num];
3297 }
3298 
3299 inline const Assembly &
3300 FEProblemBase::assembly(const THREAD_ID tid, const unsigned int sys_num) const
3301 {
3302  mooseAssert(tid < _assembly.size(), "Assembly objects not initialized");
3303  mooseAssert(sys_num < _assembly[tid].size(),
3304  "System number larger than the assembly container size");
3305  return *_assembly[tid][sys_num];
3306 }
3307 
3308 inline const libMesh::CouplingMatrix *
3309 FEProblemBase::couplingMatrix(const unsigned int i) const
3310 {
3311  return _cm[i].get();
3312 }
3313 
3314 inline void
3315 FEProblemBase::fvBCsIntegrityCheck(const bool fv_bcs_integrity_check)
3316 {
3318  // the user has requested that we don't check integrity so we will honor that
3319  return;
3320 
3321  _fv_bcs_integrity_check = fv_bcs_integrity_check;
3322 }
3323 
3324 inline const std::vector<VectorTag> &
3326 {
3328 }
3329 
3330 inline void
3331 FEProblemBase::setCurrentResidualVectorTags(const std::set<TagID> & vector_tags)
3332 {
3334 }
3335 
3336 inline void
3338 {
3340 }
bool _reinit_displaced_elem
Whether to call DisplacedProblem::reinitElem when this->reinitElem is called.
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:722
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.
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.
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:36
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.
const MortarData & mortarData() const
Returns the mortar data object.
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:1047
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.
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 VariableName &target_var)
Project a function onto a range of elements for a given variable.
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:208
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:101
MooseAppCoordTransform & coordTransform()
virtual void setActiveFEVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid) override
void setResidualObjectParamsAndLog(const std::string &ro_name, const std::string &name, InputParameters &params, 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 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...
unsigned int TagID
Definition: MooseTypes.h:210
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.
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.
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)
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.
void setCurrentAlgebraicBndNodeRange(ConstBndNodeRange *range)
This is the base class for Samplers as used within the Stochastic Tools module.
Definition: Sampler.h:43
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 clearActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid) override
virtual void postExecute()
Method called at the end of the simulation.
bool isSolverSystemNonlinear(const unsigned int sys_num)
Check if the solver system is nonlinear.
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
const std::vector< SolverSystemName > & getSolverSystemNames() const
ExecuteMooseObjectWarehouse< Control > _control_warehouse
The control logic warehouse.
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.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:127
unsigned short _current_ic_state
virtual void reinitNeighborPhys(const Elem *neighbor, unsigned int neighbor_side, const std::vector< Point > &physical_points, const THREAD_ID tid) override
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:692
void computeUserObjectsInternal(const ExecFlagType &type, const Moose::AuxGroup &group, TheWarehouse::Query &query)
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:111
virtual void reinitNodes(const std::vector< dof_id_type > &nodes, const THREAD_ID tid) override
virtual void updateActiveObjects()
Update the active objects in the warehouses.
Stores the stateful material properties computed by materials.
virtual void computeIndicatorsAndMarkers()
void reinitMaterialsBoundary(BoundaryID boundary_id, const THREAD_ID tid, bool swap_stateful=true, const std::deque< MaterialBase *> *reinit_mats=nullptr)
reinit materials on a boundary
Definition: Marker.h:41
virtual void addJacobianOffDiagScalar(unsigned int ivar, const THREAD_ID tid=0)
virtual void setException(const std::string &message)
Set an exception, which is stored at this point by toggling a member variable in this class...
virtual void addJacobian(const THREAD_ID tid) override
CreateTaggedMatrixKey(const CreateTaggedMatrixKey &)
virtual void addAuxScalarKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
void setErrorOnJacobianNonzeroReallocation(bool state)
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...
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.
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)
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
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.
MaterialData & getMaterialData(Moose::MaterialDataType type, const THREAD_ID tid=0) const
All Distributions should inherit from this class.
Definition: Distribution.h:18
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)
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
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;)
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.
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 void addKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
Base class for a system (of equations)
Definition: SystemBase.h:84
const InitialConditionWarehouse & getInitialConditionWarehouse() const
Return InitialCondition storage.
virtual void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters &params)
Canonical method for adding an auxiliary variable.
std::optional< ConvergenceName > _steady_state_convergence_name
Steady-state detection convergence name.
Base class for MeshDivision objects.
Definition: MeshDivision.h:35
const MaterialPropertyStorage & getBndMaterialPropertyStorage()
bool computingNonlinearResid() const
Returns true if the problem is in the process of computing the nonlinear residual.
Definition: SubProblem.h:707
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.
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:720
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.
std::shared_ptr< MultiApp > getMultiApp(const std::string &multi_app_name) const
Get a MultiApp object by name.
ExecuteMooseObjectWarehouse< UserObject > _all_user_objects
virtual void reinitElemNeighborAndLowerD(const Elem *elem, unsigned int side, const THREAD_ID tid) override
bool hasSolverVariable(const std::string &var_name) const
AuxGroup
Flag for AuxKernel related execution type.
Definition: MooseTypes.h:704
virtual void addMarker(const std::string &marker_name, const std::string &name, InputParameters &parameters)
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
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)
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.
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.
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:1162
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:99
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.
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()
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 _input_file_saved
whether input file has been written
virtual void reinitElem(const Elem *elem, const THREAD_ID tid) override
bool needSubdomainMaterialOnSide(SubdomainID subdomain_id, const THREAD_ID tid)
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 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:27
virtual bool shouldUpdateSolution()
Check to see whether the problem should update the solution.
void mooseDeprecated(Args &&... args) const
Definition: MooseBase.h:310
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 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:715
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:202
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.
MortarData _mortar_data
bool hasTimeIntegrator() const
Returns whether or not this Problem has a TimeIntegrator.
std::shared_ptr< AuxiliarySystem > _aux
The auxiliary system.
NumberVectorValue Gradient
TheWarehouse is a container for MooseObjects that allows querying/filtering over various customizeabl...
Definition: TheWarehouse.h:185
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:88
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()
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:89
bool hasPostprocessorValueByName(const PostprocessorName &name) const
Whether or not a Postprocessor value exists by a given name.
const ExecuteMooseObjectWarehouse< UserObject > & getUserObjects() const
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:33
Adaptivity _adaptivity
std::vector< VectorTag > getVectorTags(const std::set< TagID > &tag_ids) const
Definition: SubProblem.C:172
bool allowInvalidSolution() const
Whether to accept / allow an invalid solution.
virtual const SystemBase & systemBaseAuxiliary() const override
Return the auxiliary system object as a base class reference.
void 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 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 reinitNeighborFaceRef(const Elem *neighbor_elem, unsigned int neighbor_side, Real tolerance, const std::vector< Point > *const pts, const std::vector< Real > *const weights=nullptr, const THREAD_ID tid=0) override
reinitialize FE objects on a given neighbor element on a given side at a given set of reference point...
void 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:353
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
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.
virtual void prepareAssembly(const THREAD_ID tid) override
bool haveADObjects() const
Method for reading wehther we have any ad objects.
Definition: SubProblem.h:771
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
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...
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 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:34
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
std::vector< Real > VectorPostprocessorValue
Definition: MooseTypes.h:203
const FVInitialConditionWarehouse & getFVInitialConditionWarehouse() const
Return FVInitialCondition storage.
virtual void updateMortarMesh()
Adds tagged matrices.
void addDefaultMultiAppFixedPointConvergence(const InputParameters &params)
Adds the default fixed point Convergence associated with the problem.
std::set< TagID > _fe_matrix_tags
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.
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:49
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)
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:98
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.
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.
MortarData & mortarData()
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:466
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 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.
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:731
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:267
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
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.
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:33
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.
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)
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:35
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:284
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 addScalarKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
TheWarehouse & theWarehouse()
Definition: MooseApp.h:130
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
const std::size_t _num_linear_sys
The number of linear systems.
std::map< std::string, unsigned int > _subspace_dim
Dimension of the subspace spanned by the vectors with a given prefix.
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.
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 std::unordered_map< std::pair< BoundaryID, BoundaryID >, AutomaticMortarGeneration > & getMortarInterfaces(bool on_displaced) const
const ExecFlagType EXEC_SUBDOMAIN
Definition: Moose.C:50
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
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.
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:328
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.
virtual void addJacobianNeighborLowerD(const THREAD_ID tid) override
virtual void prepareNeighborShapes(unsigned int var, const THREAD_ID tid) override
MooseObjectWarehouse< Marker > _markers
FVInitialConditionWarehouse _fv_ics
void setVerboseProblem(bool verbose)
Make the problem be verbose.
virtual void setNeighborSubdomainID(const Elem *elem, unsigned int side, const THREAD_ID tid) override
virtual bool hasException()
Whether or not an exception has occurred.
CurrentResidualVectorTagsKey(const CurrentResidualVectorTagsKey &)
virtual void initialAdaptMesh()
virtual void addResidualScalar(const THREAD_ID tid=0)
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:40
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.
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:2442
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:241
MooseMesh * _displaced_mesh
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::vector< ConvergenceName > & getLinearConvergenceNames() const
Gets the linear convergence object name(s).
unsigned int THREAD_ID
Definition: MooseTypes.h:209
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.
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