www.mooseframework.org
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
EigenProblem Class Reference

Problem for solving eigenvalue problems. More...

#include <EigenProblem.h>

Inheritance diagram for EigenProblem:
[legend]

Public Member Functions

 EigenProblem (const InputParameters &parameters)
 
virtual void solve () override
 
virtual bool converged () override
 
virtual unsigned int getNEigenPairsRequired ()
 
virtual void setNEigenPairsRequired (unsigned int n_eigen_pairs)
 
virtual bool isGeneralizedEigenvalueProblem ()
 
virtual bool isNonlinearEigenvalueSolver ()
 
NonlinearEigenSystemgetNonlinearEigenSystem ()
 
virtual void checkProblemIntegrity () override
 Method called to perform a series of sanity checks before a simulation is run. More...
 
void setEigenproblemType (Moose::EigenProblemType eigen_problem_type)
 
virtual void computeJacobianTag (const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian, TagID tag) override
 Form a Jacobian matrix for all kernels and BCs with a given tag. More...
 
virtual void computeJacobianAB (const NumericVector< Number > &soln, SparseMatrix< Number > &jacobianA, SparseMatrix< Number > &jacobianB, TagID tagA, TagID tagB)
 Form two Jacobian matrices, whre each is associateed with one tag, through one element-loop. More...
 
virtual void computeResidualTag (const NumericVector< Number > &soln, NumericVector< Number > &residual, TagID tag) override
 Form a vector for all kernels and BCs with a given tag. More...
 
virtual void computeResidualAB (const NumericVector< Number > &soln, NumericVector< Number > &residualA, NumericVector< Number > &residualB, TagID tagA, TagID tagB)
 Form two vetors, whre each is associateed with one tag, through one element-loop. More...
 
virtual void computeJacobian (const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian)
 Form a Jacobian matrix with the default tag (system). More...
 
virtual EquationSystems & es () override
 
virtual MooseMeshmesh () override
 
virtual Moose::CoordinateSystemType getCoordSystem (SubdomainID sid) override
 
virtual void setCoordSystem (const std::vector< SubdomainName > &blocks, const MultiMooseEnum &coord_sys)
 
void setAxisymmetricCoordAxis (const MooseEnum &rz_coord_axis)
 
void setCoupling (Moose::CouplingType type)
 Set the coupling between variables TODO: allow user-defined coupling. More...
 
Moose::CouplingType coupling ()
 
void setCouplingMatrix (std::unique_ptr< CouplingMatrix > cm)
 Set custom coupling matrix. More...
 
void setCouplingMatrix (CouplingMatrix *cm)
 
const CouplingMatrix * couplingMatrix ()
 
void setNonlocalCouplingMatrix ()
 Set custom coupling matrix for variables requiring nonlocal contribution. More...
 
bool areCoupled (unsigned int ivar, unsigned int jvar)
 
std::vector< std::pair< MooseVariableFEBase *, MooseVariableFEBase * > > & couplingEntries (THREAD_ID tid)
 
std::vector< std::pair< MooseVariableFEBase *, MooseVariableFEBase * > > & nonlocalCouplingEntries (THREAD_ID tid)
 
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. More...
 
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. More...
 
virtual bool hasVariable (const std::string &var_name) const override
 
virtual MooseVariableFEBasegetVariable (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 (Nonlinear vs. More...
 
virtual MooseVariablegetStandardVariable (THREAD_ID tid, const std::string &var_name) override
 Returns the variable reference for requested MooseVariable which may be in any system. More...
 
virtual VectorMooseVariablegetVectorVariable (THREAD_ID tid, const std::string &var_name) override
 Returns the variable reference for requested VectorMooseVariable which may be in any system. More...
 
virtual bool hasScalarVariable (const std::string &var_name) const override
 Returns a Boolean indicating whether any system contains a variable with the name provided. More...
 
virtual MooseVariableScalargetScalarVariable (THREAD_ID tid, const std::string &var_name) override
 Returns the scalar variable reference from whichever system contains it. More...
 
virtual System & getSystem (const std::string &var_name) override
 Returns the equation system containing the variable provided. More...
 
virtual void setActiveElementalMooseVariables (const std::set< MooseVariableFEBase *> &moose_vars, THREAD_ID tid) override
 Set the MOOSE variables to be reinited on each element. More...
 
virtual void clearActiveElementalMooseVariables (THREAD_ID tid) override
 Clear the active elemental MooseVariableFEBase. More...
 
virtual void clearActiveFEVariableCoupleableMatrixTags (THREAD_ID tid) override
 
virtual void clearActiveFEVariableCoupleableVectorTags (THREAD_ID tid) override
 
virtual void setActiveFEVariableCoupleableVectorTags (std::set< TagID > &vtags, THREAD_ID tid) override
 
virtual void setActiveFEVariableCoupleableMatrixTags (std::set< TagID > &mtags, THREAD_ID tid) override
 
virtual void clearActiveScalarVariableCoupleableMatrixTags (THREAD_ID tid) override
 
virtual void clearActiveScalarVariableCoupleableVectorTags (THREAD_ID tid) override
 
virtual void setActiveScalarVariableCoupleableVectorTags (std::set< TagID > &vtags, THREAD_ID tid) override
 
virtual void setActiveScalarVariableCoupleableMatrixTags (std::set< TagID > &mtags, THREAD_ID tid) 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. More...
 
virtual void clearActiveMaterialProperties (THREAD_ID tid) override
 Clear the active material properties. More...
 
virtual void createQRules (QuadratureType type, Order order, Order volume_order=INVALID_ORDER, Order face_order=INVALID_ORDER)
 
unsigned int getMaxQps () const
 
unsigned int getMaxShapeFunctions () const
 
Order getMaxScalarOrder () const
 
void checkNonlocalCoupling ()
 
void checkUserObjectJacobianRequirement (THREAD_ID tid)
 
void setVariableAllDoFMap (const std::vector< MooseVariableFEBase *> moose_vars)
 
const std::vector< MooseVariableFEBase * > & getUserObjectJacobianVariables (THREAD_ID tid) const
 
virtual Assemblyassembly (THREAD_ID tid) override
 
virtual std::vector< VariableName > getVariableNames ()
 Returns a list of all the variables in the problem (both from the NL and Aux systems. More...
 
virtual void addExtraVectors ()
 A place to add extra vectors to the simulation. More...
 
virtual void initialSetup ()
 
virtual void timestepSetup ()
 
virtual void prepare (const Elem *elem, THREAD_ID tid) override
 
virtual void prepare (const Elem *elem, unsigned int ivar, unsigned int jvar, const std::vector< dof_id_type > &dof_indices, THREAD_ID tid) override
 
virtual void prepareFace (const Elem *elem, THREAD_ID tid) override
 
virtual void setCurrentSubdomainID (const Elem *elem, THREAD_ID tid) override
 
virtual void setNeighborSubdomainID (const Elem *elem, unsigned int side, THREAD_ID tid) override
 
virtual void setNeighborSubdomainID (const Elem *elem, THREAD_ID tid)
 
virtual void prepareAssembly (THREAD_ID tid) override
 
virtual void addGhostedElem (dof_id_type elem_id) override
 Will make sure that all dofs connected to elem_id are ghosted to this processor. More...
 
virtual void addGhostedBoundary (BoundaryID boundary_id) override
 Will make sure that all necessary elements from boundary_id are ghosted to this processor. More...
 
virtual void ghostGhostedBoundaries () override
 Causes the boundaries added using addGhostedBoundary to actually be ghosted. More...
 
virtual void sizeZeroes (unsigned int size, THREAD_ID tid)
 
virtual bool reinitDirac (const Elem *elem, THREAD_ID tid) override
 Returns true if the Problem has Dirac kernels it needs to compute on elem. More...
 
virtual void reinitElem (const Elem *elem, THREAD_ID tid) override
 
virtual void reinitElemPhys (const Elem *elem, const std::vector< Point > &phys_points_in_elem, THREAD_ID tid, bool suppress_displaced_init=false) override
 
virtual void reinitElemFace (const Elem *elem, unsigned int side, BoundaryID bnd_id, THREAD_ID tid) override
 
virtual void reinitNode (const Node *node, THREAD_ID tid) override
 
virtual void reinitNodeFace (const Node *node, BoundaryID bnd_id, THREAD_ID tid) override
 
virtual void reinitNodes (const std::vector< dof_id_type > &nodes, THREAD_ID tid) override
 
virtual void reinitNodesNeighbor (const std::vector< dof_id_type > &nodes, THREAD_ID tid) override
 
virtual void reinitNeighbor (const Elem *elem, unsigned int side, THREAD_ID tid) override
 
virtual void reinitNeighborPhys (const Elem *neighbor, unsigned int neighbor_side, const std::vector< Point > &physical_points, THREAD_ID tid) override
 
virtual void reinitNeighborPhys (const Elem *neighbor, const std::vector< Point > &physical_points, THREAD_ID tid) override
 
virtual void reinitScalars (THREAD_ID tid) override
 
virtual void reinitOffDiagScalars (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. More...
 
virtual void clearDiracInfo () override
 Gets called before Dirac Kernels are asked to add the points they are supposed to be evaluated in. More...
 
virtual void subdomainSetup (SubdomainID subdomain, THREAD_ID tid)
 
virtual void neighborSubdomainSetup (SubdomainID subdomain, THREAD_ID tid)
 
virtual void newAssemblyArray (NonlinearSystemBase &nl)
 
virtual void initNullSpaceVectors (const InputParameters &parameters, NonlinearSystemBase &nl)
 
virtual void init () override
 
const ConstElemRange & getEvaluableElementRange ()
 
virtual void setException (const std::string &message)
 Set an exception. More...
 
virtual bool hasException ()
 Whether or not an exception has occurred. More...
 
virtual void checkExceptionAndStopSolve ()
 Check to see if an exception has occurred on any processor and stop the solve. More...
 
virtual unsigned int nNonlinearIterations () const override
 
virtual unsigned int nLinearIterations () const override
 
virtual Real finalNonlinearResidual () const override
 
virtual bool computingInitialResidual () const override
 Returns true if the problem is in the process of computing it's initial residual. More...
 
virtual bool startedInitialSetup ()
 Returns true if we are in or beyond the initialSetup stage. More...
 
virtual void onTimestepBegin () override
 
virtual void onTimestepEnd () override
 
virtual Real & time () const
 
virtual Real & timeOld () const
 
virtual int & timeStep () const
 
virtual Real & dt () const
 
virtual Real & dtOld () const
 
virtual void transient (bool trans)
 
virtual bool isTransient () const override
 
virtual void addTimeIntegrator (const std::string &type, const std::string &name, InputParameters parameters)
 
virtual void addPredictor (const std::string &type, const std::string &name, InputParameters parameters)
 
virtual void copySolutionsBackwards ()
 
virtual void advanceState ()
 Advance all of the state holding vectors / datastructures so that we can move to the next timestep. More...
 
virtual void restoreSolutions ()
 
virtual void saveOldSolutions ()
 Allocate vectors and save old solutions into them. More...
 
virtual void restoreOldSolutions ()
 Restore old solutions from the backup vectors and deallocate them. More...
 
virtual void outputStep (ExecFlagType type)
 Output the current step. More...
 
virtual void postExecute ()
 Method called at the end of the simulation. More...
 
void forceOutput ()
 Indicates that the next call to outputStep should be forced. More...
 
void initPetscOutput ()
 Reinitialize petsc output for proper linear/nonlinear iteration display. More...
 
Moose::PetscSupport::PetscOptionsgetPetscOptions ()
 Retrieve a writable reference the PETSc options (used by PetscSupport) More...
 
virtual void addFunction (std::string type, const std::string &name, InputParameters parameters)
 
virtual bool hasFunction (const std::string &name, THREAD_ID tid=0)
 
virtual FunctiongetFunction (const std::string &name, THREAD_ID tid=0)
 
virtual void addLineSearch (const InputParameters &)
 add a MOOSE line search More...
 
virtual void lineSearch ()
 execute MOOSE line search More...
 
std::shared_ptr< LineSearchgetLineSearch ()
 getter for the MOOSE line search More...
 
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. More...
 
virtual DistributiongetDistribution (const std::string &name)
 
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. More...
 
virtual SamplergetSampler (const std::string &name, THREAD_ID tid=0)
 
NonlinearSystemBasegetNonlinearSystemBase ()
 
const NonlinearSystemBasegetNonlinearSystemBase () const
 
virtual NonlinearSystemgetNonlinearSystem ()
 
virtual void addVariable (const std::string &var_name, const FEType &type, Real scale_factor, const std::set< SubdomainID > *const active_subdomains=NULL)
 
virtual void addScalarVariable (const std::string &var_name, Order order, Real scale_factor=1., const std::set< SubdomainID > *const active_subdomains=NULL)
 
virtual void addKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
virtual void addNodalKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
virtual void addScalarKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
virtual void addBoundaryCondition (const std::string &bc_name, const std::string &name, InputParameters parameters)
 
virtual void addConstraint (const std::string &c_name, const std::string &name, InputParameters parameters)
 
virtual void setInputParametersFEProblem (InputParameters &parameters)
 
virtual void addAuxVariable (const std::string &var_name, const FEType &type, const std::set< SubdomainID > *const active_subdomains=NULL)
 
virtual void addAuxScalarVariable (const std::string &var_name, Order order, Real scale_factor=1., const std::set< SubdomainID > *const active_subdomains=NULL)
 
virtual void addAuxKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
virtual void addAuxScalarKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
AuxiliarySystemgetAuxiliarySystem ()
 
virtual void addDiracKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
virtual void addDGKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
virtual void addInterfaceKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
virtual void addInitialCondition (const std::string &ic_name, const std::string &name, InputParameters parameters)
 
void projectSolution ()
 
virtual void addMaterial (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
virtual void addADResidualMaterial (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
virtual void addADJacobianMaterial (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
virtual void addMaterialHelper (std::vector< MaterialWarehouse *> warehouse, const std::string &kernel_name, 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. More...
 
virtual void reinitMaterials (SubdomainID blk_id, THREAD_ID tid, bool swap_stateful=true)
 
virtual void reinitMaterialsFace (SubdomainID blk_id, THREAD_ID tid, bool swap_stateful=true)
 
virtual void reinitMaterialsNeighbor (SubdomainID blk_id, THREAD_ID tid, bool swap_stateful=true)
 
virtual void reinitMaterialsBoundary (BoundaryID boundary_id, THREAD_ID tid, bool swap_stateful=true)
 
virtual void swapBackMaterials (THREAD_ID tid)
 
virtual void swapBackMaterialsFace (THREAD_ID tid)
 
virtual void swapBackMaterialsNeighbor (THREAD_ID tid)
 
virtual void addPostprocessor (std::string pp_name, const std::string &name, InputParameters parameters)
 
virtual void addVectorPostprocessor (std::string pp_name, const std::string &name, InputParameters parameters)
 
void initPostprocessorData (const std::string &name)
 Initializes the postprocessor data. More...
 
void initVectorPostprocessorData (const std::string &name)
 Initialize the VectorPostprocessor data. More...
 
virtual void addUserObject (std::string user_object_name, const std::string &name, InputParameters parameters)
 
const ExecuteMooseObjectWarehouse< UserObject > & getUserObjects () const
 
template<class T >
T & getUserObject (const std::string &name, unsigned int tid=0) const
 Get the user object by its name. More...
 
const UserObjectgetUserObjectBase (const std::string &name) const
 Get the user object by its name. More...
 
bool hasUserObject (const std::string &name) const
 Check if there if a user object of given name. More...
 
bool hasPostprocessor (const std::string &name)
 Check existence of the postprocessor. More...
 
PostprocessorValuegetPostprocessorValue (const PostprocessorName &name)
 Get a reference to the value associated with the postprocessor. More...
 
PostprocessorValuegetPostprocessorValueOld (const std::string &name)
 Get the reference to the old value of a post-processor. More...
 
PostprocessorValuegetPostprocessorValueOlder (const std::string &name)
 Get the reference to the older value of a post-processor. More...
 
bool hasVectorPostprocessor (const std::string &name)
 Check existence of the VectorPostprocessor. More...
 
VectorPostprocessorValuegetVectorPostprocessorValue (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. More...
 
VectorPostprocessorValuegetVectorPostprocessorValue (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast)
 Get a reference to the value associated with the VectorPostprocessor. More...
 
VectorPostprocessorValuegetVectorPostprocessorValueOld (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. More...
 
VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &name, const std::string &vector_name, bool needs_broadcast)
 Get the reference to the old value of a post-processor. More...
 
ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValue (const VectorPostprocessorName &vpp_name, const std::string &vector_name)
 Return the scatter value for the post processor. More...
 
ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOld (const VectorPostprocessorName &vpp_name, const std::string &vector_name)
 Return the scatter value for the post processor. More...
 
VectorPostprocessorValuedeclareVectorPostprocessorVector (const VectorPostprocessorName &name, const std::string &vector_name, bool contains_complete_history, bool is_broadcast)
 Declare a new VectorPostprocessor vector. More...
 
bool vectorPostprocessorHasVectors (const std::string &vpp_name)
 Whether or not the specified VectorPostprocessor has declared any vectors. More...
 
const std::vector< std::pair< std::string, VectorPostprocessorData::VectorPostprocessorState > > & getVectorPostprocessorVectors (const std::string &vpp_name)
 Get the vectors for a specific VectorPostprocessor. More...
 
virtual void addDamper (std::string damper_name, const std::string &name, InputParameters parameters)
 
void setupDampers ()
 
bool hasDampers ()
 Whether or not this system has dampers. More...
 
void addIndicator (std::string indicator_name, const std::string &name, InputParameters parameters)
 
virtual void addMarker (std::string marker_name, const std::string &name, InputParameters parameters)
 
virtual void addMultiApp (const std::string &multi_app_name, const std::string &name, InputParameters parameters)
 Add a MultiApp to the problem. More...
 
std::shared_ptr< MultiAppgetMultiApp (const std::string &multi_app_name) const
 Get a MultiApp object by name. More...
 
std::vector< std::shared_ptr< Transfer > > getTransfers (ExecFlagType type, MultiAppTransfer::DIRECTION direction) const
 Get Transfers by ExecFlagType and direction. More...
 
void execMultiAppTransfers (ExecFlagType type, MultiAppTransfer::DIRECTION direction)
 Execute MultiAppTransfers associate with execution flag and direction. More...
 
bool execMultiApps (ExecFlagType type, bool auto_advance=true)
 Execute the MultiApps associated with the ExecFlagType. More...
 
void finalizeMultiApps ()
 
void incrementMultiAppTStep (ExecFlagType type)
 Advance the MultiApps t_step (incrementStepOrReject) associated with the ExecFlagType. More...
 
void advanceMultiApps (ExecFlagType type)
 Deprecated method; use finishMultiAppStep and/or incrementMultiAppTStep depending on your purpose. More...
 
void finishMultiAppStep (ExecFlagType type)
 Finish the MultiApp time step (endStep, postStep) associated with the ExecFlagType. More...
 
void backupMultiApps (ExecFlagType type)
 Backup the MultiApps associated with the ExecFlagType. More...
 
void restoreMultiApps (ExecFlagType type, bool force=false)
 Restore the MultiApps associated with the ExecFlagType. More...
 
Real computeMultiAppsDT (ExecFlagType type)
 Find the smallest timestep over all MultiApps. More...
 
virtual void addTransfer (const std::string &transfer_name, const std::string &name, InputParameters parameters)
 Add a Transfer to the problem. More...
 
void execTransfers (ExecFlagType type)
 Execute the Transfers associated with the ExecFlagType. More...
 
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,U) More...
 
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,U,Udot) = F(t,U) More...
 
virtual Real computeResidualL2Norm ()
 Computes the residual using whatever is sitting in the current solution vector then returns the L2 norm. More...
 
virtual void computeResidualSys (NonlinearImplicitSystem &sys, const NumericVector< Number > &soln, NumericVector< Number > &residual)
 This function is called by Libmesh to form a residual. More...
 
void computeResidual (NonlinearImplicitSystem &sys, const NumericVector< Number > &soln, NumericVector< Number > &residual)
 This function is called by Libmesh to form a residual. More...
 
virtual void computeResidual (const NumericVector< Number > &soln, NumericVector< Number > &residual)
 Form a residual with default tags (nontime, time, residual). More...
 
virtual void computeResidualType (const NumericVector< Number > &soln, NumericVector< Number > &residual, TagID tag)
 Form a residual vector for a given tag and "residual" tag. More...
 
virtual void computeResidualInternal (const NumericVector< Number > &soln, NumericVector< Number > &residual, const std::set< TagID > &tags)
 Form a residual vector for a set of tags. More...
 
virtual void computeResidualTags (const std::set< TagID > &tags)
 Form multiple residual vectors and each is associated with one tag. More...
 
virtual void computeJacobianSys (NonlinearImplicitSystem &sys, const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian)
 Form a Jacobian matrix. More...
 
virtual void computeJacobian (const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian)
 Form a Jacobian matrix with the default tag (system). More...
 
virtual void computeJacobianInternal (const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian, const std::set< TagID > &tags)
 Form a Jacobian matrix for multiple tags. More...
 
virtual void computeJacobianTags (const std::set< TagID > &tags)
 Form multiple matrices, and each is associated with a tag. More...
 
virtual void computeJacobianBlocks (std::vector< JacobianBlock *> &blocks)
 Computes several Jacobian blocks simultaneously, summing their contributions into smaller preconditioning matrices. More...
 
virtual void computeJacobianBlock (SparseMatrix< Number > &jacobian, libMesh::System &precond_system, unsigned int ivar, unsigned int jvar)
 Really not a good idea to use this. More...
 
virtual Real computeDamping (const NumericVector< Number > &soln, const NumericVector< Number > &update)
 
virtual bool shouldUpdateSolution ()
 Check to see whether the problem should update the solution. More...
 
virtual bool updateSolution (NumericVector< Number > &vec_solution, NumericVector< Number > &ghosted_solution)
 Update the solution. More...
 
virtual void predictorCleanup (NumericVector< Number > &ghosted_solution)
 Perform cleanup tasks after application of predictor to solution vector. More...
 
virtual void computeBounds (NonlinearImplicitSystem &sys, NumericVector< Number > &lower, NumericVector< Number > &upper)
 
virtual void computeNearNullSpace (NonlinearImplicitSystem &sys, std::vector< NumericVector< Number > *> &sp)
 
virtual void computeNullSpace (NonlinearImplicitSystem &sys, std::vector< NumericVector< Number > *> &sp)
 
virtual void computeTransposeNullSpace (NonlinearImplicitSystem &sys, std::vector< NumericVector< Number > *> &sp)
 
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 computeIndicatorsAndMarkers ()
 
virtual void computeIndicators ()
 
virtual void computeMarkers ()
 
virtual void addResidual (THREAD_ID tid) override
 
virtual void addResidualNeighbor (THREAD_ID tid) override
 
virtual void addResidualScalar (THREAD_ID tid=0)
 
virtual void cacheResidual (THREAD_ID tid) override
 
virtual void cacheResidualNeighbor (THREAD_ID tid) override
 
virtual void addCachedResidual (THREAD_ID tid) override
 
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 vector passed in. More...
 
virtual void setResidual (NumericVector< Number > &residual, THREAD_ID tid) override
 
virtual void setResidualNeighbor (NumericVector< Number > &residual, THREAD_ID tid) override
 
virtual void addJacobian (THREAD_ID tid) override
 
virtual void addJacobianNeighbor (THREAD_ID tid) override
 
virtual void addJacobianNeighbor (SparseMatrix< Number > &jacobian, unsigned int ivar, unsigned int jvar, const DofMap &dof_map, std::vector< dof_id_type > &dof_indices, std::vector< dof_id_type > &neighbor_dof_indices, THREAD_ID tid) override
 
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
 
virtual void addJacobianScalar (THREAD_ID tid=0)
 
virtual void addJacobianOffDiagScalar (unsigned int ivar, THREAD_ID tid=0)
 
virtual void cacheJacobian (THREAD_ID tid) override
 
virtual void cacheJacobianNeighbor (THREAD_ID tid) override
 
virtual void addCachedJacobian (THREAD_ID tid) override
 
virtual void prepareShapes (unsigned int var, THREAD_ID tid) override
 
virtual void prepareFaceShapes (unsigned int var, THREAD_ID tid) override
 
virtual void prepareNeighborShapes (unsigned int var, THREAD_ID tid) override
 
virtual void addDisplacedProblem (std::shared_ptr< DisplacedProblem > displaced_problem)
 
virtual std::shared_ptr< DisplacedProblemgetDisplacedProblem ()
 
virtual void updateGeomSearch (GeometricSearchData::GeometricSearchType type=GeometricSearchData::ALL) override
 
virtual void possiblyRebuildGeomSearchPatches ()
 
virtual GeometricSearchDatageomSearchData () override
 
void setRestartFile (const std::string &file_name)
 Communicate to the Resurector the name of the restart filer. More...
 
const InitialConditionWarehousegetInitialConditionWarehouse () const
 Return InitialCondition storage. More...
 
SolverParamssolverParams ()
 Get the solver parameters. More...
 
Adaptivityadaptivity ()
 
virtual void initialAdaptMesh ()
 
virtual bool adaptMesh ()
 
unsigned int getNumCyclesCompleted ()
 
bool hasInitialAdaptivity () const
 Return a Boolean indicating whether initial AMR is turned on. More...
 
bool hasInitialAdaptivity () const
 Return a Boolean indicating whether initial AMR is turned on. More...
 
void initXFEM (std::shared_ptr< XFEMInterface > xfem)
 Create XFEM controller object. More...
 
std::shared_ptr< XFEMInterfacegetXFEM ()
 Get a pointer to the XFEM controller object. More...
 
bool haveXFEM ()
 Find out whether the current analysis is using XFEM. More...
 
virtual bool updateMeshXFEM ()
 Update the mesh due to changing XFEM cuts. More...
 
virtual void meshChanged () override
 Update data after a mesh change. More...
 
void notifyWhenMeshChanges (MeshChangedInterface *mci)
 Register an object that derives from MeshChangedInterface to be notified when the mesh changes. More...
 
void serializeSolution ()
 
void registerRandomInterface (RandomInterface &random_interface, const std::string &name)
 
void setConstJacobian (bool state)
 Set flag that Jacobian is constant (for optimization purposes) More...
 
void setKernelCoverageCheck (bool flag)
 Set flag to indicate whether kernel coverage checks should be performed. More...
 
void setMaterialCoverageCheck (bool flag)
 Set flag to indicate whether material coverage checks should be performed. More...
 
void setParallelBarrierMessaging (bool flag)
 Toggle parallel barrier messaging (defaults to on). More...
 
void parentOutputPositionChanged ()
 Calls parentOutputPositionChanged() on all sub apps. More...
 
unsigned int subspaceDim (const std::string &prefix) const
 Dimension of the subspace spanned by vectors with a given prefix. More...
 
const MaterialWarehousegetMaterialWarehouse () const
 
const MaterialWarehousegetResidualMaterialsWarehouse () const
 
const MaterialWarehousegetJacobianMaterialsWarehouse () const
 
const MaterialWarehousegetDiscreteMaterialWarehouse () const
 
std::shared_ptr< MaterialgetMaterial (std::string name, Moose::MaterialDataType type, THREAD_ID tid=0, bool no_warn=false)
 Return a pointer to a Material object. More...
 
std::shared_ptr< MaterialDatagetMaterialData (Moose::MaterialDataType type, THREAD_ID tid=0)
 
bool errorOnJacobianNonzeroReallocation () const
 Will return True if the user wants to get an error when a nonzero is reallocated in the Jacobian by PETSc. More...
 
void setErrorOnJacobianNonzeroReallocation (bool state)
 
bool ignoreZerosInJacobian () const
 
void setIgnoreZerosInJacobian (bool state)
 
bool hasTimeIntegrator () const
 Returns whether or not this Problem has a TimeIntegrator. More...
 
virtual void execute (const ExecFlagType &exec_type)
 Convenience function for performing execution of MOOSE systems. More...
 
virtual void computeUserObjects (const ExecFlagType &type, const Moose::AuxGroup &group)
 Call compute methods on UserObjects. More...
 
virtual void computeAuxiliaryKernels (const ExecFlagType &type)
 Call compute methods on AuxKernels. More...
 
void needsPreviousNewtonIteration (bool state)
 Set a flag that indicated that user required values for the previous Newton iterate. More...
 
bool needsPreviousNewtonIteration () const
 Check to see whether we need to compute the variable values of the previous Newton iterate. More...
 
bool skipAdditionalRestartData () const
 Whether or not to skip loading the additional data when restarting. More...
 
ExecuteMooseObjectWarehouse< Control > & getControlWarehouse ()
 Reference to the control logic warehouse. More...
 
void executeControls (const ExecFlagType &exec_type)
 Performs setup and execute calls for Control objects. More...
 
void executeSamplers (const ExecFlagType &exec_type)
 Performs setup and execute calls for Sampler objects. More...
 
virtual void updateActiveObjects ()
 Update the active objects in the warehouses. More...
 
void reportMooseObjectDependency (MooseObject *a, MooseObject *b)
 Register a MOOSE object dependency so we can either order operations properly or report when we cannot. More...
 
ExecuteMooseObjectWarehouse< MultiApp > & getMultiAppWarehouse ()
 
const VectorPostprocessorDatagetVectorPostprocessorData () const
 
bool hasJacobian () const
 Returns _has_jacobian. More...
 
bool constJacobian () const
 Returns _const_jacobian (whether a MOOSE object has specified that the Jacobian is the same as the previous time it was computed) More...
 
void addOutput (const std::string &, const std::string &, InputParameters)
 Adds an Output object. More...
 
TheWarehousetheWarehouse () const
 
void setSNESMFReuseBase (bool reuse, bool set_by_user)
 If or not to reuse the base vector for matrix-free calculation. More...
 
bool useSNESMFReuseBase ()
 Return a flag that indicates if we are reusing the vector base. More...
 
bool isSNESMFReuseBaseSetbyUser ()
 Return a flag to indicate if _snesmf_reuse_base is set by users. More...
 
void usingADMatProps (bool using_ad_mat_props)
 Set the global automatic differentiaion (AD) flag which indicates whether any consumer has requested an AD material property or whether any suppier has declared an AD material property. More...
 
bool usingADMatProps () const
 Whether any object has requested/supplied an AD material property. More...
 
virtual void setUDotRequested (const bool u_dot_requested)
 Set boolean flag to true to store solution time derivative. More...
 
virtual void setUDotDotRequested (const bool u_dotdot_requested)
 Set boolean flag to true to store solution second time derivative. More...
 
virtual void setUDotOldRequested (const bool u_dot_old_requested)
 Set boolean flag to true to store old solution time derivative. More...
 
virtual void setUDotDotOldRequested (const bool u_dotdot_old_requested)
 Set boolean flag to true to store old solution second time derivative. More...
 
virtual bool uDotRequested ()
 Get boolean flag to check whether solution time derivative needs to be stored. More...
 
virtual bool uDotDotRequested ()
 Get boolean flag to check whether solution second time derivative needs to be stored. More...
 
virtual bool uDotOldRequested ()
 Get boolean flag to check whether old solution time derivative needs to be stored. More...
 
virtual bool uDotDotOldRequested ()
 Get boolean flag to check whether old solution second time derivative needs to be stored. More...
 
void haveADObjects (bool have_ad_objects) override
 Method for setting whether we have any ad objects. More...
 
virtual void haveADObjects (bool have_ad_objects)
 Method for setting whether we have any ad objects. More...
 
bool haveADObjects () const
 Method for reading wehther we have any ad objects. More...
 
bool haveADObjects () const
 Method for reading wehther we have any ad objects. More...
 
bool shouldSolve () const
 
virtual bool checkNonlocalCouplingRequirement ()
 
bool defaultGhosting ()
 Whether or not the user has requested default ghosting ot be on. More...
 
virtual TagID addVectorTag (TagName tag_name)
 Create a Tag. More...
 
virtual TagID getVectorTagID (const TagName &tag_name)
 Get a TagID from a TagName. More...
 
virtual TagName vectorTagName (TagID tag)
 Retrieve the name associated with a TagID. More...
 
virtual std::map< TagName, TagID > & getVectorTags ()
 Return all vector tags, where a tag is represented by a map from name to ID. More...
 
virtual bool vectorTagExists (TagID tag)
 Check to see if a particular Tag exists. More...
 
bool vectorTagExists (const TagName &tag_name)
 Check to see if a particular Tag exists by using Tag name. More...
 
virtual unsigned int numVectorTags ()
 The total number of tags. More...
 
virtual TagID addMatrixTag (TagName tag_name)
 Create a Tag. More...
 
virtual TagID getMatrixTagID (const TagName &tag_name)
 Get a TagID from a TagName. More...
 
virtual TagName matrixTagName (TagID tag)
 Retrieve the name associated with a TagID. More...
 
virtual bool matrixTagExists (const TagName &tag_name)
 Check to see if a particular Tag exists. More...
 
virtual bool matrixTagExists (TagID tag_id)
 Check to see if a particular Tag exists. More...
 
virtual unsigned int numMatrixTags ()
 The total number of tags. More...
 
virtual std::map< TagName, TagID > & getMatrixTags ()
 Return all matrix tags in the sytem, where a tag is represented by a map from name to ID. More...
 
virtual const std::set< MooseVariableFEBase * > & getActiveElementalMooseVariables (THREAD_ID tid) const
 Get the MOOSE variables to be reinited on each element. More...
 
virtual bool hasActiveElementalMooseVariables (THREAD_ID tid) const
 Whether or not a list of active elemental moose variables has been set. More...
 
virtual const std::set< unsigned int > & getActiveMaterialProperties (THREAD_ID tid) const
 Get the material properties required by the current computing thread. More...
 
virtual bool hasActiveMaterialProperties (THREAD_ID tid) const
 Method to check whether or not a list of active material roperties has been set. More...
 
unsigned int getAxisymmetricRadialCoord () const
 Returns the desired radial direction for RZ coordinate transformation. More...
 
virtual DiracKernelInfodiracKernelInfo ()
 
virtual void storeSubdomainMatPropName (SubdomainID block_id, const std::string &name)
 Adds the given material property to a storage map based on block ids. More...
 
virtual void storeBoundaryMatPropName (BoundaryID boundary_id, const std::string &name)
 Adds the given material property to a storage map based on boundary ids. More...
 
virtual void storeSubdomainZeroMatProp (SubdomainID block_id, const MaterialPropertyName &name)
 Adds to a map based on block ids of material properties for which a zero value can be returned. More...
 
virtual void storeBoundaryZeroMatProp (BoundaryID boundary_id, const MaterialPropertyName &name)
 Adds to a map based on boundary ids of material properties for which a zero value can be returned. More...
 
virtual void storeSubdomainDelayedCheckMatProp (const std::string &requestor, SubdomainID block_id, const std::string &name)
 Adds to a map based on block ids of material properties to validate. More...
 
virtual void storeBoundaryDelayedCheckMatProp (const std::string &requestor, BoundaryID boundary_id, const std::string &name)
 Adds to a map based on boundary ids of material properties to validate. More...
 
virtual void checkBlockMatProps ()
 Checks block material properties integrity. More...
 
virtual void checkBoundaryMatProps ()
 Checks boundary material properties integrity. More...
 
virtual void markMatPropRequested (const std::string &)
 Helper method for adding a material property name to the _material_property_requested set. More...
 
virtual bool isMatPropRequested (const std::string &prop_name) const
 Find out if a material property has been requested by any object. More...
 
virtual std::set< SubdomainIDgetMaterialPropertyBlocks (const std::string &prop_name)
 Get a vector containing the block ids the material property is defined on. More...
 
virtual std::vector< SubdomainName > getMaterialPropertyBlockNames (const std::string &prop_name)
 Get a vector of block id equivalences that the material property is defined on. More...
 
virtual bool hasBlockMaterialProperty (SubdomainID block_id, const std::string &prop_name)
 Check if a material property is defined on a block. More...
 
virtual std::set< BoundaryIDgetMaterialPropertyBoundaryIDs (const std::string &prop_name)
 Get a vector containing the block ids the material property is defined on. More...
 
virtual std::vector< BoundaryName > getMaterialPropertyBoundaryNames (const std::string &prop_name)
 Get a vector of block id equivalences that the material property is defined on. More...
 
virtual bool hasBoundaryMaterialProperty (BoundaryID boundary_id, const std::string &prop_name)
 Check if a material property is defined on a block. More...
 
virtual std::set< dof_id_type > & ghostedElems ()
 Return the list of elements that should have their DoFs ghosted to this processor. More...
 
const CouplingMatrix & nonlocalCouplingMatrix () const
 
virtual const bool & currentlyComputingJacobian () const
 Returns true if the problem is in the process of computing Jacobian. More...
 
virtual void setCurrentlyComputingJacobian (const bool &flag)
 
bool & computingNonlinearResid ()
 Check whether residual being evaulated is non-linear. More...
 
bool safeAccessTaggedMatrices ()
 Is it safe to access the tagged matrices. More...
 
bool safeAccessTaggedVectors ()
 Is it safe to access the tagged vectors. More...
 
std::set< TagID > & getActiveScalarVariableCoupleableVectorTags (THREAD_ID tid)
 
std::set< TagID > & getActiveScalarVariableCoupleableMatrixTags (THREAD_ID tid)
 
std::set< TagID > & getActiveFEVariableCoupleableVectorTags (THREAD_ID tid)
 
std::set< TagID > & getActiveFEVariableCoupleableMatrixTags (THREAD_ID tid)
 
void _setCLIOption ()
 For Internal Use. More...
 
virtual void terminateSolve ()
 Allow objects to request clean termination of the solve. More...
 
virtual bool isSolveTerminationRequested ()
 Check of termination has been requested. More...
 
const std::string & type () const
 Get the type of this object. More...
 
const std::string & name () const
 Get the name of the object. More...
 
const InputParametersparameters () const
 Get the parameters of the object. More...
 
template<typename T >
const T & getParam (const std::string &name) const
 Retrieve a parameter for the object. More...
 
template<typename T >
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 Verifies that the requested parameter exists and is not NULL and returns it to the caller. More...
 
bool isParamValid (const std::string &name) const
 Test if the supplied parameter is valid. More...
 
MooseAppgetMooseApp () const
 Get the MooseApp this object is associated with. More...
 
virtual bool enabled () const
 Return the enabled status of the object. More...
 
template<typename... Args>
void paramError (const std::string &param, Args... args)
 Emits an error prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message. More...
 
template<typename... Args>
void paramWarning (const std::string &param, Args... args)
 Emits a warning prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message. More...
 
template<typename... Args>
void paramInfo (const std::string &param, Args... args)
 Emits an informational message prefixed with the file and line number of the given param (from the input file) along with the full parameter path+name followed by the given args as the message. More...
 
template<typename... Args>
void mooseError (Args &&... args) const
 
template<typename... Args>
void mooseWarning (Args &&... args) const
 
template<typename... Args>
void mooseDeprecated (Args &&... args) const
 
template<typename... Args>
void mooseInfo (Args &&... args) const
 
void allowOutput (bool state)
 Ability to enable/disable all output calls. More...
 
template<typename T >
void allowOutput (bool state)
 
bool hasMultiApps () const
 Returns whether or not the current simulation has any multiapps. More...
 
bool hasMultiApps (ExecFlagType type) const
 
bool hasMultiApp (const std::string &name) const
 
const MaterialPropertyStoragegetMaterialPropertyStorage ()
 Return a reference to the material property storage. More...
 
const MaterialPropertyStoragegetBndMaterialPropertyStorage ()
 
const MaterialPropertyStoragegetNeighborMaterialPropertyStorage ()
 
const MooseObjectWarehouse< Indicator > & getIndicatorWarehouse ()
 Return indicator/marker storage. More...
 
const MooseObjectWarehouse< InternalSideIndicator > & getInternalSideIndicatorWarehouse ()
 
const MooseObjectWarehouse< Marker > & getMarkerWarehouse ()
 
bool needBoundaryMaterialOnSide (BoundaryID bnd_id, THREAD_ID tid)
 These methods are used to determine whether stateful material properties need to be stored on internal sides. More...
 
bool needSubdomainMaterialOnSide (SubdomainID subdomain_id, THREAD_ID tid)
 
const ExecFlagTypegetCurrentExecuteOnFlag () const
 Return/set the current execution flag. More...
 
void setCurrentExecuteOnFlag (const ExecFlagType &)
 

Public Attributes

std::map< std::string, std::vector< dof_id_type > > _var_dof_map
 
const ConsoleStream _console
 An instance of helper class to write streams to the Console objects. More...
 
std::vector< Real > _real_zero
 Convenience zeros. More...
 
std::vector< VariableValue_scalar_zero
 
std::vector< VariableValue_zero
 
std::vector< MooseArray< DualReal > > _ad_zero
 
std::vector< VariableGradient_grad_zero
 
std::vector< MooseArray< DualRealVectorValue > > _ad_grad_zero
 
std::vector< VariableSecond_second_zero
 
std::vector< MooseArray< DualRealTensorValue > > _ad_second_zero
 
std::vector< VariablePhiSecond_second_phi_zero
 
std::vector< Point > _point_zero
 
std::vector< VectorVariableValue_vector_zero
 
std::vector< VectorVariableCurl_vector_curl_zero
 

Protected Member Functions

void createTagVectors ()
 Create extra tagged vectors and matrices. More...
 
void meshChangedHelper (bool intermediate_change=false)
 Helper method to update some or all data after a mesh change. More...
 
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. More...
 
void checkDisplacementOrders ()
 Verify that SECOND order mesh uses SECOND order displacements. More...
 
void checkUserObjects ()
 
void checkDependMaterialsHelper (const std::map< SubdomainID, std::vector< std::shared_ptr< Material >>> &materials_map)
 Helper method for checking Material object dependency. More...
 
void checkCoordinateSystems ()
 Verify that there are no element type/coordinate type conflicts. More...
 
void reinitBecauseOfGhostingOrNewGeomObjects ()
 Call when it is possible that the needs for ghosted elements has changed. More...
 
MooseVariableFEBasegetVariableHelper (THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type, Moose::VarFieldType expected_var_field_type, SystemBase &nl, SystemBase &aux)
 Helper function called by getVariable that handles the logic for checking whether Variables of the requested type are available. More...
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level)
 Call to register a named section for timing. More...
 
template<typename T >
T & declareRestartableData (std::string data_name)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableData (std::string data_name, const T &init_value)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, void *context)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableDataWithContext (std::string data_name, const T &init_value, void *context)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRecoverableData (std::string data_name)
 Declare a piece of data as "recoverable". More...
 
template<typename T >
T & declareRecoverableData (std::string data_name, const T &init_value)
 Declare a piece of data as "restartable" and initialize it. More...
 
template<typename T >
T & declareRestartableDataWithObjectName (std::string data_name, std::string object_name)
 Declare a piece of data as "restartable". More...
 
template<typename T >
T & declareRestartableDataWithObjectNameWithContext (std::string data_name, std::string object_name, void *context)
 Declare a piece of data as "restartable". More...
 

Protected Attributes

unsigned int _n_eigen_pairs_required
 
bool _generalized_eigenvalue_problem
 
std::shared_ptr< NonlinearEigenSystem_nl_eigen
 
PerfID _compute_jacobian_tag_timer
 Timers. More...
 
PerfID _compute_jacobian_ab_timer
 
PerfID _compute_residual_tag_timer
 
PerfID _compute_residual_ab_timer
 
PerfID _solve_timer
 
MooseMesh_mesh
 
EquationSystems _eq
 
bool _initialized
 
std::set< TagID_fe_vector_tags
 
std::set< TagID_fe_matrix_tags
 
bool _solve
 Whether or not to actually solve the nonlinear system. More...
 
bool _transient
 
Real & _time
 
Real & _time_old
 
int & _t_step
 
Real & _dt
 
Real & _dt_old
 
std::shared_ptr< NonlinearSystemBase_nl
 
std::shared_ptr< AuxiliarySystem_aux
 
Moose::CouplingType _coupling
 Type of variable coupling. More...
 
std::unique_ptr< CouplingMatrix > _cm
 Coupling matrix for variables. More...
 
std::map< std::string, unsigned int > _subspace_dim
 
std::vector< std::unique_ptr< Assembly > > _assembly
 
MooseObjectWarehouse< Function_functions
 functions More...
 
MooseObjectWarehouseBase< Distribution_distributions
 distributions More...
 
ExecuteMooseObjectWarehouse< Sampler_samplers
 Samplers. More...
 
MooseObjectWarehouse< KernelBase_nonlocal_kernels
 nonlocal kernels More...
 
MooseObjectWarehouse< IntegratedBCBase_nonlocal_integrated_bcs
 nonlocal integrated_bcs More...
 
MaterialPropertyStorage_material_props
 
MaterialPropertyStorage_bnd_material_props
 
MaterialPropertyStorage_neighbor_material_props
 
std::vector< std::shared_ptr< MaterialData > > _material_data
 
std::vector< std::shared_ptr< MaterialData > > _bnd_material_data
 
std::vector< std::shared_ptr< MaterialData > > _neighbor_material_data
 
MooseObjectWarehouse< Marker_markers
 
PostprocessorData _pps_data
 
VectorPostprocessorData _vpps_data
 
ExecuteMooseObjectWarehouse< UserObject_all_user_objects
 
ExecuteMooseObjectWarehouse< MultiApp_multi_apps
 MultiApp Warehouse. More...
 
ExecuteMooseObjectWarehouse< TransientMultiApp_transient_multi_apps
 Storage for TransientMultiApps (only needed for calling 'computeDT') More...
 
ExecuteMooseObjectWarehouse< Transfer_transfers
 Normal Transfers. More...
 
ExecuteMooseObjectWarehouse< Transfer_to_multi_app_transfers
 Transfers executed just before MultiApps to transfer data to them. More...
 
ExecuteMooseObjectWarehouse< Transfer_from_multi_app_transfers
 Transfers executed just after MultiApps to transfer data from them. More...
 
std::map< std::string, std::unique_ptr< RandomData > > _random_data_objects
 A map of objects that consume random numbers. More...
 
std::vector< std::unordered_map< SubdomainID, bool > > _block_mat_side_cache
 Cache for calculating materials on side. More...
 
std::vector< std::unordered_map< BoundaryID, bool > > _bnd_mat_side_cache
 Cache for calculating materials on side. More...
 
std::vector< MeshChangedInterface * > _notify_when_mesh_changes
 Objects to be notified when the mesh changes. More...
 
Adaptivity _adaptivity
 
unsigned int _cycles_completed
 
std::shared_ptr< XFEMInterface_xfem
 Pointer to XFEM controller. More...
 
MooseMesh_displaced_mesh
 
std::shared_ptr< DisplacedProblem_displaced_problem
 
GeometricSearchData _geometric_search_data
 
bool _reinit_displaced_elem
 
bool _reinit_displaced_face
 
bool _input_file_saved
 whether input file has been written More...
 
bool _has_dampers
 Whether or not this system has any Dampers associated with it. More...
 
bool _has_constraints
 Whether or not this system has any Constraints. More...
 
bool _snesmf_reuse_base
 If or not to resuse the base vector for matrix-free calculation. More...
 
bool _snesmf_reuse_base_set_by_user
 If or not _snesmf_reuse_base is set by user. More...
 
bool _has_initialized_stateful
 Whether nor not stateful materials have been initialized. More...
 
std::unique_ptr< Resurrector_resurrector
 Object responsible for restart (read/write) More...
 
bool _const_jacobian
 true if the Jacobian is constant More...
 
bool _has_jacobian
 Indicates if the Jacobian was computed. More...
 
bool _needs_old_newton_iter
 Indicates that we need to compute variable values for previous Newton iteration. More...
 
bool _has_nonlocal_coupling
 Indicates if nonlocal coupling is required/exists. More...
 
bool _calculate_jacobian_in_uo
 
std::vector< std::vector< MooseVariableFEBase * > > _uo_jacobian_moose_vars
 
SolverParams _solver_params
 
bool _kernel_coverage_check
 Determines whether a check to verify an active kernel on every subdomain. More...
 
bool _material_coverage_check
 Determines whether a check to verify an active material on every subdomain. More...
 
unsigned int _max_qps
 Maximum number of quadrature points used in the problem. More...
 
unsigned int _max_shape_funcs
 Maximum number of shape functions on any element in the problem. More...
 
Order _max_scalar_order
 Maximum scalar variable order. More...
 
bool _has_time_integrator
 Indicates whether or not this executioner has a time integrator (during setup) More...
 
bool _has_exception
 Whether or not an exception has occurred. More...
 
bool _parallel_barrier_messaging
 Whether or not information about how many transfers have completed is printed. More...
 
std::string _exception_message
 The error message to go with an exception. More...
 
ExecFlagType _current_execute_on_flag
 Current execute_on flag. More...
 
ExecuteMooseObjectWarehouse< Control_control_warehouse
 The control logic warehouse. More...
 
Moose::PetscSupport::PetscOptions _petsc_options
 PETSc option storage. More...
 
std::shared_ptr< LineSearch_line_search
 
std::unique_ptr< ConstElemRange > _evaluable_local_elem_range
 
bool _using_ad_mat_props
 Automatic differentiaion (AD) flag which indicates whether any consumer has requested an AD material property or whether any suppier has declared an AD material property. More...
 
std::map< TagName, TagID_vector_tag_name_to_tag_id
 The currently declared tags. More...
 
std::map< TagID, TagName > _vector_tag_id_to_tag_name
 Reverse map. More...
 
std::map< TagName, TagID_matrix_tag_name_to_tag_id
 The currently declared tags. More...
 
std::map< TagID, TagName > _matrix_tag_id_to_tag_name
 Reverse map. More...
 
Factory_factory
 The Factory for building objects. More...
 
CouplingMatrix _nonlocal_cm
 
std::map< SubdomainID, Moose::CoordinateSystemType_coord_sys
 nonlocal coupling matrix; More...
 
DiracKernelInfo _dirac_kernel_info
 
std::map< SubdomainID, std::set< std::string > > _map_block_material_props
 Map of material properties (block_id -> list of properties) More...
 
std::map< BoundaryID, std::set< std::string > > _map_boundary_material_props
 Map for boundary material properties (boundary_id -> list of properties) More...
 
std::map< SubdomainID, std::set< MaterialPropertyName > > _zero_block_material_props
 Set of properties returned as zero properties. More...
 
std::map< BoundaryID, std::set< MaterialPropertyName > > _zero_boundary_material_props
 
std::set< std::string > _material_property_requested
 set containing all material property names that have been requested by getMaterialProperty* More...
 
std::vector< std::set< MooseVariableFEBase * > > _active_elemental_moose_variables
 This is the set of MooseVariableFEBases that will actually get reinited by a call to reinit(elem) More...
 
std::vector< unsigned int > _has_active_elemental_moose_variables
 Whether or not there is currently a list of active elemental moose variables. More...
 
std::vector< std::set< unsigned int > > _active_material_property_ids
 Set of material property ids that determine whether materials get reinited. More...
 
std::vector< std::set< TagID > > _active_fe_var_coupleable_matrix_tags
 
std::vector< std::set< TagID > > _active_fe_var_coupleable_vector_tags
 
std::vector< std::set< TagID > > _active_sc_var_coupleable_matrix_tags
 
std::vector< std::set< TagID > > _active_sc_var_coupleable_vector_tags
 
bool _requires_nonlocal_coupling
 nonlocal coupling requirement flag More...
 
bool _default_ghosting
 Whether or not to use default libMesh coupling. More...
 
std::set< dof_id_type > _ghosted_elems
 Elements that should have Dofs ghosted to the local processor. More...
 
unsigned int _rz_coord_axis
 Storage for RZ axis selection. More...
 
bool _currently_computing_jacobian
 Flag to determine whether the problem is currently computing Jacobian. More...
 
bool _computing_nonlinear_residual
 Whether residual being evaulated is non-linear. More...
 
bool _safe_access_tagged_matrices
 Is it safe to retrieve data from tagged matrices. More...
 
bool _safe_access_tagged_vectors
 Is it safe to retrieve data from tagged vectors. More...
 
bool _have_ad_objects
 AD flag indicating whether any AD objects have been added. More...
 
bool _cli_option_found
 True if the CLI option is found. More...
 
bool _color_output
 True if we're going to attempt to write color output. More...
 
bool _termination_requested
 True if termination of the solve has been requested. More...
 
const InputParameters_pars
 Parameters of this object, references the InputParameters stored in the InputParametersWarehouse. More...
 
MooseApp_app
 The MooseApp this object is associated with. More...
 
const std::string & _type
 The type of this object (the Class name) More...
 
const std::string & _name
 The name of this object, reference to value stored in InputParameters. More...
 
const bool & _enabled
 Reference to the "enable" InputParaemters, used by Controls for toggling on/off MooseObjects. More...
 
const InputParameters_pg_params
 Params. More...
 
PerfGraph_perf_graph
 The performance graph to add to. More...
 
std::string _prefix
 A prefix to use for all sections. More...
 
InitialConditionWarehouse _ics
 
MooseObjectWarehouseBase< ScalarInitialCondition_scalar_ics
 
MaterialWarehouse _residual_materials
 
MaterialWarehouse _jacobian_materials
 
MaterialWarehouse _discrete_materials
 
MaterialWarehouse _all_materials
 
MooseObjectWarehouse< Indicator_indicators
 
MooseObjectWarehouse< InternalSideIndicator_internal_side_indicators
 
std::map< SubdomainID, std::multimap< std::string, std::string > > _map_block_material_props_check
 Data structures of the requested material properties. More...
 
std::map< BoundaryID, std::multimap< std::string, std::string > > _map_boundary_material_props_check
 

Detailed Description

Problem for solving eigenvalue problems.

Definition at line 26 of file EigenProblem.h.

Constructor & Destructor Documentation

◆ EigenProblem()

EigenProblem::EigenProblem ( const InputParameters parameters)

Definition at line 37 of file EigenProblem.C.

39  // By default, we want to compute an eigenvalue only (smallest or largest)
42  _nl_eigen(std::make_shared<NonlinearEigenSystem>(*this, "eigen0")),
43  _compute_jacobian_tag_timer(registerTimedSection("computeJacobianTag", 3)),
44  _compute_jacobian_ab_timer(registerTimedSection("computeJacobianAB", 3)),
45  _compute_residual_tag_timer(registerTimedSection("computeResidualTag", 3)),
46  _compute_residual_ab_timer(registerTimedSection("computeResidualAB", 3)),
48 {
49 #if LIBMESH_HAVE_SLEPC
50  _nl = _nl_eigen;
51  _aux = std::make_shared<AuxiliarySystem>(*this, "aux0");
52 
54 
56 
57  _eq.parameters.set<EigenProblem *>("_eigen_problem") = this;
58 
59 #else
60  mooseError("Need to install SLEPc to solve eigenvalue problems, please reconfigure\n");
61 #endif /* LIBMESH_HAVE_SLEPC */
62 
63  // Create extra vectors and matrices if any
65 }
PerfID registerTimedSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
std::shared_ptr< NonlinearSystemBase > _nl
PerfID _compute_residual_ab_timer
Definition: EigenProblem.h:94
virtual void initNullSpaceVectors(const InputParameters &parameters, NonlinearSystemBase &nl)
unsigned int _n_eigen_pairs_required
Definition: EigenProblem.h:86
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
FEProblemBase(const InputParameters &parameters)
std::shared_ptr< NonlinearEigenSystem > _nl_eigen
Definition: EigenProblem.h:88
bool _generalized_eigenvalue_problem
Definition: EigenProblem.h:87
virtual void newAssemblyArray(NonlinearSystemBase &nl)
PerfID _compute_jacobian_tag_timer
Timers.
Definition: EigenProblem.h:91
void createTagVectors()
Create extra tagged vectors and matrices.
PerfID _solve_timer
Definition: EigenProblem.h:95
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
std::shared_ptr< AuxiliarySystem > _aux
PerfID _compute_jacobian_ab_timer
Definition: EigenProblem.h:92
EquationSystems _eq
Problem for solving eigenvalue problems.
Definition: EigenProblem.h:26
PerfID _compute_residual_tag_timer
Definition: EigenProblem.h:93

Member Function Documentation

◆ _setCLIOption()

void Problem::_setCLIOption ( )
inlineinherited

For Internal Use.

Definition at line 36 of file Problem.h.

36 { _cli_option_found = true; }
bool _cli_option_found
True if the CLI option is found.
Definition: Problem.h:47

◆ adaptivity()

Adaptivity& FEProblemBase::adaptivity ( )
inlineinherited

Definition at line 1254 of file FEProblemBase.h.

Referenced by Steady::execute(), FEProblemBase::initialAdaptMesh(), and FEProblemBase::initialSetup().

1254 { return _adaptivity; }
Adaptivity _adaptivity

◆ adaptMesh()

bool FEProblemBase::adaptMesh ( )
virtualinherited
Returns
Whether or not the mesh was changed

Reimplemented in DumpObjectsProblem.

Definition at line 5043 of file FEProblemBase.C.

Referenced by Steady::execute(), and Transient::incrementStepOrReject().

5044 {
5045  // reset cycle counter
5046  _cycles_completed = 0;
5047 
5049  return false;
5050 
5051  TIME_SECTION(_adapt_mesh_timer);
5052 
5053  unsigned int cycles_per_step = _adaptivity.getCyclesPerStep();
5054 
5055  bool mesh_changed = false;
5056 
5057  for (unsigned int i = 0; i < cycles_per_step; ++i)
5058  {
5059  _console << "Adaptivity step " << i + 1 << " of " << cycles_per_step << '\n';
5060 
5061  // Markers were already computed once by Executioner
5062  if (_adaptivity.getRecomputeMarkersFlag() && i > 0)
5063  computeMarkers();
5064 
5065  if (_adaptivity.adaptMesh())
5066  {
5067  mesh_changed = true;
5068 
5069  meshChangedHelper(true); // This may be an intermediate change
5071  }
5072  else
5073  {
5074  _console << "Mesh unchanged, skipping remaining steps..." << std::endl;
5075  break;
5076  }
5077 
5078  // Show adaptivity progress
5079  _console << std::flush;
5080  }
5081 
5082  // We're done with all intermediate changes; now get systems ready
5083  // for real if necessary.
5084  if (mesh_changed)
5085  _eq.reinit_systems();
5086 
5087  return mesh_changed;
5088 }
const PerfID _adapt_mesh_timer
bool adaptMesh(std::string marker_name=std::string())
Adapts the mesh based on the error estimator used.
Definition: Adaptivity.C:125
void meshChangedHelper(bool intermediate_change=false)
Helper method to update some or all data after a mesh change.
unsigned int _cycles_completed
unsigned int getCyclesPerStep() const
Pull out the number of cycles_per_step previously set through the AdaptivityAction.
Definition: Adaptivity.h:107
virtual void computeMarkers()
bool getRecomputeMarkersFlag() const
Pull out the _recompute_markers_during_cycles flag previously set through the AdaptivityAction.
Definition: Adaptivity.h:120
Adaptivity _adaptivity
bool isAdaptivityDue()
Query if an adaptivity step should be performed at the current time / time step.
Definition: Adaptivity.C:309
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
EquationSystems _eq

◆ addADJacobianMaterial()

void FEProblemBase::addADJacobianMaterial ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Definition at line 2370 of file FEProblemBase.C.

2373 {
2375 }
MaterialWarehouse _jacobian_materials
virtual void addMaterialHelper(std::vector< MaterialWarehouse *> warehouse, const std::string &kernel_name, const std::string &name, InputParameters parameters)
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56

◆ addADResidualMaterial()

void FEProblemBase::addADResidualMaterial ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Definition at line 2362 of file FEProblemBase.C.

2365 {
2367 }
virtual void addMaterialHelper(std::vector< MaterialWarehouse *> warehouse, const std::string &kernel_name, const std::string &name, InputParameters parameters)
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
MaterialWarehouse _residual_materials
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56

◆ addAuxKernel()

void FEProblemBase::addAuxKernel ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 2041 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addAuxKernel().

2044 {
2045  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
2046  {
2047  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2048  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
2049  parameters.set<SystemBase *>("_nl_sys") = &_displaced_problem->nlSys();
2050  if (!parameters.get<std::vector<BoundaryName>>("boundary").empty())
2051  _reinit_displaced_face = true;
2052  else
2053  _reinit_displaced_elem = true;
2054  }
2055  else
2056  {
2057  if (_displaced_problem == nullptr && parameters.get<bool>("use_displaced_mesh"))
2058  {
2059  // We allow AuxKernels to request that they use_displaced_mesh,
2060  // but then be overridden when no displacements variables are
2061  // provided in the Mesh block. If that happened, update the value
2062  // of use_displaced_mesh appropriately for this AuxKernel.
2063  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2064  parameters.set<bool>("use_displaced_mesh") = false;
2065  }
2066 
2067  parameters.set<SubProblem *>("_subproblem") = this;
2068  parameters.set<SystemBase *>("_sys") = _aux.get();
2069  parameters.set<SystemBase *>("_nl_sys") = _nl.get();
2070  }
2071 
2072  _aux->addKernel(kernel_name, name, parameters);
2073 }
bool _reinit_displaced_elem
std::shared_ptr< NonlinearSystemBase > _nl
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Base class for a system (of equations)
Definition: SystemBase.h:93
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
std::shared_ptr< AuxiliarySystem > _aux
bool _reinit_displaced_face
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
std::shared_ptr< DisplacedProblem > _displaced_problem

◆ addAuxScalarKernel()

void FEProblemBase::addAuxScalarKernel ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 2076 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addAuxScalarKernel().

2079 {
2080  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
2081  {
2082  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2083  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
2084  }
2085  else
2086  {
2087  if (_displaced_problem == nullptr && parameters.get<bool>("use_displaced_mesh"))
2088  {
2089  // We allow AuxScalarKernels to request that they use_displaced_mesh,
2090  // but then be overridden when no displacements variables are
2091  // provided in the Mesh block. If that happened, update the value
2092  // of use_displaced_mesh appropriately for this AuxScalarKernel.
2093  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2094  parameters.set<bool>("use_displaced_mesh") = false;
2095  }
2096 
2097  parameters.set<SubProblem *>("_subproblem") = this;
2098  parameters.set<SystemBase *>("_sys") = _aux.get();
2099  }
2100 
2101  _aux->addScalarKernel(kernel_name, name, parameters);
2102 }
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Base class for a system (of equations)
Definition: SystemBase.h:93
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
std::shared_ptr< AuxiliarySystem > _aux
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
std::shared_ptr< DisplacedProblem > _displaced_problem

◆ addAuxScalarVariable()

void FEProblemBase::addAuxScalarVariable ( const std::string &  var_name,
Order  order,
Real  scale_factor = 1.,
const std::set< SubdomainID > *const  active_subdomains = NULL 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 2023 of file FEProblemBase.C.

2027 {
2028  if (order > _max_scalar_order)
2029  _max_scalar_order = order;
2030 
2031  FEType type(order, SCALAR);
2032  if (duplicateVariableCheck(var_name, type, /* is_aux = */ true))
2033  return;
2034 
2035  _aux->addScalarVariable(var_name, order, scale_factor, active_subdomains);
2036  if (_displaced_problem)
2037  _displaced_problem->addAuxScalarVariable(var_name, order, scale_factor, active_subdomains);
2038 }
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.
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:50
std::shared_ptr< AuxiliarySystem > _aux
std::shared_ptr< DisplacedProblem > _displaced_problem
Order _max_scalar_order
Maximum scalar variable order.

◆ addAuxVariable()

void FEProblemBase::addAuxVariable ( const std::string &  var_name,
const FEType &  type,
const std::set< SubdomainID > *const  active_subdomains = NULL 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 2010 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addAuxVariable().

2013 {
2014  if (duplicateVariableCheck(var_name, type, /* is_aux = */ true))
2015  return;
2016 
2017  _aux->addVariable(var_name, type, 1.0, active_subdomains);
2018  if (_displaced_problem)
2019  _displaced_problem->addAuxVariable(var_name, type, active_subdomains);
2020 }
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.
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:50
std::shared_ptr< AuxiliarySystem > _aux
std::shared_ptr< DisplacedProblem > _displaced_problem

◆ addBoundaryCondition()

void FEProblemBase::addBoundaryCondition ( const std::string &  bc_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 1944 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addBoundaryCondition().

1947 {
1948  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
1949  {
1950  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1951  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
1952  const auto & disp_names = _displaced_problem->getDisplacementVarNames();
1953  parameters.set<std::vector<VariableName>>("displacements") =
1954  std::vector<VariableName>(disp_names.begin(), disp_names.end());
1955  _reinit_displaced_face = true;
1956  }
1957  else
1958  {
1959  if (_displaced_problem == nullptr && parameters.get<bool>("use_displaced_mesh"))
1960  {
1961  // We allow Materials to request that they use_displaced_mesh,
1962  // but then be overridden when no displacements variables are
1963  // provided in the Mesh block. If that happened, update the value
1964  // of use_displaced_mesh appropriately for this Material.
1965  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1966  parameters.set<bool>("use_displaced_mesh") = false;
1967  }
1968 
1969  parameters.set<SubProblem *>("_subproblem") = this;
1970  parameters.set<SystemBase *>("_sys") = _nl.get();
1971  }
1972 
1973  _nl->addBoundaryCondition(bc_name, name, parameters);
1974 }
std::shared_ptr< NonlinearSystemBase > _nl
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Base class for a system (of equations)
Definition: SystemBase.h:93
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
bool _reinit_displaced_face
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
std::shared_ptr< DisplacedProblem > _displaced_problem

◆ addCachedJacobian()

void FEProblemBase::addCachedJacobian ( THREAD_ID  tid)
overridevirtualinherited

Implements SubProblem.

Definition at line 1273 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::computeJacobianInternal(), NonlinearSystemBase::constraintJacobians(), NonlinearSystemBase::enforceNodalConstraintsJacobian(), and ComputeJacobianThread::postElement().

1274 {
1275  _assembly[tid]->addCachedJacobian();
1276  if (_displaced_problem)
1277  _displaced_problem->addCachedJacobian(tid);
1278 }
std::shared_ptr< DisplacedProblem > _displaced_problem
std::vector< std::unique_ptr< Assembly > > _assembly

◆ addCachedResidual()

void FEProblemBase::addCachedResidual ( THREAD_ID  tid)
overridevirtualinherited

Implements SubProblem.

Definition at line 1182 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::computeResidualInternal(), NonlinearSystemBase::constraintResiduals(), ComputeNodalKernelBcsThread::onNode(), ComputeNodalKernelsThread::onNode(), and ComputeResidualThread::postElement().

1183 {
1184  _assembly[tid]->addCachedResiduals();
1185 
1186  if (_displaced_problem)
1187  _displaced_problem->addCachedResidual(tid);
1188 }
std::shared_ptr< DisplacedProblem > _displaced_problem
std::vector< std::unique_ptr< Assembly > > _assembly

◆ addCachedResidualDirectly()

void FEProblemBase::addCachedResidualDirectly ( NumericVector< Number > &  residual,
THREAD_ID  tid 
)
virtualinherited

Allows for all the residual contributions that are currently cached to be added directly into the vector passed in.

Parameters
residualThe vector to add the cached contributions to.
tidThe thread id.

Definition at line 1191 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::constraintResiduals(), and NonlinearSystemBase::enforceNodalConstraintsResidual().

1192 {
1193  _assembly[tid]->addCachedResidual(residual, _nl->timeVectorTag());
1194  _assembly[tid]->addCachedResidual(residual, _nl->nonTimeVectorTag());
1195 
1196  if (_displaced_problem)
1197  _displaced_problem->addCachedResidualDirectly(residual, tid);
1198 }
std::shared_ptr< NonlinearSystemBase > _nl
std::shared_ptr< DisplacedProblem > _displaced_problem
std::vector< std::unique_ptr< Assembly > > _assembly

◆ addConstraint()

void FEProblemBase::addConstraint ( const std::string &  c_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 1977 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addConstraint().

1980 {
1981  _has_constraints = true;
1982 
1983  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
1984  {
1985  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1986  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
1987  _reinit_displaced_face = true;
1988  }
1989  else
1990  {
1991  // It might _want_ to use a displaced mesh... but we're not so set it to false
1992  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1993  parameters.set<bool>("use_displaced_mesh") = false;
1994 
1995  parameters.set<SubProblem *>("_subproblem") = this;
1996  parameters.set<SystemBase *>("_sys") = _nl.get();
1997  }
1998 
1999  // Check that "variable" is in the NonlinearSystem.
2000  if (!_nl->hasVariable(parameters.get<NonlinearVariableName>("variable")))
2001  mooseError(name,
2002  ": Cannot add Constraint for variable ",
2003  parameters.get<NonlinearVariableName>("variable"),
2004  ", it is not a nonlinear variable!");
2005 
2006  _nl->addConstraint(c_name, name, parameters);
2007 }
std::shared_ptr< NonlinearSystemBase > _nl
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
Base class for a system (of equations)
Definition: SystemBase.h:93
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
bool _reinit_displaced_face
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
std::shared_ptr< DisplacedProblem > _displaced_problem
bool _has_constraints
Whether or not this system has any Constraints.

◆ addDamper()

void FEProblemBase::addDamper ( std::string  damper_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Definition at line 3293 of file FEProblemBase.C.

3296 {
3297  parameters.set<SubProblem *>("_subproblem") = this;
3298  parameters.set<SystemBase *>("_sys") = _nl.get();
3299 
3300  _has_dampers = true;
3301  _nl->addDamper(damper_name, name, parameters);
3302 }
std::shared_ptr< NonlinearSystemBase > _nl
bool _has_dampers
Whether or not this system has any Dampers associated with it.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Base class for a system (of equations)
Definition: SystemBase.h:93
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56

◆ addDGKernel()

void FEProblemBase::addDGKernel ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 2137 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addDGKernel().

2140 {
2141  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
2142  {
2143  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2144  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
2145  _reinit_displaced_face = true;
2146  }
2147  else
2148  {
2149  if (_displaced_problem == nullptr && parameters.get<bool>("use_displaced_mesh"))
2150  {
2151  // We allow DGKernels to request that they use_displaced_mesh,
2152  // but then be overridden when no displacements variables are
2153  // provided in the Mesh block. If that happened, update the value
2154  // of use_displaced_mesh appropriately for this DGKernel.
2155  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2156  parameters.set<bool>("use_displaced_mesh") = false;
2157  }
2158 
2159  parameters.set<SubProblem *>("_subproblem") = this;
2160  parameters.set<SystemBase *>("_sys") = _nl.get();
2161  }
2162 
2163  _nl->addDGKernel(dg_kernel_name, name, parameters);
2164 
2166 }
std::shared_ptr< NonlinearSystemBase > _nl
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Base class for a system (of equations)
Definition: SystemBase.h:93
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
bool _reinit_displaced_face
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
std::shared_ptr< DisplacedProblem > _displaced_problem
bool _has_internal_edge_residual_objects
Whether the problem has dgkernels or interface kernels.

◆ addDiracKernel()

void FEProblemBase::addDiracKernel ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 2105 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addDiracKernel().

2108 {
2109  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
2110  {
2111  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2112  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
2113  _reinit_displaced_elem = true;
2114  }
2115  else
2116  {
2117  if (_displaced_problem == nullptr && parameters.get<bool>("use_displaced_mesh"))
2118  {
2119  // We allow DiracKernels to request that they use_displaced_mesh,
2120  // but then be overridden when no displacements variables are
2121  // provided in the Mesh block. If that happened, update the value
2122  // of use_displaced_mesh appropriately for this DiracKernel.
2123  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2124  parameters.set<bool>("use_displaced_mesh") = false;
2125  }
2126 
2127  parameters.set<SubProblem *>("_subproblem") = this;
2128  parameters.set<SystemBase *>("_sys") = _nl.get();
2129  }
2130 
2131  _nl->addDiracKernel(kernel_name, name, parameters);
2132 }
bool _reinit_displaced_elem
std::shared_ptr< NonlinearSystemBase > _nl
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Base class for a system (of equations)
Definition: SystemBase.h:93
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
std::shared_ptr< DisplacedProblem > _displaced_problem

◆ addDisplacedProblem()

void FEProblemBase::addDisplacedProblem ( std::shared_ptr< DisplacedProblem displaced_problem)
virtualinherited

Definition at line 4930 of file FEProblemBase.C.

4931 {
4932  _displaced_mesh = &displaced_problem->mesh();
4933  _displaced_problem = displaced_problem;
4934 }
std::shared_ptr< DisplacedProblem > _displaced_problem
MooseMesh * _displaced_mesh

◆ addDistribution()

void FEProblemBase::addDistribution ( std::string  type,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

The following functions will enable MOOSE to have the capability to import distributions.

Definition at line 1748 of file FEProblemBase.C.

1751 {
1752  parameters.set<std::string>("type") = type;
1753  std::shared_ptr<Distribution> dist = _factory.create<Distribution>(type, name, parameters);
1754  _distributions.addObject(dist);
1755 }
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:587
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
All Distributions should inherit from this class.
Definition: Distribution.h:23
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:50
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.
MooseObjectWarehouseBase< Distribution > _distributions
distributions

◆ addExtraVectors()

void FEProblemBase::addExtraVectors ( )
virtualinherited

A place to add extra vectors to the simulation.

It is called early during initialSetup.

Definition at line 552 of file FEProblemBase.C.

Referenced by FEProblemBase::initialSetup().

553 {
554  _nl->addExtraVectors();
555  _aux->addExtraVectors();
556 }
std::shared_ptr< NonlinearSystemBase > _nl
std::shared_ptr< AuxiliarySystem > _aux

◆ addFunction()

void FEProblemBase::addFunction ( std::string  type,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 1669 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addFunction(), and FEProblemBase::getFunction().

1670 {
1671  parameters.set<SubProblem *>("_subproblem") = this;
1672 
1673  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
1674  {
1675  std::shared_ptr<Function> func = _factory.create<Function>(type, name, parameters, tid);
1676  _functions.addObject(func, tid);
1677  }
1678 }
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
Base class for function objects.
Definition: Function.h:41
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:587
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:50
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
MooseObjectWarehouse< Function > _functions
functions
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.
unsigned int THREAD_ID
Definition: MooseTypes.h:162

◆ addGhostedBoundary()

void FEProblemBase::addGhostedBoundary ( BoundaryID  boundary_id)
overridevirtualinherited

Will make sure that all necessary elements from boundary_id are ghosted to this processor.

Implements SubProblem.

Definition at line 1352 of file FEProblemBase.C.

Referenced by DisplacedProblem::addGhostedBoundary().

1353 {
1354  _mesh.addGhostedBoundary(boundary_id);
1355  if (_displaced_problem)
1356  _displaced_mesh->addGhostedBoundary(boundary_id);
1357 }
MooseMesh & _mesh
std::shared_ptr< DisplacedProblem > _displaced_problem
void addGhostedBoundary(BoundaryID boundary_id)
This will add the boundary ids to be ghosted to this processor.
Definition: MooseMesh.C:2375
MooseMesh * _displaced_mesh

◆ addGhostedElem()

void FEProblemBase::addGhostedElem ( dof_id_type  elem_id)
overridevirtualinherited

Will make sure that all dofs connected to elem_id are ghosted to this processor.

Implements SubProblem.

Definition at line 1345 of file FEProblemBase.C.

Referenced by DisplacedProblem::addGhostedElem(), and NodalPatchRecovery::NodalPatchRecovery().

1346 {
1347  if (_mesh.elemPtr(elem_id)->processor_id() != processor_id())
1348  _ghosted_elems.insert(elem_id);
1349 }
virtual Elem * elemPtr(const dof_id_type i)
Definition: MooseMesh.C:2269
std::set< dof_id_type > _ghosted_elems
Elements that should have Dofs ghosted to the local processor.
Definition: SubProblem.h:644
MooseMesh & _mesh

◆ addIndicator()

void FEProblemBase::addIndicator ( std::string  indicator_name,
const std::string &  name,
InputParameters  parameters 
)
inherited

Definition at line 3311 of file FEProblemBase.C.

3314 {
3315  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
3316  {
3317  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
3318  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
3319  _reinit_displaced_elem = true;
3320  }
3321  else
3322  {
3323  if (_displaced_problem == nullptr && parameters.get<bool>("use_displaced_mesh"))
3324  {
3325  // We allow Indicators to request that they use_displaced_mesh,
3326  // but then be overridden when no displacements variables are
3327  // provided in the Mesh block. If that happened, update the value
3328  // of use_displaced_mesh appropriately for this Indicator.
3329  if (parameters.have_parameter<bool>("use_displaced_mesh"))
3330  parameters.set<bool>("use_displaced_mesh") = false;
3331  }
3332 
3333  parameters.set<SubProblem *>("_subproblem") = this;
3334  parameters.set<SystemBase *>("_sys") = _aux.get();
3335  }
3336 
3337  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
3338  {
3339  std::shared_ptr<Indicator> indicator =
3340  _factory.create<Indicator>(indicator_name, name, parameters, tid);
3341 
3342  std::shared_ptr<InternalSideIndicator> isi =
3344  if (isi)
3346  else
3347  _indicators.addObject(indicator, tid);
3348  }
3349 }
bool _reinit_displaced_elem
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:587
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
Base class for a system (of equations)
Definition: SystemBase.h:93
MooseObjectWarehouse< InternalSideIndicator > _internal_side_indicators
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
std::shared_ptr< AuxiliarySystem > _aux
MooseObjectWarehouse< Indicator > _indicators
The InternalSideIndicator class is responsible for calculating the residuals for various physics on i...
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
std::shared_ptr< DisplacedProblem > _displaced_problem
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.
unsigned int THREAD_ID
Definition: MooseTypes.h:162

◆ addInitialCondition()

void FEProblemBase::addInitialCondition ( const std::string &  ic_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 2203 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addInitialCondition().

2206 {
2207 
2208  // before we start to mess with the initial condition, we need to check parameters for errors.
2210 
2211  parameters.set<SubProblem *>("_subproblem") = this;
2212 
2213  const std::string & var_name = parameters.get<VariableName>("variable");
2214  // field IC
2215  if (hasVariable(var_name))
2216  {
2217  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
2218  {
2221  parameters.set<SystemBase *>("_sys") = &var.sys();
2222  std::shared_ptr<InitialConditionBase> ic;
2223  if (dynamic_cast<MooseVariable *>(&var))
2224  ic = _factory.create<InitialCondition>(ic_name, name, parameters, tid);
2225  else if (dynamic_cast<VectorMooseVariable *>(&var))
2226  ic = _factory.create<VectorInitialCondition>(ic_name, name, parameters, tid);
2227  else
2228  mooseError("Your FE variable in initial condition ",
2229  name,
2230  " must be either of scalar or vector type");
2231  _ics.addObject(ic, tid);
2232  }
2233  }
2234 
2235  // scalar IC
2236  else if (hasScalarVariable(var_name))
2237  {
2238  MooseVariableScalar & var = getScalarVariable(0, var_name);
2239  parameters.set<SystemBase *>("_sys") = &var.sys();
2240  std::shared_ptr<ScalarInitialCondition> ic =
2242  _scalar_ics.addObject(ic);
2243  }
2244 
2245  else
2246  mooseError(
2247  "Variable '", var_name, "' requested in initial condition '", name, "' does not exist.");
2248 }
virtual bool hasVariable(const std::string &var_name) const override
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:587
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...
This is a template class that implements the workhorse compute and computeNodal methods.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
virtual bool hasScalarVariable(const std::string &var_name) const override
Returns a Boolean indicating whether any system contains a variable with the name provided...
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
Base class for a system (of equations)
Definition: SystemBase.h:93
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
virtual MooseVariableScalar & getScalarVariable(THREAD_ID tid, const std::string &var_name) override
Returns the scalar variable reference from whichever system contains it.
void addObject(std::shared_ptr< InitialConditionBase > object, THREAD_ID tid, bool recurse=true)
Add object to the warehouse.
void checkParams(const std::string &parsing_syntax)
This function checks parameters stored in the object to make sure they are in the correct state as th...
InitialConditions are objects that set the initial value of variables.
InitialConditionWarehouse _ics
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
Class for scalar variables (they are different).
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.
SystemBase & sys()
Get the system this variable is part of.
MooseObjectWarehouseBase< ScalarInitialCondition > _scalar_ics
unsigned int THREAD_ID
Definition: MooseTypes.h:162

◆ addInterfaceKernel()

void FEProblemBase::addInterfaceKernel ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 2171 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addInterfaceKernel().

2174 {
2175  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
2176  {
2177  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2178  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
2179  _reinit_displaced_face = true;
2180  }
2181  else
2182  {
2183  if (_displaced_problem == nullptr && parameters.get<bool>("use_displaced_mesh"))
2184  {
2185  // We allow InterfaceKernels to request that they use_displaced_mesh,
2186  // but then be overridden when no displacements variables are
2187  // provided in the Mesh block. If that happened, update the value
2188  // of use_displaced_mesh appropriately for this InterfaceKernel.
2189  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2190  parameters.set<bool>("use_displaced_mesh") = false;
2191  }
2192 
2193  parameters.set<SubProblem *>("_subproblem") = this;
2194  parameters.set<SystemBase *>("_sys") = _nl.get();
2195  }
2196 
2197  _nl->addInterfaceKernel(interface_kernel_name, name, parameters);
2198 
2200 }
std::shared_ptr< NonlinearSystemBase > _nl
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Base class for a system (of equations)
Definition: SystemBase.h:93
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
bool _reinit_displaced_face
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
std::shared_ptr< DisplacedProblem > _displaced_problem
bool _has_internal_edge_residual_objects
Whether the problem has dgkernels or interface kernels.

◆ addJacobian()

void FEProblemBase::addJacobian ( THREAD_ID  tid)
overridevirtualinherited

Implements SubProblem.

Definition at line 1217 of file FEProblemBase.C.

Referenced by ComputeDiracThread::postElement().

1218 {
1219  _assembly[tid]->addJacobian();
1221  _assembly[tid]->addJacobianNonlocal();
1222  if (_displaced_problem)
1223  {
1224  _displaced_problem->addJacobian(tid);
1226  _displaced_problem->addJacobianNonlocal(tid);
1227  }
1228 }
bool _has_nonlocal_coupling
Indicates if nonlocal coupling is required/exists.
std::shared_ptr< DisplacedProblem > _displaced_problem
std::vector< std::unique_ptr< Assembly > > _assembly

◆ addJacobianBlock()

void FEProblemBase::addJacobianBlock ( SparseMatrix< Number > &  jacobian,
unsigned int  ivar,
unsigned int  jvar,
const DofMap &  dof_map,
std::vector< dof_id_type > &  dof_indices,
THREAD_ID  tid 
)
overridevirtualinherited

Implements SubProblem.

Definition at line 1281 of file FEProblemBase.C.

Referenced by ComputeJacobianBlocksThread::postElement().

1287 {
1288  _assembly[tid]->addJacobianBlock(jacobian, ivar, jvar, dof_map, dof_indices);
1290  if (_nonlocal_cm(ivar, jvar) != 0)
1291  {
1292  MooseVariableFEBase & jv = _nl->getVariable(tid, jvar);
1293  _assembly[tid]->addJacobianBlockNonlocal(
1294  jacobian, ivar, jvar, dof_map, dof_indices, jv.allDofIndices());
1295  }
1296 
1297  if (_displaced_problem)
1298  {
1299  _displaced_problem->addJacobianBlock(jacobian, ivar, jvar, dof_map, dof_indices, tid);
1301  if (_nonlocal_cm(ivar, jvar) != 0)
1302  {
1303  MooseVariableFEBase & jv = _nl->getVariable(tid, jvar);
1304  _displaced_problem->addJacobianBlockNonlocal(
1305  jacobian, ivar, jvar, dof_map, dof_indices, jv.allDofIndices(), tid);
1306  }
1307  }
1308 }
std::shared_ptr< NonlinearSystemBase > _nl
bool _has_nonlocal_coupling
Indicates if nonlocal coupling is required/exists.
DofMap & dof_map
const std::vector< dof_id_type > & allDofIndices() const
Get all global dofindices for the variable.
std::shared_ptr< DisplacedProblem > _displaced_problem
CouplingMatrix _nonlocal_cm
Definition: SubProblem.h:589
std::vector< std::unique_ptr< Assembly > > _assembly

◆ addJacobianNeighbor() [1/2]

void FEProblemBase::addJacobianNeighbor ( THREAD_ID  tid)
overridevirtualinherited

Implements SubProblem.

Definition at line 1231 of file FEProblemBase.C.

Referenced by ComputeJacobianThread::onInterface(), and ComputeJacobianThread::onInternalSide().

1232 {
1233  _assembly[tid]->addJacobianNeighbor();
1234  if (_displaced_problem)
1235  _displaced_problem->addJacobianNeighbor(tid);
1236 }
std::shared_ptr< DisplacedProblem > _displaced_problem
std::vector< std::unique_ptr< Assembly > > _assembly

◆ addJacobianNeighbor() [2/2]

void FEProblemBase::addJacobianNeighbor ( SparseMatrix< Number > &  jacobian,
unsigned int  ivar,
unsigned int  jvar,
const DofMap &  dof_map,
std::vector< dof_id_type > &  dof_indices,
std::vector< dof_id_type > &  neighbor_dof_indices,
THREAD_ID  tid 
)
overridevirtualinherited

Implements SubProblem.

Definition at line 1311 of file FEProblemBase.C.

1318 {
1319  _assembly[tid]->addJacobianNeighbor(
1320  jacobian, ivar, jvar, dof_map, dof_indices, neighbor_dof_indices);
1321  if (_displaced_problem)
1322  _displaced_problem->addJacobianNeighbor(
1323  jacobian, ivar, jvar, dof_map, dof_indices, neighbor_dof_indices, tid);
1324 }
DofMap & dof_map
std::shared_ptr< DisplacedProblem > _displaced_problem
std::vector< std::unique_ptr< Assembly > > _assembly

◆ addJacobianOffDiagScalar()

void FEProblemBase::addJacobianOffDiagScalar ( unsigned int  ivar,
THREAD_ID  tid = 0 
)
virtualinherited

Definition at line 1245 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::computeScalarKernelsJacobians().

1246 {
1247  _assembly[tid]->addJacobianOffDiagScalar(ivar);
1248 }
std::vector< std::unique_ptr< Assembly > > _assembly

◆ addJacobianScalar()

void FEProblemBase::addJacobianScalar ( THREAD_ID  tid = 0)
virtualinherited

Definition at line 1239 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::computeScalarKernelsJacobians().

1240 {
1241  _assembly[tid]->addJacobianScalar();
1242 }
std::vector< std::unique_ptr< Assembly > > _assembly

◆ addKernel()

void FEProblemBase::addKernel ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 1853 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addKernel().

1856 {
1857  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
1858  {
1859  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1860  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
1861  const auto & disp_names = _displaced_problem->getDisplacementVarNames();
1862  parameters.set<std::vector<VariableName>>("displacements") =
1863  std::vector<VariableName>(disp_names.begin(), disp_names.end());
1864  _reinit_displaced_elem = true;
1865  }
1866  else
1867  {
1868  if (_displaced_problem == nullptr && parameters.get<bool>("use_displaced_mesh"))
1869  {
1870  // We allow Kernels to request that they use_displaced_mesh,
1871  // but then be overridden when no displacements variables are
1872  // provided in the Mesh block. If that happened, update the value
1873  // of use_displaced_mesh appropriately for this Kernel.
1874  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1875  parameters.set<bool>("use_displaced_mesh") = false;
1876  }
1877 
1878  parameters.set<SubProblem *>("_subproblem") = this;
1879  parameters.set<SystemBase *>("_sys") = _nl.get();
1880  }
1881 
1882  _nl->addKernel(kernel_name, name, parameters);
1883 }
bool _reinit_displaced_elem
std::shared_ptr< NonlinearSystemBase > _nl
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Base class for a system (of equations)
Definition: SystemBase.h:93
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
std::shared_ptr< DisplacedProblem > _displaced_problem

◆ addLineSearch()

virtual void FEProblemBase::addLineSearch ( const InputParameters )
inlinevirtualinherited

add a MOOSE line search

Reimplemented in DumpObjectsProblem, and FEProblem.

Definition at line 532 of file FEProblemBase.h.

Referenced by FEProblemSolve::FEProblemSolve().

533  {
534  mooseError("Line search not implemented for this problem type yet.");
535  }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144

◆ addMarker()

void FEProblemBase::addMarker ( std::string  marker_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Definition at line 3352 of file FEProblemBase.C.

3355 {
3356  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
3357  {
3358  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
3359  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
3360  _reinit_displaced_elem = true;
3361  }
3362  else
3363  {
3364  if (_displaced_problem == nullptr && parameters.get<bool>("use_displaced_mesh"))
3365  {
3366  // We allow Markers to request that they use_displaced_mesh,
3367  // but then be overridden when no displacements variables are
3368  // provided in the Mesh block. If that happened, update the value
3369  // of use_displaced_mesh appropriately for this Marker.
3370  if (parameters.have_parameter<bool>("use_displaced_mesh"))
3371  parameters.set<bool>("use_displaced_mesh") = false;
3372  }
3373 
3374  parameters.set<SubProblem *>("_subproblem") = this;
3375  parameters.set<SystemBase *>("_sys") = _aux.get();
3376  }
3377 
3378  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
3379  {
3380  std::shared_ptr<Marker> marker = _factory.create<Marker>(marker_name, name, parameters, tid);
3381  _markers.addObject(marker, tid);
3382  }
3383 }
bool _reinit_displaced_elem
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:587
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Definition: Marker.h:40
Base class for a system (of equations)
Definition: SystemBase.h:93
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
std::shared_ptr< AuxiliarySystem > _aux
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
std::shared_ptr< DisplacedProblem > _displaced_problem
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.
MooseObjectWarehouse< Marker > _markers
unsigned int THREAD_ID
Definition: MooseTypes.h:162

◆ addMaterial()

void FEProblemBase::addMaterial ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 2354 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addMaterial().

2357 {
2359 }
MaterialWarehouse _jacobian_materials
virtual void addMaterialHelper(std::vector< MaterialWarehouse *> warehouse, const std::string &kernel_name, const std::string &name, InputParameters parameters)
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
MaterialWarehouse _residual_materials
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56

◆ addMaterialHelper()

void FEProblemBase::addMaterialHelper ( std::vector< MaterialWarehouse *>  warehouse,
const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Definition at line 2378 of file FEProblemBase.C.

Referenced by FEProblemBase::addADJacobianMaterial(), FEProblemBase::addADResidualMaterial(), and FEProblemBase::addMaterial().

2382 {
2383  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
2384  {
2385  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2386  _reinit_displaced_elem = true;
2387  }
2388  else
2389  {
2390  if (_displaced_problem == nullptr && parameters.get<bool>("use_displaced_mesh"))
2391  {
2392  // We allow Materials to request that they use_displaced_mesh,
2393  // but then be overridden when no displacements variables are
2394  // provided in the Mesh block. If that happened, update the value
2395  // of use_displaced_mesh appropriately for this Material.
2396  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2397  parameters.set<bool>("use_displaced_mesh") = false;
2398  }
2399 
2400  parameters.set<SubProblem *>("_subproblem") = this;
2401  }
2402 
2403  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
2404  {
2405  // Create the general Block/Boundary Material object
2406  std::shared_ptr<Material> material = _factory.create<Material>(mat_name, name, parameters, tid);
2407  bool discrete = !material->getParam<bool>("compute");
2408 
2409  // If the object is boundary restricted do not create the neighbor and face objects
2410  if (material->boundaryRestricted())
2411  {
2412  _all_materials.addObject(material, tid);
2413  if (discrete)
2414  _discrete_materials.addObject(material, tid);
2415  else
2416  for (auto && warehouse : warehouses)
2417  warehouse->addObject(material, tid);
2418  }
2419 
2420  // Non-boundary restricted require face and neighbor objects
2421  else
2422  {
2423  // The name of the object being created, this is changed multiple times as objects are created
2424  // below
2425  std::string object_name;
2426 
2427  // Create a copy of the supplied parameters to the setting for "_material_data_type" isn't
2428  // used from a previous tid loop
2429  InputParameters current_parameters = parameters;
2430 
2431  // face material
2432  current_parameters.set<Moose::MaterialDataType>("_material_data_type") =
2434  object_name = name + "_face";
2435  std::shared_ptr<Material> face_material =
2436  _factory.create<Material>(mat_name, object_name, current_parameters, tid);
2437 
2438  // neighbor material
2439  current_parameters.set<Moose::MaterialDataType>("_material_data_type") =
2441  current_parameters.set<bool>("_neighbor") = true;
2442  object_name = name + "_neighbor";
2443  std::shared_ptr<Material> neighbor_material =
2444  _factory.create<Material>(mat_name, object_name, current_parameters, tid);
2445 
2446  // Store the material objects
2447  _all_materials.addObjects(material, neighbor_material, face_material, tid);
2448 
2449  if (discrete)
2450  _discrete_materials.addObjects(material, neighbor_material, face_material, tid);
2451  else
2452  for (auto && warehouse : warehouses)
2453  warehouse->addObjects(material, neighbor_material, face_material, tid);
2454 
2455  // link parameters of face and neighbor materials
2456  MooseObjectParameterName name(MooseObjectName("Material", material->name()), "*");
2457  MooseObjectParameterName face_name(MooseObjectName("Material", face_material->name()), "*");
2458  MooseObjectParameterName neighbor_name(MooseObjectName("Material", neighbor_material->name()),
2459  "*");
2462  name, neighbor_name, false);
2463  }
2464  }
2465 }
bool _reinit_displaced_elem
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:587
InputParameterWarehouse & getInputParameterWarehouse()
Get the InputParameterWarehouse for MooseObjects.
Definition: MooseApp.C:1326
MaterialDataType
MaterialData types.
Definition: MooseTypes.h:460
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: MooseObject.h:188
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
Materials compute MaterialProperties.
Definition: Material.h:47
void addControllableParameterConnection(const MooseObjectParameterName &master, const MooseObjectParameterName &slave, bool error_on_empty=true)
Method for linking control parameters of different names.
MaterialWarehouse _discrete_materials
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:174
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
std::shared_ptr< DisplacedProblem > _displaced_problem
A class for storing an input parameter name.
void addObjects(std::shared_ptr< Material > block, std::shared_ptr< Material > neighbor, std::shared_ptr< Material > face, THREAD_ID tid=0)
A special method unique to this class for adding Block, Neighbor, and Face material objects...
A class for storing the names of MooseObject by tag and object name.
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.
MaterialWarehouse _all_materials
unsigned int THREAD_ID
Definition: MooseTypes.h:162

◆ addMatrixTag()

TagID SubProblem::addMatrixTag ( TagName  tag_name)
virtualinherited

Create a Tag.

Tags can be associated with Vectors and Matrices and allow objects (such as Kernels) to arbitrarily contribute values to any set of vectors/matrics

Note: If the tag is already present then this will simply return the TagID of that Tag

Parameters
tag_nameThe name of the tag to create, the TagID will get automatically generated

Reimplemented in DisplacedProblem.

Definition at line 111 of file SubProblem.C.

Referenced by DisplacedProblem::addMatrixTag(), FEProblemBase::createTagVectors(), NonlinearEigenSystem::NonlinearEigenSystem(), and NonlinearSystemBase::NonlinearSystemBase().

112 {
113  auto tag_name_upper = MooseUtils::toUpper(tag_name);
114  auto existing_tag = _matrix_tag_name_to_tag_id.find(tag_name_upper);
115  if (existing_tag == _matrix_tag_name_to_tag_id.end())
116  {
117  auto tag_id = _matrix_tag_name_to_tag_id.size();
118 
119  _matrix_tag_name_to_tag_id[tag_name_upper] = tag_id;
120 
121  _matrix_tag_id_to_tag_name[tag_id] = tag_name_upper;
122  }
123 
124  return _matrix_tag_name_to_tag_id.at(tag_name_upper);
125 }
std::map< TagName, TagID > _matrix_tag_name_to_tag_id
The currently declared tags.
Definition: SubProblem.h:581
std::string toUpper(const std::string &name)
Convert supplied string to upper case.
Definition: MooseUtils.C:699
std::map< TagID, TagName > _matrix_tag_id_to_tag_name
Reverse map.
Definition: SubProblem.h:584

◆ addMultiApp()

void FEProblemBase::addMultiApp ( const std::string &  multi_app_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Add a MultiApp to the problem.

Definition at line 3386 of file FEProblemBase.C.

3389 {
3390  parameters.set<MPI_Comm>("_mpi_comm") = _communicator.get();
3391  parameters.set<std::shared_ptr<CommandLine>>("_command_line") = _app.commandLine();
3392 
3393  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
3394  {
3395  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
3396  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
3397  _reinit_displaced_elem = true;
3398  }
3399  else
3400  {
3401  if (_displaced_problem == nullptr && parameters.get<bool>("use_displaced_mesh"))
3402  {
3403  // We allow MultiApps to request that they use_displaced_mesh,
3404  // but then be overridden when no displacements variables are
3405  // provided in the Mesh block. If that happened, update the value
3406  // of use_displaced_mesh appropriately for this MultiApp.
3407  if (parameters.have_parameter<bool>("use_displaced_mesh"))
3408  parameters.set<bool>("use_displaced_mesh") = false;
3409  }
3410 
3411  parameters.set<SubProblem *>("_subproblem") = this;
3412  parameters.set<SystemBase *>("_sys") = _aux.get();
3413  }
3414 
3415  std::shared_ptr<MultiApp> multi_app = _factory.create<MultiApp>(multi_app_name, name, parameters);
3416 
3417  multi_app->setupPositions();
3418 
3419  _multi_apps.addObject(multi_app);
3420 
3421  // Store TranseintMultiApp objects in another container, this is needed for calling computeDT
3422  std::shared_ptr<TransientMultiApp> trans_multi_app =
3424  if (trans_multi_app)
3425  _transient_multi_apps.addObject(trans_multi_app);
3426 }
bool _reinit_displaced_elem
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:587
void setupPositions()
Called just after construction to allow derived classes to set _positions;.
Definition: MultiApp.C:223
std::shared_ptr< CommandLine > commandLine() const
Get the command line.
Definition: MooseApp.h:294
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
MultiApp Implementation for Transient Apps.
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
ExecuteMooseObjectWarehouse< TransientMultiApp > _transient_multi_apps
Storage for TransientMultiApps (only needed for calling &#39;computeDT&#39;)
Base class for a system (of equations)
Definition: SystemBase.h:93
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
std::shared_ptr< AuxiliarySystem > _aux
ExecuteMooseObjectWarehouse< MultiApp > _multi_apps
MultiApp Warehouse.
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:174
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
std::shared_ptr< DisplacedProblem > _displaced_problem
A MultiApp represents one or more MOOSE applications that are running simultaneously.
Definition: MultiApp.h:58

◆ addNodalKernel()

void FEProblemBase::addNodalKernel ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 1886 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addNodalKernel().

1889 {
1890  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
1891  {
1892  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1893  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
1894  _reinit_displaced_elem = true;
1895  }
1896  else
1897  {
1898  if (_displaced_problem == nullptr && parameters.get<bool>("use_displaced_mesh"))
1899  {
1900  // We allow NodalKernels to request that they use_displaced_mesh,
1901  // but then be overridden when no displacements variables are
1902  // provided in the Mesh block. If that happened, update the value
1903  // of use_displaced_mesh appropriately for this NodalKernel.
1904  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1905  parameters.set<bool>("use_displaced_mesh") = false;
1906  }
1907 
1908  parameters.set<SubProblem *>("_subproblem") = this;
1909  parameters.set<SystemBase *>("_sys") = _nl.get();
1910  }
1911  _nl->addNodalKernel(kernel_name, name, parameters);
1912 }
bool _reinit_displaced_elem
std::shared_ptr< NonlinearSystemBase > _nl
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Base class for a system (of equations)
Definition: SystemBase.h:93
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
std::shared_ptr< DisplacedProblem > _displaced_problem

◆ addOutput()

void FEProblemBase::addOutput ( const std::string &  object_type,
const std::string &  object_name,
InputParameters  parameters 
)
inherited

Adds an Output object.

Definition at line 5816 of file FEProblemBase.C.

5819 {
5820  // Get a reference to the OutputWarehouse
5821  OutputWarehouse & output_warehouse = _app.getOutputWarehouse();
5822 
5823  // Reject the reserved names for objects not built by MOOSE
5824  if (!parameters.get<bool>("_built_by_moose") && output_warehouse.isReservedName(object_name))
5825  mooseError("The name '", object_name, "' is a reserved name for output objects");
5826 
5827  // Check that an object by the same name does not already exist; this must be done before the
5828  // object is created to avoid getting misleading errors from the Parser
5829  if (output_warehouse.hasOutput(object_name))
5830  mooseError("An output object named '", object_name, "' already exists");
5831 
5832  // Add a pointer to the FEProblemBase class
5833  parameters.addPrivateParam<FEProblemBase *>("_fe_problem_base", this);
5834 
5835  // Create common parameter exclude list
5836  std::vector<std::string> exclude;
5837  if (object_type == "Console")
5838  {
5839  exclude.push_back("execute_on");
5840 
5841  // --show-input should enable the display of the input file on the screen
5842  if (_app.getParam<bool>("show_input") && parameters.get<bool>("output_screen"))
5843  parameters.set<ExecFlagEnum>("execute_input_on") = EXEC_INITIAL;
5844  }
5845 
5846  // Apply the common parameters
5847  InputParameters * common = output_warehouse.getCommonParameters();
5848  if (common)
5849  parameters.applyParameters(*common, exclude);
5850 
5851  // Set the correct value for the binary flag for XDA/XDR output
5852  if (object_type == "XDR")
5853  parameters.set<bool>("_binary") = true;
5854  else if (object_type == "XDA")
5855  parameters.set<bool>("_binary") = false;
5856 
5857  // Adjust the checkpoint suffix if auto recovery was enabled
5858  if (object_name == "auto_recovery_checkpoint")
5859  parameters.set<std::string>("suffix") = "auto_recovery";
5860 
5861  // Create the object and add it to the warehouse
5862  std::shared_ptr<Output> output = _factory.create<Output>(object_type, object_name, parameters);
5863  output_warehouse.addOutput(output);
5864 }
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
A MultiMooseEnum object to hold "execute_on" flags.
Definition: ExecFlagEnum.h:25
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:587
void addPrivateParam(const std::string &name, const T &value)
These method add a parameter to the InputParameters object which can be retrieved like any other para...
void addOutput(std::shared_ptr< Output > &output)
Adds an existing output object to the warehouse.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
bool isReservedName(const std::string &name)
Test if the given name is reserved.
bool hasOutput(const std::string &name) const
Returns true if the output object exists.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Based class for output objects.
Definition: Output.h:42
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
Class for storing and utilizing output objects.
void applyParameters(const InputParameters &common, std::vector< std::string > exclude=std::vector< std::string >())
Method for applying common parameters.
const T & getParam(const std::string &name)
Retrieve a parameter for the object.
Definition: MooseApp.h:926
InputParameters * getCommonParameters()
Get a reference to the common output parameters.
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:174
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:1054
const ExecFlagType EXEC_INITIAL

◆ addPostprocessor()

void FEProblemBase::addPostprocessor ( std::string  pp_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Definition at line 2659 of file FEProblemBase.C.

2662 {
2663  // Check for name collision
2664  if (hasUserObject(name))
2665  mooseError(std::string("A UserObject with the name \"") + name +
2666  "\" already exists. You may not add a Postprocessor by the same name.");
2667 
2668  addUserObject(pp_name, name, parameters);
2670 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
bool hasUserObject(const std::string &name) const
Check if there if a user object of given name.
void initPostprocessorData(const std::string &name)
Initializes the postprocessor data.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
virtual void addUserObject(std::string user_object_name, const std::string &name, InputParameters parameters)

◆ addPredictor()

void FEProblemBase::addPredictor ( const std::string &  type,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Definition at line 4338 of file FEProblemBase.C.

Referenced by AB2PredictorCorrector::AB2PredictorCorrector().

4341 {
4342  parameters.set<SubProblem *>("_subproblem") = this;
4343  std::shared_ptr<Predictor> predictor = _factory.create<Predictor>(type, name, parameters);
4344  _nl->setPredictor(predictor);
4345 }
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:587
std::shared_ptr< NonlinearSystemBase > _nl
Base class for predictors.
Definition: Predictor.h:34
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:50
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56

◆ addResidual()

void FEProblemBase::addResidual ( THREAD_ID  tid)
overridevirtualinherited

Implements SubProblem.

Definition at line 1142 of file FEProblemBase.C.

Referenced by ComputeDiracThread::postElement().

1143 {
1144  _assembly[tid]->addResidual(getVectorTags());
1145 
1146  if (_displaced_problem)
1147  _displaced_problem->addResidual(tid);
1148 }
virtual std::map< TagName, TagID > & getVectorTags()
Return all vector tags, where a tag is represented by a map from name to ID.
Definition: SubProblem.h:107
std::shared_ptr< DisplacedProblem > _displaced_problem
std::vector< std::unique_ptr< Assembly > > _assembly

◆ addResidualNeighbor()

void FEProblemBase::addResidualNeighbor ( THREAD_ID  tid)
overridevirtualinherited

Implements SubProblem.

Definition at line 1151 of file FEProblemBase.C.

Referenced by ComputeResidualThread::onInterface(), and ComputeResidualThread::onInternalSide().

1152 {
1153  _assembly[tid]->addResidualNeighbor(getVectorTags());
1154 
1155  if (_displaced_problem)
1156  _displaced_problem->addResidualNeighbor(tid);
1157 }
virtual std::map< TagName, TagID > & getVectorTags()
Return all vector tags, where a tag is represented by a map from name to ID.
Definition: SubProblem.h:107
std::shared_ptr< DisplacedProblem > _displaced_problem
std::vector< std::unique_ptr< Assembly > > _assembly

◆ addResidualScalar()

void FEProblemBase::addResidualScalar ( THREAD_ID  tid = 0)
virtualinherited

Definition at line 1160 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::computeResidualInternal().

1161 {
1162  _assembly[tid]->addResidualScalar(getVectorTags());
1163 }
virtual std::map< TagName, TagID > & getVectorTags()
Return all vector tags, where a tag is represented by a map from name to ID.
Definition: SubProblem.h:107
std::vector< std::unique_ptr< Assembly > > _assembly

◆ addSampler()

void FEProblemBase::addSampler ( std::string  type,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

The following functions will enable MOOSE to have the capability to import Samplers.

Definition at line 1767 of file FEProblemBase.C.

1768 {
1769  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
1770  {
1771  std::shared_ptr<Sampler> dist = _factory.create<Sampler>(type, name, parameters, tid);
1772  _samplers.addObject(dist, tid);
1773  }
1774 }
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:587
This is the base class for Samplers.
Definition: Sampler.h:41
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:50
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
ExecuteMooseObjectWarehouse< Sampler > _samplers
Samplers.
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
unsigned int THREAD_ID
Definition: MooseTypes.h:162

◆ addScalarKernel()

void FEProblemBase::addScalarKernel ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 1915 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addScalarKernel().

1918 {
1919  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
1920  {
1921  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1922  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
1923  }
1924  else
1925  {
1926  if (_displaced_problem == nullptr && parameters.get<bool>("use_displaced_mesh"))
1927  {
1928  // We allow ScalarKernels to request that they use_displaced_mesh,
1929  // but then be overridden when no displacements variables are
1930  // provided in the Mesh block. If that happened, update the value
1931  // of use_displaced_mesh appropriately for this ScalarKernel.
1932  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1933  parameters.set<bool>("use_displaced_mesh") = false;
1934  }
1935 
1936  parameters.set<SubProblem *>("_subproblem") = this;
1937  parameters.set<SystemBase *>("_sys") = _nl.get();
1938  }
1939 
1940  _nl->addScalarKernel(kernel_name, name, parameters);
1941 }
std::shared_ptr< NonlinearSystemBase > _nl
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Base class for a system (of equations)
Definition: SystemBase.h:93
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
std::shared_ptr< DisplacedProblem > _displaced_problem

◆ addScalarVariable()

void FEProblemBase::addScalarVariable ( const std::string &  var_name,
Order  order,
Real  scale_factor = 1.,
const std::set< SubdomainID > *const  active_subdomains = NULL 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 1835 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addAuxScalarVariable(), and DumpObjectsProblem::addScalarVariable().

1839 {
1840  if (order > _max_scalar_order)
1841  _max_scalar_order = order;
1842 
1843  FEType type(order, SCALAR);
1844  if (duplicateVariableCheck(var_name, type, /* is_aux = */ false))
1845  return;
1846 
1847  _nl->addScalarVariable(var_name, order, scale_factor, active_subdomains);
1848  if (_displaced_problem)
1849  _displaced_problem->addScalarVariable(var_name, order, scale_factor, active_subdomains);
1850 }
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.
std::shared_ptr< NonlinearSystemBase > _nl
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:50
std::shared_ptr< DisplacedProblem > _displaced_problem
Order _max_scalar_order
Maximum scalar variable order.

◆ addTimeIntegrator()

void FEProblemBase::addTimeIntegrator ( const std::string &  type,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Definition at line 4322 of file FEProblemBase.C.

Referenced by Transient::setupTimeIntegrator().

4325 {
4326  parameters.set<SubProblem *>("_subproblem") = this;
4327  _aux->addTimeIntegrator(type, name + ":aux", parameters);
4328  _nl->addTimeIntegrator(type, name, parameters);
4329  _has_time_integrator = true;
4330 
4331  // add vectors to store u_dot, u_dotdot, udot_old and u_dotdot_old if requested by the time
4332  // integrator
4333  _aux->addDotVectors();
4334  _nl->addDotVectors();
4335 }
std::shared_ptr< NonlinearSystemBase > _nl
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
bool _has_time_integrator
Indicates whether or not this executioner has a time integrator (during setup)
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:50
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
std::shared_ptr< AuxiliarySystem > _aux
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56

◆ addTransfer()

void FEProblemBase::addTransfer ( const std::string &  transfer_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Add a Transfer to the problem.

Definition at line 3654 of file FEProblemBase.C.

3657 {
3658  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
3659  {
3660  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
3661  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
3662  _reinit_displaced_elem = true;
3663  }
3664  else
3665  {
3666  if (_displaced_problem == nullptr && parameters.get<bool>("use_displaced_mesh"))
3667  {
3668  // We allow Transfers to request that they use_displaced_mesh,
3669  // but then be overridden when no displacements variables are
3670  // provided in the Mesh block. If that happened, update the value
3671  // of use_displaced_mesh appropriately for this Transfer.
3672  if (parameters.have_parameter<bool>("use_displaced_mesh"))
3673  parameters.set<bool>("use_displaced_mesh") = false;
3674  }
3675 
3676  parameters.set<SubProblem *>("_subproblem") = this;
3677  parameters.set<SystemBase *>("_sys") = _aux.get();
3678  }
3679 
3680  // Handle the "SAME_AS_MULTIAPP" execute option
3681  ExecFlagEnum & exec_enum = parameters.set<ExecFlagEnum>("execute_on", true);
3682  if (exec_enum.contains(EXEC_SAME_AS_MULTIAPP))
3683  {
3684  std::shared_ptr<MultiApp> multiapp = getMultiApp(parameters.get<MultiAppName>("multi_app"));
3685  exec_enum = multiapp->getParam<ExecFlagEnum>("execute_on");
3686  }
3687 
3688  // Create the Transfer objects
3689  std::shared_ptr<Transfer> transfer = _factory.create<Transfer>(transfer_name, name, parameters);
3690 
3691  // Add MultiAppTransfer object
3692  std::shared_ptr<MultiAppTransfer> multi_app_transfer =
3694  if (multi_app_transfer)
3695  {
3696  if (multi_app_transfer->direction() == MultiAppTransfer::TO_MULTIAPP)
3697  _to_multi_app_transfers.addObject(multi_app_transfer);
3698  else
3699  _from_multi_app_transfers.addObject(multi_app_transfer);
3700  }
3701  else
3702  _transfers.addObject(transfer);
3703 }
bool _reinit_displaced_elem
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
A MultiMooseEnum object to hold "execute_on" flags.
Definition: ExecFlagEnum.h:25
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:587
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
ExecuteMooseObjectWarehouse< Transfer > _from_multi_app_transfers
Transfers executed just after MultiApps to transfer data from them.
Base class for a system (of equations)
Definition: SystemBase.h:93
std::shared_ptr< MultiApp > getMultiApp(const std::string &multi_app_name) const
Get a MultiApp object by name.
ExecuteMooseObjectWarehouse< Transfer > _transfers
Normal Transfers.
bool contains(const std::string &value) const
Contains methods for seeing if a value is in the MultiMooseEnum.
ExecuteMooseObjectWarehouse< Transfer > _to_multi_app_transfers
Transfers executed just before MultiApps to transfer data to them.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
std::shared_ptr< AuxiliarySystem > _aux
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
Base class for all MultiAppTransfer objects.
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.
const ExecFlagType EXEC_SAME_AS_MULTIAPP
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
std::shared_ptr< DisplacedProblem > _displaced_problem
Base class for all Transfer objects.
Definition: Transfer.h:41

◆ addUserObject()

void FEProblemBase::addUserObject ( std::string  user_object_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Definition at line 2687 of file FEProblemBase.C.

Referenced by FEProblemBase::addPostprocessor(), and FEProblemBase::addVectorPostprocessor().

2690 {
2691  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
2692  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2693  else
2694  {
2695  if (_displaced_problem == nullptr && parameters.get<bool>("use_displaced_mesh"))
2696  {
2697  // We allow UserObjects to request that they use_displaced_mesh,
2698  // but then be overridden when no displacements variables are
2699  // provided in the Mesh block. If that happened, update the value
2700  // of use_displaced_mesh appropriately for this UserObject.
2701  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2702  parameters.set<bool>("use_displaced_mesh") = false;
2703  }
2704 
2705  parameters.set<SubProblem *>("_subproblem") = this;
2706  }
2707 
2708  UserObject * primary = nullptr;
2709  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
2710  {
2711  // Create the UserObject
2712  std::shared_ptr<UserObject> user_object =
2713  _factory.create<UserObject>(user_object_name, name, parameters, tid);
2714  if (tid == 0)
2715  primary = user_object.get();
2716  else
2717  user_object->setPrimaryThreadCopy(primary);
2718 
2719  // TODO: delete this line after apps have been updated to not call getUserObjects
2720  _all_user_objects.addObject(user_object, tid);
2721 
2722  theWarehouse().add(user_object, "UserObject");
2723 
2724  // Attempt to create all the possible UserObject types
2725  auto euo = std::dynamic_pointer_cast<ElementUserObject>(user_object);
2726  auto suo = std::dynamic_pointer_cast<SideUserObject>(user_object);
2727  auto isuo = std::dynamic_pointer_cast<InternalSideUserObject>(user_object);
2728  auto iuo = std::dynamic_pointer_cast<InterfaceUserObject>(user_object);
2729  auto nuo = std::dynamic_pointer_cast<NodalUserObject>(user_object);
2730  auto guo = std::dynamic_pointer_cast<GeneralUserObject>(user_object);
2731  auto tguo = std::dynamic_pointer_cast<ThreadedGeneralUserObject>(user_object);
2732 
2733  // Account for displaced mesh use
2734  if (_displaced_problem && parameters.get<bool>("use_displaced_mesh"))
2735  {
2736  if (euo || nuo)
2737  _reinit_displaced_elem = true;
2738  else if (suo || iuo)
2739  // shouldn't we add isuo
2740  _reinit_displaced_face = true;
2741  }
2742 
2743  if (guo && !tguo)
2744  break;
2745  }
2746 }
bool _reinit_displaced_elem
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:587
void setPrimaryThreadCopy(UserObject *primary)
Definition: UserObject.h:129
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
ExecuteMooseObjectWarehouse< UserObject > _all_user_objects
A user object that runs over all the nodes and does an aggregation step to compute a single value...
TheWarehouse & theWarehouse() const
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
bool _reinit_displaced_face
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:60
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.
void add(std::shared_ptr< MooseObject > obj, const std::string &system)
add adds a new object to the warehouse and stores attributes/metadata about it for running queries/fi...
Definition: TheWarehouse.C:94
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
std::shared_ptr< DisplacedProblem > _displaced_problem
Base class for implementing interface user objects.
Base class for user-specific data.
Definition: UserObject.h:38
unsigned int THREAD_ID
Definition: MooseTypes.h:162
An instance of this object type has one copy per thread that runs on each thread. ...

◆ addVariable()

void FEProblemBase::addVariable ( const std::string &  var_name,
const FEType &  type,
Real  scale_factor,
const std::set< SubdomainID > *const  active_subdomains = NULL 
)
virtualinherited

Reimplemented in DumpObjectsProblem.

Definition at line 1821 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addVariable().

1825 {
1826  if (duplicateVariableCheck(var_name, type, /* is_aux = */ false))
1827  return;
1828 
1829  _nl->addVariable(var_name, type, scale_factor, active_subdomains);
1830  if (_displaced_problem)
1831  _displaced_problem->addVariable(var_name, type, scale_factor, active_subdomains);
1832 }
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.
std::shared_ptr< NonlinearSystemBase > _nl
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:50
std::shared_ptr< DisplacedProblem > _displaced_problem

◆ addVectorPostprocessor()

void FEProblemBase::addVectorPostprocessor ( std::string  pp_name,
const std::string &  name,
InputParameters  parameters 
)
virtualinherited

Definition at line 2673 of file FEProblemBase.C.

2676 {
2677  // Check for name collision
2678  if (hasUserObject(name))
2679  mooseError(std::string("A UserObject with the name \"") + name +
2680  "\" already exists. You may not add a VectorPostprocessor by the same name.");
2681 
2682  addUserObject(pp_name, name, parameters);
2684 }
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
bool hasUserObject(const std::string &name) const
Check if there if a user object of given name.
void initVectorPostprocessorData(const std::string &name)
Initialize the VectorPostprocessor data.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:62
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
virtual void addUserObject(std::string user_object_name, const std::string &name, InputParameters parameters)

◆ addVectorTag()

TagID SubProblem::addVectorTag ( TagName  tag_name)
virtualinherited

Create a Tag.

Tags can be associated with Vectors and Matrices and allow objects (such as Kernels) to arbitrarily contribute values to any set of vectors/matrics

Note: If the tag is already present then this will simply return the TagID of that Tag

Parameters
tag_nameThe name of the tag to create, the TagID will get automatically generated

Reimplemented in DisplacedProblem.

Definition at line 65 of file SubProblem.C.

Referenced by DisplacedProblem::addVectorTag(), FEProblemBase::createTagVectors(), NonlinearSystemBase::getResidualNonTimeVector(), NonlinearSystemBase::getResidualTimeVector(), NonlinearEigenSystem::NonlinearEigenSystem(), and NonlinearSystemBase::NonlinearSystemBase().

66 {
67  auto tag_name_upper = MooseUtils::toUpper(tag_name);
68  auto existing_tag = _vector_tag_name_to_tag_id.find(tag_name_upper);
69  if (existing_tag == _vector_tag_name_to_tag_id.end())
70  {
71  auto tag_id = _vector_tag_name_to_tag_id.size();
72 
73  _vector_tag_name_to_tag_id[tag_name_upper] = tag_id;
74 
75  _vector_tag_id_to_tag_name[tag_id] = tag_name_upper;
76  }
77 
78  return _vector_tag_name_to_tag_id.at(tag_name_upper);
79 }
std::map< TagName, TagID > _vector_tag_name_to_tag_id
The currently declared tags.
Definition: SubProblem.h:575
std::string toUpper(const std::string &name)
Convert supplied string to upper case.
Definition: MooseUtils.C:699
std::map< TagID, TagName > _vector_tag_id_to_tag_name
Reverse map.
Definition: SubProblem.h:578

◆ advanceMultiApps()

void FEProblemBase::advanceMultiApps ( ExecFlagType  type)
inlineinherited

Deprecated method; use finishMultiAppStep and/or incrementMultiAppTStep depending on your purpose.

Definition at line 940 of file FEProblemBase.h.

941  {
942  mooseDeprecated("Deprecated method; use finishMultiAppStep and/or incrementMultiAppTStep "
943  "depending on your purpose");
945  }
void finishMultiAppStep(ExecFlagType type)
Finish the MultiApp time step (endStep, postStep) associated with the ExecFlagType.
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:50
void mooseDeprecated(Args &&... args) const
Definition: MooseObject.h:158

◆ advanceState()

void FEProblemBase::advanceState ( )
virtualinherited

Advance all of the state holding vectors / datastructures so that we can move to the next timestep.

Reimplemented in DumpObjectsProblem.

Definition at line 4221 of file FEProblemBase.C.

Referenced by Steady::execute(), Transient::incrementStepOrReject(), NonlinearEigen::init(), TransientMultiApp::setupApp(), ExplicitTVDRK2::solve(), ExplicitRK2::solve(), TransientMultiApp::solveStep(), DT2::step(), NonlinearEigen::takeStep(), and InversePowerMethod::takeStep().

4222 {
4223  TIME_SECTION(_advance_state_timer);
4224 
4225  _nl->copyOldSolutions();
4226  _aux->copyOldSolutions();
4227 
4228  if (_displaced_problem)
4229  {
4230  _displaced_problem->nlSys().copyOldSolutions();
4231  _displaced_problem->auxSys().copyOldSolutions();
4232  }
4233 
4236 
4238  _material_props.shift(*this);
4239 
4241  _bnd_material_props.shift(*this);
4242 
4245 }
MaterialPropertyStorage & _bnd_material_props
void copyValuesBack()
Copy the current post-processor values into old (i.e.
std::shared_ptr< NonlinearSystemBase > _nl
const PerfID _advance_state_timer
void shift(const FEProblemBase &fe_problem)
Shift the material properties in time.
PostprocessorData _pps_data
std::shared_ptr< AuxiliarySystem > _aux
VectorPostprocessorData _vpps_data
void copyValuesBack()
Copy the current Postprocessor values into old (i.e.
std::shared_ptr< DisplacedProblem > _displaced_problem
MaterialPropertyStorage & _neighbor_material_props
MaterialPropertyStorage & _material_props

◆ allowOutput() [1/2]

void FEProblemBase::allowOutput ( bool  state)
inherited

Ability to enable/disable all output calls.

This is needed by Multiapps and applications to disable output for cases when executioners call other executions and when Multiapps are sub cycling.

Definition at line 4290 of file FEProblemBase.C.

Referenced by TransientMultiApp::resetApp(), and TransientMultiApp::solveStep().

4291 {
4293 }
void allowOutput(bool state)
Ability to enable/disable output calls This is private, users should utilize FEProblemBase::allowOutp...
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:174
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:1054

◆ allowOutput() [2/2]

template<typename T >
void FEProblemBase::allowOutput ( bool  state)
inherited

Definition at line 1954 of file FEProblemBase.h.

1955 {
1956  _app.getOutputWarehouse().allowOutput<T>(state);
1957 }
void allowOutput(bool state)
Ability to enable/disable output calls This is private, users should utilize FEProblemBase::allowOutp...
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:174
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:1054

◆ areCoupled()

bool FEProblemBase::areCoupled ( unsigned int  ivar,
unsigned int  jvar 
)
inherited

Definition at line 4009 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::constraintJacobians().

4010 {
4011  return (*_cm)(ivar, jvar);
4012 }
std::unique_ptr< CouplingMatrix > _cm
Coupling matrix for variables.

◆ assembly()

virtual Assembly& FEProblemBase::assembly ( THREAD_ID  tid)
inlineoverridevirtualinherited

◆ backupMultiApps()

void FEProblemBase::backupMultiApps ( ExecFlagType  type)
inherited

Backup the MultiApps associated with the ExecFlagType.

Definition at line 3583 of file FEProblemBase.C.

Referenced by FEProblemBase::initialSetup(), and PicardSolve::solve().

3584 {
3585  const auto & multi_apps = _multi_apps[type].getActiveObjects();
3586 
3587  if (multi_apps.size())
3588  {
3589  TIME_SECTION(_backup_multi_apps_timer);
3590 
3591  _console << COLOR_CYAN << "\nBacking Up MultiApps on " << type.name() << COLOR_DEFAULT
3592  << std::endl;
3593 
3594  for (const auto & multi_app : multi_apps)
3595  multi_app->backup();
3596 
3598 
3599  _console << COLOR_CYAN << "Finished Backing Up MultiApps on " << type.name() << "\n"
3600  << COLOR_DEFAULT << std::endl;
3601  }
3602 }
const PerfID _backup_multi_apps_timer
bool _parallel_barrier_messaging
Whether or not information about how many transfers have completed is printed.
const std::string & type() const
Get the type of this object.
Definition: MooseObject.h:50
const std::vector< std::shared_ptr< T > > & getActiveObjects(THREAD_ID tid=0) const
Retrieve complete vector to the active all/block/boundary restricted objects for a given thread...
void parallelBarrierNotify(const libMesh::Parallel::Communicator &comm, bool messaging=true)
This function implements a parallel barrier function but writes progress to stdout.
ExecuteMooseObjectWarehouse< MultiApp > _multi_apps
MultiApp Warehouse.
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.

◆ cacheJacobian()

void FEProblemBase::cacheJacobian ( THREAD_ID  tid)
overridevirtualinherited

Implements SubProblem.

Definition at line 1251 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::constraintJacobians(), and ComputeJacobianThread::postElement().

1252 {
1253  _assembly[tid]->cacheJacobian();
1255  _assembly[tid]->cacheJacobianNonlocal();
1256  if (_displaced_problem)
1257  {
1258  _displaced_problem->cacheJacobian(tid);
1260  _displaced_problem->cacheJacobianNonlocal(tid);
1261  }
1262 }
bool _has_nonlocal_coupling
Indicates if nonlocal coupling is required/exists.
std::shared_ptr< DisplacedProblem > _displaced_problem
std::vector< std::unique_ptr< Assembly > > _assembly

◆ cacheJacobianNeighbor()

void FEProblemBase::cacheJacobianNeighbor ( THREAD_ID  tid)
overridevirtualinherited

Implements SubProblem.

Definition at line 1265 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::constraintJacobians().

1266 {
1267  _assembly[tid]->cacheJacobianNeighbor();
1268  if (_displaced_problem)
1269  _displaced_problem->cacheJacobianNeighbor(tid);
1270 }
std::shared_ptr< DisplacedProblem > _displaced_problem
std::vector< std::unique_ptr< Assembly > > _assembly

◆ cacheResidual()

void FEProblemBase::cacheResidual ( THREAD_ID  tid)
overridevirtualinherited

Implements SubProblem.

Definition at line 1166 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::constraintResiduals(), and ComputeResidualThread::postElement().

1167 {
1168  _assembly[tid]->cacheResidual();
1169  if (_displaced_problem)
1170  _displaced_problem->cacheResidual(tid);
1171 }
std::shared_ptr< DisplacedProblem > _displaced_problem
std::vector< std::unique_ptr< Assembly > > _assembly

◆ cacheResidualNeighbor()

void FEProblemBase::cacheResidualNeighbor ( THREAD_ID  tid)
overridevirtualinherited

Implements SubProblem.

Definition at line 1174 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::constraintResiduals().

1175 {
1176  _assembly[tid]->cacheResidualNeighbor();
1177  if (_displaced_problem)
1178  _displaced_problem->cacheResidualNeighbor(tid);
1179 }
std::shared_ptr< DisplacedProblem > _displaced_problem
std::vector< std::unique_ptr< Assembly > > _assembly

◆ checkBlockMatProps()

void SubProblem::checkBlockMatProps ( )
virtualinherited

Checks block material properties integrity.

See also
FEProblemBase::checkProblemIntegrity

Definition at line 445 of file SubProblem.C.

Referenced by FEProblemBase::checkProblemIntegrity().

446 {
447  // Variable for storing the value for ANY_BLOCK_ID/ANY_BOUNDARY_ID
449 
450  // Variable for storing all available blocks/boundaries from the mesh
451  std::set<SubdomainID> all_ids(mesh().meshSubdomains());
452 
453  // Loop through the properties to check
454  for (const auto & check_it : _map_block_material_props_check)
455  {
456  // The current id for the property being checked (BoundaryID || BlockID)
457  SubdomainID check_id = check_it.first;
458 
459  // In the case when the material being checked has an ID is set to ANY, then loop through all
460  // the possible ids and verify that the material property is defined.
461  std::set<SubdomainID> check_ids = {check_id};
462  if (check_id == any_id)
463  check_ids = all_ids;
464 
465  // Loop through all the block/boundary ids
466  for (const auto & id : check_ids)
467  {
468  // Loop through all the stored properties
469  for (const auto & prop_it : check_it.second)
470  {
471  // Produce an error if the material property is not defined on the current block/boundary
472  // and any block/boundary
473  // and not is not a zero material property.
474  if (_map_block_material_props[id].count(prop_it.second) == 0 &&
475  _map_block_material_props[any_id].count(prop_it.second) == 0 &&
476  _zero_block_material_props[id].count(prop_it.second) == 0 &&
477  _zero_block_material_props[any_id].count(prop_it.second) == 0)
478  {
479  std::string check_name = restrictionSubdomainCheckName(id);
480  if (check_name.empty())
481  check_name = std::to_string(id);
482  mooseError("Material property '",
483  prop_it.second,
484  "', requested by '",
485  prop_it.first,
486  "' is not defined on block ",
487  check_name);
488  }
489  }
490  }
491  }
492 }
virtual MooseMesh & mesh()=0
subdomain_id_type SubdomainID
Definition: MooseTypes.h:160
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
std::string restrictionSubdomainCheckName(SubdomainID check_id)
Helper functions for checking MaterialProperties.
Definition: SubProblem.C:587
const SubdomainID ANY_BLOCK_ID
Definition: MooseTypes.C:15
std::map< SubdomainID, std::set< MaterialPropertyName > > _zero_block_material_props
Set of properties returned as zero properties.
Definition: SubProblem.h:603
std::map< SubdomainID, std::multimap< std::string, std::string > > _map_block_material_props_check
Data structures of the requested material properties.
Definition: SubProblem.h:615
std::map< SubdomainID, std::set< std::string > > _map_block_material_props
Map of material properties (block_id -> list of properties)
Definition: SubProblem.h:597

◆ checkBoundaryMatProps()

void SubProblem::checkBoundaryMatProps ( )
virtualinherited

Checks boundary material properties integrity.

See also
FEProblemBase::checkProblemIntegrity

Definition at line 495 of file SubProblem.C.

Referenced by FEProblemBase::checkProblemIntegrity().

496 {
497  // Variable for storing the value for ANY_BLOCK_ID/ANY_BOUNDARY_ID
499 
500  // Variable for storing all available blocks/boundaries from the mesh
501  std::set<BoundaryID> all_ids(mesh().getBoundaryIDs());
502 
503  // Loop through the properties to check
504  for (const auto & check_it : _map_boundary_material_props_check)
505  {
506  // The current id for the property being checked (BoundaryID || BlockID)
507  BoundaryID check_id = check_it.first;
508 
509  // In the case when the material being checked has an ID is set to ANY, then loop through all
510  // the possible ids and verify that the material property is defined.
511  std::set<BoundaryID> check_ids{check_id};
512  if (check_id == any_id)
513  check_ids = all_ids;
514 
515  // Loop through all the block/boundary ids
516  for (const auto & id : check_ids)
517  {
518  // Loop through all the stored properties
519  for (const auto & prop_it : check_it.second)
520  {
521  // Produce an error if the material property is not defined on the current block/boundary
522  // and any block/boundary
523  // and not is not a zero material property.
524  if (_map_boundary_material_props[id].count(prop_it.second) == 0 &&
525  _map_boundary_material_props[any_id].count(prop_it.second) == 0 &&
526  _zero_boundary_material_props[id].count(prop_it.second) == 0 &&
527  _zero_boundary_material_props[any_id].count(prop_it.second) == 0)
528  {
529  std::string check_name = restrictionBoundaryCheckName(id);
530  if (check_name.empty())
531  check_name = std::to_string(id);
532  mooseError("Material property '",
533  prop_it.second,
534  "', requested by '",
535  prop_it.first,
536  "' is not defined on boundary ",
537  check_name);
538  }
539  }
540  }
541  }
542 }
virtual MooseMesh & mesh()=0
std::map< BoundaryID, std::multimap< std::string, std::string > > _map_boundary_material_props_check
Definition: SubProblem.h:616
std::string restrictionBoundaryCheckName(BoundaryID check_id)
Definition: SubProblem.C:598
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
std::map< BoundaryID, std::set< MaterialPropertyName > > _zero_boundary_material_props
Definition: SubProblem.h:604
std::map< BoundaryID, std::set< std::string > > _map_boundary_material_props
Map for boundary material properties (boundary_id -> list of properties)
Definition: SubProblem.h:600
std::vector< libMesh::boundary_id_type > getBoundaryIDs(const libMesh::MeshBase &mesh, const std::vector< BoundaryName > &boundary_name, bool generate_unknown)
const BoundaryID ANY_BOUNDARY_ID
Definition: MooseTypes.C:17
boundary_id_type BoundaryID
Definition: MooseTypes.h:158

◆ checkCoordinateSystems()

void FEProblemBase::checkCoordinateSystems ( )
protectedinherited

Verify that there are no element type/coordinate type conflicts.

Definition at line 5553 of file FEProblemBase.C.

Referenced by FEProblemBase::checkProblemIntegrity().

5554 {
5555  for (const auto & elem : _mesh.getMesh().element_ptr_range())
5556  {
5557  SubdomainID sid = elem->subdomain_id();
5558  if (_coord_sys[sid] == Moose::COORD_RZ && elem->dim() == 3)
5559  mooseError("An RZ coordinate system was requested for subdomain " + Moose::stringify(sid) +
5560  " which contains 3D elements.");
5561  if (_coord_sys[sid] == Moose::COORD_RSPHERICAL && elem->dim() > 1)
5562  mooseError("An RSPHERICAL coordinate system was requested for subdomain " +
5563  Moose::stringify(sid) + " which contains 2D or 3D elements.");
5564  }
5565 }
std::map< SubdomainID, Moose::CoordinateSystemType > _coord_sys
nonlocal coupling matrix;
Definition: SubProblem.h:592
subdomain_id_type SubdomainID
Definition: MooseTypes.h:160
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2569
MooseMesh & _mesh
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:61

◆ checkDependMaterialsHelper()

void FEProblemBase::checkDependMaterialsHelper ( const std::map< SubdomainID, std::vector< std::shared_ptr< Material >>> &  materials_map)
protectedinherited

Helper method for checking Material object dependency.

See also
checkProblemIntegrity

These two sets are used to make sure that all dependent props on a block are actually supplied

Definition at line 5428 of file FEProblemBase.C.

Referenced by FEProblemBase::checkProblemIntegrity().

5430 {
5431  auto & prop_names = _material_props.statefulPropNames();
5432 
5433  for (const auto & it : materials_map)
5434  {
5436  std::set<std::string> block_depend_props, block_supplied_props;
5437 
5438  for (const auto & mat1 : it.second)
5439  {
5440  const std::set<std::string> & depend_props = mat1->getRequestedItems();
5441  block_depend_props.insert(depend_props.begin(), depend_props.end());
5442 
5443  auto & alldeps = mat1->getMatPropDependencies(); // includes requested stateful props
5444  for (auto & dep : alldeps)
5445  {
5446  if (prop_names.count(dep) > 0)
5447  block_depend_props.insert(prop_names.at(dep));
5448  }
5449 
5450  // See if any of the active materials supply this property
5451  for (const auto & mat2 : it.second)
5452  {
5453  const std::set<std::string> & supplied_props = mat2->Material::getSuppliedItems();
5454  block_supplied_props.insert(supplied_props.begin(), supplied_props.end());
5455  }
5456  }
5457 
5458  // Add zero material properties specific to this block and unrestricted
5459  block_supplied_props.insert(_zero_block_material_props[it.first].begin(),
5460  _zero_block_material_props[it.first].end());
5461  block_supplied_props.insert(_zero_block_material_props[Moose::ANY_BLOCK_ID].begin(),
5463 
5464  // Error check to make sure all properties consumed by materials are supplied on this block
5465  std::set<std::string> difference;
5466  std::set_difference(block_depend_props.begin(),
5467  block_depend_props.end(),
5468  block_supplied_props.begin(),
5469  block_supplied_props.end(),
5470  std::inserter(difference, difference.end()));
5471 
5472  if (!difference.empty())
5473  {
5474  std::ostringstream oss;
5475  oss << "One or more Material Properties were not supplied on block " << it.first << ":\n";
5476  for (const auto & name : difference)
5477  oss << name << "\n";
5478  mooseError(oss.str());
5479  }
5480  }
5481 
5482  // This loop checks that materials are not supplied by multiple Material objects
5483  for (const auto & it : materials_map)
5484  {
5485  const auto & materials = it.second;
5486  std::set<std::string> inner_supplied, outer_supplied;
5487 
5488  for (const auto & outer_mat : materials)
5489  {
5490  // Storage for properties for this material (outer) and all other materials (inner)
5491  outer_supplied = outer_mat->getSuppliedItems();
5492  inner_supplied.clear();
5493 
5494  // Property to material map for error reporting
5495  std::map<std::string, std::set<std::string>> prop_to_mat;
5496  for (const auto & name : outer_supplied)
5497  prop_to_mat[name].insert(outer_mat->name());
5498 
5499  for (const auto & inner_mat : materials)
5500  {
5501  if (outer_mat == inner_mat)
5502  continue;
5503 
5504  // Check whether these materials are an AD pair
5505  auto outer_mat_type = outer_mat->type();
5506  auto inner_mat_type = inner_mat->type();
5507  removeSubstring(outer_mat_type, "<RESIDUAL>");
5508  removeSubstring(outer_mat_type, "<JACOBIAN>");
5509  removeSubstring(inner_mat_type, "<RESIDUAL>");
5510  removeSubstring(inner_mat_type, "<JACOBIAN>");
5511  if (outer_mat_type == inner_mat_type && outer_mat_type != outer_mat->type() &&
5512  inner_mat_type != inner_mat->type())
5513  continue;
5514 
5515  inner_supplied.insert(inner_mat->getSuppliedItems().begin(),
5516  inner_mat->getSuppliedItems().end());
5517 
5518  for (const auto & inner_supplied_name : inner_supplied)
5519  prop_to_mat[inner_supplied_name].insert(inner_mat->name());
5520  }
5521 
5522  // Test that a property isn't supplied on multiple blocks
5523  std::set<std::string> intersection;
5524  std::set_intersection(outer_supplied.begin(),
5525  outer_supplied.end(),
5526  inner_supplied.begin(),
5527  inner_supplied.end(),
5528  std::inserter(intersection, intersection.end()));
5529 
5530  if (!intersection.empty())
5531  {
5532  std::ostringstream oss;
5533  oss << "The following material properties are declared on block " << it.first
5534  << " by multiple materials:\n";
5535  oss << ConsoleUtils::indent(2) << std::setw(30) << std::left << "Material Property"
5536  << "Material Objects\n";
5537  for (const auto & outer_name : intersection)
5538  {
5539  oss << ConsoleUtils::indent(2) << std::setw(30) << std::left << outer_name;
5540  for (const auto & inner_name : prop_to_mat[outer_name])
5541  oss << inner_name << " ";
5542  oss << '\n';
5543  }
5544 
5545  mooseError(oss.str());
5546  break;
5547  }
5548  }
5549  }
5550 }
std::string indent(unsigned int spaces)
Create empty string for indenting.
Definition: ConsoleUtils.C:29
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
const std::map< unsigned int, std::string > statefulPropNames() const
void removeSubstring(std::string &main, const std::string &sub)
find, erase, length algorithm for removing a substring from a string
Definition: MooseUtils.C:915
const SubdomainID ANY_BLOCK_ID
Definition: MooseTypes.C:15
std::map< SubdomainID, std::set< MaterialPropertyName > > _zero_block_material_props
Set of properties returned as zero properties.
Definition: SubProblem.h:603
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:56
MaterialPropertyStorage & _material_props

◆ checkDisplacementOrders()

void FEProblemBase::checkDisplacementOrders ( )
protectedinherited

Verify that SECOND order mesh uses SECOND order displacements.

Definition at line 5344 of file FEProblemBase.C.

Referenced by FEProblemBase::checkProblemIntegrity().

5345 {
5346  if (_displaced_problem)
5347  {
5348  bool mesh_has_second_order_elements = false;
5349  for (const auto & elem : as_range(_displaced_mesh->activeLocalElementsBegin(),
5351  {
5352  if (elem->default_order() == SECOND)
5353  {
5354  mesh_has_second_order_elements = true;
5355  break;
5356  }
5357  }
5358 
5359  // We checked our local elements, so take the max over all processors.
5360  _displaced_mesh->comm().max(mesh_has_second_order_elements);
5361 
5362  // If the Mesh has second order elements, make sure the
5363  // displacement variables are second-order.
5364  if (mesh_has_second_order_elements)
5365  {
5366  const std::vector<std::string> & displacement_variables =
5367  _displaced_problem->getDisplacementVarNames();
5368 
5369  for (const auto & var_name : displacement_variables)
5370  {
5371  MooseVariableFEBase & mv =
5372  _displaced_problem->getVariable(/*tid=*/0,
5373  var_name,
5376  if (mv.order() != SECOND)
5377  mooseError("Error: mesh has SECOND order elements, so all displacement variables must be "
5378  "SECOND order.");
5379  }
5380  }
5381  }
5382 }
MeshBase::const_element_iterator activeLocalElementsBegin()
Calls active_local_nodes_begin/end() on the underlying libMesh mesh object.
Definition: MooseMesh.C:2219
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
Order order() const
Get the order of this variable Note: Order enum can be implicitly converted to unsigned int...
std::shared_ptr< DisplacedProblem > _displaced_problem
const MeshBase::const_element_iterator activeLocalElementsEnd()
Definition: MooseMesh.C:2225
MooseMesh * _displaced_mesh

◆ checkExceptionAndStopSolve()

void FEProblemBase::checkExceptionAndStopSolve ( )
virtualinherited

Check to see if an exception has occurred on any processor and stop the solve.

Note: Collective on MPI! Must be called simultaneously by all processors!

Also: This will throw a MooseException!

Note: DO NOT CALL THIS IN A THREADED REGION! This is meant to be called just after a threaded section.

Definition at line 4142 of file FEProblemBase.C.

Referenced by FEProblemBase::computeBounds().

4143 {
4145 
4146  // See if any processor had an exception. If it did, get back the
4147  // processor that the exception occurred on.
4148  unsigned int processor_id;
4149 
4150  _communicator.maxloc(_has_exception, processor_id);
4151 
4152  if (_has_exception)
4153  {
4154  _communicator.broadcast(_exception_message, processor_id);
4155 
4156  // Print the message
4157  if (_communicator.rank() == 0)
4158  Moose::err << _exception_message << std::endl;
4159 
4160  // Stop the solve -- this entails setting
4161  // SNESSetFunctionDomainError() or directly inserting NaNs in the
4162  // residual vector to let PETSc >= 3.6 return DIVERGED_NANORINF.
4163  _nl->stopSolve();
4164 
4165  // and close Aux system (we MUST do this here; see #11525)
4166  _aux->solution().close();
4167 
4168  // We've handled this exception, so we no longer have one.
4169  _has_exception = false;
4170 
4171  // Force the next linear convergence check to fail.
4173 
4174  // Repropagate the exception, so it can be caught at a higher level, typically
4175  // this is NonlinearSystem::computeResidual().
4177  }
4178 }
std::shared_ptr< NonlinearSystemBase > _nl
bool _has_exception
Whether or not an exception has occurred.
std::shared_ptr< AuxiliarySystem > _aux
std::string _exception_message
The error message to go with an exception.
const PerfID _check_exception_and_stop_solve_timer
Provides a way for users to bail out of the current solve.
bool _fail_next_linear_convergence_check

◆ checkLinearConvergence()

MooseLinearConvergenceReason FEProblemBase::checkLinearConvergence ( std::string &  msg,
const PetscInt  n,
const Real  rnorm,
const Real  rtol,
const Real  atol,
const Real  dtol,
const PetscInt  maxits 
)
virtualinherited

Check for convergence of the linear solution.

Parameters
msgError message that gets sent back to the solver
nIteration counter
rnormNorm of the residual vector
rtolRelative residual convergence tolerance
atolAbsolute residual convergence tolerance
dtolDivergence tolerance
maxitsMaximum number of linear iterations allowed

Definition at line 5681 of file FEProblemBase.C.

Referenced by Moose::PetscSupport::petscConverged().

5688 {
5689  TIME_SECTION(_check_linear_convergence_timer);
5690 
5692  {
5693  // Unset the flag
5696  }
5697 
5698  // We initialize the reason to something that basically means MOOSE
5699  // has not made a decision on convergence yet.
5701 
5702  // Get a reference to our Nonlinear System
5704 
5705  // If it's the beginning of a new set of iterations, reset
5706  // last_rnorm, otherwise record the most recent linear residual norm
5707  // in the NonlinearSystem.
5708  if (n == 0)
5709  system._last_rnorm = 1e99;
5710  else
5711  system._last_rnorm = rnorm;
5712 
5713  // If the linear residual norm is less than the System's linear absolute
5714  // step tolerance, we consider it to be converged and set the reason as
5715  // MooseLinearConvergenceReason::CONVERGED_RTOL.
5716  if (std::abs(rnorm - system._last_rnorm) < system._l_abs_step_tol)
5718 
5719  // If we hit max its, then we consider that converged (rather than
5720  // KSP_DIVERGED_ITS).
5721  if (n >= maxits)
5723 
5724  // If either of our convergence criteria is met, store the number of linear
5725  // iterations in the System.
5728  system._current_l_its.push_back(static_cast<unsigned int>(n));
5729 
5730  return reason;
5731 }
const PerfID _check_linear_convergence_timer
MetaPhysicL::DualNumber< T, D > abs(const MetaPhysicL::DualNumber< T, D > &in)
NonlinearSystemBase & getNonlinearSystemBase()
Nonlinear system to be solved.
MooseLinearConvergenceReason
nl system()
PetscInt n
bool _fail_next_linear_convergence_check

◆ checkNonlinearConvergence()

MooseNonlinearConvergenceReason FEProblemBase::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 
)
virtualinherited

Check for converence of the nonlinear solution.

Parameters
msgError message that gets sent back to the solver
itIteration counter
xnormNorm of the solution vector
snormNorm of the change in the solution vector
fnormNorm of the residual vector
rtolRelative residual convergence tolerance
stolSolution change convergence tolerance
abstolAbsolute residual convergence tolerance
nfuncsNumber of function evaluations
max_funcsMaximum Number of function evaluations
initial_residual_before_preset_bcsResidual norm prior to imposition of PresetBC values on solution vector
div_thresholdMaximum value of residual before triggering divergence check

Definition at line 5600 of file FEProblemBase.C.

Referenced by Moose::PetscSupport::petscNonlinearConverged().

5613 {
5614  TIME_SECTION(_check_nonlinear_convergence_timer);
5615 
5618 
5619  // This is the first residual before any iterations have been done,
5620  // but after PresetBCs (if any) have been imposed on the solution
5621  // vector. We save it, and use it to detect convergence if
5622  // compute_initial_residual_before_preset_bcs=false.
5623  if (it == 0)
5624  system._initial_residual_after_preset_bcs = fnorm;
5625 
5626  std::ostringstream oss;
5627  if (fnorm != fnorm)
5628  {
5629  oss << "Failed to converge, function norm is NaN\n";
5631  }
5632  else if (fnorm < abstol && (it || !force_iteration))
5633  {
5634  oss << "Converged due to function norm " << fnorm << " < " << abstol << '\n';
5636  }
5637  else if (nfuncs >= max_funcs)
5638  {
5639  oss << "Exceeded maximum number of function evaluations: " << nfuncs << " > " << max_funcs
5640  << '\n';
5642  }
5643  else if (it && fnorm > system._last_nl_rnorm && fnorm >= div_threshold)
5644  {
5645  oss << "Nonlinear solve was blowing up!\n";
5647  }
5648 
5649  if (it && reason == MooseNonlinearConvergenceReason::ITERATING)
5650  {
5651  // If compute_initial_residual_before_preset_bcs==false, then use the
5652  // first residual computed by Petsc to determine convergence.
5653  Real the_residual = system._compute_initial_residual_before_preset_bcs
5654  ? initial_residual_before_preset_bcs
5655  : system._initial_residual_after_preset_bcs;
5656  if (fnorm <= the_residual * rtol)
5657  {
5658  oss << "Converged due to function norm " << fnorm << " < "
5659  << " (relative tolerance)\n";
5661  }
5662  else if (snorm < stol * xnorm)
5663  {
5664  oss << "Converged due to small update length: " << snorm << " < " << stol << " * " << xnorm
5665  << '\n';
5667  }
5668  }
5669 
5670  system._last_nl_rnorm = fnorm;
5671  system._current_nl_its = static_cast<unsigned int>(it);
5672 
5673  msg = oss.str();
5674  if (_app.multiAppLevel() > 0)
5676 
5677  return reason;
5678 }
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:73
NonlinearSystemBase & getNonlinearSystemBase()
void indentMessage(const std::string &prefix, std::string &message, const char *color=COLOR_CYAN)
Indents the supplied message given the prefix and color.
Definition: MooseUtils.C:479
unsigned int multiAppLevel() const
The MultiApp Level.
Definition: MooseApp.h:511
Nonlinear system to be solved.
nl system()
const PerfID _check_nonlinear_convergence_timer
MooseNonlinearConvergenceReason
Enumeration for nonlinear convergence reasons.
Definition: FEProblemBase.h:91
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:174

◆ checkNonlocalCoupling()

void FEProblemBase::checkNonlocalCoupling ( )
inherited
Returns
Flag indicating nonlocal coupling exists or not.

Definition at line 953 of file FEProblemBase.C.

Referenced by FEProblemBase::initialSetup().

954 {
955  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
956  {
957  const auto & all_kernels = _nl->getKernelWarehouse();
958  const auto & kernels = all_kernels.getObjects(tid);
959  for (const auto & kernel : kernels)
960  {
961  std::shared_ptr<NonlocalKernel> nonlocal_kernel =
963  if (nonlocal_kernel)
964  {
967  _nonlocal_kernels.addObject(kernel, tid);
968  }
969  }
970  const MooseObjectWarehouse<IntegratedBCBase> & all_integrated_bcs =
971  _nl->getIntegratedBCWarehouse();
972  const auto & integrated_bcs = all_integrated_bcs.getObjects(tid);
973  for (const auto & integrated_bc : integrated_bcs)
974  {
975  std::shared_ptr<NonlocalIntegratedBC> nonlocal_integrated_bc =
977  if (nonlocal_integrated_bc)
978  {
981  _nonlocal_integrated_bcs.addObject(integrated_bc, tid);
982  }
983  }
984  }
985 }
bool _requires_nonlocal_coupling
nonlocal coupling requirement flag
Definition: SubProblem.h:638
std::shared_ptr< NonlinearSystemBase > _nl
NonlocalIntegratedBC is used for solving integral terms in integro-differential equations.
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
bool _calculate_jacobian_in_uo
const std::vector< std::shared_ptr< T > > & getObjects(THREAD_ID tid=0) const
Retrieve complete vector to the all/block/boundary restricted objects for a given thread...
NonlocalKernel is used for solving integral terms in integro-differential equations.
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.
unsigned int THREAD_ID
Definition: MooseTypes.h:162
MooseObjectWarehouse< IntegratedBCBase > _nonlocal_integrated_bcs
nonlocal integrated_bcs
MooseObjectWarehouse< KernelBase > _nonlocal_kernels
nonlocal kernels

◆ checkNonlocalCouplingRequirement()

virtual bool SubProblem::checkNonlocalCouplingRequirement ( )
inlinevirtualinherited

◆ checkProblemIntegrity()

void EigenProblem::checkProblemIntegrity ( )
overridevirtual

Method called to perform a series of sanity checks before a simulation is run.

This method doesn't return when errors are found, instead it generally calls mooseError() directly.

If a material is specified for any block in the simulation, then all blocks must have a material specified.

unsigned int is necessary to print SubdomainIDs in the statement below

Reimplemented from FEProblemBase.

Definition at line 214 of file EigenProblem.C.

215 {
217  _nl_eigen->checkIntegrity();
218 }
std::shared_ptr< NonlinearEigenSystem > _nl_eigen
Definition: EigenProblem.h:88
virtual void checkProblemIntegrity()
Method called to perform a series of sanity checks before a simulation is run.

◆ checkUserObjectJacobianRequirement()

void FEProblemBase::checkUserObjectJacobianRequirement ( THREAD_ID  tid)
inherited

Definition at line 988 of file FEProblemBase.C.

Referenced by FEProblemBase::initialSetup().

989 {
990  std::set<MooseVariableFEBase *> uo_jacobian_moose_vars;
991  {
992  std::vector<ShapeElementUserObject *> objs;
993  theWarehouse()
994  .query()
996  .condition<AttribThread>(tid)
997  .queryInto(objs);
998 
999  for (const auto & uo : objs)
1000  {
1001  _calculate_jacobian_in_uo = uo->computeJacobianFlag();
1002  const std::set<MooseVariableFEBase *> & mv_deps = uo->jacobianMooseVariables();
1003  uo_jacobian_moose_vars.insert(mv_deps.begin(), mv_deps.end());
1004  }
1005  }
1006  {
1007  std::vector<ShapeSideUserObject *> objs;
1008  theWarehouse()
1009  .query()
1011  .condition<AttribThread>(tid)
1012  .queryInto(objs);
1013  for (