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 "MortarData.h"
16 #include "PostprocessorData.h"
18 #include "Adaptivity.h"
21 #include "Restartable.h"
22 #include "SolverParams.h"
23 #include "PetscSupport.h"
24 #include "MooseApp.h"
26 #include "MaterialWarehouse.h"
27 #include "MooseVariableFE.h"
28 #include "MultiAppTransfer.h"
29 #include "Postprocessor.h"
30 #include "HashMap.h"
31 #include "VectorPostprocessor.h"
32 #include "PerfGraphInterface.h"
33 #include "Attributes.h"
34 
35 #include "libmesh/enum_quadrature_type.h"
36 #include "libmesh/equation_systems.h"
37 
38 #include <unordered_map>
39 
40 // Forward declarations
41 class AuxiliarySystem;
42 class DisplacedProblem;
43 class FEProblemBase;
44 class MooseMesh;
46 class NonlinearSystem;
47 class RandomInterface;
48 class RandomData;
50 class MultiMooseEnum;
52 class MaterialData;
53 class MooseEnum;
54 class Resurrector;
55 class Assembly;
56 class JacobianBlock;
57 class Control;
58 class MultiApp;
59 class TransientMultiApp;
61 class Indicator;
63 class Marker;
64 class Material;
65 class Transfer;
66 class XFEMInterface;
67 class SideUserObject;
68 class NodalUserObject;
69 class ElementUserObject;
72 class GeneralUserObject;
73 class Function;
74 class Distribution;
75 class Sampler;
76 class KernelBase;
77 class IntegratedBCBase;
78 class LineSearch;
79 class UserObject;
81 
82 // libMesh forward declarations
83 namespace libMesh
84 {
85 class CouplingMatrix;
86 class NonlinearImplicitSystem;
87 } // namespace libMesh
88 
89 template <>
91 
94 {
95  ITERATING = 0,
100  DIVERGED_FNORM_NAN = -4,
102 };
103 
104 // The idea with these enums is to abstract the reasons for
105 // convergence/divergence, i.e. they could be used with linear algebra
106 // packages other than PETSc. They were directly inspired by PETSc,
107 // though. This enum could also be combined with the
108 // MooseNonlinearConvergenceReason enum but there might be some
109 // confusion (?)
111 {
112  ITERATING = 0,
113  // CONVERGED_RTOL_NORMAL = 1,
114  // CONVERGED_ATOL_NORMAL = 9,
115  CONVERGED_RTOL = 2,
116  CONVERGED_ATOL = 3,
117  CONVERGED_ITS = 4,
118  // CONVERGED_CG_NEG_CURVE = 5,
119  // CONVERGED_CG_CONSTRAINED = 6,
120  // CONVERGED_STEP_LENGTH = 7,
121  // CONVERGED_HAPPY_BREAKDOWN = 8,
122  DIVERGED_NULL = -2,
123  // DIVERGED_ITS = -3,
124  // DIVERGED_DTOL = -4,
125  // DIVERGED_BREAKDOWN = -5,
126  // DIVERGED_BREAKDOWN_BICG = -6,
127  // DIVERGED_NONSYMMETRIC = -7,
128  // DIVERGED_INDEFINITE_PC = -8,
129  DIVERGED_NANORINF = -9,
130  // DIVERGED_INDEFINITE_MAT = -10
132 };
133 
138 class FEProblemBase : public SubProblem, public Restartable
139 {
140 public:
142  virtual ~FEProblemBase();
143 
144  virtual EquationSystems & es() override { return _eq; }
145  virtual MooseMesh & mesh() override { return _mesh; }
146  virtual const MooseMesh & mesh() const override { return _mesh; }
147 
149  virtual void setCoordSystem(const std::vector<SubdomainName> & blocks,
150  const MultiMooseEnum & coord_sys);
151  void setAxisymmetricCoordAxis(const MooseEnum & rz_coord_axis);
152 
159 
161 
166  void setCouplingMatrix(std::unique_ptr<CouplingMatrix> cm);
167 
168  // DEPRECATED METHOD
169  void setCouplingMatrix(CouplingMatrix * cm);
170 
171  const CouplingMatrix * couplingMatrix() { return _cm.get(); }
172 
175 
176  bool areCoupled(unsigned int ivar, unsigned int jvar);
177 
178  std::vector<std::pair<MooseVariableFEBase *, MooseVariableFEBase *>> &
180  std::vector<std::pair<MooseVariableFEBase *, MooseVariableFEBase *>> &
182 
200  checkNonlinearConvergence(std::string & msg,
201  const PetscInt it,
202  const Real xnorm,
203  const Real snorm,
204  const Real fnorm,
205  const Real rtol,
206  const Real stol,
207  const Real abstol,
208  const PetscInt nfuncs,
209  const PetscInt max_funcs,
210  const PetscBool force_iteration,
211  const Real initial_residual_before_preset_bcs,
212  const Real div_threshold);
213 
224  virtual MooseLinearConvergenceReason checkLinearConvergence(std::string & msg,
225  const PetscInt n,
226  const Real rnorm,
227  const Real rtol,
228  const Real atol,
229  const Real dtol,
230  const PetscInt maxits);
231 
232  virtual bool hasVariable(const std::string & var_name) const override;
234  THREAD_ID tid,
235  const std::string & var_name,
237  Moose::VarFieldType expected_var_field_type = Moose::VarFieldType::VAR_FIELD_ANY) override;
238  virtual MooseVariable & getStandardVariable(THREAD_ID tid, const std::string & var_name) override;
240  const std::string & var_name) override;
241 
242  virtual bool hasScalarVariable(const std::string & var_name) const override;
244  const std::string & var_name) override;
245  virtual System & getSystem(const std::string & var_name) override;
246 
253  virtual void setActiveElementalMooseVariables(const std::set<MooseVariableFEBase *> & moose_vars,
254  THREAD_ID tid) override;
255 
263  virtual void clearActiveElementalMooseVariables(THREAD_ID tid) override;
264 
265  virtual void clearActiveFEVariableCoupleableMatrixTags(THREAD_ID tid) override;
266 
267  virtual void clearActiveFEVariableCoupleableVectorTags(THREAD_ID tid) override;
268 
269  virtual void setActiveFEVariableCoupleableVectorTags(std::set<TagID> & vtags,
270  THREAD_ID tid) override;
271 
272  virtual void setActiveFEVariableCoupleableMatrixTags(std::set<TagID> & mtags,
273  THREAD_ID tid) override;
274 
275  virtual void clearActiveScalarVariableCoupleableMatrixTags(THREAD_ID tid) override;
276 
277  virtual void clearActiveScalarVariableCoupleableVectorTags(THREAD_ID tid) override;
278 
279  virtual void setActiveScalarVariableCoupleableVectorTags(std::set<TagID> & vtags,
280  THREAD_ID tid) override;
281 
282  virtual void setActiveScalarVariableCoupleableMatrixTags(std::set<TagID> & mtags,
283  THREAD_ID tid) override;
284 
291  virtual void setActiveMaterialProperties(const std::set<unsigned int> & mat_prop_ids,
292  THREAD_ID tid) override;
293 
299  virtual void clearActiveMaterialProperties(THREAD_ID tid) override;
300 
301  virtual void createQRules(QuadratureType type,
302  Order order,
303  Order volume_order = INVALID_ORDER,
304  Order face_order = INVALID_ORDER);
305 
309  unsigned int getMaxQps() const;
310 
314  unsigned int getMaxShapeFunctions() const;
315 
319  Order getMaxScalarOrder() const;
320 
324  void checkNonlocalCoupling();
326  void setVariableAllDoFMap(const std::vector<MooseVariableFEBase *> moose_vars);
327 
328  const std::vector<MooseVariableFEBase *> & getUserObjectJacobianVariables(THREAD_ID tid) const
329  {
330  return _uo_jacobian_moose_vars[tid];
331  }
332 
333  Assembly & assembly(THREAD_ID tid) override
334  {
335  mooseAssert(tid < _assembly.size(), "Assembly objects not initialized");
336  return *_assembly[tid];
337  }
338  const Assembly & assembly(THREAD_ID tid) const override
339  {
340  mooseAssert(tid < _assembly.size(), "Assembly objects not initialized");
341  return *_assembly[tid];
342  }
343 
347  virtual std::vector<VariableName> getVariableNames();
348 
352  virtual void addExtraVectors();
353  virtual void initialSetup();
354  virtual void timestepSetup();
355 
356  virtual void prepare(const Elem * elem, THREAD_ID tid) override;
357  virtual void prepareFace(const Elem * elem, THREAD_ID tid) override;
358  virtual void prepare(const Elem * elem,
359  unsigned int ivar,
360  unsigned int jvar,
361  const std::vector<dof_id_type> & dof_indices,
362  THREAD_ID tid) override;
363 
364  virtual void setCurrentSubdomainID(const Elem * elem, THREAD_ID tid) override;
365  virtual void setNeighborSubdomainID(const Elem * elem, unsigned int side, THREAD_ID tid) override;
366  virtual void setNeighborSubdomainID(const Elem * elem, THREAD_ID tid);
367  virtual void prepareAssembly(THREAD_ID tid) override;
368 
369  virtual void addGhostedElem(dof_id_type elem_id) override;
370  virtual void addGhostedBoundary(BoundaryID boundary_id) override;
371  virtual void ghostGhostedBoundaries() override;
372 
373  virtual void sizeZeroes(unsigned int size, THREAD_ID tid);
374  virtual bool reinitDirac(const Elem * elem, THREAD_ID tid) override;
375  virtual void reinitElem(const Elem * elem, THREAD_ID tid) override;
376  virtual void reinitElemPhys(const Elem * elem,
377  const std::vector<Point> & phys_points_in_elem,
378  THREAD_ID tid,
379  bool suppress_displaced_init = false) override;
380  virtual void
381  reinitElemFace(const Elem * elem, unsigned int side, BoundaryID bnd_id, THREAD_ID tid) override;
382  virtual void reinitNode(const Node * node, THREAD_ID tid) override;
383  virtual void reinitNodeFace(const Node * node, BoundaryID bnd_id, THREAD_ID tid) override;
384  virtual void reinitNodes(const std::vector<dof_id_type> & nodes, THREAD_ID tid) override;
385  virtual void reinitNodesNeighbor(const std::vector<dof_id_type> & nodes, THREAD_ID tid) override;
386  virtual void reinitNeighbor(const Elem * elem, unsigned int side, THREAD_ID tid) override;
387  virtual void reinitNeighborPhys(const Elem * neighbor,
388  unsigned int neighbor_side,
389  const std::vector<Point> & physical_points,
390  THREAD_ID tid) override;
391  virtual void reinitNeighborPhys(const Elem * neighbor,
392  const std::vector<Point> & physical_points,
393  THREAD_ID tid) override;
394  virtual void reinitScalars(THREAD_ID tid) override;
395  virtual void reinitOffDiagScalars(THREAD_ID tid) override;
396 
398  virtual void getDiracElements(std::set<const Elem *> & elems) override;
399  virtual void clearDiracInfo() override;
400 
401  virtual void subdomainSetup(SubdomainID subdomain, THREAD_ID tid);
402  virtual void neighborSubdomainSetup(SubdomainID subdomain, THREAD_ID tid);
403 
404  virtual void newAssemblyArray(NonlinearSystemBase & nl);
406 
407  virtual void init() override;
408  virtual void solve() override;
409 
410  const ConstElemRange & getEvaluableElementRange();
411 
418  virtual void setException(const std::string & message);
419 
423  virtual bool hasException() { return _has_exception; }
424 
435  virtual void checkExceptionAndStopSolve();
436 
437  virtual bool converged() override;
438  virtual unsigned int nNonlinearIterations() const override;
439  virtual unsigned int nLinearIterations() const override;
440  virtual Real finalNonlinearResidual() const override;
441  virtual bool computingInitialResidual() const override;
442 
446  virtual bool startedInitialSetup() { return _started_initial_setup; }
447 
448  virtual void onTimestepBegin() override;
449  virtual void onTimestepEnd() override;
450 
451  virtual Real & time() const { return _time; }
452  virtual Real & timeOld() const { return _time_old; }
453  virtual int & timeStep() const { return _t_step; }
454  virtual Real & dt() const { return _dt; }
455  virtual Real & dtOld() const { return _dt_old; }
456 
457  virtual void transient(bool trans) { _transient = trans; }
458  virtual bool isTransient() const override { return _transient; }
459 
460  virtual void
461  addTimeIntegrator(const std::string & type, const std::string & name, InputParameters parameters);
462  virtual void
463  addPredictor(const std::string & type, const std::string & name, InputParameters parameters);
464 
465  virtual void copySolutionsBackwards();
466 
471  virtual void advanceState();
472 
473  virtual void restoreSolutions();
474 
478  virtual void saveOldSolutions();
479 
483  virtual void restoreOldSolutions();
484 
491  virtual void outputStep(ExecFlagType type);
492 
496  virtual void postExecute();
497 
499 
505  void allowOutput(bool state);
506  template <typename T>
507  void allowOutput(bool state);
509 
518  void forceOutput();
519 
523  void initPetscOutput();
524 
525 #ifdef LIBMESH_HAVE_PETSC
526 
530 #endif // LIBMESH_HAVE_PETSC
531 
532  // Function /////
533  virtual void addFunction(std::string type, const std::string & name, InputParameters parameters);
534  virtual bool hasFunction(const std::string & name, THREAD_ID tid = 0);
535  virtual Function & getFunction(const std::string & name, THREAD_ID tid = 0);
536 
540  virtual void addLineSearch(const InputParameters & /*parameters*/)
541  {
542  mooseError("Line search not implemented for this problem type yet.");
543  }
544 
548  virtual void lineSearch();
549 
553  std::shared_ptr<LineSearch> getLineSearch() { return _line_search; }
554 
558  virtual void
559  addDistribution(std::string type, const std::string & name, InputParameters parameters);
560  virtual Distribution & getDistribution(const std::string & name);
561 
565  virtual void addSampler(std::string type, const std::string & name, InputParameters parameters);
566  virtual Sampler & getSampler(const std::string & name, THREAD_ID tid = 0);
567 
568  // NL /////
570  const NonlinearSystemBase & getNonlinearSystemBase() const { return *_nl; }
571 
572  virtual const SystemBase & systemBaseNonlinear() const override;
573  virtual SystemBase & systemBaseNonlinear() override;
574 
575  virtual const SystemBase & systemBaseAuxiliary() const override;
576  virtual SystemBase & systemBaseAuxiliary() override;
577 
579 
580  virtual void addVariable(const std::string & var_name,
581  const FEType & type,
582  Real scale_factor,
583  const std::set<SubdomainID> * const active_subdomains = NULL);
584  virtual void addScalarVariable(const std::string & var_name,
585  Order order,
586  Real scale_factor = 1.,
587  const std::set<SubdomainID> * const active_subdomains = NULL);
588  virtual void
589  addKernel(const std::string & kernel_name, const std::string & name, InputParameters parameters);
590  virtual void addNodalKernel(const std::string & kernel_name,
591  const std::string & name,
593  virtual void addScalarKernel(const std::string & kernel_name,
594  const std::string & name,
596  virtual void addBoundaryCondition(const std::string & bc_name,
597  const std::string & name,
599  virtual void
600  addConstraint(const std::string & c_name, const std::string & name, InputParameters parameters);
601 
603  {
604  parameters.set<FEProblemBase *>("_fe_problem_base") = this;
605  }
606 
607  // Aux /////
608  virtual void addAuxVariable(const std::string & var_name,
609  const FEType & type,
610  const std::set<SubdomainID> * const active_subdomains = NULL);
611  virtual void addAuxScalarVariable(const std::string & var_name,
612  Order order,
613  Real scale_factor = 1.,
614  const std::set<SubdomainID> * const active_subdomains = NULL);
615  virtual void addAuxKernel(const std::string & kernel_name,
616  const std::string & name,
618  virtual void addAuxScalarKernel(const std::string & kernel_name,
619  const std::string & name,
621 
623 
624  // Dirac /////
625  virtual void addDiracKernel(const std::string & kernel_name,
626  const std::string & name,
628 
629  // DG /////
630  virtual void addDGKernel(const std::string & kernel_name,
631  const std::string & name,
633 
634  // Interface /////
635  virtual void addInterfaceKernel(const std::string & kernel_name,
636  const std::string & name,
638 
639  // IC /////
640  virtual void addInitialCondition(const std::string & ic_name,
641  const std::string & name,
643 
644  void projectSolution();
645 
646  // Materials /////
647  virtual void addMaterial(const std::string & kernel_name,
648  const std::string & name,
650  virtual void addADResidualMaterial(const std::string & kernel_name,
651  const std::string & name,
653  virtual void addADJacobianMaterial(const std::string & kernel_name,
654  const std::string & name,
656  virtual void addMaterialHelper(std::vector<MaterialWarehouse *> warehouse,
657  const std::string & kernel_name,
658  const std::string & name,
660 
666  virtual void prepareMaterials(SubdomainID blk_id, THREAD_ID tid);
667 
668  virtual void reinitMaterials(SubdomainID blk_id, THREAD_ID tid, bool swap_stateful = true);
669  virtual void reinitMaterialsFace(SubdomainID blk_id, THREAD_ID tid, bool swap_stateful = true);
670  virtual void
671  reinitMaterialsNeighbor(SubdomainID blk_id, THREAD_ID tid, bool swap_stateful = true);
672  virtual void
673  reinitMaterialsBoundary(BoundaryID boundary_id, THREAD_ID tid, bool swap_stateful = true);
674  /*
675  * Swap back underlying data storing stateful material properties
676  */
677  virtual void swapBackMaterials(THREAD_ID tid);
678  virtual void swapBackMaterialsFace(THREAD_ID tid);
679  virtual void swapBackMaterialsNeighbor(THREAD_ID tid);
680 
681  // Postprocessors /////
682  virtual void
683  addPostprocessor(std::string pp_name, const std::string & name, InputParameters parameters);
684 
685  // VectorPostprocessors /////
686  virtual void
687  addVectorPostprocessor(std::string pp_name, const std::string & name, InputParameters parameters);
688 
693  void initPostprocessorData(const std::string & name);
694 
696  void initVectorPostprocessorData(const std::string & name);
697 
698  // UserObjects /////
699  virtual void
700  addUserObject(std::string user_object_name, const std::string & name, InputParameters parameters);
701 
702  // TODO: delete this function after apps have been updated to not call it
704  {
706  "This function is deprecated, use theWarehouse().query() to construct a query instead");
707  return _all_user_objects;
708  }
709 
715  template <class T>
716  T & getUserObject(const std::string & name, unsigned int tid = 0) const
717  {
718  std::vector<T *> objs;
719  theWarehouse().query().condition<AttribThread>(tid).condition<AttribName>(name).queryInto(objs);
720  if (objs.empty())
721  mooseError("Unable to find user object with name '" + name + "'");
722  return *(objs[0]);
723  }
729  const UserObject & getUserObjectBase(const std::string & name) const;
730 
736  bool hasUserObject(const std::string & name) const;
737 
743  bool hasPostprocessor(const std::string & name);
744 
753  PostprocessorValue & getPostprocessorValue(const PostprocessorName & name);
754 
763  PostprocessorValue & getPostprocessorValueOld(const std::string & name);
764 
773  PostprocessorValue & getPostprocessorValueOlder(const std::string & name);
774 
776 
779  bool hasMultiApps() const { return _multi_apps.hasActiveObjects(); }
780  bool hasMultiApps(ExecFlagType type) const;
781  bool hasMultiApp(const std::string & name) const;
783 
789  bool hasVectorPostprocessor(const std::string & name);
790 
800  VectorPostprocessorValue & getVectorPostprocessorValue(const VectorPostprocessorName & name,
801  const std::string & vector_name);
802 
813  const std::string & vector_name);
814 
821  VectorPostprocessorValue & getVectorPostprocessorValue(const VectorPostprocessorName & name,
822  const std::string & vector_name,
823  bool needs_broadcast);
824 
832  const std::string & vector_name,
833  bool needs_broadcast);
834 
847  getScatterVectorPostprocessorValue(const VectorPostprocessorName & vpp_name,
848  const std::string & vector_name);
849 
862  getScatterVectorPostprocessorValueOld(const VectorPostprocessorName & vpp_name,
863  const std::string & vector_name);
864 
875  VectorPostprocessorValue & declareVectorPostprocessorVector(const VectorPostprocessorName & name,
876  const std::string & vector_name,
877  bool contains_complete_history,
878  bool is_broadcast);
879 
883  bool vectorPostprocessorHasVectors(const std::string & vpp_name)
884  {
885  return _vpps_data.hasVectors(vpp_name);
886  }
887 
892  const std::vector<std::pair<std::string, VectorPostprocessorData::VectorPostprocessorState>> &
893  getVectorPostprocessorVectors(const std::string & vpp_name);
894 
895  // Dampers /////
896  virtual void
897  addDamper(std::string damper_name, const std::string & name, InputParameters parameters);
898  void setupDampers();
899 
903  bool hasDampers() { return _has_dampers; }
904 
905  // Indicators /////
906  void
907  addIndicator(std::string indicator_name, const std::string & name, InputParameters parameters);
908 
909  // Markers //////
910  virtual void
911  addMarker(std::string marker_name, const std::string & name, InputParameters parameters);
912 
916  virtual void addMultiApp(const std::string & multi_app_name,
917  const std::string & name,
919 
923  std::shared_ptr<MultiApp> getMultiApp(const std::string & multi_app_name) const;
924 
928  std::vector<std::shared_ptr<Transfer>> getTransfers(ExecFlagType type,
929  MultiAppTransfer::DIRECTION direction) const;
930 
936 
943 
947  bool execMultiApps(ExecFlagType type, bool auto_advance = true);
948 
949  void finalizeMultiApps();
950 
955 
961  {
962  mooseDeprecated("Deprecated method; use finishMultiAppStep and/or incrementMultiAppTStep "
963  "depending on your purpose");
965  }
966 
971 
976 
981  void restoreMultiApps(ExecFlagType type, bool force = false);
982 
987 
991  virtual void addTransfer(const std::string & transfer_name,
992  const std::string & name,
994 
1002 
1005  const NumericVector<Number> & u,
1006  const NumericVector<Number> & udot,
1007  const NumericVector<Number> & udotdot,
1008  NumericVector<Number> & residual);
1009 
1012  const NumericVector<Number> & u,
1013  const NumericVector<Number> & udot,
1014  const NumericVector<Number> & udotdot,
1015  Real duDotDu_shift,
1016  Real duDotDotDu_shift,
1017  SparseMatrix<Number> & jacobian);
1018 
1020 
1027  virtual Real computeResidualL2Norm();
1028 
1032  virtual void computeResidualSys(NonlinearImplicitSystem & sys,
1033  const NumericVector<Number> & soln,
1034  NumericVector<Number> & residual);
1039  void computeResidual(NonlinearImplicitSystem & sys,
1040  const NumericVector<Number> & soln,
1041  NumericVector<Number> & residual);
1042 
1046  virtual void computeResidual(const NumericVector<Number> & soln,
1047  NumericVector<Number> & residual);
1051  virtual void computeResidualTag(const NumericVector<Number> & soln,
1052  NumericVector<Number> & residual,
1053  TagID tag);
1057  virtual void computeResidualType(const NumericVector<Number> & soln,
1058  NumericVector<Number> & residual,
1059  TagID tag);
1064  virtual void computeResidualInternal(const NumericVector<Number> & soln,
1065  NumericVector<Number> & residual,
1066  const std::set<TagID> & tags);
1070  virtual void computeResidualTags(const std::set<TagID> & tags);
1071 
1075  virtual void computeJacobianSys(NonlinearImplicitSystem & sys,
1076  const NumericVector<Number> & soln,
1077  SparseMatrix<Number> & jacobian);
1081  virtual void computeJacobian(const NumericVector<Number> & soln, SparseMatrix<Number> & jacobian);
1082 
1086  virtual void computeJacobianTag(const NumericVector<Number> & soln,
1087  SparseMatrix<Number> & jacobian,
1088  TagID tag);
1089 
1093  virtual void computeJacobianInternal(const NumericVector<Number> & soln,
1094  SparseMatrix<Number> & jacobian,
1095  const std::set<TagID> & tags);
1096 
1100  virtual void computeJacobianTags(const std::set<TagID> & tags);
1101 
1110  virtual void computeJacobianBlocks(std::vector<JacobianBlock *> & blocks);
1111 
1125  virtual void computeJacobianBlock(SparseMatrix<Number> & jacobian,
1126  libMesh::System & precond_system,
1127  unsigned int ivar,
1128  unsigned int jvar);
1129 
1130  virtual Real computeDamping(const NumericVector<Number> & soln,
1131  const NumericVector<Number> & update);
1132 
1137  virtual bool shouldUpdateSolution();
1138 
1145  virtual bool updateSolution(NumericVector<Number> & vec_solution,
1146  NumericVector<Number> & ghosted_solution);
1147 
1152  virtual void predictorCleanup(NumericVector<Number> & ghosted_solution);
1153 
1154  virtual void computeBounds(NonlinearImplicitSystem & sys,
1155  NumericVector<Number> & lower,
1156  NumericVector<Number> & upper);
1157  virtual void computeNearNullSpace(NonlinearImplicitSystem & sys,
1158  std::vector<NumericVector<Number> *> & sp);
1159  virtual void computeNullSpace(NonlinearImplicitSystem & sys,
1160  std::vector<NumericVector<Number> *> & sp);
1161  virtual void computeTransposeNullSpace(NonlinearImplicitSystem & sys,
1162  std::vector<NumericVector<Number> *> & sp);
1163  virtual void computePostCheck(NonlinearImplicitSystem & sys,
1164  const NumericVector<Number> & old_soln,
1165  NumericVector<Number> & search_direction,
1166  NumericVector<Number> & new_soln,
1167  bool & changed_search_direction,
1168  bool & changed_new_soln);
1169 
1170  virtual void computeIndicatorsAndMarkers();
1171  virtual void computeIndicators();
1172  virtual void computeMarkers();
1173 
1174  virtual void addResidual(THREAD_ID tid) override;
1175  virtual void addResidualNeighbor(THREAD_ID tid) override;
1176  virtual void addResidualScalar(THREAD_ID tid = 0);
1177 
1178  virtual void cacheResidual(THREAD_ID tid) override;
1179  virtual void cacheResidualNeighbor(THREAD_ID tid) override;
1180  virtual void addCachedResidual(THREAD_ID tid) override;
1181 
1189  virtual void addCachedResidualDirectly(NumericVector<Number> & residual, THREAD_ID tid);
1190 
1191  virtual void setResidual(NumericVector<Number> & residual, THREAD_ID tid) override;
1192  virtual void setResidualNeighbor(NumericVector<Number> & residual, THREAD_ID tid) override;
1193 
1194  virtual void addJacobian(THREAD_ID tid) override;
1195  virtual void addJacobianNeighbor(THREAD_ID tid) override;
1196  virtual void addJacobianBlock(SparseMatrix<Number> & jacobian,
1197  unsigned int ivar,
1198  unsigned int jvar,
1199  const DofMap & dof_map,
1200  std::vector<dof_id_type> & dof_indices,
1201  THREAD_ID tid) override;
1202  virtual void addJacobianNeighbor(SparseMatrix<Number> & jacobian,
1203  unsigned int ivar,
1204  unsigned int jvar,
1205  const DofMap & dof_map,
1206  std::vector<dof_id_type> & dof_indices,
1207  std::vector<dof_id_type> & neighbor_dof_indices,
1208  THREAD_ID tid) override;
1209  virtual void addJacobianScalar(THREAD_ID tid = 0);
1210  virtual void addJacobianOffDiagScalar(unsigned int ivar, THREAD_ID tid = 0);
1211 
1212  virtual void cacheJacobian(THREAD_ID tid) override;
1213  virtual void cacheJacobianNeighbor(THREAD_ID tid) override;
1214  virtual void addCachedJacobian(THREAD_ID tid) override;
1215 
1216  virtual void prepareShapes(unsigned int var, THREAD_ID tid) override;
1217  virtual void prepareFaceShapes(unsigned int var, THREAD_ID tid) override;
1218  virtual void prepareNeighborShapes(unsigned int var, THREAD_ID tid) override;
1219 
1220  // Displaced problem /////
1221  virtual void addDisplacedProblem(std::shared_ptr<DisplacedProblem> displaced_problem);
1222  virtual std::shared_ptr<DisplacedProblem> getDisplacedProblem() { return _displaced_problem; }
1223 
1224  virtual void updateGeomSearch(
1226  virtual void updateMortarMesh();
1227 
1228  void
1229  createMortarInterface(const std::pair<BoundaryID, BoundaryID> & master_slave_boundary_pair,
1230  const std::pair<SubdomainID, SubdomainID> & master_slave_subdomain_pair,
1231  bool on_displaced,
1232  bool periodic);
1233 
1235  getMortarInterface(const std::pair<BoundaryID, BoundaryID> & master_slave_boundary_pair,
1236  const std::pair<SubdomainID, SubdomainID> & master_slave_subdomain_pair,
1237  bool on_displaced) const;
1238 
1239  const std::unordered_map<std::pair<BoundaryID, BoundaryID>, AutomaticMortarGeneration> &
1240  getMortarInterfaces(bool on_displaced) const;
1241 
1242  virtual void possiblyRebuildGeomSearchPatches();
1243 
1245 
1250  void setRestartFile(const std::string & file_name);
1251 
1253 
1260  {
1261  return _neighbor_material_props;
1262  }
1264 
1266 
1271  {
1273  }
1276 
1281 
1286 
1287 #ifdef LIBMESH_ENABLE_AMR
1288  // Adaptivity /////
1290  virtual void initialAdaptMesh();
1291 
1295  virtual bool adaptMesh();
1296 
1300  unsigned int getNumCyclesCompleted() { return _cycles_completed; }
1301 
1305  bool hasInitialAdaptivity() const { return _adaptivity.getInitialSteps() > 0; }
1306 #else
1307 
1310  bool hasInitialAdaptivity() const { return false; }
1311 #endif // LIBMESH_ENABLE_AMR
1312 
1314  void initXFEM(std::shared_ptr<XFEMInterface> xfem);
1315 
1317  std::shared_ptr<XFEMInterface> getXFEM() { return _xfem; }
1318 
1320  bool haveXFEM() { return _xfem != nullptr; }
1321 
1323  virtual bool updateMeshXFEM();
1324 
1328  virtual void meshChanged() override;
1329 
1335 
1340  virtual void checkProblemIntegrity();
1341 
1342  void serializeSolution();
1343 
1344  void registerRandomInterface(RandomInterface & random_interface, const std::string & name);
1345 
1350  void setConstJacobian(bool state) { _const_jacobian = state; }
1351 
1357 
1365 
1370 
1375 
1377 
1395  bool needSubdomainMaterialOnSide(SubdomainID subdomain_id, THREAD_ID tid);
1397 
1402  unsigned int subspaceDim(const std::string & prefix) const
1403  {
1404  if (_subspace_dim.count(prefix))
1405  return _subspace_dim.find(prefix)->second;
1406  else
1407  return 0;
1408  }
1409 
1410  /*
1411  * Return a reference to the material warehouse of *all* Material objects.
1412  */
1414 
1415  /*
1416  * Return a reference to the material warehouse of Material objects to be computed.
1417  */
1421 
1429  std::shared_ptr<Material> getMaterial(std::string name,
1431  THREAD_ID tid = 0,
1432  bool no_warn = false);
1433 
1434  /*
1435  * Return a pointer to the MaterialData
1436  */
1437  std::shared_ptr<MaterialData> getMaterialData(Moose::MaterialDataType type, THREAD_ID tid = 0);
1438 
1444  {
1446  }
1447 
1449  {
1451  }
1452 
1454 
1456 
1458  bool hasTimeIntegrator() const { return _has_time_integrator; }
1459 
1461 
1467  const ExecFlagType & getCurrentExecuteOnFlag() const;
1468  void setCurrentExecuteOnFlag(const ExecFlagType &);
1470 
1474  virtual void execute(const ExecFlagType & exec_type);
1475 
1479  virtual void computeUserObjects(const ExecFlagType & type, const Moose::AuxGroup & group);
1480 
1484  virtual void computeUserObjectByName(const ExecFlagType & type, const std::string & name);
1485 
1489  virtual void computeAuxiliaryKernels(const ExecFlagType & type);
1490 
1494  void needsPreviousNewtonIteration(bool state);
1495 
1500  bool needsPreviousNewtonIteration() const;
1501 
1506 
1508 
1511  std::vector<Real> _real_zero;
1512  std::vector<VariableValue> _scalar_zero;
1513  std::vector<VariableValue> _zero;
1514  std::vector<MooseArray<DualReal>> _ad_zero;
1515  std::vector<VariableGradient> _grad_zero;
1516  std::vector<MooseArray<DualRealVectorValue>> _ad_grad_zero;
1517  std::vector<VariableSecond> _second_zero;
1518  std::vector<MooseArray<DualRealTensorValue>> _ad_second_zero;
1519  std::vector<VariablePhiSecond> _second_phi_zero;
1520  std::vector<Point> _point_zero;
1521  std::vector<VectorVariableValue> _vector_zero;
1522  std::vector<VectorVariableCurl> _vector_curl_zero;
1524 
1529 
1533  void executeControls(const ExecFlagType & exec_type);
1534 
1538  void executeSamplers(const ExecFlagType & exec_type);
1539 
1543  virtual void updateActiveObjects();
1544 
1551 
1553 
1555 
1559  bool hasJacobian() const;
1560 
1565  bool constJacobian() const;
1566 
1570  void addOutput(const std::string &, const std::string &, InputParameters);
1571 
1572  inline TheWarehouse & theWarehouse() const { return _app.theWarehouse(); }
1573 
1577  void setSNESMFReuseBase(bool reuse, bool set_by_user)
1578  {
1579  _snesmf_reuse_base = reuse, _snesmf_reuse_base_set_by_user = set_by_user;
1580  }
1581 
1586 
1591 
1596  void usingADMatProps(bool using_ad_mat_props) { _using_ad_mat_props = using_ad_mat_props; }
1597 
1601  bool usingADMatProps() const { return _using_ad_mat_props; }
1602 
1604  virtual void setUDotRequested(const bool u_dot_requested) { _u_dot_requested = u_dot_requested; };
1605 
1607  virtual void setUDotDotRequested(const bool u_dotdot_requested)
1608  {
1609  _u_dotdot_requested = u_dotdot_requested;
1610  };
1611 
1613  virtual void setUDotOldRequested(const bool u_dot_old_requested)
1614  {
1615  _u_dot_old_requested = u_dot_old_requested;
1616  };
1617 
1619  virtual void setUDotDotOldRequested(const bool u_dotdot_old_requested)
1620  {
1621  _u_dotdot_old_requested = u_dotdot_old_requested;
1622  };
1623 
1625  virtual bool uDotRequested() { return _u_dot_requested; };
1626 
1628  virtual bool uDotDotRequested() { return _u_dotdot_requested; };
1629 
1631  virtual bool uDotOldRequested()
1632  {
1634  mooseError("FEProblemBase: When requesting old time derivative of solution, current time "
1635  "derivative of solution should also be stored. Please set `u_dot_requested` to "
1636  "true using setUDotRequested.");
1637 
1638  return _u_dot_old_requested;
1639  };
1640 
1642  virtual bool uDotDotOldRequested()
1643  {
1645  mooseError("FEProblemBase: When requesting old second time derivative of solution, current "
1646  "second time derivation of solution should also be stored. Please set "
1647  "`u_dotdot_requested` to true using setUDotDotRequested.");
1648  return _u_dotdot_old_requested;
1649  };
1650 
1652  void haveADObjects(bool have_ad_objects) override;
1653 
1654  // Whether or not we should solve this system
1655  bool shouldSolve() const { return _solve; }
1656 
1660  const MortarData & mortarData() const { return _mortar_data; }
1661 
1662 protected:
1664  void createTagVectors();
1665 
1667  EquationSystems _eq;
1669 
1670  std::set<TagID> _fe_vector_tags;
1671 
1672  std::set<TagID> _fe_matrix_tags;
1673 
1675  bool _solve;
1676 
1678  Real & _time;
1679  Real & _time_old;
1680  int & _t_step;
1681  Real & _dt;
1682  Real & _dt_old;
1683 
1684  std::shared_ptr<NonlinearSystemBase> _nl;
1685  std::shared_ptr<AuxiliarySystem> _aux;
1686 
1688  std::unique_ptr<CouplingMatrix> _cm;
1689 
1690  // Dimension of the subspace spanned by the vectors with a given prefix
1691  std::map<std::string, unsigned int> _subspace_dim;
1692 
1693  std::vector<std::unique_ptr<Assembly>> _assembly;
1694 
1697 
1700 
1703 
1706 
1709 
1713  ScalarInitialConditionWarehouse _scalar_ics; // use base b/c of setup methods
1715 
1716  // material properties
1720 
1721  std::vector<std::shared_ptr<MaterialData>> _material_data;
1722  std::vector<std::shared_ptr<MaterialData>> _bnd_material_data;
1723  std::vector<std::shared_ptr<MaterialData>> _neighbor_material_data;
1724 
1726  // Material Warehouses
1727  MaterialWarehouse _residual_materials; // Residual materials. This is the union of traditional
1728  // materials and the residual copy of an ADMaterial
1729  MaterialWarehouse _jacobian_materials; // Jacobian materials. This is the union of traditional
1730  // materials and the Jacobian copy of an ADMaterial
1731  MaterialWarehouse _discrete_materials; // Materials that the user must compute
1732  MaterialWarehouse _all_materials; // All materials for error checking and MaterialData storage
1734 
1736  // Indicator Warehouses
1740 
1741  // Marker Warehouse
1743 
1744  // postprocessors
1746 
1747  // VectorPostprocessors
1749 
1750  // TODO: delete this after apps have been updated to not call getUserObjects
1752 
1755 
1758 
1761 
1764 
1767 
1769  std::map<std::string, std::unique_ptr<RandomData>> _random_data_objects;
1770 
1772  std::vector<std::unordered_map<SubdomainID, bool>> _block_mat_side_cache;
1773 
1775  std::vector<std::unordered_map<BoundaryID, bool>> _bnd_mat_side_cache;
1776 
1778  std::vector<MeshChangedInterface *> _notify_when_mesh_changes;
1779 
1787  void meshChangedHelper(bool intermediate_change = false);
1788 
1790  bool duplicateVariableCheck(const std::string & var_name, const FEType & type, bool is_aux);
1791 
1793  const Moose::AuxGroup & group,
1794  TheWarehouse::Query & query);
1795 
1797  void checkDisplacementOrders();
1798 
1799  void checkUserObjects();
1800 
1807  const std::map<SubdomainID, std::vector<std::shared_ptr<Material>>> & materials_map);
1808 
1810  void checkCoordinateSystems();
1811 
1816 
1817 #ifdef LIBMESH_ENABLE_AMR
1819  unsigned int _cycles_completed;
1820 #endif
1821 
1823  std::shared_ptr<XFEMInterface> _xfem;
1824 
1825  // Displaced mesh /////
1827  std::shared_ptr<DisplacedProblem> _displaced_problem;
1830 
1833 
1836 
1839 
1842 
1845 
1848 
1851 
1853  std::unique_ptr<Resurrector> _resurrector;
1854 
1857 
1860 
1863 
1867 
1868  std::vector<std::vector<MooseVariableFEBase *>> _uo_jacobian_moose_vars;
1869 
1871 
1874 
1877 
1879  unsigned int _max_qps;
1880 
1882  unsigned int _max_shape_funcs;
1883 
1886 
1889 
1892 
1895 
1897  std::string _exception_message;
1898 
1901 
1904 
1905 #ifdef LIBMESH_HAVE_PETSC
1908 #endif // LIBMESH_HAVE_PETSC
1909 
1910  std::shared_ptr<LineSearch> _line_search;
1911 
1912  std::unique_ptr<ConstElemRange> _evaluable_local_elem_range;
1913 
1917 
1918 private:
1919  void joinAndFinalize(TheWarehouse::Query query, bool isgen = false);
1920 
1923  const bool _force_restart;
1927 
1930 
1933 
1980 
1983 
1986 
1989 
1992 
1993  friend class AuxiliarySystem;
1994  friend class NonlinearSystemBase;
1995  friend class MooseEigenSystem;
1996  friend class Resurrector;
1997  friend class RestartableDataIO;
1998  friend class Restartable;
1999  friend class DisplacedProblem;
2000 };
2001 
2002 template <typename T>
2003 void
2005 {
2006  _app.getOutputWarehouse().allowOutput<T>(state);
2007 }
bool _reinit_displaced_elem
void computeTransientImplicitResidual(Real time, const NumericVector< Number > &u, const NumericVector< Number > &udot, const NumericVector< Number > &udotdot, NumericVector< Number > &residual)
Evaluates transient residual G in canonical semidiscrete form G(t,U,Udot,Udotdot) = F(t...
virtual void addResidual(THREAD_ID tid) override
const PerfID _adapt_mesh_timer
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.
const PerfID _backup_multi_apps_timer
VarFieldType
Definition: MooseTypes.h:488
virtual bool hasVariable(const std::string &var_name) const override
virtual void addMultiApp(const std::string &multi_app_name, const std::string &name, InputParameters parameters)
Add a MultiApp to the problem.
bool shouldSolve() const
const VectorPostprocessorData & getVectorPostprocessorData() const
virtual bool computingInitialResidual() const override
Returns true if the problem is in the process of computing it&#39;s initial residual. ...
virtual void setUDotDotOldRequested(const bool u_dotdot_old_requested)
Set boolean flag to true to store old solution second time derivative.
const PerfID _compute_residual_l2_norm_timer
Class for doing restart.
Definition: Resurrector.h:27
Helper class for holding the preconditioning blocks to fill.
virtual void setResidualNeighbor(NumericVector< Number > &residual, THREAD_ID tid) override
virtual void computeJacobianSys(NonlinearImplicitSystem &sys, const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian)
Form a Jacobian matrix.
virtual void addCachedResidualDirectly(NumericVector< Number > &residual, THREAD_ID tid)
Allows for all the residual contributions that are currently cached to be added directly into the vec...
Moose::PetscSupport::PetscOptions & getPetscOptions()
Retrieve a writable reference the PETSc options (used by PetscSupport)
virtual void prepare(const Elem *elem, THREAD_ID tid) override
virtual Real & dtOld() const
const PerfID _compute_bounds_timer
Base class for function objects.
Definition: Function.h:40
const CouplingMatrix * couplingMatrix()
void initPetscOutput()
Reinitialize petsc output for proper linear/nonlinear iteration display.
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.
const PerfID _check_linear_convergence_timer
bool _snesmf_reuse_base_set_by_user
If or not _snesmf_reuse_base is set by user.
bool _parallel_barrier_messaging
Whether or not information about how many transfers have completed is printed.
virtual void addResidualNeighbor(THREAD_ID tid) override
A class for creating restricted objects.
Definition: Restartable.h:29
std::vector< std::shared_ptr< MaterialData > > _neighbor_material_data
MaterialPropertyStorage & _bnd_material_props
virtual void addGhostedElem(dof_id_type elem_id) override
Will make sure that all dofs connected to elem_id are ghosted to this processor.
void setNonlocalCouplingMatrix()
Set custom coupling matrix for variables requiring nonlocal contribution.
virtual Real & time() const
SolverParams _solver_params
void execMultiAppTransfers(ExecFlagType type, MultiAppTransfer::DIRECTION direction)
Execute MultiAppTransfers associate with execution flag and direction.
SolverParams & solverParams()
Get the solver parameters.
virtual void addJacobianOffDiagScalar(unsigned int ivar, THREAD_ID tid=0)
const PerfID _compute_residual_tags_timer
MaterialWarehouse _jacobian_materials
const PerfID _mesh_changed_helper_timer
virtual void prepareFace(const Elem *elem, THREAD_ID tid) override
virtual void setInputParametersFEProblem(InputParameters &parameters)
ExecFlagType _current_execute_on_flag
Current execute_on flag.
T & getUserObject(const std::string &name, unsigned int tid=0) const
Get the user object by its name.
bool hasVectors(const std::string &vpp_name) const
Check to see if a VPP has any vectors at all.
const PerfID _compute_damping_timer
virtual void addPredictor(const std::string &type, const std::string &name, InputParameters parameters)
virtual void prepareMaterials(SubdomainID blk_id, THREAD_ID tid)
Add the MooseVariables that the current materials depend on to the dependency list.
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...
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:62
virtual void setActiveElementalMooseVariables(const std::set< MooseVariableFEBase *> &moose_vars, THREAD_ID tid) override
Set the MOOSE variables to be reinited on each element.
virtual void addMaterial(const std::string &kernel_name, const std::string &name, InputParameters parameters)
bool _error_on_jacobian_nonzero_reallocation
const PerfID _compute_residual_internal_timer
NonlinearSystemBase & getNonlinearSystemBase()
unsigned int TagID
Definition: MooseTypes.h:162
virtual void addVectorPostprocessor(std::string pp_name, const std::string &name, InputParameters parameters)
virtual MooseVariableFEBase & getVariable(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) override
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
virtual void addScalarVariable(const std::string &var_name, Order order, Real scale_factor=1., const std::set< SubdomainID > *const active_subdomains=NULL)
bool usingADMatProps() const
Whether any object has requested/supplied an AD material property.
std::shared_ptr< NonlinearSystemBase > _nl
bool _has_jacobian
Indicates if the Jacobian was computed.
const PerfID _exec_multi_apps_timer
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 _has_nonlocal_coupling
Indicates if nonlocal coupling is required/exists.
virtual VectorMooseVariable & getVectorVariable(THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested VectorMooseVariable which may be in any system...
virtual bool reinitDirac(const Elem *elem, THREAD_ID tid) override
Returns true if the Problem has Dirac kernels it needs to compute on elem.
This is the base class for Samplers.
Definition: Sampler.h:40
virtual void addDiracKernel(const std::string &kernel_name, const std::string &name, InputParameters parameters)
virtual void postExecute()
Method called at the end of the simulation.
void setVariableAllDoFMap(const std::vector< MooseVariableFEBase *> moose_vars)
void joinAndFinalize(TheWarehouse::Query query, bool isgen=false)
Warehouse for storing initial conditions.
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters parameters)
const UserObject & getUserObjectBase(const std::string &name) const
Get the user object by its name.
ExecuteMooseObjectWarehouse< Control > _control_warehouse
The control logic warehouse.
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 bool uDotRequested()
Get boolean flag to check whether solution time derivative needs to be stored.
virtual void init() override
virtual void prepareNeighborShapes(unsigned int var, THREAD_ID tid) override
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.
PostprocessorValue & getPostprocessorValueOld(const std::string &name)
Get the reference to the old value of a post-processor.
virtual void lineSearch()
execute MOOSE line search
virtual bool uDotDotRequested()
Get boolean flag to check whether solution second time derivative needs to be stored.
void serializeSolution()
virtual void reinitMaterialsNeighbor(SubdomainID blk_id, THREAD_ID tid, bool swap_stateful=true)
Class for doing restart.
void finishMultiAppStep(ExecFlagType type)
Finish the MultiApp time step (endStep, postStep) associated with the ExecFlagType.
const PerfID _update_mesh_xfem_timer
virtual void initNullSpaceVectors(const InputParameters &parameters, NonlinearSystemBase &nl)
void addOutput(const std::string &, const std::string &, InputParameters)
Adds an Output object.
A struct for storing the various types of petsc options and values.
Definition: PetscSupport.h:39
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...
virtual void computeJacobian(const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian)
Form a Jacobian matrix with the default tag (system).
const PerfID _reinit_because_of_ghosting_or_new_geom_objects_timer
MaterialDataType
MaterialData types.
Definition: MooseTypes.h:459
void computeUserObjectsInternal(const ExecFlagType &type, const Moose::AuxGroup &group, TheWarehouse::Query &query)
const PerfID _solve_timer
virtual void addJacobianNeighbor(THREAD_ID tid) override
Assembly & assembly(THREAD_ID tid) override
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
virtual void updateActiveObjects()
Update the active objects in the warehouses.
Stores the stateful material properties computed by materials.
bool needSubdomainMaterialOnSide(SubdomainID subdomain_id, THREAD_ID tid)
virtual void computeIndicatorsAndMarkers()
Definition: Marker.h:39
virtual void setActiveScalarVariableCoupleableMatrixTags(std::set< TagID > &mtags, THREAD_ID tid) override
virtual void setException(const std::string &message)
Set an exception.
ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValue(const VectorPostprocessorName &vpp_name, const std::string &vector_name)
Return the scatter value for the post processor.
virtual void clearActiveScalarVariableCoupleableMatrixTags(THREAD_ID tid) override
std::shared_ptr< Material > getMaterial(std::string name, Moose::MaterialDataType type, THREAD_ID tid=0, bool no_warn=false)
Return a pointer to a Material object.
void setErrorOnJacobianNonzeroReallocation(bool state)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
bool hasPostprocessor(const std::string &name)
Check existence of the postprocessor.
const Assembly & assembly(THREAD_ID tid) const override
virtual void computeBounds(NonlinearImplicitSystem &sys, NumericVector< Number > &lower, NumericVector< Number > &upper)
virtual bool hasScalarVariable(const std::string &var_name) const override
Returns a Boolean indicating whether any system contains a variable with the name provided...
const PerfID _check_problem_integrity_timer
MultiApp Implementation for Transient Apps.
virtual void addNodalKernel(const std::string &kernel_name, const std::string &name, InputParameters parameters)
const PerfID _advance_state_timer
std::vector< VariableSecond > _second_zero
const PerfID _compute_residual_sys_timer
virtual void onTimestepEnd() override
All Distributions should inherit from this class.
Definition: Distribution.h:22
void setCouplingMatrix(std::unique_ptr< CouplingMatrix > cm)
Set custom coupling matrix.
std::vector< VectorVariableCurl > _vector_curl_zero
virtual bool updateSolution(NumericVector< Number > &vec_solution, NumericVector< Number > &ghosted_solution)
Update the solution.
bool _has_exception
Whether or not an exception has occurred.
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)
ExecuteMooseObjectWarehouse< MultiApp > & getMultiAppWarehouse()
bool hasVectorPostprocessor(const std::string &name)
Check existence of the VectorPostprocessor.
Material objects are special in that they have additional objects created automatically (see FEProble...
void mooseError(Args &&... args) const
Definition: MooseObject.h:147
ExecuteMooseObjectWarehouse< TransientMultiApp > _transient_multi_apps
Storage for TransientMultiApps (only needed for calling &#39;computeDT&#39;)
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
virtual void setActiveFEVariableCoupleableMatrixTags(std::set< TagID > &mtags, THREAD_ID tid) override
ExecuteMooseObjectWarehouse< Transfer > _from_multi_app_transfers
Transfers executed just after MultiApps to transfer data from them.
std::vector< std::shared_ptr< Transfer > > getTransfers(ExecFlagType type, MultiAppTransfer::DIRECTION direction) const
Get Transfers by ExecFlagType and direction.
Base class for a system (of equations)
Definition: SystemBase.h:92
const InitialConditionWarehouse & getInitialConditionWarehouse() const
Return InitialCondition storage.
virtual void computeUserObjectByName(const ExecFlagType &type, const std::string &name)
Compute an user object with the given name.
PostprocessorValue & getPostprocessorValueOlder(const std::string &name)
Get the reference to the older value of a post-processor.
const MaterialPropertyStorage & getBndMaterialPropertyStorage()
unsigned int getNumCyclesCompleted()
virtual void reinitElem(const Elem *elem, THREAD_ID tid) override
const PerfID _execute_controls_timer
virtual void reinitMaterials(SubdomainID blk_id, THREAD_ID tid, bool swap_stateful=true)
virtual void addTransfer(const std::string &transfer_name, const std::string &name, InputParameters parameters)
Add a Transfer to the problem.
bool hasDampers()
Whether or not this system has dampers.
std::vector< std::shared_ptr< MaterialData > > _bnd_material_data
virtual void reinitMaterialsBoundary(BoundaryID boundary_id, THREAD_ID tid, bool swap_stateful=true)
std::unique_ptr< CouplingMatrix > _cm
Coupling matrix for variables.
virtual void clearActiveScalarVariableCoupleableVectorTags(THREAD_ID tid) override
FEProblemBase(const InputParameters &parameters)
virtual Real finalNonlinearResidual() const 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.
void addIndicator(std::string indicator_name, const std::string &name, InputParameters parameters)
virtual unsigned int nLinearIterations() const override
virtual void setActiveMaterialProperties(const std::set< unsigned int > &mat_prop_ids, THREAD_ID tid) override
Record and set the material properties required by the current computing thread.
virtual void subdomainSetup(SubdomainID subdomain, THREAD_ID tid)
const PerfID _save_old_solutions_timer
std::vector< std::pair< MooseVariableFEBase *, MooseVariableFEBase * > > & couplingEntries(THREAD_ID tid)
virtual bool hasFunction(const std::string &name, THREAD_ID tid=0)
Real computeMultiAppsDT(ExecFlagType type)
Find the smallest timestep over all MultiApps.
void setParallelBarrierMessaging(bool flag)
Toggle parallel barrier messaging (defaults to on).
void projectSolution()
bool vectorPostprocessorHasVectors(const std::string &vpp_name)
Whether or not the specified VectorPostprocessor has declared any vectors.
virtual void addResidualScalar(THREAD_ID tid=0)
virtual void computeResidualTags(const std::set< TagID > &tags)
Form multiple residual vectors and each is associated with one tag.
unsigned int PerfID
Definition: MooseTypes.h:163
std::shared_ptr< MultiApp > getMultiApp(const std::string &multi_app_name) const
Get a MultiApp object by name.
virtual void addMaterialHelper(std::vector< MaterialWarehouse *> warehouse, const std::string &kernel_name, const std::string &name, InputParameters parameters)
virtual void reinitNodesNeighbor(const std::vector< dof_id_type > &nodes, THREAD_ID tid) override
ExecuteMooseObjectWarehouse< UserObject > _all_user_objects
AuxGroup
Flag for AuxKernel related execution type.
Definition: MooseTypes.h:470
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 addKernel(const std::string &kernel_name, const std::string &name, InputParameters parameters)
virtual void timestepSetup()
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 computeJacobianBlocks(std::vector< JacobianBlock *> &blocks)
Computes several Jacobian blocks simultaneously, summing their contributions into smaller preconditio...
virtual EquationSystems & es() override
This class is a container/interface for the objects involved in automatic generation of mortar spaces...
Query & condition(Args &&... args)
Adds a new condition to the query.
Definition: TheWarehouse.h:157
const bool _skip_nl_system_check
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:53
ScalarInitialConditionWarehouse _scalar_ics
NonlinearSystemBase * nl
Nonlinear system to be solved.
virtual void advanceState()
Advance all of the state holding vectors / datastructures so that we can move to the next timestep...
A user object that runs over all the nodes and does an aggregation step to compute a single value...
ExecuteMooseObjectWarehouse< Transfer > _transfers
Normal Transfers.
void initPostprocessorData(const std::string &name)
Initializes the postprocessor data.
virtual void addAuxScalarKernel(const std::string &kernel_name, const std::string &name, InputParameters parameters)
const std::vector< std::pair< std::string, VectorPostprocessorData::VectorPostprocessorState > > & getVectorPostprocessorVectors(const std::string &vpp_name)
Get the vectors for a specific VectorPostprocessor.
virtual const SystemBase & systemBaseNonlinear() const override
Return the nonlinear system object as a base class reference.
MooseLinearConvergenceReason
virtual void addLineSearch(const InputParameters &)
add a MOOSE line search
virtual void copySolutionsBackwards()
bool _calculate_jacobian_in_uo
virtual void addConstraint(const std::string &c_name, const std::string &name, InputParameters parameters)
virtual void computeUserObjects(const ExecFlagType &type, const Moose::AuxGroup &group)
Call compute methods on UserObjects.
virtual void addExtraVectors()
A place to add extra vectors to the simulation.
virtual MooseLinearConvergenceReason checkLinearConvergence(std::string &msg, const PetscInt n, const Real rnorm, const Real rtol, const Real atol, const Real dtol, const PetscInt maxits)
Check for convergence of the linear solution.
const MaterialWarehouse & getDiscreteMaterialWarehouse() const
bool hasJacobian() const
Returns _has_jacobian.
void initVectorPostprocessorData(const std::string &name)
Initialize the VectorPostprocessor data.
virtual void addCachedJacobian(THREAD_ID tid) override
virtual bool converged() override
virtual Sampler & getSampler(const std::string &name, THREAD_ID tid=0)
virtual void execute(const ExecFlagType &exec_type)
Convenience function for performing execution of MOOSE systems.
const PerfID _compute_indicators_timer
const bool _skip_additional_restart_data
virtual void newAssemblyArray(NonlinearSystemBase &nl)
ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueOld(const VectorPostprocessorName &vpp_name, const std::string &vector_name)
Return the scatter value for the post processor.
virtual Function & getFunction(const std::string &name, THREAD_ID tid=0)
virtual std::vector< VariableName > getVariableNames()
Returns a list of all the variables in the problem (both from the NL and Aux systems.
void reinitBecauseOfGhostingOrNewGeomObjects()
Call when it is possible that the needs for ghosted elements has changed.
virtual void computeResidualTag(const NumericVector< Number > &soln, NumericVector< Number > &residual, TagID tag)
Form a residual vector for a given tag.
void usingADMatProps(bool using_ad_mat_props)
Set the global automatic differentiaion (AD) flag which indicates whether any consumer has requested ...
MooseObjectWarehouse< InternalSideIndicator > _internal_side_indicators
const AutomaticMortarGeneration & getMortarInterface(const std::pair< BoundaryID, BoundaryID > &master_slave_boundary_pair, const std::pair< SubdomainID, SubdomainID > &master_slave_subdomain_pair, bool on_displaced) const
const PerfID _compute_markers_timer
const PerfID _initial_adapt_mesh_timer
ExecuteMooseObjectWarehouse< Transfer > _to_multi_app_transfers
Transfers executed just before MultiApps to transfer data to them.
Interface for notifications that the mesh has changed.
const PerfID _mesh_changed_timer
virtual std::shared_ptr< DisplacedProblem > getDisplacedProblem()
This is the common base class for the two main kernel types implemented in MOOSE, EigenKernel and Ker...
Definition: KernelBase.h:44
bool _input_file_saved
whether input file has been written
virtual void setActiveFEVariableCoupleableVectorTags(std::set< TagID > &vtags, THREAD_ID tid) override
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 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:42
const PerfID _serialize_solution_timer
virtual bool shouldUpdateSolution()
Check to see whether the problem should update the solution.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
PostprocessorData _pps_data
const std::vector< MooseVariableFEBase * > & getUserObjectJacobianVariables(THREAD_ID tid) const
void executeSamplers(const ExecFlagType &exec_type)
Performs setup and execute calls for Sampler objects.
virtual void cacheJacobian(THREAD_ID tid) override
boundary_id_type BoundaryID
virtual void addCachedResidual(THREAD_ID tid) override
const PerfID _exec_multi_app_transfers_timer
virtual void setUDotRequested(const bool u_dot_requested)
Set boolean flag to true to store solution time derivative.
const PerfID _check_nonlinear_convergence_timer
bool constJacobian() const
Returns _const_jacobian (whether a MOOSE object has specified that the Jacobian is the same as the pr...
virtual void clearActiveMaterialProperties(THREAD_ID tid) override
Clear the active material properties.
std::vector< MeshChangedInterface * > _notify_when_mesh_changes
Objects to be notified when the mesh changes.
void checkNonlocalCoupling()
VarKindType
Framework-wide stuff.
Definition: MooseTypes.h:481
const PerfID _execute_samplers_timer
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.
const PerfID _restore_solutions_timer
Real PostprocessorValue
MOOSE typedefs.
Definition: MooseTypes.h:154
DofMap & dof_map
unsigned int getMaxShapeFunctions() const
std::vector< std::unordered_map< SubdomainID, bool > > _block_mat_side_cache
Cache for calculating materials on side.
MortarData _mortar_data
const PerfID _compute_jacobian_blocks_timer
bool hasTimeIntegrator() const
Returns whether or not this Problem has a TimeIntegrator.
std::shared_ptr< AuxiliarySystem > _aux
virtual MooseVariableScalar & getScalarVariable(THREAD_ID tid, const std::string &var_name) override
Returns the scalar variable reference from whichever system contains it.
virtual void addFunction(std::string type, const std::string &name, InputParameters parameters)
TheWarehouse is a container for MooseObjects that allows querying/filtering over various customizeabl...
Definition: TheWarehouse.h:119
virtual void addADResidualMaterial(const std::string &kernel_name, const std::string &name, InputParameters parameters)
void checkDependMaterialsHelper(const std::map< SubdomainID, std::vector< std::shared_ptr< Material >>> &materials_map)
Helper method for checking Material object dependency.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
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 void meshChanged() override
Update data after a mesh change.
MooseMesh & _mesh
virtual bool uDotOldRequested()
Get boolean flag to check whether old solution time derivative needs to be stored.
const PerfID _compute_user_objects_timer
virtual bool updateMeshXFEM()
Update the mesh due to changing XFEM cuts.
virtual void restoreSolutions()
const PerfID _compute_transient_implicit_residual_timer
const PerfID _compute_jacobian_internal_timer
bool _u_dotdot_old_requested
Whether old solution second time derivative needs to be stored.
virtual void addTimeIntegrator(const std::string &type, const std::string &name, InputParameters parameters)
unsigned int _max_shape_funcs
Maximum number of shape functions on any element in the problem.
const ExecuteMooseObjectWarehouse< UserObject > & getUserObjects() const
void setAxisymmetricCoordAxis(const MooseEnum &rz_coord_axis)
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
virtual const SystemBase & systemBaseAuxiliary() const override
Return the auxiliary system object as a base class reference.
void checkUserObjectJacobianRequirement(THREAD_ID tid)
VectorPostprocessorData _vpps_data
bool areCoupled(unsigned int ivar, unsigned int jvar)
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)
const bool _force_restart
const ExecuteMooseObjectWarehouse< Transfer > & getMultiAppTransferWarehouse(MultiAppTransfer::DIRECTION direction) const
Return the complete warehouse for MultiAppTransfer object for the given direction.
void forceOutput()
Indicates that the next call to outputStep should be forced.
void createMortarInterface(const std::pair< BoundaryID, BoundaryID > &master_slave_boundary_pair, const std::pair< SubdomainID, SubdomainID > &master_slave_subdomain_pair, bool on_displaced, bool periodic)
std::vector< VariablePhiSecond > _second_phi_zero
bool _started_initial_setup
At or beyond initialSteup stage.
std::map< std::string, std::unique_ptr< RandomData > > _random_data_objects
A map of objects that consume random numbers.
bool errorOnJacobianNonzeroReallocation() const
Will return True if the user wants to get an error when a nonzero is reallocated in the Jacobian by P...
std::vector< std::vector< MooseVariableFEBase * > > _uo_jacobian_moose_vars
subdomain_id_type SubdomainID
virtual void addVariable(const std::string &var_name, const FEType &type, Real scale_factor, const std::set< SubdomainID > *const active_subdomains=NULL)
virtual void addDamper(std::string damper_name, const std::string &name, InputParameters parameters)
virtual void swapBackMaterials(THREAD_ID tid)
const PerfID _initial_setup_timer
Timers.
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< Indicator > _indicators
std::unique_ptr< Resurrector > _resurrector
Object responsible for restart (read/write)
virtual void reinitNodeFace(const Node *node, BoundaryID bnd_id, THREAD_ID tid) override
bool haveADObjects() const
Method for reading wehther we have any ad objects.
Definition: SubProblem.h:622
const MooseObjectWarehouse< Indicator > & getIndicatorWarehouse()
Return indicator/marker storage.
VectorPostprocessorValue & getVectorPostprocessorValueOld(const std::string &name, const std::string &vector_name)
DEPRECATED: Use the new version where you need to specify whether or not the vector must be broadcast...
InitialConditions are objects that set the initial value of variables.
virtual void clearDiracInfo() override
Gets called before Dirac Kernels are asked to add the points they are supposed to be evaluated in...
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 reinitNodes(const std::vector< dof_id_type > &nodes, THREAD_ID tid) override
ExecuteMooseObjectWarehouse< MultiApp > _multi_apps
MultiApp Warehouse.
virtual int & timeStep() const
ExecuteMooseObjectWarehouse< Sampler > _samplers
Samplers.
CoordinateSystemType
Definition: MooseTypes.h:556
virtual void swapBackMaterialsNeighbor(THREAD_ID tid)
virtual void addDisplacedProblem(std::shared_ptr< DisplacedProblem > displaced_problem)
std::shared_ptr< MaterialData > getMaterialData(Moose::MaterialDataType type, THREAD_ID tid=0)
virtual void setCoordSystem(const std::vector< SubdomainName > &blocks, const MultiMooseEnum &coord_sys)
Materials compute MaterialProperties.
Definition: Material.h:46
const PerfID _eq_init_timer
bool _solve
Whether or not to actually solve the nonlinear system.
const PerfID _check_exception_and_stop_solve_timer
bool _snesmf_reuse_base
If or not to resuse the base vector for matrix-free calculation.
const PerfID _update_active_objects_timer
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:93
const PerfID _update_geometric_search_timer
virtual void clearActiveFEVariableCoupleableVectorTags(THREAD_ID tid) override
std::vector< Real > VectorPostprocessorValue
Definition: MooseTypes.h:155
virtual void updateMortarMesh()
Real ScatterVectorPostprocessorValue
Definition: MooseTypes.h:156
std::set< TagID > _fe_matrix_tags
std::vector< std::pair< MooseVariableFEBase *, MooseVariableFEBase * > > & nonlocalCouplingEntries(THREAD_ID tid)
virtual void addADJacobianMaterial(const std::string &kernel_name, const std::string &name, InputParameters parameters)
bool isSNESMFReuseBaseSetbyUser()
Return a flag to indicate if _snesmf_reuse_base is set by users.
const PerfID _compute_post_check_timer
InitialConditionWarehouse _ics
virtual void reinitElemFace(const Elem *elem, unsigned int side, BoundaryID bnd_id, THREAD_ID tid) override
virtual void addJacobianScalar(THREAD_ID tid=0)
MaterialWarehouse _discrete_materials
bool _reinit_displaced_face
The InternalSideIndicator class is responsible for calculating the residuals for various physics on i...
virtual void prepareAssembly(THREAD_ID tid) override
virtual void reinitScalars(THREAD_ID tid) override
virtual void addDistribution(std::string type, const std::string &name, InputParameters parameters)
The following functions will enable MOOSE to have the capability to import distributions.
std::shared_ptr< LineSearch > getLineSearch()
getter for the MOOSE line search
virtual void addAuxScalarVariable(const std::string &var_name, Order order, Real scale_factor=1., const std::set< SubdomainID > *const active_subdomains=NULL)
virtual void neighborSubdomainSetup(SubdomainID subdomain, THREAD_ID tid)
Takes care of everything related to mesh adaptivity.
Definition: Adaptivity.h:46
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:59
void setConstJacobian(bool state)
Set flag that Jacobian is constant (for optimization purposes)
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:21
Base class for Control objects.
Definition: Control.h:37
std::vector< VariableGradient > _grad_zero
bool hasActiveObjects(THREAD_ID tid=0) const
std::vector< MooseArray< DualRealTensorValue > > _ad_second_zero
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:92
virtual void addDGKernel(const std::string &kernel_name, const std::string &name, InputParameters parameters)
const MaterialWarehouse & getJacobianMaterialsWarehouse() const
std::vector< MooseArray< DualRealVectorValue > > _ad_grad_zero
virtual void reinitMaterialsFace(SubdomainID blk_id, THREAD_ID tid, bool swap_stateful=true)
virtual void setCurrentSubdomainID(const Elem *elem, THREAD_ID tid) override
PetscInt n
MaterialWarehouse _residual_materials
void restoreMultiApps(ExecFlagType type, bool force=false)
Restore the MultiApps associated with the ExecFlagType.
virtual void addMarker(std::string marker_name, const std::string &name, InputParameters parameters)
virtual void addJacobian(THREAD_ID tid) override
const PerfID _on_timestep_begin_timer
virtual void computeAuxiliaryKernels(const ExecFlagType &type)
Call compute methods on AuxKernels.
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.
void mooseDeprecated(Args &&... args) const
Definition: MooseObject.h:161
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse...
Definition: TheWarehouse.h:239
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.
InputParameters validParams< FEProblemBase >()
VectorPostprocessorValue & getVectorPostprocessorValue(const VectorPostprocessorName &name, const std::string &vector_name)
DEPRECATED: Use the new version where you need to specify whether or not the vector must be broadcast...
virtual void cacheJacobianNeighbor(THREAD_ID tid) override
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:177
virtual Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) override
const PerfID _project_solution_timer
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.
void incrementMultiAppTStep(ExecFlagType type)
Advance the MultiApps t_step (incrementStepOrReject) associated with the ExecFlagType.
virtual void reinitElemPhys(const Elem *elem, const std::vector< Point > &phys_points_in_elem, THREAD_ID tid, bool suppress_displaced_init=false) override
Class for scalar variables (they are different).
virtual MooseMesh & mesh() override
std::vector< MooseArray< DualReal > > _ad_zero
const PerfID _compute_jacobian_tags_timer
std::vector< VariableValue > _zero
CouplingType
Definition: MooseTypes.h:496
virtual void addSampler(std::string type, const std::string &name, InputParameters parameters)
The following functions will enable MOOSE to have the capability to import Samplers.
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:59
std::set< TagID > _fe_vector_tags
Base class for deriving any boundary condition of a integrated type.
virtual void addInitialCondition(const std::string &ic_name, const std::string &name, InputParameters parameters)
virtual void saveOldSolutions()
Allocate vectors and save old solutions into them.
virtual void prepareFaceShapes(unsigned int var, THREAD_ID tid) override
const PerfID _restore_old_solutions_timer
std::shared_ptr< DisplacedProblem > _displaced_problem
GeometricSearchData _geometric_search_data
Moose::CouplingType coupling()
MooseObjectWarehouse< Function > _functions
functions
virtual Real & timeOld() const
Proxy for accessing MaterialPropertyStorage.
Definition: MaterialData.h:27
std::vector< VectorVariableValue > _vector_zero
PostprocessorValue & getPostprocessorValue(const PostprocessorName &name)
Get a reference to the value associated with the postprocessor.
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 void reinitNeighbor(const Elem *elem, unsigned int side, THREAD_ID tid) override
bool useSNESMFReuseBase()
Return a flag that indicates if we are reusing the vector base.
bool _has_initialized_stateful
Whether nor not stateful materials have been initialized.
unsigned int _max_qps
Maximum number of quadrature points used in the problem.
virtual void prepareShapes(unsigned int var, THREAD_ID tid) override
void setMaterialCoverageCheck(bool flag)
Set flag to indicate whether material coverage checks should be performed.
virtual void initialSetup()
TheWarehouse & theWarehouse()
Definition: MooseApp.h:64
Base class for implementing interface user objects.
virtual void sizeZeroes(unsigned int size, THREAD_ID tid)
virtual MooseVariable & getStandardVariable(THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested MooseVariable which may be in any system.
MaterialPropertyStorage & _neighbor_material_props
std::map< std::string, unsigned int > _subspace_dim
const ConstElemRange & getEvaluableElementRange()
EquationSystems _eq
const PerfID _init_timer
virtual unsigned int nNonlinearIterations() const override
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.
virtual void cacheResidual(THREAD_ID tid) override
bool execMultiApps(ExecFlagType type, bool auto_advance=true)
Execute the MultiApps associated with the ExecFlagType.
void computeTransientImplicitJacobian(Real time, const NumericVector< Number > &u, const NumericVector< Number > &udot, const NumericVector< Number > &udotdot, Real duDotDu_shift, Real duDotDotDu_shift, SparseMatrix< Number > &jacobian)
Evaluates transient Jacobian J_a = dG/dU + a*dG/dUdot from canonical semidiscrete form G(t...
virtual void reinitOffDiagScalars(THREAD_ID tid) override
ExecuteMooseObjectWarehouse< Control > & getControlWarehouse()
Reference to the control logic warehouse.
const std::unordered_map< std::pair< BoundaryID, BoundaryID >, AutomaticMortarGeneration > & getMortarInterfaces(bool on_displaced) const
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.
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.
const MaterialWarehouse & getResidualMaterialsWarehouse() const
const PerfID _output_step_timer
virtual void solve() override
virtual void reinitNode(const Node *node, 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 PerfID _possibly_rebuild_geom_search_patches_timer
virtual void createQRules(QuadratureType type, Order order, Order volume_order=INVALID_ORDER, Order face_order=INVALID_ORDER)
virtual void addInterfaceKernel(const std::string &kernel_name, const std::string &name, InputParameters parameters)
bool _const_jacobian
true if the Jacobian is constant
virtual void possiblyRebuildGeomSearchPatches()
Query is a convenient way to construct and pass around (possible partially constructed) warehouse que...
Definition: TheWarehouse.h:128
A MultiApp represents one or more MOOSE applications that are running simultaneously.
Definition: MultiApp.h:57
MaterialPropertyStorage & _material_props
virtual void addPostprocessor(std::string pp_name, const std::string &name, InputParameters parameters)
virtual NonlinearSystem & getNonlinearSystem()
virtual void clearActiveFEVariableCoupleableMatrixTags(THREAD_ID tid) override
virtual void addGhostedBoundary(BoundaryID boundary_id) override
Will make sure that all necessary elements from boundary_id are ghosted to this processor.
Adaptivity & adaptivity()
virtual Real & dt() const
void advanceMultiApps(ExecFlagType type)
Deprecated method; use finishMultiAppStep and/or incrementMultiAppTStep depending on your purpose...
const NonlinearSystemBase & getNonlinearSystemBase() const
VectorPostprocessorValue & declareVectorPostprocessorVector(const VectorPostprocessorName &name, const std::string &vector_name, bool contains_complete_history, bool is_broadcast)
Declare a new VectorPostprocessor vector.
virtual void computeResidualSys(NonlinearImplicitSystem &sys, const NumericVector< Number > &soln, NumericVector< Number > &residual)
This function is called by Libmesh to form a residual.
MooseObjectWarehouse< Marker > _markers
virtual void swapBackMaterialsFace(THREAD_ID tid)
virtual bool hasException()
Whether or not an exception has occurred.
MooseObjectWarehouseBase< Distribution > _distributions
distributions
virtual void initialAdaptMesh()
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.
A system that holds auxiliary variables.
Moose::PetscSupport::PetscOptions _petsc_options
PETSc option storage.
std::vector< std::unique_ptr< Assembly > > _assembly
Base class for user-specific data.
Definition: UserObject.h:37
virtual void addJacobianBlock(SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, std::vector< dof_id_type > &dof_indices, THREAD_ID tid) override
std::vector< std::shared_ptr< MaterialData > > _material_data
void allowOutput(bool state)
Ability to enable/disable all output calls.
const MooseObjectWarehouse< InternalSideIndicator > & getInternalSideIndicatorWarehouse()
virtual void outputStep(ExecFlagType type)
Output the current step.
virtual void clearActiveElementalMooseVariables(THREAD_ID tid) override
Clear the active elemental MooseVariableFEBase.
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:1055
virtual MooseNonlinearConvergenceReason checkNonlinearConvergence(std::string &msg, const PetscInt it, const Real xnorm, const Real snorm, const Real fnorm, const Real rtol, const Real stol, const Real abstol, const PetscInt nfuncs, const PetscInt max_funcs, const PetscBool force_iteration, const Real initial_residual_before_preset_bcs, const Real div_threshold)
Check for converence of the nonlinear solution.
virtual void setActiveScalarVariableCoupleableVectorTags(std::set< TagID > &vtags, THREAD_ID tid) override
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 addScalarKernel(const std::string &kernel_name, const std::string &name, InputParameters parameters)
const PerfID _compute_residual_type_timer
virtual void computeNearNullSpace(NonlinearImplicitSystem &sys, std::vector< NumericVector< Number > *> &sp)
MooseMesh * _displaced_mesh
virtual void addUserObject(std::string user_object_name, const std::string &name, InputParameters parameters)
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.
bool needBoundaryMaterialOnSide(BoundaryID bnd_id, THREAD_ID tid)
These methods are used to determine whether stateful material properties need to be stored on interna...
unsigned int THREAD_ID
Definition: MooseTypes.h:161
virtual void ghostGhostedBoundaries() override
Causes the boundaries added using addGhostedBoundary to actually be ghosted.
virtual void addBoundaryCondition(const std::string &bc_name, const std::string &name, InputParameters parameters)
bool skipAdditionalRestartData() const
Whether or not to skip loading the additional data when restarting.
virtual bool adaptMesh()
bool _fail_next_linear_convergence_check
const MaterialPropertyStorage & getNeighborMaterialPropertyStorage()
virtual void checkExceptionAndStopSolve()
Check to see if an exception has occurred on any processor and stop the solve.
virtual void setNeighborSubdomainID(const Elem *elem, unsigned int side, THREAD_ID tid) override
virtual void setResidual(NumericVector< Number > &residual, THREAD_ID tid) override
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.
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:40
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.
virtual void cacheResidualNeighbor(THREAD_ID tid) override
virtual void reinitNeighborPhys(const Elem *neighbor, unsigned int neighbor_side, const std::vector< Point > &physical_points, THREAD_ID tid) override
unsigned int getMaxQps() const
virtual void addAuxVariable(const std::string &var_name, const FEType &type, const std::set< SubdomainID > *const active_subdomains=NULL)