www.mooseframework.org
FEProblemBase.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
39 #include "libmesh/enum_quadrature_type.h"
40 #include "libmesh/equation_systems.h"
41 
42 #include <unordered_map>
43 #include <memory>
44 
45 // Forward declarations
46 class AuxiliarySystem;
47 class DisplacedProblem;
48 class MooseMesh;
50 class NonlinearSystem;
51 class RandomInterface;
52 class RandomData;
54 class MultiMooseEnum;
56 class MaterialData;
57 class MooseEnum;
58 class Assembly;
59 class JacobianBlock;
60 class Control;
61 class MultiApp;
62 class TransientMultiApp;
64 class Indicator;
66 class Marker;
67 class Material;
68 class Transfer;
69 class XFEMInterface;
70 class SideUserObject;
71 class NodalUserObject;
72 class ElementUserObject;
75 class GeneralUserObject;
76 class Positions;
77 class Function;
78 class Distribution;
79 class Sampler;
80 class KernelBase;
81 class IntegratedBCBase;
82 class LineSearch;
83 class UserObject;
86 class Function;
88 class MortarUserObject;
89 
90 // libMesh forward declarations
91 namespace libMesh
92 {
93 class CouplingMatrix;
94 class NonlinearImplicitSystem;
95 } // namespace libMesh
96 
99 {
100  ITERATING = 0,
105  DIVERGED_FNORM_NAN = -4,
107  DIVERGED_DTOL = -9,
109 };
110 
111 // The idea with these enums is to abstract the reasons for
112 // convergence/divergence, i.e. they could be used with linear algebra
113 // packages other than PETSc. They were directly inspired by PETSc,
114 // though. This enum could also be combined with the
115 // MooseNonlinearConvergenceReason enum but there might be some
116 // confusion (?)
118 {
119  ITERATING = 0,
120  // CONVERGED_RTOL_NORMAL = 1,
121  // CONVERGED_ATOL_NORMAL = 9,
122  CONVERGED_RTOL = 2,
123  CONVERGED_ATOL = 3,
124  CONVERGED_ITS = 4,
125  // CONVERGED_CG_NEG_CURVE = 5,
126  // CONVERGED_CG_CONSTRAINED = 6,
127  // CONVERGED_STEP_LENGTH = 7,
128  // CONVERGED_HAPPY_BREAKDOWN = 8,
129  DIVERGED_NULL = -2,
130  // DIVERGED_ITS = -3,
131  // DIVERGED_DTOL = -4,
132  // DIVERGED_BREAKDOWN = -5,
133  // DIVERGED_BREAKDOWN_BICG = -6,
134  // DIVERGED_NONSYMMETRIC = -7,
135  // DIVERGED_INDEFINITE_PC = -8,
136  DIVERGED_NANORINF = -9,
137  // DIVERGED_INDEFINITE_MAT = -10
139 };
140 
145 class FEProblemBase : public SubProblem, public Restartable
146 {
147 public:
148  static InputParameters validParams();
149 
151  virtual ~FEProblemBase();
152 
153  virtual EquationSystems & es() override { return _req.set().es(); }
154  virtual MooseMesh & mesh() override { return _mesh; }
155  virtual const MooseMesh & mesh() const override { return _mesh; }
156  const MooseMesh & mesh(bool use_displaced) const override;
157 
158  void setCoordSystem(const std::vector<SubdomainName> & blocks, const MultiMooseEnum & coord_sys);
159  void setAxisymmetricCoordAxis(const MooseEnum & rz_coord_axis);
160 
167 
169 
175  void setCouplingMatrix(std::unique_ptr<CouplingMatrix> cm, const unsigned int nl_sys_num);
176 
177  // DEPRECATED METHOD
178  void setCouplingMatrix(CouplingMatrix * cm, const unsigned int nl_sys_num);
179 
180  const CouplingMatrix * couplingMatrix(const unsigned int nl_sys_num) const override;
181 
184 
185  bool
186  areCoupled(const unsigned int ivar, const unsigned int jvar, const unsigned int nl_sys_num) const;
187 
191  bool hasUOAuxStateCheck() const { return _uo_aux_state_check; }
192 
200 
207 
208  std::vector<std::pair<MooseVariableFEBase *, MooseVariableFEBase *>> &
209  couplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num);
210  std::vector<std::pair<MooseVariableFEBase *, MooseVariableFEBase *>> &
211  nonlocalCouplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num);
212 
231  checkNonlinearConvergence(std::string & msg,
232  const PetscInt it,
233  const Real xnorm,
234  const Real snorm,
235  const Real fnorm,
236  const Real rtol,
237  const Real divtol,
238  const Real stol,
239  const Real abstol,
240  const PetscInt nfuncs,
241  const PetscInt max_funcs,
242  const Real initial_residual_before_preset_bcs,
243  const Real div_threshold);
244 
246  virtual void nonlinearConvergenceSetup() {}
247 
256  virtual bool checkRelativeConvergence(const PetscInt it,
257  const Real fnorm,
258  const Real the_residual,
259  const Real rtol,
260  const Real abstol,
261  std::ostringstream & oss);
262 
263  virtual bool hasVariable(const std::string & var_name) const override;
265  virtual const MooseVariableFieldBase &
266  getVariable(const THREAD_ID tid,
267  const std::string & var_name,
269  Moose::VarFieldType expected_var_field_type =
270  Moose::VarFieldType::VAR_FIELD_ANY) const override;
272  const std::string & var_name) override;
273  virtual MooseVariable & getStandardVariable(const THREAD_ID tid,
274  const std::string & var_name) override;
275  virtual VectorMooseVariable & getVectorVariable(const THREAD_ID tid,
276  const std::string & var_name) override;
277  virtual ArrayMooseVariable & getArrayVariable(const THREAD_ID tid,
278  const std::string & var_name) override;
279 
280  virtual bool hasScalarVariable(const std::string & var_name) const override;
281  virtual MooseVariableScalar & getScalarVariable(const THREAD_ID tid,
282  const std::string & var_name) override;
283  virtual System & getSystem(const std::string & var_name) override;
284 
291  virtual void setActiveElementalMooseVariables(const std::set<MooseVariableFEBase *> & moose_vars,
292  const THREAD_ID tid) override;
293 
301  virtual void clearActiveElementalMooseVariables(const THREAD_ID tid) override;
302 
303  virtual void clearActiveFEVariableCoupleableMatrixTags(const THREAD_ID tid) override;
304 
305  virtual void clearActiveFEVariableCoupleableVectorTags(const THREAD_ID tid) override;
306 
307  virtual void setActiveFEVariableCoupleableVectorTags(std::set<TagID> & vtags,
308  const THREAD_ID tid) override;
309 
310  virtual void setActiveFEVariableCoupleableMatrixTags(std::set<TagID> & mtags,
311  const THREAD_ID tid) override;
312 
313  virtual void clearActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid) override;
314 
315  virtual void clearActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid) override;
316 
317  virtual void setActiveScalarVariableCoupleableVectorTags(std::set<TagID> & vtags,
318  const THREAD_ID tid) override;
319 
320  virtual void setActiveScalarVariableCoupleableMatrixTags(std::set<TagID> & mtags,
321  const THREAD_ID tid) override;
322 
323  virtual void createQRules(QuadratureType type,
324  Order order,
325  Order volume_order = INVALID_ORDER,
326  Order face_order = INVALID_ORDER,
328  bool allow_negative_qweights = true);
329 
337  void bumpVolumeQRuleOrder(Order order, SubdomainID block);
338 
339  void bumpAllQRuleOrder(Order order, SubdomainID block);
340 
344  unsigned int getMaxQps() const;
345 
349  Order getMaxScalarOrder() const;
350 
354  void checkNonlocalCoupling();
356  void setVariableAllDoFMap(const std::vector<const MooseVariableFEBase *> & moose_vars);
357 
358  const std::vector<const MooseVariableFEBase *> &
360  {
361  return _uo_jacobian_moose_vars[tid];
362  }
363 
364  Assembly & assembly(const THREAD_ID tid, const unsigned int nl_sys_num) override;
365  const Assembly & assembly(const THREAD_ID tid, const unsigned int nl_sys_num) const override;
366 
370  virtual std::vector<VariableName> getVariableNames();
371 
372  void initialSetup() override;
374  void timestepSetup() override;
375  void customSetup(const ExecFlagType & exec_type) override;
376  void residualSetup() override;
377  void jacobianSetup() override;
378 
379  virtual void prepare(const Elem * elem, const THREAD_ID tid) override;
380  virtual void prepareFace(const Elem * elem, const THREAD_ID tid) override;
381  virtual void prepare(const Elem * elem,
382  unsigned int ivar,
383  unsigned int jvar,
384  const std::vector<dof_id_type> & dof_indices,
385  const THREAD_ID tid) override;
386 
387  virtual void setCurrentSubdomainID(const Elem * elem, const THREAD_ID tid) override;
388  virtual void
389  setNeighborSubdomainID(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
390  virtual void setNeighborSubdomainID(const Elem * elem, const THREAD_ID tid);
391  virtual void prepareAssembly(const THREAD_ID tid) override;
392 
393  virtual void addGhostedElem(dof_id_type elem_id) override;
394  virtual void addGhostedBoundary(BoundaryID boundary_id) override;
395  virtual void ghostGhostedBoundaries() override;
396 
397  virtual void sizeZeroes(unsigned int size, const THREAD_ID tid);
398  virtual bool reinitDirac(const Elem * elem, const THREAD_ID tid) override;
399 
400  virtual void reinitElem(const Elem * elem, const THREAD_ID tid) override;
401  virtual void reinitElemPhys(const Elem * elem,
402  const std::vector<Point> & phys_points_in_elem,
403  const THREAD_ID tid) override;
404  virtual void reinitElemFace(const Elem * elem,
405  unsigned int side,
406  BoundaryID bnd_id,
407  const THREAD_ID tid) override;
408  virtual void reinitLowerDElem(const Elem * lower_d_elem,
409  const THREAD_ID tid,
410  const std::vector<Point> * const pts = nullptr,
411  const std::vector<Real> * const weights = nullptr) override;
412  virtual void reinitNode(const Node * node, const THREAD_ID tid) override;
413  virtual void reinitNodeFace(const Node * node, BoundaryID bnd_id, const THREAD_ID tid) override;
414  virtual void reinitNodes(const std::vector<dof_id_type> & nodes, const THREAD_ID tid) override;
415  virtual void reinitNodesNeighbor(const std::vector<dof_id_type> & nodes,
416  const THREAD_ID tid) override;
417  virtual void reinitNeighbor(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
418  virtual void reinitNeighborPhys(const Elem * neighbor,
419  unsigned int neighbor_side,
420  const std::vector<Point> & physical_points,
421  const THREAD_ID tid) override;
422  virtual void reinitNeighborPhys(const Elem * neighbor,
423  const std::vector<Point> & physical_points,
424  const THREAD_ID tid) override;
425  virtual void
426  reinitElemNeighborAndLowerD(const Elem * elem, unsigned int side, const THREAD_ID tid) override;
427  virtual void reinitScalars(const THREAD_ID tid,
428  bool reinit_for_derivative_reordering = false) override;
429  virtual void reinitOffDiagScalars(const THREAD_ID tid) override;
430 
432  virtual void getDiracElements(std::set<const Elem *> & elems) override;
433  virtual void clearDiracInfo() override;
434 
435  virtual void subdomainSetup(SubdomainID subdomain, const THREAD_ID tid);
436  virtual void neighborSubdomainSetup(SubdomainID subdomain, const THREAD_ID tid);
437 
438  virtual void newAssemblyArray(std::vector<std::shared_ptr<NonlinearSystemBase>> & nl);
439  virtual void initNullSpaceVectors(const InputParameters & parameters,
440  std::vector<std::shared_ptr<NonlinearSystemBase>> & nl);
441 
442  virtual void init() override;
443  virtual void solve(const unsigned int nl_sys_num);
444 
446 
465 
474  virtual void setException(const std::string & message);
475 
479  virtual bool hasException() { return _has_exception; }
480 
497  virtual void checkExceptionAndStopSolve(bool print_message = true);
498 
499  virtual bool nlConverged(const unsigned int nl_sys_num) override;
500  virtual unsigned int nNonlinearIterations(const unsigned int nl_sys_num) const override;
501  virtual unsigned int nLinearIterations(const unsigned int nl_sys_num) const override;
502  virtual Real finalNonlinearResidual(const unsigned int nl_sys_num) const override;
503  virtual bool computingInitialResidual(const unsigned int nl_sys_num) const override;
504 
508  virtual std::string solverTypeString() { return Moose::stringify(solverParams()._type); }
509 
513  virtual bool startedInitialSetup() { return _started_initial_setup; }
514 
515  virtual void onTimestepBegin() override;
516  virtual void onTimestepEnd() override;
517 
518  virtual Real & time() const { return _time; }
519  virtual Real & timeOld() const { return _time_old; }
520  virtual int & timeStep() const { return _t_step; }
521  virtual Real & dt() const { return _dt; }
522  virtual Real & dtOld() const { return _dt_old; }
526  Real getTimeFromStateArg(const Moose::StateArg & state) const;
527 
528  virtual void transient(bool trans) { _transient = trans; }
529  virtual bool isTransient() const override { return _transient; }
530 
531  virtual void addTimeIntegrator(const std::string & type,
532  const std::string & name,
534  virtual void
535  addPredictor(const std::string & type, const std::string & name, InputParameters & parameters);
536 
537  virtual void copySolutionsBackwards();
538 
543  virtual void advanceState();
544 
545  virtual void restoreSolutions();
546 
550  virtual void saveOldSolutions();
551 
555  virtual void restoreOldSolutions();
556 
563  virtual void outputStep(ExecFlagType type);
564 
568  virtual void postExecute();
569 
571 
577  void allowOutput(bool state);
578  template <typename T>
579  void allowOutput(bool state);
581 
590  void forceOutput();
591 
597 
602 
606  void logAdd(const std::string & system, const std::string & name, const std::string & type) const;
607 
608  // Function /////
609  virtual void
610  addFunction(const std::string & type, const std::string & name, InputParameters & parameters);
611  virtual bool hasFunction(const std::string & name, const THREAD_ID tid = 0);
612  virtual Function & getFunction(const std::string & name, const THREAD_ID tid = 0);
613 
615  void
616  addMeshDivision(const std::string & type, const std::string & name, InputParameters & params);
618  MeshDivision & getMeshDivision(const std::string & name, const THREAD_ID tid = 0) const;
619 
623  virtual void addLineSearch(const InputParameters & /*parameters*/)
624  {
625  mooseError("Line search not implemented for this problem type yet.");
626  }
627 
631  virtual void lineSearch();
632 
636  LineSearch * getLineSearch() override { return _line_search.get(); }
637 
641  virtual void
642  addDistribution(const std::string & type, const std::string & name, InputParameters & parameters);
643  virtual Distribution & getDistribution(const std::string & name);
644 
648  virtual void
649  addSampler(const std::string & type, const std::string & name, InputParameters & parameters);
650  virtual Sampler & getSampler(const std::string & name, const THREAD_ID tid = 0);
651 
652  // NL /////
653  NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num);
654  const NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num) const;
655  void setCurrentNonlinearSystem(const unsigned int nl_sys_num);
658 
659  virtual const SystemBase & systemBaseNonlinear(const unsigned int sys_num) const override;
660  virtual SystemBase & systemBaseNonlinear(const unsigned int sys_num) override;
661 
662  virtual const SystemBase & systemBaseAuxiliary() const override;
663  virtual SystemBase & systemBaseAuxiliary() override;
664 
665  virtual NonlinearSystem & getNonlinearSystem(const unsigned int sys_num);
666 
673  virtual void
674  addVariable(const std::string & var_type, const std::string & var_name, InputParameters & params);
675 
676  virtual void addKernel(const std::string & kernel_name,
677  const std::string & name,
679  virtual void addNodalKernel(const std::string & kernel_name,
680  const std::string & name,
682  virtual void addScalarKernel(const std::string & kernel_name,
683  const std::string & name,
685  virtual void addBoundaryCondition(const std::string & bc_name,
686  const std::string & name,
688  virtual void
689  addConstraint(const std::string & c_name, const std::string & name, InputParameters & parameters);
690 
692  {
693  parameters.set<FEProblemBase *>("_fe_problem_base") = this;
694  }
695 
696  // Aux /////
697 
704  virtual void addAuxVariable(const std::string & var_type,
705  const std::string & var_name,
706  InputParameters & params);
707 
708  virtual void addAuxVariable(const std::string & var_name,
709  const FEType & type,
710  const std::set<SubdomainID> * const active_subdomains = NULL);
711  virtual void addAuxArrayVariable(const std::string & var_name,
712  const FEType & type,
713  unsigned int components,
714  const std::set<SubdomainID> * const active_subdomains = NULL);
715  virtual void addAuxScalarVariable(const std::string & var_name,
716  Order order,
717  Real scale_factor = 1.,
718  const std::set<SubdomainID> * const active_subdomains = NULL);
719  virtual void addAuxKernel(const std::string & kernel_name,
720  const std::string & name,
722  virtual void addAuxScalarKernel(const std::string & kernel_name,
723  const std::string & name,
725 
727 
728  // Dirac /////
729  virtual void addDiracKernel(const std::string & kernel_name,
730  const std::string & name,
732 
733  // DG /////
734  virtual void addDGKernel(const std::string & kernel_name,
735  const std::string & name,
737 
738  virtual void addFVKernel(const std::string & kernel_name,
739  const std::string & name,
741 
742  virtual void
743  addFVBC(const std::string & fv_bc_name, const std::string & name, InputParameters & parameters);
744  virtual void addFVInterfaceKernel(const std::string & fv_ik_name,
745  const std::string & name,
747 
748  // Interface /////
749  virtual void addInterfaceKernel(const std::string & kernel_name,
750  const std::string & name,
752 
753  // IC /////
754  virtual void addInitialCondition(const std::string & ic_name,
755  const std::string & name,
763  virtual void addFVInitialCondition(const std::string & ic_name,
764  const std::string & name,
766 
767  void projectSolution();
768 
775  ConstBndNodeRange & bnd_node_range);
776 
777  // Materials /////
778  virtual void addMaterial(const std::string & material_name,
779  const std::string & name,
781  virtual void addMaterialHelper(std::vector<MaterialWarehouse *> warehouse,
782  const std::string & material_name,
783  const std::string & name,
785  virtual void addInterfaceMaterial(const std::string & material_name,
786  const std::string & name,
788  void addFunctorMaterial(const std::string & functor_material_name,
789  const std::string & name,
791 
803  void prepareMaterials(const std::unordered_set<unsigned int> & consumer_needed_mat_props,
804  const SubdomainID blk_id,
805  const THREAD_ID tid);
806 
807  void reinitMaterials(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful = true);
808 
819  void reinitMaterialsFace(SubdomainID blk_id,
820  const THREAD_ID tid,
821  bool swap_stateful = true,
822  const std::deque<MaterialBase *> * reinit_mats = nullptr);
823 
835  const THREAD_ID tid,
836  bool swap_stateful = true,
837  const std::deque<MaterialBase *> * reinit_mats = nullptr);
838 
849  void reinitMaterialsBoundary(BoundaryID boundary_id,
850  const THREAD_ID tid,
851  bool swap_stateful = true,
852  const std::deque<MaterialBase *> * reinit_mats = nullptr);
853 
854  void
855  reinitMaterialsInterface(BoundaryID boundary_id, const THREAD_ID tid, bool swap_stateful = true);
856 
857  /*
858  * Swap back underlying data storing stateful material properties
859  */
860  virtual void swapBackMaterials(const THREAD_ID tid);
861  virtual void swapBackMaterialsFace(const THREAD_ID tid);
862  virtual void swapBackMaterialsNeighbor(const THREAD_ID tid);
863 
870  void setActiveMaterialProperties(const std::unordered_set<unsigned int> & mat_prop_ids,
871  const THREAD_ID tid);
872 
881  bool hasActiveMaterialProperties(const THREAD_ID tid) const;
882 
889 
901  template <typename T>
902  std::vector<std::shared_ptr<T>> addObject(const std::string & type,
903  const std::string & name,
905  const bool threaded = true,
906  const std::string & var_param_name = "variable");
907 
908  // Postprocessors /////
909  virtual void addPostprocessor(const std::string & pp_name,
910  const std::string & name,
912 
913  // VectorPostprocessors /////
914  virtual void addVectorPostprocessor(const std::string & pp_name,
915  const std::string & name,
917 
926  virtual void
927  addReporter(const std::string & type, const std::string & name, InputParameters & parameters);
928 
936  const ReporterData & getReporterData() const { return _reporter_data; }
937 
944 
945  // UserObjects /////
946  virtual void addUserObject(const std::string & user_object_name,
947  const std::string & name,
949 
950  // TODO: delete this function after apps have been updated to not call it
952  {
954  "This function is deprecated, use theWarehouse().query() to construct a query instead");
955  return _all_user_objects;
956  }
957 
963  template <class T>
964  T & getUserObject(const std::string & name, unsigned int tid = 0) const
965  {
966  std::vector<T *> objs;
967  theWarehouse()
968  .query()
969  .condition<AttribSystem>("UserObject")
970  .condition<AttribThread>(tid)
971  .condition<AttribName>(name)
972  .queryInto(objs);
973  if (objs.empty())
974  mooseError("Unable to find user object with name '" + name + "'");
975  return *(objs[0]);
976  }
983  const UserObject & getUserObjectBase(const std::string & name, const THREAD_ID tid = 0) const;
984 
990  const Positions & getPositionsObject(const std::string & name) const;
991 
997  bool hasUserObject(const std::string & name) const;
998 
1007  bool hasPostprocessorValueByName(const PostprocessorName & name) const;
1008 
1019  const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName & name,
1020  std::size_t t_index = 0) const;
1021 
1036  void setPostprocessorValueByName(const PostprocessorName & name,
1037  const PostprocessorValue & value,
1038  std::size_t t_index = 0);
1039 
1043  bool hasPostprocessor(const std::string & name) const;
1044 
1055  const VectorPostprocessorValue &
1056  getVectorPostprocessorValueByName(const std::string & object_name,
1057  const std::string & vector_name,
1058  std::size_t t_index = 0) const;
1059 
1067  void setVectorPostprocessorValueByName(const std::string & object_name,
1068  const std::string & vector_name,
1069  const VectorPostprocessorValue & value,
1070  std::size_t t_index = 0);
1071 
1080  const VectorPostprocessor & getVectorPostprocessorObjectByName(const std::string & object_name,
1081  const THREAD_ID tid = 0) const;
1082 
1084 
1087  bool hasMultiApps() const { return _multi_apps.hasActiveObjects(); }
1088  bool hasMultiApps(ExecFlagType type) const;
1089  bool hasMultiApp(const std::string & name) const;
1091 
1092  // Dampers /////
1093  virtual void addDamper(const std::string & damper_name,
1094  const std::string & name,
1096  void setupDampers();
1097 
1101  bool hasDampers() { return _has_dampers; }
1102 
1103  // Indicators /////
1104  virtual void addIndicator(const std::string & indicator_name,
1105  const std::string & name,
1107 
1108  // Markers //////
1109  virtual void addMarker(const std::string & marker_name,
1110  const std::string & name,
1112 
1116  virtual void addMultiApp(const std::string & multi_app_name,
1117  const std::string & name,
1119 
1123  std::shared_ptr<MultiApp> getMultiApp(const std::string & multi_app_name) const;
1124 
1128  std::vector<std::shared_ptr<Transfer>> getTransfers(ExecFlagType type,
1129  Transfer::DIRECTION direction) const;
1130  std::vector<std::shared_ptr<Transfer>> getTransfers(Transfer::DIRECTION direction) const;
1131 
1137 
1144 
1148  bool execMultiApps(ExecFlagType type, bool auto_advance = true);
1149 
1150  void finalizeMultiApps();
1151 
1156 
1162  {
1163  mooseDeprecated("Deprecated method; use finishMultiAppStep and/or incrementMultiAppTStep "
1164  "depending on your purpose");
1166  }
1167 
1172  void finishMultiAppStep(ExecFlagType type, bool recurse_through_multiapp_levels = false);
1173 
1178 
1183  void restoreMultiApps(ExecFlagType type, bool force = false);
1184 
1189 
1193  virtual void addTransfer(const std::string & transfer_name,
1194  const std::string & name,
1196 
1204 
1211  virtual Real computeResidualL2Norm();
1212 
1216  virtual void computeResidualSys(NonlinearImplicitSystem & sys,
1217  const NumericVector<Number> & soln,
1218  NumericVector<Number> & residual);
1223  void computeResidual(NonlinearImplicitSystem & sys,
1224  const NumericVector<Number> & soln,
1225  NumericVector<Number> & residual);
1226 
1230  virtual void computeResidual(const NumericVector<Number> & soln,
1231  NumericVector<Number> & residual,
1232  const unsigned int nl_sys_num);
1233 
1238  NumericVector<Number> & residual,
1239  SparseMatrix<Number> & jacobian);
1240 
1244  virtual void computeResidualTag(const NumericVector<Number> & soln,
1245  NumericVector<Number> & residual,
1246  TagID tag);
1250  virtual void computeResidualType(const NumericVector<Number> & soln,
1251  NumericVector<Number> & residual,
1252  TagID tag);
1253 
1258  virtual void computeResidualInternal(const NumericVector<Number> & soln,
1259  NumericVector<Number> & residual,
1260  const std::set<TagID> & tags);
1264  virtual void computeResidualTags(const std::set<TagID> & tags);
1265 
1269  virtual void computeJacobianSys(NonlinearImplicitSystem & sys,
1270  const NumericVector<Number> & soln,
1271  SparseMatrix<Number> & jacobian);
1275  virtual void computeJacobian(const NumericVector<Number> & soln,
1276  SparseMatrix<Number> & jacobian,
1277  const unsigned int nl_sys_num);
1278 
1282  virtual void computeJacobianTag(const NumericVector<Number> & soln,
1283  SparseMatrix<Number> & jacobian,
1284  TagID tag);
1285 
1289  virtual void computeJacobianInternal(const NumericVector<Number> & soln,
1290  SparseMatrix<Number> & jacobian,
1291  const std::set<TagID> & tags);
1292 
1296  virtual void computeJacobianTags(const std::set<TagID> & tags);
1297 
1306  virtual void computeJacobianBlocks(std::vector<JacobianBlock *> & blocks,
1307  const unsigned int nl_sys_num);
1308 
1322  virtual void computeJacobianBlock(SparseMatrix<Number> & jacobian,
1323  libMesh::System & precond_system,
1324  unsigned int ivar,
1325  unsigned int jvar);
1326 
1327  virtual Real computeDamping(const NumericVector<Number> & soln,
1328  const NumericVector<Number> & update);
1329 
1334  virtual bool shouldUpdateSolution();
1335 
1342  virtual bool updateSolution(NumericVector<Number> & vec_solution,
1343  NumericVector<Number> & ghosted_solution);
1344 
1349  virtual void predictorCleanup(NumericVector<Number> & ghosted_solution);
1350 
1351  virtual void computeBounds(NonlinearImplicitSystem & sys,
1352  NumericVector<Number> & lower,
1353  NumericVector<Number> & upper);
1354  virtual void computeNearNullSpace(NonlinearImplicitSystem & sys,
1355  std::vector<NumericVector<Number> *> & sp);
1356  virtual void computeNullSpace(NonlinearImplicitSystem & sys,
1357  std::vector<NumericVector<Number> *> & sp);
1358  virtual void computeTransposeNullSpace(NonlinearImplicitSystem & sys,
1359  std::vector<NumericVector<Number> *> & sp);
1360  virtual void computePostCheck(NonlinearImplicitSystem & sys,
1361  const NumericVector<Number> & old_soln,
1362  NumericVector<Number> & search_direction,
1363  NumericVector<Number> & new_soln,
1364  bool & changed_search_direction,
1365  bool & changed_new_soln);
1366 
1367  virtual void computeIndicatorsAndMarkers();
1368  virtual void computeIndicators();
1369  virtual void computeMarkers();
1370 
1371  virtual void addResidual(const THREAD_ID tid) override;
1372  virtual void addResidualNeighbor(const THREAD_ID tid) override;
1373  virtual void addResidualLower(const THREAD_ID tid) override;
1374  virtual void addResidualScalar(const THREAD_ID tid = 0);
1375 
1376  virtual void cacheResidual(const THREAD_ID tid) override;
1377  virtual void cacheResidualNeighbor(const THREAD_ID tid) override;
1378  virtual void addCachedResidual(const THREAD_ID tid) override;
1379 
1387  virtual void addCachedResidualDirectly(NumericVector<Number> & residual, const THREAD_ID tid);
1388 
1389  virtual void setResidual(NumericVector<Number> & residual, const THREAD_ID tid) override;
1390  virtual void setResidualNeighbor(NumericVector<Number> & residual, const THREAD_ID tid) override;
1391 
1392  virtual void addJacobian(const THREAD_ID tid) override;
1393  virtual void addJacobianNeighbor(const THREAD_ID tid) override;
1394  virtual void addJacobianNeighborLowerD(const THREAD_ID tid) override;
1395  virtual void addJacobianLowerD(const THREAD_ID tid) override;
1396  virtual void addJacobianBlockTags(SparseMatrix<Number> & jacobian,
1397  unsigned int ivar,
1398  unsigned int jvar,
1399  const DofMap & dof_map,
1400  std::vector<dof_id_type> & dof_indices,
1401  const std::set<TagID> & tags,
1402  const THREAD_ID tid);
1403  virtual void addJacobianNeighbor(SparseMatrix<Number> & jacobian,
1404  unsigned int ivar,
1405  unsigned int jvar,
1406  const DofMap & dof_map,
1407  std::vector<dof_id_type> & dof_indices,
1408  std::vector<dof_id_type> & neighbor_dof_indices,
1409  const std::set<TagID> & tags,
1410  const THREAD_ID tid) override;
1411  virtual void addJacobianScalar(const THREAD_ID tid = 0);
1412  virtual void addJacobianOffDiagScalar(unsigned int ivar, const THREAD_ID tid = 0);
1413 
1414  virtual void cacheJacobian(const THREAD_ID tid) override;
1415  virtual void cacheJacobianNeighbor(const THREAD_ID tid) override;
1416  virtual void addCachedJacobian(const THREAD_ID tid) override;
1417 
1418  virtual void prepareShapes(unsigned int var, const THREAD_ID tid) override;
1419  virtual void prepareFaceShapes(unsigned int var, const THREAD_ID tid) override;
1420  virtual void prepareNeighborShapes(unsigned int var, const THREAD_ID tid) override;
1421 
1422  // Displaced problem /////
1423  virtual void addDisplacedProblem(std::shared_ptr<DisplacedProblem> displaced_problem);
1424  virtual std::shared_ptr<const DisplacedProblem> getDisplacedProblem() const
1425  {
1426  return _displaced_problem;
1427  }
1428  virtual std::shared_ptr<DisplacedProblem> getDisplacedProblem() { return _displaced_problem; }
1429 
1430  virtual void updateGeomSearch(
1432  virtual void updateMortarMesh();
1433 
1434  void createMortarInterface(
1435  const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
1436  const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
1437  bool on_displaced,
1438  bool periodic,
1439  const bool debug,
1440  const bool correct_edge_dropping,
1441  const Real minimum_projection_angle);
1442 
1449  getMortarInterface(const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
1450  const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
1451  bool on_displaced) const;
1452 
1454  getMortarInterface(const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
1455  const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
1456  bool on_displaced);
1458 
1459  const std::unordered_map<std::pair<BoundaryID, BoundaryID>, AutomaticMortarGeneration> &
1460  getMortarInterfaces(bool on_displaced) const;
1461 
1462  virtual void possiblyRebuildGeomSearchPatches();
1463 
1465 
1470  void setRestartFile(const std::string & file_name);
1471 
1476  {
1477  return _material_prop_registry;
1478  }
1479 
1488  {
1489  return _neighbor_material_props;
1490  }
1492 
1499  {
1501  }
1504 
1509 
1514 
1519 
1523  const SolverParams & solverParams() const;
1524 
1525 #ifdef LIBMESH_ENABLE_AMR
1526  // Adaptivity /////
1528  virtual void initialAdaptMesh();
1529 
1533  virtual bool adaptMesh();
1534 
1538  unsigned int getNumCyclesCompleted() { return _cycles_completed; }
1539 
1543  bool hasInitialAdaptivity() const { return _adaptivity.getInitialSteps() > 0; }
1544 #else
1545 
1548  bool hasInitialAdaptivity() const { return false; }
1549 #endif // LIBMESH_ENABLE_AMR
1550 
1552  void initXFEM(std::shared_ptr<XFEMInterface> xfem);
1553 
1555  std::shared_ptr<XFEMInterface> getXFEM() { return _xfem; }
1556 
1558  bool haveXFEM() { return _xfem != nullptr; }
1559 
1561  virtual bool updateMeshXFEM();
1562 
1566  virtual void meshChanged() override;
1567 
1573 
1579  void initElementStatefulProps(const ConstElemRange & elem_range, const bool threaded);
1580 
1585  virtual void checkProblemIntegrity();
1586 
1587  void registerRandomInterface(RandomInterface & random_interface, const std::string & name);
1588 
1593  void setConstJacobian(bool state) { _const_jacobian = state; }
1594 
1600 
1608 
1613 
1615  void setVerboseProblem(bool verbose);
1616 
1620  bool verboseMultiApps() const { return _verbose_multiapps; }
1621 
1626 
1628 
1645  bool needBoundaryMaterialOnSide(BoundaryID bnd_id, const THREAD_ID tid);
1646  bool needInterfaceMaterialOnSide(BoundaryID bnd_id, const THREAD_ID tid);
1647  bool needSubdomainMaterialOnSide(SubdomainID subdomain_id, const THREAD_ID tid);
1649 
1654  unsigned int subspaceDim(const std::string & prefix) const
1655  {
1656  if (_subspace_dim.count(prefix))
1657  return _subspace_dim.find(prefix)->second;
1658  else
1659  return 0;
1660  }
1661 
1662  /*
1663  * Return a reference to the material warehouse of *all* Material objects.
1664  */
1666 
1667  /*
1668  * Return a reference to the material warehouse of Material objects to be computed.
1669  */
1673 
1681  std::shared_ptr<MaterialBase> getMaterial(std::string name,
1683  const THREAD_ID tid = 0,
1684  bool no_warn = false);
1685 
1686  /*
1687  * @return The MaterialData for the type \p type for thread \p tid
1688  */
1690 
1696  {
1698  }
1699 
1701  {
1703  }
1704 
1709 
1714 
1716 
1718 
1720  bool hasTimeIntegrator() const { return _has_time_integrator; }
1721 
1723 
1729  const ExecFlagType & getCurrentExecuteOnFlag() const;
1730  void setCurrentExecuteOnFlag(const ExecFlagType &);
1732 
1736  virtual void execute(const ExecFlagType & exec_type);
1737  virtual void executeAllObjects(const ExecFlagType & exec_type);
1738 
1739  virtual Executor & getExecutor(const std::string & name) { return _app.getExecutor(name); }
1740 
1744  virtual void computeUserObjects(const ExecFlagType & type, const Moose::AuxGroup & group);
1745 
1749  virtual void computeUserObjectByName(const ExecFlagType & type,
1750  const Moose::AuxGroup & group,
1751  const std::string & name);
1752 
1756  virtual void computeAuxiliaryKernels(const ExecFlagType & type);
1757 
1761  void needsPreviousNewtonIteration(bool state);
1762 
1767  bool needsPreviousNewtonIteration() const;
1768 
1770 
1773  std::vector<Real> _real_zero;
1774  std::vector<VariableValue> _scalar_zero;
1775  std::vector<VariableValue> _zero;
1776  std::vector<VariablePhiValue> _phi_zero;
1777  std::vector<MooseArray<ADReal>> _ad_zero;
1778  std::vector<VariableGradient> _grad_zero;
1779  std::vector<MooseArray<ADRealVectorValue>> _ad_grad_zero;
1780  std::vector<VariablePhiGradient> _grad_phi_zero;
1781  std::vector<VariableSecond> _second_zero;
1782  std::vector<MooseArray<ADRealTensorValue>> _ad_second_zero;
1783  std::vector<VariablePhiSecond> _second_phi_zero;
1784  std::vector<Point> _point_zero;
1785  std::vector<VectorVariableValue> _vector_zero;
1786  std::vector<VectorVariableCurl> _vector_curl_zero;
1788 
1793 
1797  void executeControls(const ExecFlagType & exec_type);
1798 
1802  void executeSamplers(const ExecFlagType & exec_type);
1803 
1807  virtual void updateActiveObjects();
1808 
1815 
1817 
1821  bool hasJacobian() const;
1822 
1827  bool constJacobian() const;
1828 
1832  void addOutput(const std::string &, const std::string &, InputParameters &);
1833 
1834  inline TheWarehouse & theWarehouse() const { return _app.theWarehouse(); }
1835 
1839  void setSNESMFReuseBase(bool reuse, bool set_by_user)
1840  {
1841  _snesmf_reuse_base = reuse, _snesmf_reuse_base_set_by_user = set_by_user;
1842  }
1843 
1848 
1852  void skipExceptionCheck(bool skip_exception_check)
1853  {
1854  _skip_exception_check = skip_exception_check;
1855  }
1856 
1861 
1866 
1867 #if !PETSC_RELEASE_LESS_THAN(3, 12, 0)
1868  PetscOptions & petscOptionsDatabase() { return _petsc_option_data_base; }
1869 #endif
1870 
1872  virtual void setUDotRequested(const bool u_dot_requested) { _u_dot_requested = u_dot_requested; }
1873 
1875  virtual void setUDotDotRequested(const bool u_dotdot_requested)
1876  {
1877  _u_dotdot_requested = u_dotdot_requested;
1878  }
1879 
1881  virtual void setUDotOldRequested(const bool u_dot_old_requested)
1882  {
1883  _u_dot_old_requested = u_dot_old_requested;
1884  }
1885 
1887  virtual void setUDotDotOldRequested(const bool u_dotdot_old_requested)
1888  {
1889  _u_dotdot_old_requested = u_dotdot_old_requested;
1890  }
1891 
1893  virtual bool uDotRequested() { return _u_dot_requested; }
1894 
1896  virtual bool uDotDotRequested() { return _u_dotdot_requested; }
1897 
1899  virtual bool uDotOldRequested()
1900  {
1902  mooseError("FEProblemBase: When requesting old time derivative of solution, current time "
1903  "derivative of solution should also be stored. Please set `u_dot_requested` to "
1904  "true using setUDotRequested.");
1905 
1906  return _u_dot_old_requested;
1907  }
1908 
1910  virtual bool uDotDotOldRequested()
1911  {
1913  mooseError("FEProblemBase: When requesting old second time derivative of solution, current "
1914  "second time derivation of solution should also be stored. Please set "
1915  "`u_dotdot_requested` to true using setUDotDotRequested.");
1916  return _u_dotdot_old_requested;
1917  }
1918 
1920  void haveADObjects(bool have_ad_objects) override;
1921 
1922  // Whether or not we should solve this system
1923  bool shouldSolve() const { return _solve; }
1924 
1928  const MortarData & mortarData() const { return _mortar_data; }
1930 
1935 
1939  virtual bool hasMortarCoupling() const { return _has_mortar; }
1940 
1942  void computingNonlinearResid(bool computing_nonlinear_residual) final;
1943 
1945  void setCurrentlyComputingResidual(bool currently_computing_residual) final;
1946 
1950  void numGridSteps(unsigned int num_grid_steps) { _num_grid_steps = num_grid_steps; }
1951 
1956  void uniformRefine();
1957 
1959  void automaticScaling(bool automatic_scaling) override;
1960 
1962 
1965  template <typename T>
1966  static void objectSetupHelper(const std::vector<T *> & objects, const ExecFlagType & exec_flag);
1967  template <typename T>
1968  static void objectExecuteHelper(const std::vector<T *> & objects);
1970 
1977  virtual void reinitElemFaceRef(const Elem * elem,
1978  unsigned int side,
1979  BoundaryID bnd_id,
1980  Real tolerance,
1981  const std::vector<Point> * const pts,
1982  const std::vector<Real> * const weights = nullptr,
1983  const THREAD_ID tid = 0) override;
1984 
1991  virtual void reinitNeighborFaceRef(const Elem * neighbor_elem,
1992  unsigned int neighbor_side,
1993  BoundaryID bnd_id,
1994  Real tolerance,
1995  const std::vector<Point> * const pts,
1996  const std::vector<Real> * const weights = nullptr,
1997  const THREAD_ID tid = 0) override;
1998 
2003 
2008  void fvBCsIntegrityCheck(bool fv_bcs_integrity_check);
2009 
2018  void getFVMatsAndDependencies(SubdomainID block_id,
2019  std::vector<std::shared_ptr<MaterialBase>> & face_materials,
2020  std::vector<std::shared_ptr<MaterialBase>> & neighbor_materials,
2021  std::set<MooseVariableFieldBase *> & variables,
2022  const THREAD_ID tid);
2023 
2030  void resizeMaterialData(Moose::MaterialDataType data_type, unsigned int nqp, const THREAD_ID tid);
2031 
2032  bool haveDisplaced() const override final { return _displaced_problem.get(); }
2033 
2035  void setMaxNLPingPong(const unsigned int n_max_nl_pingpong)
2036  {
2037  _n_max_nl_pingpong = n_max_nl_pingpong;
2038  }
2039 
2041  void setNonlinearForcedIterations(const unsigned int nl_forced_its)
2042  {
2043  _nl_forced_its = nl_forced_its;
2044  }
2045 
2047  unsigned int getNonlinearForcedIterations() const { return _nl_forced_its; }
2048 
2050  void setNonlinearAbsoluteDivergenceTolerance(const Real nl_abs_div_tol)
2051  {
2052  _nl_abs_div_tol = nl_abs_div_tol;
2053  }
2054 
2058  void computingScalingJacobian(bool computing_scaling_jacobian)
2059  {
2060  _computing_scaling_jacobian = computing_scaling_jacobian;
2061  }
2062 
2063  bool computingScalingJacobian() const override final { return _computing_scaling_jacobian; }
2064 
2068  void computingScalingResidual(bool computing_scaling_residual)
2069  {
2070  _computing_scaling_residual = computing_scaling_residual;
2071  }
2072 
2076  bool computingScalingResidual() const override final { return _computing_scaling_residual; }
2077 
2083 
2084  virtual std::size_t numNonlinearSystems() const override { return _num_nl_sys; }
2085  virtual unsigned int currentNlSysNum() const override;
2086  virtual unsigned int nlSysNum(const NonlinearSystemName & nl_sys_name) const override;
2087 
2092  {
2094  }
2095 
2100 
2101  /*
2102  * Set the status of loop order of execution printing
2103  * @param print_exec set of execution flags to print on
2104  */
2105  void setExecutionPrinting(const ExecFlagEnum & print_exec) { _print_execution_on = print_exec; }
2106 
2110  bool shouldPrintExecution(const THREAD_ID tid) const;
2115  void reinitMortarUserObjects(BoundaryID primary_boundary_id,
2116  BoundaryID secondary_boundary_id,
2117  bool displaced);
2118 
2119  virtual const std::vector<VectorTag> & currentResidualVectorTags() const override;
2120 
2126  {
2127  friend class CrankNicolson;
2128  friend class FEProblemBase;
2131  };
2132 
2136  void setCurrentResidualVectorTags(const std::set<TagID> & vector_tags);
2137 
2142 
2147 
2149  virtual void doingPRefinement(bool doing_p_refinement,
2150  const MultiMooseEnum & disable_p_refinement_for_families) override;
2151 
2152  virtual void needFV() override { _have_fv = true; }
2153  virtual bool haveFV() const override { return _have_fv; }
2154 
2155  virtual bool hasNonlocalCoupling() const override { return _has_nonlocal_coupling; }
2156 
2161 
2162  virtual void setCurrentLowerDElem(const Elem * const lower_d_elem, const THREAD_ID tid) override;
2163  virtual void setCurrentBoundaryID(BoundaryID bid, const THREAD_ID tid) override;
2164 
2165 protected:
2167  void createTagVectors();
2168 
2170  void createTagSolutions();
2171 
2173 
2174 private:
2177 
2178 protected:
2180 
2181  std::set<TagID> _fe_vector_tags;
2182 
2183  std::set<TagID> _fe_matrix_tags;
2184 
2186  const bool & _solve;
2187 
2191  int & _t_step;
2194 
2196  unsigned int _n_nl_pingpong = 0;
2198 
2201 
2204 
2206  const std::vector<NonlinearSystemName> _nl_sys_names;
2207 
2209  const std::size_t _num_nl_sys;
2210 
2212  std::vector<std::shared_ptr<NonlinearSystemBase>> _nl;
2213 
2215  std::map<NonlinearSystemName, unsigned int> _nl_sys_name_to_num;
2216 
2218  std::map<NonlinearVariableName, unsigned int> _nl_var_to_sys_num;
2219 
2222 
2224  std::shared_ptr<AuxiliarySystem> _aux;
2225 
2227  std::vector<std::unique_ptr<CouplingMatrix>> _cm;
2228 
2230  std::map<std::string, unsigned int> _subspace_dim;
2231 
2234  std::vector<std::vector<std::unique_ptr<Assembly>>> _assembly;
2235 
2240 
2243 
2246 
2249 
2254  ScalarInitialConditionWarehouse _scalar_ics; // use base b/c of setup methods
2256 
2257 protected:
2258  // material properties
2263 
2265  // Material Warehouses
2266  MaterialWarehouse _materials; // regular materials
2267  MaterialWarehouse _interface_materials; // interface materials
2268  MaterialWarehouse _discrete_materials; // Materials that the user must compute
2269  MaterialWarehouse _all_materials; // All materials for error checking and MaterialData storage
2271 
2273  // Indicator Warehouses
2277 
2278  // Marker Warehouse
2280 
2281  // Helper class to access Reporter object values
2283 
2284  // TODO: delete this after apps have been updated to not call getUserObjects
2286 
2289 
2292 
2295 
2298 
2301 
2304 
2306  std::map<std::string, std::unique_ptr<RandomData>> _random_data_objects;
2307 
2309  std::vector<std::unordered_map<SubdomainID, bool>> _block_mat_side_cache;
2310 
2312  std::vector<std::unordered_map<BoundaryID, bool>> _bnd_mat_side_cache;
2313 
2315  std::vector<std::unordered_map<BoundaryID, bool>> _interface_mat_side_cache;
2316 
2318  std::vector<MeshChangedInterface *> _notify_when_mesh_changes;
2319 
2327  void meshChangedHelper(bool intermediate_change = false);
2328 
2330  bool duplicateVariableCheck(const std::string & var_name, const FEType & type, bool is_aux);
2331 
2333  const Moose::AuxGroup & group,
2334  TheWarehouse::Query & query);
2335 
2337  void checkDisplacementOrders();
2338 
2339  void checkUserObjects();
2340 
2347  const std::map<SubdomainID, std::vector<std::shared_ptr<MaterialBase>>> & materials_map);
2348 
2350  void checkCoordinateSystems();
2351 
2357  void reinitBecauseOfGhostingOrNewGeomObjects(bool mortar_changed = false);
2358 
2365  void addObjectParamsHelper(InputParameters & params,
2366  const std::string & object_name,
2367  const std::string & var_param_name = "variable");
2368 
2369 #ifdef LIBMESH_ENABLE_AMR
2371  unsigned int _cycles_completed;
2372 #endif
2373 
2375  std::shared_ptr<XFEMInterface> _xfem;
2376 
2377  // Displaced mesh /////
2379  std::shared_ptr<DisplacedProblem> _displaced_problem;
2382 
2389 
2392 
2395 
2398 
2401 
2404 
2407 
2410 
2413 
2416 
2419 
2423 
2424  std::vector<std::vector<const MooseVariableFEBase *>> _uo_jacobian_moose_vars;
2425 
2427  std::vector<unsigned char> _has_active_material_properties;
2428 
2430 
2433 
2437 
2441 
2444 
2447 
2450 
2453 
2455  unsigned int _max_qps;
2456 
2459 
2462 
2465 
2468 
2471 
2474 
2476  std::string _exception_message;
2477 
2480 
2483 
2486 #if !PETSC_RELEASE_LESS_THAN(3, 12, 0)
2488 #endif
2489 
2492 
2493  std::shared_ptr<LineSearch> _line_search;
2494 
2495  std::unique_ptr<ConstElemRange> _evaluable_local_elem_range;
2496  std::unique_ptr<ConstElemRange> _nl_evaluable_local_elem_range;
2497  std::unique_ptr<ConstElemRange> _aux_evaluable_local_elem_range;
2498 
2502 
2503 private:
2508  void handleException(const std::string & calling_method);
2509 
2514  std::vector<MortarUserObject *>
2515  getMortarUserObjects(BoundaryID primary_boundary_id,
2516  BoundaryID secondary_boundary_id,
2517  bool displaced,
2518  const std::vector<MortarUserObject *> & mortar_uo_superset);
2519 
2524  std::vector<MortarUserObject *> getMortarUserObjects(BoundaryID primary_boundary_id,
2525  BoundaryID secondary_boundary_id,
2526  bool displaced);
2527 
2537  std::pair<bool, unsigned int>
2538  determineNonlinearSystem(const std::string & var_name,
2539  bool error_if_not_found = false) const override;
2540 
2547  void checkICRestartError(const std::string & ic_name,
2548  const std::string & name,
2549  const VariableName & var_name);
2550 
2551  /*
2552  * Test if stateful property redistribution is expected to be
2553  * necessary, and set it up if so.
2554  */
2555  void addAnyRedistributers();
2556 
2557  void updateMaxQps();
2558 
2559  void joinAndFinalize(TheWarehouse::Query query, bool isgen = false);
2560 
2564  virtual void resetState();
2565 
2568  const bool _force_restart;
2574 
2577 
2580 
2583 
2586 
2589 
2592 
2593  friend class AuxiliarySystem;
2594  friend class NonlinearSystemBase;
2595  friend class MooseEigenSystem;
2596  friend class Resurrector;
2597  friend class Restartable;
2598  friend class DisplacedProblem;
2599 
2602 
2604  unsigned int _num_grid_steps;
2605 
2609 
2612 
2615 
2618 
2621 
2624 
2628  std::vector<VectorTag> _current_residual_vector_tags;
2629 
2631  bool _have_fv = false;
2632 
2636 };
2637 
2639 
2640 template <typename T>
2641 void
2643 {
2644  _app.getOutputWarehouse().allowOutput<T>(state);
2645 }
2646 
2647 template <typename T>
2648 void
2649 FEProblemBase::objectSetupHelper(const std::vector<T *> & objects, const ExecFlagType & exec_flag)
2650 {
2651  if (exec_flag == EXEC_INITIAL)
2652  {
2653  for (T * obj_ptr : objects)
2654  obj_ptr->initialSetup();
2655  }
2656 
2657  else if (exec_flag == EXEC_TIMESTEP_BEGIN)
2658  {
2659  for (const auto obj_ptr : objects)
2660  obj_ptr->timestepSetup();
2661  }
2662  else if (exec_flag == EXEC_SUBDOMAIN)
2663  {
2664  for (const auto obj_ptr : objects)
2665  obj_ptr->subdomainSetup();
2666  }
2667 
2668  else if (exec_flag == EXEC_NONLINEAR)
2669  {
2670  for (const auto obj_ptr : objects)
2671  obj_ptr->jacobianSetup();
2672  }
2673 
2674  else if (exec_flag == EXEC_LINEAR)
2675  {
2676  for (const auto obj_ptr : objects)
2677  obj_ptr->residualSetup();
2678  }
2679 }
2680 
2681 template <typename T>
2682 void
2683 FEProblemBase::objectExecuteHelper(const std::vector<T *> & objects)
2684 {
2685  for (T * obj_ptr : objects)
2686  obj_ptr->execute();
2687 }
2688 
2689 template <typename T>
2690 std::vector<std::shared_ptr<T>>
2691 FEProblemBase::addObject(const std::string & type,
2692  const std::string & name,
2694  const bool threaded,
2695  const std::string & var_param_name)
2696 {
2697  parallel_object_only();
2698 
2699  logAdd(MooseUtils::prettyCppType<T>(), name, type);
2700  // Add the _subproblem and _sys parameters depending on use_displaced_mesh
2701  addObjectParamsHelper(parameters, name, var_param_name);
2702 
2703  const auto n_threads = threaded ? libMesh::n_threads() : 1;
2704  std::vector<std::shared_ptr<T>> objects(n_threads);
2705  for (THREAD_ID tid = 0; tid < n_threads; ++tid)
2706  {
2707  std::shared_ptr<T> obj = _factory.create<T>(type, name, parameters, tid);
2708  theWarehouse().add(obj);
2709  objects[tid] = std::move(obj);
2710  }
2711 
2712  return objects;
2713 }
2714 
2715 inline NonlinearSystemBase &
2716 FEProblemBase::getNonlinearSystemBase(const unsigned int sys_num)
2717 {
2718  mooseAssert(sys_num < _nl.size(), "System number greater than the number of nonlinear systems");
2719  return *_nl[sys_num];
2720 }
2721 
2722 inline const NonlinearSystemBase &
2723 FEProblemBase::getNonlinearSystemBase(const unsigned int sys_num) const
2724 {
2725  mooseAssert(sys_num < _nl.size(), "System number greater than the number of nonlinear systems");
2726  return *_nl[sys_num];
2727 }
2728 
2729 inline NonlinearSystemBase &
2731 {
2732  mooseAssert(_current_nl_sys, "The nonlinear system is not currently set");
2733  return *_current_nl_sys;
2734 }
2735 
2736 inline const NonlinearSystemBase &
2738 {
2739  mooseAssert(_current_nl_sys, "The nonlinear system is not currently set");
2740  return *_current_nl_sys;
2741 }
2742 
2743 inline Assembly &
2744 FEProblemBase::assembly(const THREAD_ID tid, const unsigned int nl_sys_num)
2745 {
2746  mooseAssert(tid < _assembly.size(), "Assembly objects not initialized");
2747  mooseAssert(nl_sys_num < _assembly[tid].size(),
2748  "Nonlinear system number larger than the assembly container size");
2749  return *_assembly[tid][nl_sys_num];
2750 }
2751 
2752 inline const Assembly &
2753 FEProblemBase::assembly(const THREAD_ID tid, const unsigned int nl_sys_num) const
2754 {
2755  mooseAssert(tid < _assembly.size(), "Assembly objects not initialized");
2756  mooseAssert(nl_sys_num < _assembly[tid].size(),
2757  "Nonlinear system number larger than the assembly container size");
2758  return *_assembly[tid][nl_sys_num];
2759 }
2760 
2761 inline const CouplingMatrix *
2762 FEProblemBase::couplingMatrix(const unsigned int i) const
2763 {
2764  return _cm[i].get();
2765 }
2766 
2767 inline void
2768 FEProblemBase::setCurrentNonlinearSystem(const unsigned int nl_sys_num)
2769 {
2770  mooseAssert(nl_sys_num < _nl.size(),
2771  "System number greater than the number of nonlinear systems");
2772  _current_nl_sys = _nl[nl_sys_num].get();
2773 }
2774 
2775 inline void
2776 FEProblemBase::fvBCsIntegrityCheck(const bool fv_bcs_integrity_check)
2777 {
2779  // the user has requested that we don't check integrity so we will honor that
2780  return;
2781 
2782  _fv_bcs_integrity_check = fv_bcs_integrity_check;
2783 }
2784 
2785 inline const std::vector<VectorTag> &
2787 {
2789 }
2790 
2791 inline void
2792 FEProblemBase::setCurrentResidualVectorTags(const std::set<TagID> & vector_tags)
2793 {
2795 }
2796 
2797 inline void
2799 {
2801 }
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.
std::vector< Point > _point_zero
Interface for objects that need parallel consistent random numbers without patterns over the course o...
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:634
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
void logAdd(const std::string &system, const std::string &name, const std::string &type) const
Output information about the object just added to the problem.
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::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 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 computeJacobianSys(NonlinearImplicitSystem &sys, const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian)
Form a Jacobian matrix.
virtual void addDamper(const std::string &damper_name, const std::string &name, InputParameters &parameters)
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
void setMaxNLPingPong(const unsigned int n_max_nl_pingpong)
method setting the maximum number of allowable non linear residual pingpong
virtual void prepareFace(const Elem *elem, const THREAD_ID tid) override
Base class for function objects.
Definition: Function.h:37
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 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
bool _snesmf_reuse_base_set_by_user
If or not _snesmf_reuse_base is set by user.
Order
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:972
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.
virtual void addUserObject(const std::string &user_object_name, const std::string &name, InputParameters &parameters)
void setNonlocalCouplingMatrix()
Set custom coupling matrix for variables requiring nonlocal contribution.
void setExecutionPrinting(const ExecFlagEnum &print_exec)
virtual Real & time() const
SolverParams _solver_params
std::vector< std::pair< MooseVariableFEBase *, MooseVariableFEBase * > > & couplingEntries(const THREAD_ID tid, const unsigned int nl_sys_num)
SolverParams & solverParams()
Get the solver parameters.
virtual void addJacobianBlockTags(SparseMatrix< 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 checkDependMaterialsHelper(const std::map< SubdomainID, std::vector< std::shared_ptr< MaterialBase >>> &materials_map)
Helper method for checking Material object dependency.
unsigned int n_threads()
virtual void cacheResidualNeighbor(const THREAD_ID tid) override
virtual void setInputParametersFEProblem(InputParameters &parameters)
bool identifyVariableGroupsInNL() const
Whether to identify variable groups in nonlinear systems.
int _nl_forced_its
the number of forced nonlinear iterations
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.
virtual bool hasNonlocalCoupling() const override
Whether the simulation has nonlocal coupling which should be accounted for in the Jacobian...
virtual void checkExceptionAndStopSolve(bool print_message=true)
Check to see if an exception has occurred on any processor and, if possible, force the solve to fail...
void meshChangedHelper(bool intermediate_change=false)
Helper method to update some or all data after a mesh change.
virtual bool uDotDotOldRequested()
Get boolean flag to check whether old solution second time derivative needs to be stored...
void mooseDeprecated(Args &&... args) const
bool duplicateVariableCheck(const std::string &var_name, const FEType &type, bool is_aux)
Helper to check for duplicate variable names across systems or within a single system.
Keeps track of stuff related to assembling.
Definition: Assembly.h:93
Class for stuff related to variables.
Definition: Adaptivity.h:31
MooseAppCoordTransform & coordTransform()
virtual void setActiveFEVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid) override
bool _error_on_jacobian_nonzero_reallocation
virtual void reinitElemFaceRef(const Elem *elem, unsigned int side, BoundaryID bnd_id, 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...
unsigned int TagID
Definition: MooseTypes.h:199
virtual void reinitNode(const Node *node, const THREAD_ID tid) override
virtual std::size_t numNonlinearSystems() const 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.
virtual void computeNullSpace(NonlinearImplicitSystem &sys, std::vector< NumericVector< Number > *> &sp)
bool _has_dampers
Whether or not this system has any Dampers associated with it.
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.
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.
void joinAndFinalize(TheWarehouse::Query query, bool isgen=false)
std::vector< MooseArray< ADRealVectorValue > > _ad_grad_zero
Warehouse for storing initial conditions.
ExecuteMooseObjectWarehouse< Control > _control_warehouse
The control logic warehouse.
virtual void setActiveScalarVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid) override
MaterialData & getMaterialData(Moose::MaterialDataType type, const THREAD_ID tid=0)
std::unique_ptr< ConstElemRange > _evaluable_local_elem_range
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 setResidualNeighbor(NumericVector< Number > &residual, const THREAD_ID tid) override
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 uDotDotRequested()
Get boolean flag to check whether solution second time derivative needs to be stored.
std::vector< std::unique_ptr< CouplingMatrix > > _cm
Coupling matrix for variables.
void trustUserCouplingMatrix()
Whether to trust the user coupling matrix even if we want to do things like be paranoid and create a ...
const bool _uo_aux_state_check
Whether or not checking the state of uo/aux evaluation.
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:38
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:604
void computeUserObjectsInternal(const ExecFlagType &type, const Moose::AuxGroup &group, TheWarehouse::Query &query)
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:19
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)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:86
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 bool checkRelativeConvergence(const PetscInt it, const Real fnorm, const Real the_residual, const Real rtol, const Real abstol, std::ostringstream &oss)
Check the relative convergence of the nonlinear solution.
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:35
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
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...
virtual void createQRules(QuadratureType type, Order order, Order volume_order=INVALID_ORDER, Order face_order=INVALID_ORDER, SubdomainID block=Moose::ANY_BLOCK_ID, bool allow_negative_qweights=true)
virtual void computeBounds(NonlinearImplicitSystem &sys, NumericVector< Number > &lower, NumericVector< Number > &upper)
QuadratureType
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.
void addFunctorMaterial(const std::string &functor_material_name, const std::string &name, InputParameters &parameters)
std::vector< VariableSecond > _second_zero
std::vector< MooseArray< ADReal > > _ad_zero
virtual void onTimestepEnd() override
virtual void addNodalKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
All Distributions should inherit from this class.
Definition: Distribution.h:18
std::vector< VectorVariableCurl > _vector_curl_zero
virtual bool updateSolution(NumericVector< Number > &vec_solution, NumericVector< Number > &ghosted_solution)
Update the solution.
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.
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
virtual void computeJacobianTag(const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian, TagID tag)
Form a Jacobian matrix for a given tag.
void setCurrentExecuteOnFlag(const ExecFlagType &)
const MaterialWarehouse & getMaterialWarehouse() const
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.
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:662
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.
FEProblemBase(const InputParameters &parameters)
void setFailNextNonlinearConvergenceCheck()
Skip further residual evaluations and fail the next nonlinear convergence check.
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.
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.
ExecFlagEnum _print_execution_on
When to print the execution of loops.
virtual const std::string & name() const
Get the name of the class.
Definition: MooseBase.h:56
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.
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
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:675
auto max(const L &left, const R &right)
virtual void newAssemblyArray(std::vector< std::shared_ptr< NonlinearSystemBase >> &nl)
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
AuxGroup
Flag for AuxKernel related execution type.
Definition: MooseTypes.h:616
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 Real computeDamping(const NumericVector< Number > &soln, const NumericVector< Number > &update)
virtual void computeJacobian(const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian, const unsigned int nl_sys_num)
Form a Jacobian matrix with the default tag (system).
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)
virtual EquationSystems & es() override
This class is a container/interface for the objects involved in automatic generation of mortar spaces...
const bool _skip_nl_system_check
virtual void resetState()
Reset state of this object in preparation for the next evaluation.
virtual void addInitialCondition(const std::string &ic_name, const std::string &name, InputParameters &parameters)
ScalarInitialConditionWarehouse _scalar_ics
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.
Real _nl_abs_div_tol
the absolute non linear divergence tolerance
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 bool nlConverged(const unsigned int nl_sys_num) override
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()
bool _calculate_jacobian_in_uo
virtual void prepareFaceShapes(unsigned int var, const THREAD_ID tid) override
unsigned int _n_max_nl_pingpong
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:1107
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
virtual void addCachedResidualDirectly(NumericVector< Number > &residual, const THREAD_ID tid)
Allows for all the residual contributions that are currently cached to be added directly into the vec...
bool hasJacobian() const
Returns _has_jacobian.
void createTagSolutions()
Create extra tagged solution vectors.
virtual void execute(const ExecFlagType &exec_type)
Convenience function for performing execution of MOOSE systems.
bool _trust_user_coupling_matrix
Whether to trust the user coupling matrix no matter what.
void handleException(const std::string &calling_method)
Handle exceptions.
virtual std::vector< VariableName > getVariableNames()
Returns a list of all the variables in the problem (both from the NL and Aux systems.
ReporterData _reporter_data
void uniformRefine()
uniformly refine the problem mesh(es).
const ReporterData & getReporterData() const
Provides const access the ReporterData object.
virtual void computeResidualTag(const NumericVector< Number > &soln, NumericVector< Number > &residual, TagID tag)
Form a residual vector for a given tag.
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.
virtual void setResidual(NumericVector< Number > &residual, const THREAD_ID tid) override
MooseObjectWarehouse< InternalSideIndicator > _internal_side_indicators
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.
ExecuteMooseObjectWarehouse< Transfer > _to_multi_app_transfers
Transfers executed just before MultiApps to transfer data to them.
virtual void nonlinearConvergenceSetup()
Perform steps required before checking nonlinear convergence.
NonlinearSystemBase * _current_nl_sys
The current nonlinear system that we are solving.
Interface for notifications that the mesh has changed.
void setCurrentNonlinearSystem(const unsigned int nl_sys_num)
virtual std::shared_ptr< DisplacedProblem > getDisplacedProblem()
void computeResidualAndJacobian(const NumericVector< Number > &soln, NumericVector< Number > &residual, SparseMatrix< Number > &jacobian)
Form a residual and Jacobian with default tags.
This is the common base class for the three main kernel types implemented in MOOSE, Kernel, VectorKernel and ArrayKernel.
Definition: KernelBase.h:22
void numGridSteps(unsigned int num_grid_steps)
Set the number of steps in a grid sequences.
bool _input_file_saved
whether input file has been written
bool _fail_next_nonlinear_convergence_check
virtual void reinitElem(const Elem *elem, const THREAD_ID tid) override
bool needSubdomainMaterialOnSide(SubdomainID subdomain_id, const THREAD_ID tid)
TheWarehouse & theWarehouse() const
void createTagVectors()
Create extra tagged vectors and matrices.
virtual void computeResidualType(const NumericVector< Number > &soln, NumericVector< Number > &residual, TagID tag)
Form a residual vector for a given tag and "residual" tag.
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 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:33
virtual bool shouldUpdateSolution()
Check to see whether the problem should update the solution.
virtual void reinitElemFace(const Elem *elem, unsigned int side, BoundaryID bnd_id, const THREAD_ID tid) override
Real getTimeFromStateArg(const Moose::StateArg &state) const
Returns the time associated with the requested state.
const ExecFlagType EXEC_TIMESTEP_BEGIN
Definition: Moose.C:33
void executeSamplers(const ExecFlagType &exec_type)
Performs setup and execute calls for Sampler objects.
virtual void reinitNeighborPhys(const Elem *neighbor, unsigned int neighbor_side, const std::vector< Point > &physical_points, const THREAD_ID tid) override
void addOutput(const std::string &, const std::string &, InputParameters &)
Adds an Output object.
boundary_id_type BoundaryID
void setCouplingMatrix(std::unique_ptr< CouplingMatrix > cm, const unsigned int nl_sys_num)
Set custom coupling matrix.
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()
VarKindType
Framework-wide stuff.
Definition: MooseTypes.h:627
NonlinearSystemBase & currentNonlinearSystem()
void computingScalingResidual(bool computing_scaling_residual)
Setter for whether we&#39;re computing the scaling residual.
virtual void predictorCleanup(NumericVector< Number > &ghosted_solution)
Perform cleanup tasks after application of predictor to solution vector.
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:191
virtual void addJacobianNeighbor(const THREAD_ID tid) 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.
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)
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 meshChanged() override
Update data after a mesh change.
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
bool _u_dotdot_old_requested
Whether old solution second time derivative needs to be stored.
void addAnyRedistributers()
const std::string & type() const
Get the type of this class.
Definition: MooseBase.h:50
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:31
Adaptivity _adaptivity
std::vector< VectorTag > getVectorTags(const std::set< TagID > &tag_ids) const
Definition: SubProblem.C:149
bool allowInvalidSolution() const
Whether or not the invalid solutions are allowed.
virtual const SystemBase & systemBaseAuxiliary() const override
Return the auxiliary system object as a base class reference.
void checkUserObjectJacobianRequirement(THREAD_ID tid)
MooseVariableFieldBase & getActualFieldVariable(const THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested MooseVariableField which may be in any system...
LineSearch * getLineSearch() override
getter for the MOOSE line search
virtual void computePostCheck(NonlinearImplicitSystem &sys, const NumericVector< Number > &old_soln, NumericVector< Number > &search_direction, NumericVector< Number > &new_soln, bool &changed_search_direction, bool &changed_new_soln)
virtual void addTimeIntegrator(const std::string &type, const std::string &name, InputParameters &parameters)
virtual void cacheResidual(const THREAD_ID tid) override
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.
virtual MooseNonlinearConvergenceReason checkNonlinearConvergence(std::string &msg, const PetscInt it, const Real xnorm, const Real snorm, const Real fnorm, const Real rtol, const Real divtol, const Real stol, const Real abstol, const PetscInt nfuncs, const PetscInt max_funcs, const Real initial_residual_before_preset_bcs, const Real div_threshold)
Check for convergence of the nonlinear solution.
bool errorOnJacobianNonzeroReallocation() const
Will return True if the user wants to get an error when a nonzero is reallocated in the Jacobian by P...
virtual void addResidual(const THREAD_ID tid) override
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
virtual void addResidualNeighbor(const THREAD_ID tid) override
void initElementStatefulProps(const ConstElemRange &elem_range, const bool threaded)
Initialize stateful properties for elements in a specific elem_range This is needed when elements/bou...
subdomain_id_type SubdomainID
MooseApp & _app
The MOOSE application this is associated with.
Definition: MooseBase.h:69
virtual void clearActiveFEVariableCoupleableVectorTags(const THREAD_ID tid) override
virtual void addAuxArrayVariable(const std::string &var_name, const FEType &type, unsigned int components, const std::set< SubdomainID > *const active_subdomains=NULL)
bool _verbose_setup
Whether or not to be verbose during setup.
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...
virtual std::string solverTypeString()
Return solver type as a human readable string.
const ExecFlagType EXEC_LINEAR
Definition: Moose.C:29
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:62
std::string _exception_message
The error message to go with an exception.
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
bool _kernel_coverage_check
Determines whether a check to verify an active kernel on every subdomain.
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:726
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.
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)
void setNonlinearForcedIterations(const unsigned int nl_forced_its)
method setting the minimum number of nonlinear iterations before performing divergence checks ...
virtual void setCurrentSubdomainID(const Elem *elem, const THREAD_ID tid) override
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
GeometricSearchType
Used to select groups of geometric search objects to update.
void backupMultiApps(ExecFlagType type)
Backup the MultiApps associated with the ExecFlagType.
virtual ~FEProblemBase()
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters &params)
Canonical method for adding a non-linear variable.
bool doingPRefinement() const
Definition: SubProblem.C:1312
ExecuteMooseObjectWarehouse< MultiApp > _multi_apps
MultiApp Warehouse.
virtual int & timeStep() const
std::vector< std::vector< std::unique_ptr< Assembly > > > _assembly
The Assembly objects.
virtual void addDisplacedProblem(std::shared_ptr< DisplacedProblem > displaced_problem)
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)
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.
virtual void computeJacobianInternal(const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian, const std::set< TagID > &tags)
Form a Jacobian matrix for multiple tags.
This is the XFEMInterface class.
Definition: XFEMInterface.h:37
MooseNonlinearConvergenceReason
Enumeration for nonlinear convergence reasons.
Definition: FEProblemBase.h:98
const std::vector< NonlinearSystemName > _nl_sys_names
The nonlinear system names.
void projectInitialConditionOnCustomRange(ConstElemRange &elem_range, ConstBndNodeRange &bnd_node_range)
Project initial conditions for custom elem_range and bnd_node_range This is needed when elements/boun...
const ExecFlagType EXEC_NONLINEAR
Definition: Moose.C:30
std::vector< Real > VectorPostprocessorValue
Definition: MooseTypes.h:192
const FVInitialConditionWarehouse & getFVInitialConditionWarehouse() const
Return FVInitialCondition storage.
virtual void updateMortarMesh()
std::set< TagID > _fe_matrix_tags
const ExecuteMooseObjectWarehouse< Transfer > & getMultiAppTransferWarehouse(Transfer::DIRECTION direction) const
Return the complete warehouse for MultiAppTransfer object for the given direction.
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.
The InternalSideIndicator class is responsible for calculating the residuals for various physics on i...
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
virtual void addAuxScalarVariable(const std::string &var_name, Order order, Real scale_factor=1., const std::set< SubdomainID > *const active_subdomains=NULL)
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
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:75
void clearCurrentJacobianVectorTags()
Clear the current Jacobian vector tag data structure ...
void setConstJacobian(bool state)
Set flag that Jacobian is constant (for optimization purposes)
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:18
Class that is used as a parameter to set/clearCurrentResidualVectorTags that allows only blessed clas...
Base class for Control objects.
Definition: Control.h:32
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
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:97
void reinitMaterials(SubdomainID blk_id, const THREAD_ID tid, bool swap_stateful=true)
const CouplingMatrix * couplingMatrix(const unsigned int nl_sys_num) const override
The coupling matrix defining what blocks exist in the preconditioning matrix.
const bool _identify_variable_groups_in_nl
Whether to identify variable groups in nonlinear systems. This affects dof ordering.
PetscOptions & petscOptionsDatabase()
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 ...
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 prepare(const Elem *elem, const THREAD_ID tid) override
std::pair< bool, unsigned int > determineNonlinearSystem(const std::string &var_name, bool error_if_not_found=false) const override
Determine what nonlinear system the provided variable name lies in.
virtual void computeAuxiliaryKernels(const ExecFlagType &type)
Call compute methods on AuxKernels.
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 executeControls(const ExecFlagType &exec_type)
Performs setup and execute calls for Control objects.
MortarData & mortarData()
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
Nonlinear system to be solved.
void checkDuplicatePostprocessorVariableNames()
const bool & _allow_invalid_solution
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...
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...
void incrementMultiAppTStep(ExecFlagType type)
Advance the MultiApps t_step (incrementStepOrReject) associated with the ExecFlagType.
Class for scalar variables (they are different).
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:643
void setNonlinearAbsoluteDivergenceTolerance(const Real nl_abs_div_tol)
method setting the absolute divergence tolerance
libMesh::EquationSystems & es()
std::set< TagID > _fe_vector_tags
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
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.
virtual void saveOldSolutions()
Allocate vectors and save old solutions into them.
bool hasPostprocessor(const std::string &name) const
Deprecated.
std::shared_ptr< DisplacedProblem > _displaced_problem
GeometricSearchData _geometric_search_data
const InputParameters & parameters() const
Get the parameters of the object.
State argument for evaluating functors.
Moose::CouplingType coupling()
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
virtual bool computingInitialResidual(const unsigned int nl_sys_num) const override
Returns true if the problem is in the process of computing it&#39;s initial residual. ...
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)
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...
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:97
void bumpAllQRuleOrder(Order order, SubdomainID block)
Base class for implementing interface user objects.
virtual unsigned int nNonlinearIterations(const unsigned int nl_sys_num) const override
MaterialPropertyStorage & _neighbor_material_props
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 ConstElemRange & getEvaluableElementRange()
In general, {evaluable elements} >= {local elements} U {algebraic ghosting elements}.
friend class Resurrector
unsigned int _n_nl_pingpong
maximum numbver
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 It sho...
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:42
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 hasMultiApps() const
Returns whether or not the current simulation has any multiapps.
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > ConstBndNodeRange
Some useful StoredRange typedefs.
Definition: MooseMesh.h:2026
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.
void computeResidual(NonlinearImplicitSystem &sys, const NumericVector< Number > &soln, NumericVector< Number > &residual)
This function is called by Libmesh to form a residual.
bool computingScalingResidual() const override final
virtual void executeAllObjects(const ExecFlagType &exec_type)
virtual void setActiveFEVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid) override
virtual void computeJacobianBlock(SparseMatrix< Number > &jacobian, libMesh::System &precond_system, unsigned int ivar, unsigned int jvar)
Really not a good idea to use this.
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 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()
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 ...
Assembly & assembly(const THREAD_ID tid, const unsigned int nl_sys_num) override
const 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)
virtual void addGhostedBoundary(BoundaryID boundary_id) override
Will make sure that all necessary elements from boundary_id are ghosted to this processor.
virtual void reinitNeighborFaceRef(const Elem *neighbor_elem, unsigned int neighbor_side, BoundaryID bnd_id, 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...
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
Executor * getExecutor() const
Definition: MooseApp.h:330
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 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 computeResidualSys(NonlinearImplicitSystem &sys, const NumericVector< Number > &soln, NumericVector< Number > &residual)
This function is called by Libmesh to form a residual.
std::unique_ptr< ConstElemRange > _aux_evaluable_local_elem_range
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 bool hasException()
Whether or not an exception has occurred.
CurrentResidualVectorTagsKey(const CurrentResidualVectorTagsKey &)
virtual void initialAdaptMesh()
virtual void addResidualScalar(const THREAD_ID tid=0)
bool _material_coverage_check
Determines whether a check to verify an active material on every subdomain.
Order _max_scalar_order
Maximum scalar variable order.
MaterialWarehouse _all_materials
bool _u_dotdot_requested
Whether solution second time derivative needs to be stored.
void bumpVolumeQRuleOrder(Order order, SubdomainID block)
Increases the element/volume quadrature order for the specified mesh block if and only if the current...
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 void clearActiveElementalMooseVariables(const THREAD_ID tid) override
Clear the active elemental MooseVariableFEBase.
Base class for user-specific data.
Definition: UserObject.h:39
void allowOutput(bool state)
Ability to enable/disable all output calls.
const MooseObjectWarehouse< InternalSideIndicator > & getInternalSideIndicatorWarehouse()
virtual Sampler & getSampler(const std::string &name, const THREAD_ID tid=0)
std::map< NonlinearVariableName, unsigned int > _nl_var_to_sys_num
Map from nonlinear variable name to nonlinear system number.
const std::string & _type
The type of this class.
Definition: MooseBase.h:72
virtual void outputStep(ExecFlagType type)
Output the current step.
std::unique_ptr< ConstElemRange > _nl_evaluable_local_elem_range
virtual unsigned int nlSysNum(const NonlinearSystemName &nl_sys_name) const override
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:1772
virtual void computeTransposeNullSpace(NonlinearImplicitSystem &sys, std::vector< NumericVector< Number > *> &sp)
void setIgnoreZerosInJacobian(bool state)
virtual void computeJacobianTags(const std::set< TagID > &tags)
Form multiple matrices, and each is associated with a tag.
virtual void computeNearNullSpace(NonlinearImplicitSystem &sys, std::vector< NumericVector< Number > *> &sp)
MooseMesh * _displaced_mesh
unsigned int getNonlinearForcedIterations() const
method returning the number of forced nonlinear iterations
bool _has_mortar
Whether the simulation requires mortar coupling.
Order getMaxScalarOrder() const
void execTransfers(ExecFlagType type)
Execute the Transfers associated with the ExecFlagType.
virtual void computeResidualInternal(const NumericVector< Number > &soln, NumericVector< Number > &residual, const std::set< TagID > &tags)
Form a residual vector for a set of tags.
unsigned int THREAD_ID
Definition: MooseTypes.h:198
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
virtual void setNeighborSubdomainID(const Elem *elem, unsigned int side, const THREAD_ID tid) override
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 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)
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:28
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