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...
 
virtual bool checkNonlocalCouplingRequirement ()
 
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...
 
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 1253 of file FEProblemBase.h.

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

1253 { return _adaptivity; }
Adaptivity _adaptivity

◆ adaptMesh()

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

Reimplemented in DumpObjectsProblem.

Definition at line 5091 of file FEProblemBase.C.

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

5092 {
5093  // reset cycle counter
5094  _cycles_completed = 0;
5095 
5097  return false;
5098 
5099  TIME_SECTION(_adapt_mesh_timer);
5100 
5101  unsigned int cycles_per_step = _adaptivity.getCyclesPerStep();
5102 
5103  bool mesh_changed = false;
5104 
5105  for (unsigned int i = 0; i < cycles_per_step; ++i)
5106  {
5107  _console << "Adaptivity step " << i + 1 << " of " << cycles_per_step << '\n';
5108 
5109  // Markers were already computed once by Executioner
5110  if (_adaptivity.getRecomputeMarkersFlag() && i > 0)
5111  computeMarkers();
5112 
5113  if (_adaptivity.adaptMesh())
5114  {
5115  mesh_changed = true;
5116 
5117  meshChangedHelper(true); // This may be an intermediate change
5119  }
5120  else
5121  {
5122  _console << "Mesh unchanged, skipping remaining steps..." << std::endl;
5123  break;
5124  }
5125 
5126  // Show adaptivity progress
5127  _console << std::flush;
5128  }
5129 
5130  // We're done with all intermediate changes; now get systems ready
5131  // for real if necessary.
5132  if (mesh_changed)
5133  _eq.reinit_systems();
5134 
5135  return mesh_changed;
5136 }
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:310
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 2366 of file FEProblemBase.C.

2369 {
2371 }
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 2358 of file FEProblemBase.C.

2361 {
2363 }
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 2037 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addAuxKernel().

2040 {
2041  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
2042  {
2043  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2044  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
2045  parameters.set<SystemBase *>("_nl_sys") = &_displaced_problem->nlSys();
2046  if (!parameters.get<std::vector<BoundaryName>>("boundary").empty())
2047  _reinit_displaced_face = true;
2048  else
2049  _reinit_displaced_elem = true;
2050  }
2051  else
2052  {
2053  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
2054  {
2055  // We allow AuxKernels to request that they use_displaced_mesh,
2056  // but then be overridden when no displacements variables are
2057  // provided in the Mesh block. If that happened, update the value
2058  // of use_displaced_mesh appropriately for this AuxKernel.
2059  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2060  parameters.set<bool>("use_displaced_mesh") = false;
2061  }
2062 
2063  parameters.set<SubProblem *>("_subproblem") = this;
2064  parameters.set<SystemBase *>("_sys") = _aux.get();
2065  parameters.set<SystemBase *>("_nl_sys") = _nl.get();
2066  }
2067 
2068  _aux->addKernel(kernel_name, name, parameters);
2069 }
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 2072 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addAuxScalarKernel().

2075 {
2076  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
2077  {
2078  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2079  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
2080  }
2081  else
2082  {
2083  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
2084  {
2085  // We allow AuxScalarKernels to request that they use_displaced_mesh,
2086  // but then be overridden when no displacements variables are
2087  // provided in the Mesh block. If that happened, update the value
2088  // of use_displaced_mesh appropriately for this AuxScalarKernel.
2089  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2090  parameters.set<bool>("use_displaced_mesh") = false;
2091  }
2092 
2093  parameters.set<SubProblem *>("_subproblem") = this;
2094  parameters.set<SystemBase *>("_sys") = _aux.get();
2095  }
2096 
2097  _aux->addScalarKernel(kernel_name, name, parameters);
2098 }
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 2019 of file FEProblemBase.C.

2023 {
2024  if (order > _max_scalar_order)
2025  _max_scalar_order = order;
2026 
2027  FEType type(order, SCALAR);
2028  if (duplicateVariableCheck(var_name, type, /* is_aux = */ true))
2029  return;
2030 
2031  _aux->addScalarVariable(var_name, order, scale_factor, active_subdomains);
2032  if (_displaced_problem)
2033  _displaced_problem->addAuxScalarVariable(var_name, order, scale_factor, active_subdomains);
2034 }
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 2006 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addAuxVariable().

2009 {
2010  if (duplicateVariableCheck(var_name, type, /* is_aux = */ true))
2011  return;
2012 
2013  _aux->addVariable(var_name, type, 1.0, active_subdomains);
2014  if (_displaced_problem)
2015  _displaced_problem->addAuxVariable(var_name, type, active_subdomains);
2016 }
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 1940 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addBoundaryCondition().

1943 {
1944  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
1945  {
1946  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1947  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
1948  const auto & disp_names = _displaced_problem->getDisplacementVarNames();
1949  parameters.set<std::vector<VariableName>>("displacements") =
1950  std::vector<VariableName>(disp_names.begin(), disp_names.end());
1951  _reinit_displaced_face = true;
1952  }
1953  else
1954  {
1955  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
1956  {
1957  // We allow Materials to request that they use_displaced_mesh,
1958  // but then be overridden when no displacements variables are
1959  // provided in the Mesh block. If that happened, update the value
1960  // of use_displaced_mesh appropriately for this Material.
1961  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1962  parameters.set<bool>("use_displaced_mesh") = false;
1963  }
1964 
1965  parameters.set<SubProblem *>("_subproblem") = this;
1966  parameters.set<SystemBase *>("_sys") = _nl.get();
1967  }
1968 
1969  _nl->addBoundaryCondition(bc_name, name, parameters);
1970 }
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 1269 of file FEProblemBase.C.

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

1270 {
1271  _assembly[tid]->addCachedJacobian();
1272  if (_displaced_problem)
1273  _displaced_problem->addCachedJacobian(tid);
1274 }
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 1178 of file FEProblemBase.C.

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

1179 {
1180  _assembly[tid]->addCachedResiduals();
1181 
1182  if (_displaced_problem)
1183  _displaced_problem->addCachedResidual(tid);
1184 }
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 1187 of file FEProblemBase.C.

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

1188 {
1189  _assembly[tid]->addCachedResidual(residual, _nl->timeVectorTag());
1190  _assembly[tid]->addCachedResidual(residual, _nl->nonTimeVectorTag());
1191 
1192  if (_displaced_problem)
1193  _displaced_problem->addCachedResidualDirectly(residual, tid);
1194 }
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 1973 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addConstraint().

1976 {
1977  _has_constraints = true;
1978 
1979  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
1980  {
1981  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1982  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
1983  _reinit_displaced_face = true;
1984  }
1985  else
1986  {
1987  // It might _want_ to use a displaced mesh... but we're not so set it to false
1988  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1989  parameters.set<bool>("use_displaced_mesh") = false;
1990 
1991  parameters.set<SubProblem *>("_subproblem") = this;
1992  parameters.set<SystemBase *>("_sys") = _nl.get();
1993  }
1994 
1995  // Check that "variable" is in the NonlinearSystem.
1996  if (!_nl->hasVariable(parameters.get<NonlinearVariableName>("variable")))
1997  mooseError(name,
1998  ": Cannot add Constraint for variable ",
1999  parameters.get<NonlinearVariableName>("variable"),
2000  ", it is not a nonlinear variable!");
2001 
2002  _nl->addConstraint(c_name, name, parameters);
2003 }
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 3341 of file FEProblemBase.C.

3344 {
3345  parameters.set<SubProblem *>("_subproblem") = this;
3346  parameters.set<SystemBase *>("_sys") = _nl.get();
3347 
3348  _has_dampers = true;
3349  _nl->addDamper(damper_name, name, parameters);
3350 }
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 2133 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addDGKernel().

2136 {
2137  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
2138  {
2139  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2140  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
2141  _reinit_displaced_face = true;
2142  }
2143  else
2144  {
2145  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
2146  {
2147  // We allow DGKernels to request that they use_displaced_mesh,
2148  // but then be overridden when no displacements variables are
2149  // provided in the Mesh block. If that happened, update the value
2150  // of use_displaced_mesh appropriately for this DGKernel.
2151  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2152  parameters.set<bool>("use_displaced_mesh") = false;
2153  }
2154 
2155  parameters.set<SubProblem *>("_subproblem") = this;
2156  parameters.set<SystemBase *>("_sys") = _nl.get();
2157  }
2158 
2159  _nl->addDGKernel(dg_kernel_name, name, parameters);
2160 
2162 }
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 2101 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addDiracKernel().

2104 {
2105  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
2106  {
2107  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2108  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
2109  _reinit_displaced_elem = true;
2110  }
2111  else
2112  {
2113  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
2114  {
2115  // We allow DiracKernels to request that they use_displaced_mesh,
2116  // but then be overridden when no displacements variables are
2117  // provided in the Mesh block. If that happened, update the value
2118  // of use_displaced_mesh appropriately for this DiracKernel.
2119  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2120  parameters.set<bool>("use_displaced_mesh") = false;
2121  }
2122 
2123  parameters.set<SubProblem *>("_subproblem") = this;
2124  parameters.set<SystemBase *>("_sys") = _nl.get();
2125  }
2126 
2127  _nl->addDiracKernel(kernel_name, name, parameters);
2128 }
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 4978 of file FEProblemBase.C.

4979 {
4980  _displaced_mesh = &displaced_problem->mesh();
4981  _displaced_problem = displaced_problem;
4982 }
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 1744 of file FEProblemBase.C.

1747 {
1748  parameters.set<std::string>("type") = type;
1749  std::shared_ptr<Distribution> dist = _factory.create<Distribution>(type, name, parameters);
1750  _distributions.addObject(dist);
1751 }
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:582
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 548 of file FEProblemBase.C.

Referenced by FEProblemBase::initialSetup().

549 {
550  _nl->addExtraVectors();
551  _aux->addExtraVectors();
552 }
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 1665 of file FEProblemBase.C.

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

1666 {
1667  parameters.set<SubProblem *>("_subproblem") = this;
1668 
1669  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
1670  {
1671  std::shared_ptr<Function> func = _factory.create<Function>(type, name, parameters, tid);
1672  _functions.addObject(func, tid);
1673  }
1674 }
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:582
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:126

◆ 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 1348 of file FEProblemBase.C.

Referenced by DisplacedProblem::addGhostedBoundary().

1349 {
1350  _mesh.addGhostedBoundary(boundary_id);
1351  if (_displaced_problem)
1352  _displaced_mesh->addGhostedBoundary(boundary_id);
1353 }
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:2368
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 1341 of file FEProblemBase.C.

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

1342 {
1343  if (_mesh.elemPtr(elem_id)->processor_id() != processor_id())
1344  _ghosted_elems.insert(elem_id);
1345 }
virtual Elem * elemPtr(const dof_id_type i)
Definition: MooseMesh.C:2262
std::set< dof_id_type > _ghosted_elems
Elements that should have Dofs ghosted to the local processor.
Definition: SubProblem.h:636
MooseMesh & _mesh

◆ addIndicator()

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

Definition at line 3359 of file FEProblemBase.C.

3362 {
3363  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
3364  {
3365  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
3366  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
3367  _reinit_displaced_elem = true;
3368  }
3369  else
3370  {
3371  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
3372  {
3373  // We allow Indicators to request that they use_displaced_mesh,
3374  // but then be overridden when no displacements variables are
3375  // provided in the Mesh block. If that happened, update the value
3376  // of use_displaced_mesh appropriately for this Indicator.
3377  if (parameters.have_parameter<bool>("use_displaced_mesh"))
3378  parameters.set<bool>("use_displaced_mesh") = false;
3379  }
3380 
3381  parameters.set<SubProblem *>("_subproblem") = this;
3382  parameters.set<SystemBase *>("_sys") = _aux.get();
3383  }
3384 
3385  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
3386  {
3387  std::shared_ptr<Indicator> indicator =
3388  _factory.create<Indicator>(indicator_name, name, parameters, tid);
3389 
3390  std::shared_ptr<InternalSideIndicator> isi =
3392  if (isi)
3394  else
3395  _indicators.addObject(indicator, tid);
3396  }
3397 }
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:582
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:126

◆ addInitialCondition()

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

Reimplemented in DumpObjectsProblem.

Definition at line 2199 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addInitialCondition().

2202 {
2203 
2204  // before we start to mess with the initial condition, we need to check parameters for errors.
2206 
2207  parameters.set<SubProblem *>("_subproblem") = this;
2208 
2209  const std::string & var_name = parameters.get<VariableName>("variable");
2210  // field IC
2211  if (hasVariable(var_name))
2212  {
2213  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
2214  {
2217  parameters.set<SystemBase *>("_sys") = &var.sys();
2218  std::shared_ptr<InitialConditionBase> ic;
2219  if (dynamic_cast<MooseVariable *>(&var))
2220  ic = _factory.create<InitialCondition>(ic_name, name, parameters, tid);
2221  else if (dynamic_cast<VectorMooseVariable *>(&var))
2222  ic = _factory.create<VectorInitialCondition>(ic_name, name, parameters, tid);
2223  else
2224  mooseError("Your FE variable in initial condition ",
2225  name,
2226  " must be either of scalar or vector type");
2227  _ics.addObject(ic, tid);
2228  }
2229  }
2230 
2231  // scalar IC
2232  else if (hasScalarVariable(var_name))
2233  {
2234  MooseVariableScalar & var = getScalarVariable(0, var_name);
2235  parameters.set<SystemBase *>("_sys") = &var.sys();
2236  std::shared_ptr<ScalarInitialCondition> ic =
2238  _scalar_ics.addObject(ic);
2239  }
2240 
2241  else
2242  mooseError(
2243  "Variable '", var_name, "' requested in initial condition '", name, "' does not exist.");
2244 }
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:582
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:126

◆ addInterfaceKernel()

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

Reimplemented in DumpObjectsProblem.

Definition at line 2167 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addInterfaceKernel().

2170 {
2171  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
2172  {
2173  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2174  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
2175  _reinit_displaced_face = true;
2176  }
2177  else
2178  {
2179  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
2180  {
2181  // We allow InterfaceKernels to request that they use_displaced_mesh,
2182  // but then be overridden when no displacements variables are
2183  // provided in the Mesh block. If that happened, update the value
2184  // of use_displaced_mesh appropriately for this InterfaceKernel.
2185  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2186  parameters.set<bool>("use_displaced_mesh") = false;
2187  }
2188 
2189  parameters.set<SubProblem *>("_subproblem") = this;
2190  parameters.set<SystemBase *>("_sys") = _nl.get();
2191  }
2192 
2193  _nl->addInterfaceKernel(interface_kernel_name, name, parameters);
2194 
2196 }
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 1213 of file FEProblemBase.C.

Referenced by ComputeDiracThread::postElement().

1214 {
1215  _assembly[tid]->addJacobian();
1217  _assembly[tid]->addJacobianNonlocal();
1218  if (_displaced_problem)
1219  {
1220  _displaced_problem->addJacobian(tid);
1222  _displaced_problem->addJacobianNonlocal(tid);
1223  }
1224 }
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 1277 of file FEProblemBase.C.

Referenced by ComputeJacobianBlocksThread::postElement().

1283 {
1284  _assembly[tid]->addJacobianBlock(jacobian, ivar, jvar, dof_map, dof_indices);
1286  if (_nonlocal_cm(ivar, jvar) != 0)
1287  {
1288  MooseVariableFEBase & jv = _nl->getVariable(tid, jvar);
1289  _assembly[tid]->addJacobianBlockNonlocal(
1290  jacobian, ivar, jvar, dof_map, dof_indices, jv.allDofIndices());
1291  }
1292 
1293  if (_displaced_problem)
1294  {
1295  _displaced_problem->addJacobianBlock(jacobian, ivar, jvar, dof_map, dof_indices, tid);
1297  if (_nonlocal_cm(ivar, jvar) != 0)
1298  {
1299  MooseVariableFEBase & jv = _nl->getVariable(tid, jvar);
1300  _displaced_problem->addJacobianBlockNonlocal(
1301  jacobian, ivar, jvar, dof_map, dof_indices, jv.allDofIndices(), tid);
1302  }
1303  }
1304 }
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:584
std::vector< std::unique_ptr< Assembly > > _assembly

◆ addJacobianNeighbor() [1/2]

void FEProblemBase::addJacobianNeighbor ( THREAD_ID  tid)
overridevirtualinherited

Implements SubProblem.

Definition at line 1227 of file FEProblemBase.C.

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

1228 {
1229  _assembly[tid]->addJacobianNeighbor();
1230  if (_displaced_problem)
1231  _displaced_problem->addJacobianNeighbor(tid);
1232 }
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 1307 of file FEProblemBase.C.

1314 {
1315  _assembly[tid]->addJacobianNeighbor(
1316  jacobian, ivar, jvar, dof_map, dof_indices, neighbor_dof_indices);
1317  if (_displaced_problem)
1318  _displaced_problem->addJacobianNeighbor(
1319  jacobian, ivar, jvar, dof_map, dof_indices, neighbor_dof_indices, tid);
1320 }
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 1241 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::computeScalarKernelsJacobians().

1242 {
1243  _assembly[tid]->addJacobianOffDiagScalar(ivar);
1244 }
std::vector< std::unique_ptr< Assembly > > _assembly

◆ addJacobianScalar()

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

Definition at line 1235 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::computeScalarKernelsJacobians().

1236 {
1237  _assembly[tid]->addJacobianScalar();
1238 }
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 1849 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addKernel().

1852 {
1853  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
1854  {
1855  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1856  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
1857  const auto & disp_names = _displaced_problem->getDisplacementVarNames();
1858  parameters.set<std::vector<VariableName>>("displacements") =
1859  std::vector<VariableName>(disp_names.begin(), disp_names.end());
1860  _reinit_displaced_elem = true;
1861  }
1862  else
1863  {
1864  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
1865  {
1866  // We allow Kernels to request that they use_displaced_mesh,
1867  // but then be overridden when no displacements variables are
1868  // provided in the Mesh block. If that happened, update the value
1869  // of use_displaced_mesh appropriately for this Kernel.
1870  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1871  parameters.set<bool>("use_displaced_mesh") = false;
1872  }
1873 
1874  parameters.set<SubProblem *>("_subproblem") = this;
1875  parameters.set<SystemBase *>("_sys") = _nl.get();
1876  }
1877 
1878  _nl->addKernel(kernel_name, name, parameters);
1879 }
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 531 of file FEProblemBase.h.

Referenced by Executioner::Executioner().

532  {
533  mooseError("Line search not implemented for this problem type yet.");
534  }
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 3400 of file FEProblemBase.C.

3403 {
3404  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
3405  {
3406  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
3407  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
3408  _reinit_displaced_elem = true;
3409  }
3410  else
3411  {
3412  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
3413  {
3414  // We allow Markers to request that they use_displaced_mesh,
3415  // but then be overridden when no displacements variables are
3416  // provided in the Mesh block. If that happened, update the value
3417  // of use_displaced_mesh appropriately for this Marker.
3418  if (parameters.have_parameter<bool>("use_displaced_mesh"))
3419  parameters.set<bool>("use_displaced_mesh") = false;
3420  }
3421 
3422  parameters.set<SubProblem *>("_subproblem") = this;
3423  parameters.set<SystemBase *>("_sys") = _aux.get();
3424  }
3425 
3426  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
3427  {
3428  std::shared_ptr<Marker> marker = _factory.create<Marker>(marker_name, name, parameters, tid);
3429  _markers.addObject(marker, tid);
3430  }
3431 }
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:582
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:126

◆ addMaterial()

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

Reimplemented in DumpObjectsProblem.

Definition at line 2350 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addMaterial().

2353 {
2355 }
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 2374 of file FEProblemBase.C.

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

2378 {
2379  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
2380  {
2381  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2382  _reinit_displaced_elem = true;
2383  }
2384  else
2385  {
2386  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
2387  {
2388  // We allow Materials to request that they use_displaced_mesh,
2389  // but then be overridden when no displacements variables are
2390  // provided in the Mesh block. If that happened, update the value
2391  // of use_displaced_mesh appropriately for this Material.
2392  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2393  parameters.set<bool>("use_displaced_mesh") = false;
2394  }
2395 
2396  parameters.set<SubProblem *>("_subproblem") = this;
2397  }
2398 
2399  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
2400  {
2401  // Create the general Block/Boundary Material object
2402  std::shared_ptr<Material> material = _factory.create<Material>(mat_name, name, parameters, tid);
2403  bool discrete = !material->getParam<bool>("compute");
2404 
2405  // If the object is boundary restricted do not create the neighbor and face objects
2406  if (material->boundaryRestricted())
2407  {
2408  _all_materials.addObject(material, tid);
2409  if (discrete)
2410  _discrete_materials.addObject(material, tid);
2411  else
2412  for (auto && warehouse : warehouses)
2413  warehouse->addObject(material, tid);
2414  }
2415 
2416  // Non-boundary restricted require face and neighbor objects
2417  else
2418  {
2419  // The name of the object being created, this is changed multiple times as objects are created
2420  // below
2421  std::string object_name;
2422 
2423  // Create a copy of the supplied parameters to the setting for "_material_data_type" isn't
2424  // used from a previous tid loop
2425  InputParameters current_parameters = parameters;
2426 
2427  // face material
2428  current_parameters.set<Moose::MaterialDataType>("_material_data_type") =
2430  object_name = name + "_face";
2431  std::shared_ptr<Material> face_material =
2432  _factory.create<Material>(mat_name, object_name, current_parameters, tid);
2433 
2434  // neighbor material
2435  current_parameters.set<Moose::MaterialDataType>("_material_data_type") =
2437  current_parameters.set<bool>("_neighbor") = true;
2438  object_name = name + "_neighbor";
2439  std::shared_ptr<Material> neighbor_material =
2440  _factory.create<Material>(mat_name, object_name, current_parameters, tid);
2441 
2442  // Store the material objects
2443  _all_materials.addObjects(material, neighbor_material, face_material, tid);
2444 
2445  if (discrete)
2446  _discrete_materials.addObjects(material, neighbor_material, face_material, tid);
2447  else
2448  for (auto && warehouse : warehouses)
2449  warehouse->addObjects(material, neighbor_material, face_material, tid);
2450 
2451  // link parameters of face and neighbor materials
2452  MooseObjectParameterName name(MooseObjectName("Material", material->name()), "*");
2453  MooseObjectParameterName face_name(MooseObjectName("Material", face_material->name()), "*");
2454  MooseObjectParameterName neighbor_name(MooseObjectName("Material", neighbor_material->name()),
2455  "*");
2458  name, neighbor_name, false);
2459  }
2460  }
2461 }
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:582
InputParameterWarehouse & getInputParameterWarehouse()
Get the InputParameterWarehouse for MooseObjects.
Definition: MooseApp.C:1321
MaterialDataType
MaterialData types.
Definition: MooseTypes.h:421
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:126

◆ 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 102 of file SubProblem.C.

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

103 {
104  auto tag_name_upper = MooseUtils::toUpper(tag_name);
105  auto existing_tag = _matrix_tag_name_to_tag_id.find(tag_name_upper);
106  if (existing_tag == _matrix_tag_name_to_tag_id.end())
107  {
108  auto tag_id = _matrix_tag_name_to_tag_id.size();
109 
110  _matrix_tag_name_to_tag_id[tag_name_upper] = tag_id;
111 
112  _matrix_tag_id_to_tag_name[tag_id] = tag_name_upper;
113  }
114 
115  return _matrix_tag_name_to_tag_id.at(tag_name_upper);
116 }
std::map< TagName, TagID > _matrix_tag_name_to_tag_id
The currently declared tags.
Definition: SubProblem.h:576
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:579

◆ 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 3434 of file FEProblemBase.C.

3437 {
3438  parameters.set<MPI_Comm>("_mpi_comm") = _communicator.get();
3439  parameters.set<std::shared_ptr<CommandLine>>("_command_line") = _app.commandLine();
3440 
3441  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
3442  {
3443  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
3444  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
3445  _reinit_displaced_elem = true;
3446  }
3447  else
3448  {
3449  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
3450  {
3451  // We allow MultiApps to request that they use_displaced_mesh,
3452  // but then be overridden when no displacements variables are
3453  // provided in the Mesh block. If that happened, update the value
3454  // of use_displaced_mesh appropriately for this MultiApp.
3455  if (parameters.have_parameter<bool>("use_displaced_mesh"))
3456  parameters.set<bool>("use_displaced_mesh") = false;
3457  }
3458 
3459  parameters.set<SubProblem *>("_subproblem") = this;
3460  parameters.set<SystemBase *>("_sys") = _aux.get();
3461  }
3462 
3463  std::shared_ptr<MultiApp> multi_app = _factory.create<MultiApp>(multi_app_name, name, parameters);
3464 
3465  multi_app->setupPositions();
3466 
3467  _multi_apps.addObject(multi_app);
3468 
3469  // Store TranseintMultiApp objects in another container, this is needed for calling computeDT
3470  std::shared_ptr<TransientMultiApp> trans_multi_app =
3472  if (trans_multi_app)
3473  _transient_multi_apps.addObject(trans_multi_app);
3474 }
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:582
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 1882 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addNodalKernel().

1885 {
1886  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
1887  {
1888  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1889  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
1890  _reinit_displaced_elem = true;
1891  }
1892  else
1893  {
1894  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
1895  {
1896  // We allow NodalKernels to request that they use_displaced_mesh,
1897  // but then be overridden when no displacements variables are
1898  // provided in the Mesh block. If that happened, update the value
1899  // of use_displaced_mesh appropriately for this NodalKernel.
1900  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1901  parameters.set<bool>("use_displaced_mesh") = false;
1902  }
1903 
1904  parameters.set<SubProblem *>("_subproblem") = this;
1905  parameters.set<SystemBase *>("_sys") = _nl.get();
1906  }
1907  _nl->addNodalKernel(kernel_name, name, parameters);
1908 }
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 5864 of file FEProblemBase.C.

5867 {
5868  // Get a reference to the OutputWarehouse
5869  OutputWarehouse & output_warehouse = _app.getOutputWarehouse();
5870 
5871  // Reject the reserved names for objects not built by MOOSE
5872  if (!parameters.get<bool>("_built_by_moose") && output_warehouse.isReservedName(object_name))
5873  mooseError("The name '", object_name, "' is a reserved name for output objects");
5874 
5875  // Check that an object by the same name does not already exist; this must be done before the
5876  // object is created to avoid getting misleading errors from the Parser
5877  if (output_warehouse.hasOutput(object_name))
5878  mooseError("An output object named '", object_name, "' already exists");
5879 
5880  // Add a pointer to the FEProblemBase class
5881  parameters.addPrivateParam<FEProblemBase *>("_fe_problem_base", this);
5882 
5883  // Create common parameter exclude list
5884  std::vector<std::string> exclude;
5885  if (object_type == "Console")
5886  {
5887  exclude.push_back("execute_on");
5888 
5889  // --show-input should enable the display of the input file on the screen
5890  if (_app.getParam<bool>("show_input") && parameters.get<bool>("output_screen"))
5891  parameters.set<ExecFlagEnum>("execute_input_on") = EXEC_INITIAL;
5892  }
5893 
5894  // Apply the common parameters
5895  InputParameters * common = output_warehouse.getCommonParameters();
5896  if (common != NULL)
5897  parameters.applyParameters(*common, exclude);
5898 
5899  // Set the correct value for the binary flag for XDA/XDR output
5900  if (object_type == "XDR")
5901  parameters.set<bool>("_binary") = true;
5902  else if (object_type == "XDA")
5903  parameters.set<bool>("_binary") = false;
5904 
5905  // Adjust the checkpoint suffix if auto recovery was enabled
5906  if (object_name == "auto_recovery_checkpoint")
5907  parameters.set<std::string>("suffix") = "auto_recovery";
5908 
5909  // Create the object and add it to the warehouse
5910  std::shared_ptr<Output> output = _factory.create<Output>(object_type, object_name, parameters);
5911  output_warehouse.addOutput(output);
5912 }
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:582
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:916
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:1049
const ExecFlagType EXEC_INITIAL

◆ addPostprocessor()

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

Definition at line 2711 of file FEProblemBase.C.

2714 {
2715  // Check for name collision
2716  if (hasUserObject(name))
2717  mooseError(std::string("A UserObject with the name \"") + name +
2718  "\" already exists. You may not add a Postprocessor by the same name.");
2719 
2720  addUserObject(pp_name, name, parameters);
2722 }
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 4386 of file FEProblemBase.C.

Referenced by AB2PredictorCorrector::AB2PredictorCorrector().

4389 {
4390  parameters.set<SubProblem *>("_subproblem") = this;
4391  std::shared_ptr<Predictor> predictor = _factory.create<Predictor>(type, name, parameters);
4392  _nl->setPredictor(predictor);
4393 }
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:582
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 1138 of file FEProblemBase.C.

Referenced by ComputeDiracThread::postElement().

1139 {
1140  _assembly[tid]->addResidual(getVectorTags());
1141 
1142  if (_displaced_problem)
1143  _displaced_problem->addResidual(tid);
1144 }
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:102
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 1147 of file FEProblemBase.C.

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

1148 {
1149  _assembly[tid]->addResidualNeighbor(getVectorTags());
1150 
1151  if (_displaced_problem)
1152  _displaced_problem->addResidualNeighbor(tid);
1153 }
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:102
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 1156 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::computeResidualInternal().

1157 {
1158  _assembly[tid]->addResidualScalar(getVectorTags());
1159 }
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:102
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 1763 of file FEProblemBase.C.

1764 {
1765  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
1766  {
1767  std::shared_ptr<Sampler> dist = _factory.create<Sampler>(type, name, parameters, tid);
1768  _samplers.addObject(dist, tid);
1769  }
1770 }
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:582
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:126

◆ addScalarKernel()

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

Reimplemented in DumpObjectsProblem.

Definition at line 1911 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addScalarKernel().

1914 {
1915  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
1916  {
1917  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1918  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
1919  }
1920  else
1921  {
1922  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
1923  {
1924  // We allow ScalarKernels to request that they use_displaced_mesh,
1925  // but then be overridden when no displacements variables are
1926  // provided in the Mesh block. If that happened, update the value
1927  // of use_displaced_mesh appropriately for this ScalarKernel.
1928  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1929  parameters.set<bool>("use_displaced_mesh") = false;
1930  }
1931 
1932  parameters.set<SubProblem *>("_subproblem") = this;
1933  parameters.set<SystemBase *>("_sys") = _nl.get();
1934  }
1935 
1936  _nl->addScalarKernel(kernel_name, name, parameters);
1937 }
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 1831 of file FEProblemBase.C.

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

1835 {
1836  if (order > _max_scalar_order)
1837  _max_scalar_order = order;
1838 
1839  FEType type(order, SCALAR);
1840  if (duplicateVariableCheck(var_name, type, /* is_aux = */ false))
1841  return;
1842 
1843  _nl->addScalarVariable(var_name, order, scale_factor, active_subdomains);
1844  if (_displaced_problem)
1845  _displaced_problem->addScalarVariable(var_name, order, scale_factor, active_subdomains);
1846 }
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 4370 of file FEProblemBase.C.

Referenced by Transient::setupTimeIntegrator().

4373 {
4374  parameters.set<SubProblem *>("_subproblem") = this;
4375  _aux->addTimeIntegrator(type, name + ":aux", parameters);
4376  _nl->addTimeIntegrator(type, name, parameters);
4377  _has_time_integrator = true;
4378 
4379  // add vectors to store u_dot, u_dotdot, udot_old and u_dotdot_old if requested by the time
4380  // integrator
4381  _aux->addDotVectors();
4382  _nl->addDotVectors();
4383 }
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 3702 of file FEProblemBase.C.

3705 {
3706  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
3707  {
3708  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
3709  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
3710  _reinit_displaced_elem = true;
3711  }
3712  else
3713  {
3714  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
3715  {
3716  // We allow Transfers to request that they use_displaced_mesh,
3717  // but then be overridden when no displacements variables are
3718  // provided in the Mesh block. If that happened, update the value
3719  // of use_displaced_mesh appropriately for this Transfer.
3720  if (parameters.have_parameter<bool>("use_displaced_mesh"))
3721  parameters.set<bool>("use_displaced_mesh") = false;
3722  }
3723 
3724  parameters.set<SubProblem *>("_subproblem") = this;
3725  parameters.set<SystemBase *>("_sys") = _aux.get();
3726  }
3727 
3728  // Handle the "SAME_AS_MULTIAPP" execute option
3729  ExecFlagEnum & exec_enum = parameters.set<ExecFlagEnum>("execute_on", true);
3730  if (exec_enum.contains(EXEC_SAME_AS_MULTIAPP))
3731  {
3732  std::shared_ptr<MultiApp> multiapp = getMultiApp(parameters.get<MultiAppName>("multi_app"));
3733  exec_enum = multiapp->getParam<ExecFlagEnum>("execute_on");
3734  }
3735 
3736  // Create the Transfer objects
3737  std::shared_ptr<Transfer> transfer = _factory.create<Transfer>(transfer_name, name, parameters);
3738 
3739  // Add MultiAppTransfer object
3740  std::shared_ptr<MultiAppTransfer> multi_app_transfer =
3742  if (multi_app_transfer)
3743  {
3744  if (multi_app_transfer->direction() == MultiAppTransfer::TO_MULTIAPP)
3745  _to_multi_app_transfers.addObject(multi_app_transfer);
3746  else
3747  _from_multi_app_transfers.addObject(multi_app_transfer);
3748  }
3749  else
3750  _transfers.addObject(transfer);
3751 }
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:582
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 2739 of file FEProblemBase.C.

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

2742 {
2743  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
2744  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2745  else
2746  {
2747  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
2748  {
2749  // We allow UserObjects to request that they use_displaced_mesh,
2750  // but then be overridden when no displacements variables are
2751  // provided in the Mesh block. If that happened, update the value
2752  // of use_displaced_mesh appropriately for this UserObject.
2753  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2754  parameters.set<bool>("use_displaced_mesh") = false;
2755  }
2756 
2757  parameters.set<SubProblem *>("_subproblem") = this;
2758  }
2759 
2760  UserObject * primary = nullptr;
2761  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
2762  {
2763  // Create the UserObject
2764  std::shared_ptr<UserObject> user_object =
2765  _factory.create<UserObject>(user_object_name, name, parameters, tid);
2766  if (tid == 0)
2767  primary = user_object.get();
2768  else
2769  user_object->setPrimaryThreadCopy(primary);
2770 
2771  // TODO: delete this line after apps have been updated to not call getUserObjects
2772  _all_user_objects.addObject(user_object, tid);
2773 
2774  theWarehouse().add(user_object, "UserObject");
2775 
2776  // Attempt to create all the possible UserObject types
2777  auto euo = std::dynamic_pointer_cast<ElementUserObject>(user_object);
2778  auto suo = std::dynamic_pointer_cast<SideUserObject>(user_object);
2779  auto isuo = std::dynamic_pointer_cast<InternalSideUserObject>(user_object);
2780  auto nuo = std::dynamic_pointer_cast<NodalUserObject>(user_object);
2781  auto guo = std::dynamic_pointer_cast<GeneralUserObject>(user_object);
2782  auto tguo = std::dynamic_pointer_cast<ThreadedGeneralUserObject>(user_object);
2783 
2784  // Account for displaced mesh use
2785  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
2786  {
2787  if (euo || nuo)
2788  _reinit_displaced_elem = true;
2789  else if (suo)
2790  _reinit_displaced_face = true;
2791  }
2792 
2793  if (guo && !tguo)
2794  break;
2795  }
2796 }
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:582
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 user-specific data.
Definition: UserObject.h:38
unsigned int THREAD_ID
Definition: MooseTypes.h:126
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 1817 of file FEProblemBase.C.

Referenced by DumpObjectsProblem::addVariable().

1821 {
1822  if (duplicateVariableCheck(var_name, type, /* is_aux = */ false))
1823  return;
1824 
1825  _nl->addVariable(var_name, type, scale_factor, active_subdomains);
1826  if (_displaced_problem)
1827  _displaced_problem->addVariable(var_name, type, scale_factor, active_subdomains);
1828 }
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 2725 of file FEProblemBase.C.

2728 {
2729  // Check for name collision
2730  if (hasUserObject(name))
2731  mooseError(std::string("A UserObject with the name \"") + name +
2732  "\" already exists. You may not add a VectorPostprocessor by the same name.");
2733 
2734  addUserObject(pp_name, name, parameters);
2736 }
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 56 of file SubProblem.C.

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

57 {
58  auto tag_name_upper = MooseUtils::toUpper(tag_name);
59  auto existing_tag = _vector_tag_name_to_tag_id.find(tag_name_upper);
60  if (existing_tag == _vector_tag_name_to_tag_id.end())
61  {
62  auto tag_id = _vector_tag_name_to_tag_id.size();
63 
64  _vector_tag_name_to_tag_id[tag_name_upper] = tag_id;
65 
66  _vector_tag_id_to_tag_name[tag_id] = tag_name_upper;
67  }
68 
69  return _vector_tag_name_to_tag_id.at(tag_name_upper);
70 }
std::map< TagName, TagID > _vector_tag_name_to_tag_id
The currently declared tags.
Definition: SubProblem.h:570
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:573

◆ advanceMultiApps()

void FEProblemBase::advanceMultiApps ( ExecFlagType  type)
inlineinherited

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

Definition at line 939 of file FEProblemBase.h.

940  {
941  mooseDeprecated("Deprecated method; use finishMultiAppStep and/or incrementMultiAppTStep "
942  "depending on your purpose");
944  }
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 4269 of file FEProblemBase.C.

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

4270 {
4271  TIME_SECTION(_advance_state_timer);
4272 
4273  _nl->copyOldSolutions();
4274  _aux->copyOldSolutions();
4275 
4276  if (_displaced_problem != NULL)
4277  {
4278  _displaced_problem->nlSys().copyOldSolutions();
4279  _displaced_problem->auxSys().copyOldSolutions();
4280  }
4281 
4284 
4286  _material_props.shift(*this);
4287 
4289  _bnd_material_props.shift(*this);
4290 
4293 }
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 4338 of file FEProblemBase.C.

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

4339 {
4341 }
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:1049

◆ allowOutput() [2/2]

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

Definition at line 1950 of file FEProblemBase.h.

1951 {
1952  _app.getOutputWarehouse().allowOutput<T>(state);
1953 }
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:1049

◆ areCoupled()

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

Definition at line 4057 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::constraintJacobians().

4058 {
4059  return (*_cm)(ivar, jvar);
4060 }
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 3631 of file FEProblemBase.C.

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

3632 {
3633  const auto & multi_apps = _multi_apps[type].getActiveObjects();
3634 
3635  if (multi_apps.size())
3636  {
3637  TIME_SECTION(_backup_multi_apps_timer);
3638 
3639  _console << COLOR_CYAN << "\nBacking Up MultiApps on " << type.name() << COLOR_DEFAULT
3640  << std::endl;
3641 
3642  for (const auto & multi_app : multi_apps)
3643  multi_app->backup();
3644 
3646 
3647  _console << COLOR_CYAN << "Finished Backing Up MultiApps on " << type.name() << "\n"
3648  << COLOR_DEFAULT << std::endl;
3649  }
3650 }
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 1247 of file FEProblemBase.C.

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

1248 {
1249  _assembly[tid]->cacheJacobian();
1251  _assembly[tid]->cacheJacobianNonlocal();
1252  if (_displaced_problem)
1253  {
1254  _displaced_problem->cacheJacobian(tid);
1256  _displaced_problem->cacheJacobianNonlocal(tid);
1257  }
1258 }
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 1261 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::constraintJacobians().

1262 {
1263  _assembly[tid]->cacheJacobianNeighbor();
1264  if (_displaced_problem)
1265  _displaced_problem->cacheJacobianNeighbor(tid);
1266 }
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 1162 of file FEProblemBase.C.

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

1163 {
1164  _assembly[tid]->cacheResidual();
1165  if (_displaced_problem)
1166  _displaced_problem->cacheResidual(tid);
1167 }
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 1170 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::constraintResiduals().

1171 {
1172  _assembly[tid]->cacheResidualNeighbor();
1173  if (_displaced_problem)
1174  _displaced_problem->cacheResidualNeighbor(tid);
1175 }
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 436 of file SubProblem.C.

Referenced by FEProblemBase::checkProblemIntegrity().

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

◆ checkBoundaryMatProps()

void SubProblem::checkBoundaryMatProps ( )
virtualinherited

Checks boundary material properties integrity.

See also
FEProblemBase::checkProblemIntegrity

Definition at line 486 of file SubProblem.C.

Referenced by FEProblemBase::checkProblemIntegrity().

487 {
488  // Variable for storing the value for ANY_BLOCK_ID/ANY_BOUNDARY_ID
490 
491  // Variable for storing all available blocks/boundaries from the mesh
492  std::set<BoundaryID> all_ids(mesh().getBoundaryIDs());
493 
494  // Loop through the properties to check
495  for (const auto & check_it : _map_boundary_material_props_check)
496  {
497  // The current id for the property being checked (BoundaryID || BlockID)
498  BoundaryID check_id = check_it.first;
499 
500  // In the case when the material being checked has an ID is set to ANY, then loop through all
501  // the possible ids and verify that the material property is defined.
502  std::set<BoundaryID> check_ids{check_id};
503  if (check_id == any_id)
504  check_ids = all_ids;
505 
506  // Loop through all the block/boundary ids
507  for (const auto & id : check_ids)
508  {
509  // Loop through all the stored properties
510  for (const auto & prop_it : check_it.second)
511  {
512  // Produce an error if the material property is not defined on the current block/boundary
513  // and any block/boundary
514  // and not is not a zero material property.
515  if (_map_boundary_material_props[id].count(prop_it.second) == 0 &&
516  _map_boundary_material_props[any_id].count(prop_it.second) == 0 &&
517  _zero_boundary_material_props[id].count(prop_it.second) == 0 &&
518  _zero_boundary_material_props[any_id].count(prop_it.second) == 0)
519  {
520  std::string check_name = restrictionBoundaryCheckName(id);
521  if (check_name.empty())
522  check_name = std::to_string(id);
523  mooseError("Material property '",
524  prop_it.second,
525  "', requested by '",
526  prop_it.first,
527  "' is not defined on boundary ",
528  check_name);
529  }
530  }
531  }
532  }
533 }
virtual MooseMesh & mesh()=0
std::map< BoundaryID, std::multimap< std::string, std::string > > _map_boundary_material_props_check
Definition: SubProblem.h:611
std::string restrictionBoundaryCheckName(BoundaryID check_id)
Definition: SubProblem.C:589
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
std::map< BoundaryID, std::set< MaterialPropertyName > > _zero_boundary_material_props
Definition: SubProblem.h:599
std::map< BoundaryID, std::set< std::string > > _map_boundary_material_props
Map for boundary material properties (boundary_id -> list of properties)
Definition: SubProblem.h:595
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:122

◆ checkCoordinateSystems()

void FEProblemBase::checkCoordinateSystems ( )
protectedinherited

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

Definition at line 5601 of file FEProblemBase.C.

Referenced by FEProblemBase::checkProblemIntegrity().

5602 {
5603  for (const auto & elem : _mesh.getMesh().element_ptr_range())
5604  {
5605  SubdomainID sid = elem->subdomain_id();
5606  if (_coord_sys[sid] == Moose::COORD_RZ && elem->dim() == 3)
5607  mooseError("An RZ coordinate system was requested for subdomain " + Moose::stringify(sid) +
5608  " which contains 3D elements.");
5609  if (_coord_sys[sid] == Moose::COORD_RSPHERICAL && elem->dim() > 1)
5610  mooseError("An RSPHERICAL coordinate system was requested for subdomain " +
5611  Moose::stringify(sid) + " which contains 2D or 3D elements.");
5612  }
5613 }
std::map< SubdomainID, Moose::CoordinateSystemType > _coord_sys
nonlocal coupling matrix;
Definition: SubProblem.h:587
subdomain_id_type SubdomainID
Definition: MooseTypes.h:124
void mooseError(Args &&... args) const
Definition: MooseObject.h:144
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2562
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 5476 of file FEProblemBase.C.

Referenced by FEProblemBase::checkProblemIntegrity().

5478 {
5479  auto & prop_names = _material_props.statefulPropNames();
5480 
5481  for (const auto & it : materials_map)
5482  {
5484  std::set<std::string> block_depend_props, block_supplied_props;
5485 
5486  for (const auto & mat1 : it.second)
5487  {
5488  const std::set<std::string> & depend_props = mat1->getRequestedItems();
5489  block_depend_props.insert(depend_props.begin(), depend_props.end());
5490 
5491  auto & alldeps = mat1->getMatPropDependencies(); // includes requested stateful props
5492  for (auto & dep : alldeps)
5493  {
5494  if (prop_names.count(dep) > 0)
5495  block_depend_props.insert(prop_names.at(dep));
5496  }
5497 
5498  // See if any of the active materials supply this property
5499  for (const auto & mat2 : it.second)
5500  {
5501  const std::set<std::string> & supplied_props = mat2->Material::getSuppliedItems();
5502  block_supplied_props.insert(supplied_props.begin(), supplied_props.end());
5503  }
5504  }
5505 
5506  // Add zero material properties specific to this block and unrestricted
5507  block_supplied_props.insert(_zero_block_material_props[it.first].begin(),
5508  _zero_block_material_props[it.first].end());
5509  block_supplied_props.insert(_zero_block_material_props[Moose::ANY_BLOCK_ID].begin(),
5511 
5512  // Error check to make sure all properties consumed by materials are supplied on this block
5513  std::set<std::string> difference;
5514  std::set_difference(block_depend_props.begin(),
5515  block_depend_props.end(),
5516  block_supplied_props.begin(),
5517  block_supplied_props.end(),
5518  std::inserter(difference, difference.end()));
5519 
5520  if (!difference.empty())
5521  {
5522  std::ostringstream oss;
5523  oss << "One or more Material Properties were not supplied on block " << it.first << ":\n";
5524  for (const auto & name : difference)
5525  oss << name << "\n";
5526  mooseError(oss.str());
5527  }
5528  }
5529 
5530  // This loop checks that materials are not supplied by multiple Material objects
5531  for (const auto & it : materials_map)
5532  {
5533  const auto & materials = it.second;
5534  std::set<std::string> inner_supplied, outer_supplied;
5535 
5536  for (const auto & outer_mat : materials)
5537  {
5538  // Storage for properties for this material (outer) and all other materials (inner)
5539  outer_supplied = outer_mat->getSuppliedItems();
5540  inner_supplied.clear();
5541 
5542  // Property to material map for error reporting
5543  std::map<std::string, std::set<std::string>> prop_to_mat;
5544  for (const auto & name : outer_supplied)
5545  prop_to_mat[name].insert(outer_mat->name());
5546 
5547  for (const auto & inner_mat : materials)
5548  {
5549  if (outer_mat == inner_mat)
5550  continue;
5551 
5552  // Check whether these materials are an AD pair
5553  auto outer_mat_type = outer_mat->type();
5554  auto inner_mat_type = inner_mat->type();
5555  removeSubstring(outer_mat_type, "<RESIDUAL>");
5556  removeSubstring(outer_mat_type, "<JACOBIAN>");
5557  removeSubstring(inner_mat_type, "<RESIDUAL>");
5558  removeSubstring(inner_mat_type, "<JACOBIAN>");
5559  if (outer_mat_type == inner_mat_type && outer_mat_type != outer_mat->type() &&
5560  inner_mat_type != inner_mat->type())
5561  continue;
5562 
5563  inner_supplied.insert(inner_mat->getSuppliedItems().begin(),
5564  inner_mat->getSuppliedItems().end());
5565 
5566  for (const auto & inner_supplied_name : inner_supplied)
5567  prop_to_mat[inner_supplied_name].insert(inner_mat->name());
5568  }
5569 
5570  // Test that a property isn't supplied on multiple blocks
5571  std::set<std::string> intersection;
5572  std::set_intersection(outer_supplied.begin(),
5573  outer_supplied.end(),
5574  inner_supplied.begin(),
5575  inner_supplied.end(),
5576  std::inserter(intersection, intersection.end()));
5577 
5578  if (!intersection.empty())
5579  {
5580  std::ostringstream oss;
5581  oss << "The following material properties are declared on block " << it.first
5582  << " by multiple materials:\n";
5583  oss << ConsoleUtils::indent(2) << std::setw(30) << std::left << "Material Property"
5584  << "Material Objects\n";
5585  for (const auto & outer_name : intersection)
5586  {
5587  oss << ConsoleUtils::indent(2) << std::setw(30) << std::left << outer_name;
5588  for (const auto & inner_name : prop_to_mat[outer_name])
5589  oss << inner_name << " ";
5590  oss << '\n';
5591  }
5592 
5593  mooseError(oss.str());
5594  break;
5595  }
5596  }
5597  }
5598 }
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:598
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 5392 of file FEProblemBase.C.

Referenced by FEProblemBase::checkProblemIntegrity().

5393 {
5394  if (_displaced_problem)
5395  {
5396  bool mesh_has_second_order_elements = false;
5397  for (const auto & elem : as_range(_displaced_mesh->activeLocalElementsBegin(),
5399  {
5400  if (elem->default_order() == SECOND)
5401  {
5402  mesh_has_second_order_elements = true;
5403  break;
5404  }
5405  }
5406 
5407  // We checked our local elements, so take the max over all processors.
5408  _displaced_mesh->comm().max(mesh_has_second_order_elements);
5409 
5410  // If the Mesh has second order elements, make sure the
5411  // displacement variables are second-order.
5412  if (mesh_has_second_order_elements)
5413  {
5414  const std::vector<std::string> & displacement_variables =
5415  _displaced_problem->getDisplacementVarNames();
5416 
5417  for (const auto & var_name : displacement_variables)
5418  {
5419  MooseVariableFEBase & mv =
5420  _displaced_problem->getVariable(/*tid=*/0,
5421  var_name,
5424  if (mv.order() != SECOND)
5425  mooseError("Error: mesh has SECOND order elements, so all displacement variables must be "
5426  "SECOND order.");
5427  }
5428  }
5429  }
5430 }
MeshBase::const_element_iterator activeLocalElementsBegin()
Calls active_local_nodes_begin/end() on the underlying libMesh mesh object.
Definition: MooseMesh.C:2212
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:2218
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 4190 of file FEProblemBase.C.

Referenced by FEProblemBase::computeBounds().

4191 {
4193 
4194  // See if any processor had an exception. If it did, get back the
4195  // processor that the exception occurred on.
4196  unsigned int processor_id;
4197 
4198  _communicator.maxloc(_has_exception, processor_id);
4199 
4200  if (_has_exception)
4201  {
4202  _communicator.broadcast(_exception_message, processor_id);
4203 
4204  // Print the message
4205  if (_communicator.rank() == 0)
4206  Moose::err << _exception_message << std::endl;
4207 
4208  // Stop the solve -- this entails setting
4209  // SNESSetFunctionDomainError() or directly inserting NaNs in the
4210  // residual vector to let PETSc >= 3.6 return DIVERGED_NANORINF.
4211  _nl->stopSolve();
4212 
4213  // and close Aux system (we MUST do this here; see #11525)
4214  _aux->solution().close();
4215 
4216  // We've handled this exception, so we no longer have one.
4217  _has_exception = false;
4218 
4219  // Force the next linear convergence check to fail.
4221 
4222  // Repropagate the exception, so it can be caught at a higher level, typically
4223  // this is NonlinearSystem::computeResidual().
4225  }
4226 }
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 5729 of file FEProblemBase.C.

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

5736 {
5737  TIME_SECTION(_check_linear_convergence_timer);
5738 
5740  {
5741  // Unset the flag
5744  }
5745 
5746  // We initialize the reason to something that basically means MOOSE
5747  // has not made a decision on convergence yet.
5749 
5750  // Get a reference to our Nonlinear System
5752 
5753  // If it's the beginning of a new set of iterations, reset
5754  // last_rnorm, otherwise record the most recent linear residual norm
5755  // in the NonlinearSystem.
5756  if (n == 0)
5757  system._last_rnorm = 1e99;
5758  else
5759  system._last_rnorm = rnorm;
5760 
5761  // If the linear residual norm is less than the System's linear absolute
5762  // step tolerance, we consider it to be converged and set the reason as
5763  // MooseLinearConvergenceReason::CONVERGED_RTOL.
5764  if (std::abs(rnorm - system._last_rnorm) < system._l_abs_step_tol)
5766 
5767  // If we hit max its, then we consider that converged (rather than
5768  // KSP_DIVERGED_ITS).
5769  if (n >= maxits)
5771 
5772  // If either of our convergence criteria is met, store the number of linear
5773  // iterations in the System.
5776  system._current_l_its.push_back(static_cast<unsigned int>(n));
5777 
5778  return reason;
5779 }
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 5648 of file FEProblemBase.C.

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

5661 {
5662  TIME_SECTION(_check_nonlinear_convergence_timer);
5663 
5666 
5667  // This is the first residual before any iterations have been done,
5668  // but after PresetBCs (if any) have been imposed on the solution
5669  // vector. We save it, and use it to detect convergence if
5670  // compute_initial_residual_before_preset_bcs=false.
5671  if (it == 0)
5672  system._initial_residual_after_preset_bcs = fnorm;
5673 
5674  std::ostringstream oss;
5675  if (fnorm != fnorm)
5676  {
5677  oss << "Failed to converge, function norm is NaN\n";
5679  }
5680  else if (fnorm < abstol && (it || !force_iteration))
5681  {
5682  oss << "Converged due to function norm " << fnorm << " < " << abstol << '\n';
5684  }
5685  else if (nfuncs >= max_funcs)
5686  {
5687  oss << "Exceeded maximum number of function evaluations: " << nfuncs << " > " << max_funcs
5688  << '\n';
5690  }
5691  else if (it && fnorm > system._last_nl_rnorm && fnorm >= div_threshold)
5692  {
5693  oss << "Nonlinear solve was blowing up!\n";
5695  }
5696 
5697  if (it && reason == MooseNonlinearConvergenceReason::ITERATING)
5698  {
5699  // If compute_initial_residual_before_preset_bcs==false, then use the
5700  // first residual computed by Petsc to determine convergence.
5701  Real the_residual = system._compute_initial_residual_before_preset_bcs
5702  ? initial_residual_before_preset_bcs
5703  : system._initial_residual_after_preset_bcs;
5704  if (fnorm <= the_residual * rtol)
5705  {
5706  oss << "Converged due to function norm " << fnorm << " < "
5707  << " (relative tolerance)\n";
5709  }
5710  else if (snorm < stol * xnorm)
5711  {
5712  oss << "Converged due to small update length: " << snorm << " < " << stol << " * " << xnorm
5713  << '\n';
5715  }
5716  }
5717 
5718  system._last_nl_rnorm = fnorm;
5719  system._current_nl_its = static_cast<unsigned int>(it);
5720 
5721  msg = oss.str();
5722  if (_app.multiAppLevel() > 0)
5724 
5725  return reason;
5726 }
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:90
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 949 of file FEProblemBase.C.

Referenced by FEProblemBase::initialSetup().

950 {
951  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
952  {
953  const auto & all_kernels = _nl->getKernelWarehouse();
954  const auto & kernels = all_kernels.getObjects(tid);
955  for (const auto & kernel : kernels)
956  {
957  std::shared_ptr<NonlocalKernel> nonlocal_kernel =
959  if (nonlocal_kernel)
960  {
963  _nonlocal_kernels.addObject(kernel, tid);
964  }
965  }
966  const MooseObjectWarehouse<IntegratedBCBase> & all_integrated_bcs =
967  _nl->getIntegratedBCWarehouse();
968  const auto & integrated_bcs = all_integrated_bcs.getObjects(tid);
969  for (const auto & integrated_bc : integrated_bcs)
970  {
971  std::shared_ptr<NonlocalIntegratedBC> nonlocal_integrated_bc =
973  if (nonlocal_integrated_bc)
974  {
977  _nonlocal_integrated_bcs.addObject(integrated_bc, tid);
978  }
979  }
980  }
981 }
bool _requires_nonlocal_coupling
nonlocal coupling requirement flag
Definition: SubProblem.h:633
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:126
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 984 of file FEProblemBase.C.

Referenced by FEProblemBase::initialSetup().

985 {
986  std::set<MooseVariableFEBase *> uo_jacobian_moose_vars;
987  {
988  std::vector<ShapeElementUserObject *> objs;
989  theWarehouse()
990  .query()
992  .condition<AttribThread>(tid)
993  .queryInto(objs);
994 
995  for (const auto & uo : objs)
996  {
997  _calculate_jacobian_in_uo = uo->computeJacobianFlag();
998  const std::set<MooseVariableFEBase *> & mv_deps = uo->jacobianMooseVariables();
999  uo_jacobian_moose_vars.insert(mv_deps.begin(), mv_deps.end());
1000  }
1001  }
1002  {
1003  std::vector<ShapeSideUserObject *> objs;
1004  theWarehouse()
1005  .query()
1007  .condition<AttribThread>(tid)
1008  .queryInto(objs);
1009  for (const auto & uo : objs)
1010  {
1011  _calculate_jacobian_in_uo = uo->computeJacobianFlag();
1012  const std::set<MooseVariableFEBase *> & mv_deps = uo->jacobianMooseVariables();
1013  uo_jacobian_moose_vars.insert(mv_deps.begin(), mv_deps.end());
1014  }
1015  }
1016 
1017  _uo_jacobian_moose_vars[tid].assign(uo_jacobian_moose_vars.begin(), uo_jacobian_moose_vars.end());
1018  std::sort(
1019  _uo_jacobian_moose_vars[tid].begin(), _uo_jacobian_moose_vars[tid].end(), sortMooseVariables);
1020 }
Query & condition(Args &&... args)
Adds a new condition to the query.
Definition: TheWarehouse.h:184
bool _calculate_jacobian_in_uo
TheWarehouse & theWarehouse() const