39 #include "libmesh/enum_quadrature_type.h" 40 #include "libmesh/equation_systems.h" 42 #include <unordered_map> 94 class NonlinearImplicitSystem;
153 virtual EquationSystems &
es()
override {
return _req.
set().
es(); }
175 void setCouplingMatrix(std::unique_ptr<CouplingMatrix> cm,
const unsigned int nl_sys_num);
180 const CouplingMatrix *
couplingMatrix(
const unsigned int nl_sys_num)
const override;
186 areCoupled(
const unsigned int ivar,
const unsigned int jvar,
const unsigned int nl_sys_num)
const;
208 std::vector<std::pair<MooseVariableFEBase *, MooseVariableFEBase *>> &
210 std::vector<std::pair<MooseVariableFEBase *, MooseVariableFEBase *>> &
240 const PetscInt nfuncs,
241 const PetscInt max_funcs,
242 const Real initial_residual_before_preset_bcs,
243 const Real div_threshold);
258 const Real the_residual,
261 std::ostringstream & oss);
263 virtual bool hasVariable(
const std::string & var_name)
const override;
267 const std::string & var_name,
272 const std::string & var_name)
override;
274 const std::string & var_name)
override;
276 const std::string & var_name)
override;
278 const std::string & var_name)
override;
282 const std::string & var_name)
override;
283 virtual System &
getSystem(
const std::string & var_name)
override;
325 Order volume_order = INVALID_ORDER,
326 Order face_order = INVALID_ORDER,
328 bool allow_negative_qweights =
true);
358 const std::vector<const MooseVariableFEBase *> &
381 virtual void prepare(
const Elem * elem,
384 const std::vector<dof_id_type> & dof_indices,
402 const std::vector<Point> & phys_points_in_elem,
410 const std::vector<Point> *
const pts =
nullptr,
411 const std::vector<Real> *
const weights =
nullptr)
override;
419 unsigned int neighbor_side,
420 const std::vector<Point> & physical_points,
423 const std::vector<Point> & physical_points,
428 bool reinit_for_derivative_reordering =
false)
override;
438 virtual void newAssemblyArray(std::vector<std::shared_ptr<NonlinearSystemBase>> & nl);
440 std::vector<std::shared_ptr<NonlinearSystemBase>> & nl);
442 virtual void init()
override;
443 virtual void solve(
const unsigned int nl_sys_num);
499 virtual bool nlConverged(
const unsigned int nl_sys_num)
override;
501 virtual unsigned int nLinearIterations(
const unsigned int nl_sys_num)
const override;
532 const std::string &
name,
578 template <
typename T>
606 void logAdd(
const std::string & system,
const std::string &
name,
const std::string &
type)
const;
625 mooseError(
"Line search not implemented for this problem type yet.");
676 virtual void addKernel(
const std::string & kernel_name,
677 const std::string &
name,
680 const std::string &
name,
683 const std::string &
name,
686 const std::string &
name,
705 const std::string & var_name,
710 const std::set<SubdomainID> *
const active_subdomains = NULL);
713 unsigned int components,
714 const std::set<SubdomainID> *
const active_subdomains = NULL);
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,
723 const std::string &
name,
730 const std::string &
name,
734 virtual void addDGKernel(
const std::string & kernel_name,
735 const std::string &
name,
738 virtual void addFVKernel(
const std::string & kernel_name,
739 const std::string &
name,
745 const std::string &
name,
750 const std::string &
name,
755 const std::string &
name,
764 const std::string &
name,
778 virtual void addMaterial(
const std::string & material_name,
779 const std::string &
name,
782 const std::string & material_name,
783 const std::string &
name,
786 const std::string &
name,
789 const std::string &
name,
803 void prepareMaterials(
const std::unordered_set<unsigned int> & consumer_needed_mat_props,
821 bool swap_stateful =
true,
822 const std::deque<MaterialBase *> * reinit_mats =
nullptr);
836 bool swap_stateful =
true,
837 const std::deque<MaterialBase *> * reinit_mats =
nullptr);
851 bool swap_stateful =
true,
852 const std::deque<MaterialBase *> * reinit_mats =
nullptr);
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");
910 const std::string &
name,
915 const std::string &
name,
946 virtual void addUserObject(
const std::string & user_object_name,
947 const std::string &
name,
954 "This function is deprecated, use theWarehouse().query() to construct a query instead");
966 std::vector<T *> objs;
970 .condition<AttribThread>(tid)
974 mooseError(
"Unable to find user object with name '" +
name +
"'");
1020 std::size_t t_index = 0)
const;
1038 std::size_t t_index = 0);
1057 const std::string & vector_name,
1058 std::size_t t_index = 0)
const;
1068 const std::string & vector_name,
1070 std::size_t t_index = 0);
1093 virtual void addDamper(
const std::string & damper_name,
1094 const std::string &
name,
1104 virtual void addIndicator(
const std::string & indicator_name,
1105 const std::string &
name,
1109 virtual void addMarker(
const std::string & marker_name,
1110 const std::string &
name,
1116 virtual void addMultiApp(
const std::string & multi_app_name,
1117 const std::string &
name,
1123 std::shared_ptr<MultiApp>
getMultiApp(
const std::string & multi_app_name)
const;
1163 mooseDeprecated(
"Deprecated method; use finishMultiAppStep and/or incrementMultiAppTStep " 1164 "depending on your purpose");
1193 virtual void addTransfer(
const std::string & transfer_name,
1194 const std::string &
name,
1232 const unsigned int nl_sys_num);
1260 const std::set<TagID> & tags);
1277 const unsigned int nl_sys_num);
1291 const std::set<TagID> & tags);
1307 const unsigned int nl_sys_num);
1364 bool & changed_search_direction,
1365 bool & changed_new_soln);
1399 const DofMap & dof_map,
1400 std::vector<dof_id_type> & dof_indices,
1401 const std::set<TagID> & tags,
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,
1435 const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
1436 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
1440 const bool correct_edge_dropping,
1441 const Real minimum_projection_angle);
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;
1454 getMortarInterface(
const std::pair<BoundaryID, BoundaryID> & primary_secondary_boundary_pair,
1455 const std::pair<SubdomainID, SubdomainID> & primary_secondary_subdomain_pair,
1525 #ifdef LIBMESH_ENABLE_AMR 1549 #endif // LIBMESH_ENABLE_AMR 1552 void initXFEM(std::shared_ptr<XFEMInterface> xfem);
1684 bool no_warn =
false);
1751 const std::string &
name);
1867 #if !PETSC_RELEASE_LESS_THAN(3, 12, 0) 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.");
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.");
1965 template <
typename T>
1967 template <
typename T>
1981 const std::vector<Point> *
const pts,
1982 const std::vector<Real> *
const weights =
nullptr,
1992 unsigned int neighbor_side,
1995 const std::vector<Point> *
const pts,
1996 const std::vector<Real> *
const weights =
nullptr,
2019 std::vector<std::shared_ptr<MaterialBase>> & face_materials,
2020 std::vector<std::shared_ptr<MaterialBase>> & neighbor_materials,
2021 std::set<MooseVariableFieldBase *> & variables,
2086 virtual unsigned int nlSysNum(
const NonlinearSystemName & nl_sys_name)
const override;
2150 const MultiMooseEnum & disable_p_refinement_for_families)
override;
2212 std::vector<std::shared_ptr<NonlinearSystemBase>>
_nl;
2224 std::shared_ptr<AuxiliarySystem>
_aux;
2227 std::vector<std::unique_ptr<CouplingMatrix>>
_cm;
2234 std::vector<std::vector<std::unique_ptr<Assembly>>>
_assembly;
2347 const std::map<
SubdomainID, std::vector<std::shared_ptr<MaterialBase>>> & materials_map);
2366 const std::string & object_name,
2367 const std::string & var_param_name =
"variable");
2369 #ifdef LIBMESH_ENABLE_AMR 2486 #if !PETSC_RELEASE_LESS_THAN(3, 12, 0) 2514 std::vector<MortarUserObject *>
2518 const std::vector<MortarUserObject *> & mortar_uo_superset);
2537 std::pair<bool, unsigned int>
2539 bool error_if_not_found =
false)
const override;
2548 const std::string &
name,
2549 const VariableName & var_name);
2640 template <
typename T>
2647 template <
typename T>
2653 for (T * obj_ptr : objects)
2654 obj_ptr->initialSetup();
2659 for (
const auto obj_ptr : objects)
2660 obj_ptr->timestepSetup();
2664 for (
const auto obj_ptr : objects)
2665 obj_ptr->subdomainSetup();
2670 for (
const auto obj_ptr : objects)
2671 obj_ptr->jacobianSetup();
2676 for (
const auto obj_ptr : objects)
2677 obj_ptr->residualSetup();
2681 template <
typename T>
2685 for (T * obj_ptr : objects)
2689 template <
typename T>
2690 std::vector<std::shared_ptr<T>>
2692 const std::string &
name,
2694 const bool threaded,
2695 const std::string & var_param_name)
2697 parallel_object_only();
2704 std::vector<std::shared_ptr<T>> objects(
n_threads);
2709 objects[tid] = std::move(obj);
2718 mooseAssert(sys_num <
_nl.size(),
"System number greater than the number of nonlinear systems");
2719 return *
_nl[sys_num];
2725 mooseAssert(sys_num <
_nl.size(),
"System number greater than the number of nonlinear systems");
2726 return *
_nl[sys_num];
2732 mooseAssert(
_current_nl_sys,
"The nonlinear system is not currently set");
2739 mooseAssert(
_current_nl_sys,
"The nonlinear system is not currently set");
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");
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");
2761 inline const CouplingMatrix *
2764 return _cm[i].get();
2770 mooseAssert(nl_sys_num <
_nl.size(),
2771 "System number greater than the number of nonlinear systems");
2785 inline const std::vector<VectorTag> &
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 ¶meters)
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.
Warehouse for storing scalar initial conditions.
virtual void addFVInitialCondition(const std::string &ic_name, const std::string &name, InputParameters ¶meters)
Add an initial condition for a finite volume variables.
virtual void addMaterialHelper(std::vector< MaterialWarehouse *> warehouse, const std::string &material_name, const std::string &name, InputParameters ¶meters)
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.
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'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 ¶meters)
The following functions will enable MOOSE to have the capability to import Samplers.
bool _skip_exception_check
If or not skip 'exception and stop solve'.
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 ¶meters)
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.
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 ¶meters)
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.
bool _snesmf_reuse_base_set_by_user
If or not _snesmf_reuse_base is set by user.
bool _parallel_barrier_messaging
Whether or not information about how many transfers have completed is printed.
virtual void addResidualLower(const THREAD_ID tid) override
bool _computing_scaling_jacobian
Flag used to indicate whether we are computing the scaling Jacobian.
A class for creating restricted objects.
virtual void addJacobianLowerD(const THREAD_ID tid) override
Factory & _factory
The Factory for building objects.
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 ¶meters)
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.
virtual void cacheResidualNeighbor(const THREAD_ID tid) override
virtual void setInputParametersFEProblem(InputParameters ¶meters)
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...
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.
Class for stuff related to variables.
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...
virtual void reinitNode(const Node *node, const THREAD_ID tid) override
virtual std::size_t numNonlinearSystems() const override
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.
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...
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 ¶meters)
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 ¶meters)
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 ¶ms)
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.
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.
void computeUserObjectsInternal(const ExecFlagType &type, const Moose::AuxGroup &group, TheWarehouse::Query &query)
Positions objects are under the hood Reporters.
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 ¶meters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
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
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 ¶meters)
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).
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)
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 ¶meters)
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 ¶meters)
All Distributions should inherit from this class.
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 ¶meters)
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 'computeDT')
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'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 ¶meters)
Base class for a system (of equations)
const InitialConditionWarehouse & getInitialConditionWarehouse() const
Return InitialCondition storage.
virtual void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
Canonical method for adding an auxiliary variable.
Base class for MeshDivision objects.
const MaterialPropertyStorage & getBndMaterialPropertyStorage()
bool computingNonlinearResid() const
Returns true if the problem is in the process of computing the nonlinear residual.
virtual void addFVInterfaceKernel(const std::string &fv_ik_name, const std::string &name, InputParameters ¶meters)
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 ¶meters)
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.
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).
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.
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.
virtual void addMarker(const std::string &marker_name, const std::string &name, InputParameters ¶meters)
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 ¶meters)
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 ¶meters)
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 ¶meters)
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 ¶meters)
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 ¶meters)
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.
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.
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
Moose::CouplingType _coupling
Type of variable coupling.
Every object that can be built by the factory should be derived from this class.
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
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.
NonlinearSystemBase & currentNonlinearSystem()
void computingScalingResidual(bool computing_scaling_residual)
Setter for whether we'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 ¶meters)
Real PostprocessorValue
various MOOSE typedefs
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.
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...
virtual void addVectorPostprocessor(const std::string &pp_name, const std::string &name, InputParameters ¶meters)
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
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
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.
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...
std::vector< VectorTag > getVectorTags(const std::set< TagID > &tag_ids) const
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 ¶meters)
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.
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
std::string stringify(const T &t)
conversion to string
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 ¶meters)
MooseObjectWarehouse< Indicator > _indicators
virtual void addMultiApp(const std::string &multi_app_name, const std::string &name, InputParameters ¶meters)
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.
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 ¶meters, 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 ¶meters)
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 void addVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
Canonical method for adding a non-linear variable.
bool doingPRefinement() const
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.
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.
MooseNonlinearConvergenceReason
Enumeration for nonlinear convergence reasons.
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
std::vector< Real > VectorPostprocessorValue
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 ¶meters)
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
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 ¶meters)
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.
Generic class for solving transient nonlinear problems.
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.
Base class for Control objects.
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()
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...
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
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 ¶ms, 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.
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'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 ¶meters, 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.
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 ¶meters)
TheWarehouse & theWarehouse()
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}.
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'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
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.
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.
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 ¶meters)
virtual void addFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters ¶meters)
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
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.
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.
virtual void clearActiveElementalMooseVariables(const THREAD_ID tid) override
Clear the active elemental MooseVariableFEBase.
Base class for user-specific data.
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.
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.
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.
virtual void ghostGhostedBoundaries() override
Causes the boundaries added using addGhostedBoundary to actually be ghosted.
The Executor class directs the execution flow of simulations.
virtual void setNeighborSubdomainID(const Elem *elem, unsigned int side, const THREAD_ID tid) override
MaterialWarehouse _materials
virtual void addJacobianScalar(const THREAD_ID tid=0)
const MaterialPropertyStorage & getNeighborMaterialPropertyStorage()
virtual void addDiracKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
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.
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
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.