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

Specialization of SubProblem for solving nonlinear equations plus auxiliary equations. More...

#include <FEProblemBase.h>

Inheritance diagram for FEProblemBase:
[legend]

Public Member Functions

 FEProblemBase (const InputParameters &parameters)
 
virtual ~FEProblemBase ()
 
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< MooseVariable *, MooseVariable * > > & couplingEntries (THREAD_ID tid)
 
std::vector< std::pair< MooseVariable *, MooseVariable * > > & 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 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) override
 
virtual MooseVariablegetVariable (THREAD_ID tid, const std::string &var_name) override
 Returns the variable reference for requested variable which may be in any system. More...
 
virtual bool hasScalarVariable (const std::string &var_name) 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< MooseVariable * > &moose_vars, THREAD_ID tid) override
 Set the MOOSE variables to be reinited on each element. More...
 
virtual const std::set< MooseVariable * > & getActiveElementalMooseVariables (THREAD_ID tid) override
 Get the MOOSE variables to be reinited on each element. More...
 
virtual bool hasActiveElementalMooseVariables (THREAD_ID tid) override
 Whether or not a list of active elemental moose variables has been set. More...
 
virtual void clearActiveElementalMooseVariables (THREAD_ID tid) override
 Clear the active elemental MooseVariable. More...
 
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 const std::set< unsigned int > & getActiveMaterialProperties (THREAD_ID tid) override
 Get the material properties required by the current computing thread. More...
 
virtual bool hasActiveMaterialProperties (THREAD_ID tid) override
 Method to check whether or not a list of active material roperties has been set. 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< MooseVariable * > moose_vars)
 
const std::vector< MooseVariable * > & 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 prepareFace (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 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, std::vector< Point > phys_points_in_elem, THREAD_ID tid) 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 reinitNodeNeighbor (const Node *node, 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 deleteAssemblyArray ()
 
virtual void initNullSpaceVectors (const InputParameters &parameters, NonlinearSystemBase &nl)
 
virtual void useFECache (bool fe_cache) override
 Whether or not this problem should utilize FE shape function caching. More...
 
virtual void init () override
 
virtual void solve () override
 
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 bool converged () override
 
virtual unsigned int nNonlinearIterations () override
 
virtual unsigned int nLinearIterations () override
 
virtual Real finalNonlinearResidual () override
 
virtual bool computingInitialResidual () override
 Returns true if the problem is in the process of computing it's initial residual. More...
 
virtual bool currentlyComputingJacobian ()
 Returns true if we are currently computing Jacobian. 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 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 ()
 
void addVariable (const std::string &var_name, const FEType &type, Real scale_factor, const std::set< SubdomainID > *const active_subdomains=NULL)
 
void addScalarVariable (const std::string &var_name, Order order, Real scale_factor=1., const std::set< SubdomainID > *const active_subdomains=NULL)
 
void addKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
void addNodalKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
void addScalarKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
void addBoundaryCondition (const std::string &bc_name, const std::string &name, InputParameters parameters)
 
void addConstraint (const std::string &c_name, const std::string &name, InputParameters parameters)
 
virtual void setInputParametersFEProblem (InputParameters &parameters)
 
void addAuxVariable (const std::string &var_name, const FEType &type, const std::set< SubdomainID > *const active_subdomains=NULL)
 
void addAuxScalarVariable (const std::string &var_name, Order order, Real scale_factor=1., const std::set< SubdomainID > *const active_subdomains=NULL)
 
void addAuxKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
void addAuxScalarKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
AuxiliarySystemgetAuxiliarySystem ()
 
void addDiracKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
void addDGKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
void addInterfaceKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 
void addInitialCondition (const std::string &ic_name, const std::string &name, InputParameters parameters)
 
void projectSolution ()
 
void addMaterial (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...
 
virtual void addUserObject (std::string user_object_name, const std::string &name, InputParameters parameters)
 
const ExecuteMooseObjectWarehouse< UserObject > & getUserObjects ()
 Return the storage of all UserObjects. More...
 
template<class T >
const T & getUserObject (const std::string &name, unsigned int tid=0)
 Get the user object by its name. More...
 
const UserObjectgetUserObjectBase (const std::string &name)
 Get the user object by its name. More...
 
bool hasUserObject (const std::string &name)
 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 hasMultiApps () const
 Returns whether or not the current simulation has any multiapps. More...
 
bool hasMultiApp (const std::string &name)
 
bool hasVectorPostprocessor (const std::string &name)
 Check existence of the VectorPostprocessor. More...
 
VectorPostprocessorValuegetVectorPostprocessorValue (const VectorPostprocessorName &name, const std::string &vector_name)
 Get a reference to the value associated with the VectorPostprocessor. More...
 
VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &name, const std::string &vector_name)
 Get the reference to the old value of a post-processor. More...
 
VectorPostprocessorValuedeclareVectorPostprocessorVector (const VectorPostprocessorName &name, const std::string &vector_name)
 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...
 
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)
 
void addMarker (std::string marker_name, const std::string &name, InputParameters parameters)
 
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)
 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 advanceMultiApps (ExecFlagType type)
 Advance the MultiApps 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...
 
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, NumericVector< Number > &residual)
 Evaluates transient residual G in canonical semidiscrete form G(t,U,Udot) = F(t,U) More...
 
void computeTransientImplicitJacobian (Real time, const NumericVector< Number > &u, const NumericVector< Number > &udot, Real 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 computeResidual (NonlinearImplicitSystem &sys, const NumericVector< Number > &soln, NumericVector< Number > &residual)
 
virtual void computeResidual (const NumericVector< Number > &soln, NumericVector< Number > &residual)
 
virtual void computeResidualType (const NumericVector< Number > &soln, NumericVector< Number > &residual, Moose::KernelType type=Moose::KT_ALL)
 
virtual void computeJacobian (NonlinearImplicitSystem &sys, const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian)
 
virtual void computeJacobian (const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian, Moose::KernelType kernel_type=Moose::KT_ALL)
 
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 NumericVector< Number > & residualVector (Moose::KernelType type)
 
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 (SparseMatrix< Number > &jacobian, THREAD_ID tid) override
 
virtual void addJacobianNeighbor (SparseMatrix< Number > &jacobian, 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 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 addJacobianScalar (SparseMatrix< Number > &jacobian, THREAD_ID tid=0)
 
virtual void addJacobianOffDiagScalar (SparseMatrix< Number > &jacobian, unsigned int ivar, THREAD_ID tid=0)
 
virtual void cacheJacobian (THREAD_ID tid) override
 
virtual void cacheJacobianNeighbor (THREAD_ID tid) override
 
virtual void addCachedJacobian (SparseMatrix< Number > &jacobian, 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 void 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
 
void notifyWhenMeshChanges (MeshChangedInterface *mci)
 Register an object that derives from MeshChangedInterface to be notified when the mesh changes. More...
 
virtual void checkProblemIntegrity ()
 
void serializeSolution ()
 
void setKernelTypeResidual (Moose::KernelType kt)
 
void setConstJacobian (bool state)
 Set flag that Jacobian is constant (for optimization purposes) More...
 
void registerRandomInterface (RandomInterface &random_interface, const std::string &name)
 
void setKernelCoverageCheck (bool flag)
 
void setMaterialCoverageCheck (bool flag)
 
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 MaterialWarehousegetComputeMaterialWarehouse ()
 
const MaterialWarehousegetDiscreteMaterialWarehouse ()
 
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 ()
 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 ()
 
void setIgnoreZerosInJacobian (bool state)
 
bool hasTimeIntegrator () const
 Returns whether or not this Problem has a TimeIntegrator. More...
 
const ExecFlagTypegetCurrentExecuteOnFlag () const
 Return the current execution flag. More...
 
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...
 
template<typename T >
void initializeUserObjects (const MooseObjectWarehouse< T > &warehouse)
 
template<typename T >
void finalizeUserObjects (const MooseObjectWarehouse< T > &warehouse)
 
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 ()
 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...
 
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 ()
 
virtual bool checkNonlocalCouplingRequirement ()
 
unsigned int getAxisymmetricRadialCoord ()
 Returns the desired radial direction for RZ coordinate transformation. More...
 
virtual DiracKernelInfodiracKernelInfo ()
 
virtual void storeMatPropName (SubdomainID block_id, const std::string &name)
 Adds the given material property to a storage map based on block ids. More...
 
virtual void storeMatPropName (BoundaryID boundary_id, const std::string &name)
 Adds the given material property to a storage map based on boundary ids. More...
 
virtual void storeZeroMatProp (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 storeZeroMatProp (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 storeDelayedCheckMatProp (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 storeDelayedCheckMatProp (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...
 
virtual void registerRestartableData (std::string name, RestartableDataValue *data, THREAD_ID tid)
 Register a piece of restartable data. More...
 
const CouplingMatrix & nonlocalCouplingMatrix () const
 
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 & 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...
 
bool isParamValid (const std::string &name) const
 Test if the supplied parameter is valid. More...
 
MooseAppgetMooseApp ()
 Get the MooseApp this object is associated with. More...
 
virtual bool enabled ()
 Return the enabled status of the object. 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)
 
const MaterialPropertyStoragegetMaterialPropertyStorage ()
 Return a reference to the material property storage. More...
 
const MaterialPropertyStoragegetBndMaterialPropertyStorage ()
 
const MooseObjectWarehouse< Indicator > & getIndicatorWarehouse ()
 Return indicator/marker storage. More...
 
const MooseObjectWarehouse< InternalSideIndicator > & getInternalSideIndicatorWarehouse ()
 
const MooseObjectWarehouse< Marker > & getMarkerWarehouse ()
 
bool needMaterialOnSide (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 needMaterialOnSide (SubdomainID subdomain_id, THREAD_ID tid)
 

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_zero
 
std::vector< VariableGradient_grad_zero
 
std::vector< VariableSecond_second_zero
 
std::vector< VariablePhiSecond_second_phi_zero
 

Protected Member Functions

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...
 
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...
 
VectorPostprocessorDatagetVectorPostprocessorData ()
 

Protected Attributes

MooseMesh_mesh
 
EquationSystems _eq
 
bool _initialized
 
Moose::KernelType _kernel_type
 
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< 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< IntegratedBC_nonlocal_integrated_bcs
 nonlocal integrated_bcs More...
 
MaterialPropertyStorage_material_props
 
MaterialPropertyStorage_bnd_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< 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 _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< MooseVariable * > > _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...
 
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...
 
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< MooseVariable * > > _active_elemental_moose_variables
 This is the set of MooseVariables 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...
 
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 _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...
 
MooseApp_app
 The MooseApp this object is associated with. More...
 
const InputParameters_pars
 Parameters of this object, references the InputParameters stored in the InputParametersWarehouse. 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...
 
InitialConditionWarehouse _ics
 
MooseObjectWarehouseBase< ScalarInitialCondition_scalar_ics
 
MaterialWarehouse _materials
 
MaterialWarehouse _discrete_materials
 
MaterialWarehouse _all_materials
 
MooseObjectWarehouse< Indicator_indicators
 
MooseObjectWarehouse< InternalSideIndicator_internal_side_indicators
 
ExecuteMooseObjectWarehouse< UserObject_all_user_objects
 
AuxGroupExecuteMooseObjectWarehouse< GeneralUserObject_general_user_objects
 
AuxGroupExecuteMooseObjectWarehouse< NodalUserObject_nodal_user_objects
 
AuxGroupExecuteMooseObjectWarehouse< ElementUserObject_elemental_user_objects
 
AuxGroupExecuteMooseObjectWarehouse< SideUserObject_side_user_objects
 
AuxGroupExecuteMooseObjectWarehouse< InternalSideUserObject_internal_side_user_objects
 
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
 

Private Attributes

bool _error_on_jacobian_nonzero_reallocation
 
bool _ignore_zeros_in_jacobian
 
bool _force_restart
 
bool _skip_additional_restart_data
 
bool _fail_next_linear_convergence_check
 
bool _currently_computing_jacobian
 Whether or not the system is currently computing the Jacobian matrix. More...
 
bool _started_initial_setup
 At or beyond initialSteup stage. More...
 

Friends

class AuxiliarySystem
 
class NonlinearSystemBase
 
class MooseEigenSystem
 
class Resurrector
 
class RestartableDataIO
 
class Restartable
 
class DisplacedProblem
 

Detailed Description

Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.

Definition at line 134 of file FEProblemBase.h.

Constructor & Destructor Documentation

FEProblemBase::FEProblemBase ( const InputParameters parameters)

Definition at line 150 of file FEProblemBase.C.

151  : SubProblem(parameters),
152  Restartable(parameters, "FEProblemBase", this),
153  _mesh(*parameters.get<MooseMesh *>("mesh")),
154  _eq(_mesh),
155  _initialized(false),
157  _solve(getParam<bool>("solve")),
158 
159  _transient(false),
160  _time(declareRestartableData<Real>("time")),
161  _time_old(declareRestartableData<Real>("time_old")),
162  _t_step(declareRecoverableData<int>("t_step")),
163  _dt(declareRestartableData<Real>("dt")),
164  _dt_old(declareRestartableData<Real>("dt_old")),
165 
166  _nl(NULL),
167  _aux(NULL),
169  _distributions(/*threaded=*/false),
170  _scalar_ics(/*threaded=*/false),
172  declareRestartableDataWithContext<MaterialPropertyStorage>("material_props", &_mesh)),
174  declareRestartableDataWithContext<MaterialPropertyStorage>("bnd_material_props", &_mesh)),
175  _pps_data(*this),
176  _vpps_data(*this),
177  _general_user_objects(/*threaded=*/false),
178  _transfers(/*threaded=*/false),
179  _to_multi_app_transfers(/*threaded=*/false),
180  _from_multi_app_transfers(/*threaded=*/false),
181 #ifdef LIBMESH_ENABLE_AMR
182  _adaptivity(*this),
184 #endif
185  _displaced_mesh(NULL),
187  _reinit_displaced_elem(false),
188  _reinit_displaced_face(false),
189  _input_file_saved(false),
190  _has_dampers(false),
191  _has_constraints(false),
193  _const_jacobian(false),
194  _has_jacobian(false),
195  _needs_old_newton_iter(false),
196  _has_nonlocal_coupling(false),
198  _kernel_coverage_check(false),
200  _max_qps(std::numeric_limits<unsigned int>::max()),
201  _max_shape_funcs(std::numeric_limits<unsigned int>::max()),
202  _max_scalar_order(INVALID_ORDER),
203  _has_time_integrator(false),
204  _has_exception(false),
207  getParam<bool>("error_on_jacobian_nonzero_reallocation")),
208  _ignore_zeros_in_jacobian(getParam<bool>("ignore_zeros_in_jacobian")),
209  _force_restart(getParam<bool>("force_restart")),
210  _skip_additional_restart_data(getParam<bool>("skip_additional_restart_data")),
214 {
215 
216  _time = 0.0;
217  _time_old = 0.0;
218  _t_step = 0;
219  _dt = 0;
220  _dt_old = _dt;
221 
222  unsigned int n_threads = libMesh::n_threads();
223 
224  _real_zero.resize(n_threads, 0.);
225  _zero.resize(n_threads);
226  _grad_zero.resize(n_threads);
227  _second_zero.resize(n_threads);
228  _second_phi_zero.resize(n_threads);
229  _uo_jacobian_moose_vars.resize(n_threads);
230 
231  _material_data.resize(n_threads);
232  _bnd_material_data.resize(n_threads);
233  _neighbor_material_data.resize(n_threads);
234  for (unsigned int i = 0; i < n_threads; i++)
235  {
236  _material_data[i] = std::make_shared<MaterialData>(_material_props);
237  _bnd_material_data[i] = std::make_shared<MaterialData>(_bnd_material_props);
238  _neighbor_material_data[i] = std::make_shared<MaterialData>(_bnd_material_props);
239  }
240 
241  _active_elemental_moose_variables.resize(n_threads);
242 
243  _block_mat_side_cache.resize(n_threads);
244  _bnd_mat_side_cache.resize(n_threads);
245 
246  _resurrector = libmesh_make_unique<Resurrector>(*this);
247 
248  _eq.parameters.set<FEProblemBase *>("_fe_problem_base") = this;
249 }
bool _reinit_displaced_elem
std::vector< std::shared_ptr< MaterialData > > _neighbor_material_data
MaterialPropertyStorage & _bnd_material_props
ExecFlagType _current_execute_on_flag
Current execute_on flag.
bool _error_on_jacobian_nonzero_reallocation
std::shared_ptr< NonlinearSystemBase > _nl
bool _has_jacobian
Indicates if the Jacobian was computed.
bool _has_dampers
Whether or not this system has any Dampers associated with it.
bool _has_nonlocal_coupling
Indicates if nonlocal coupling is required/exists.
unsigned int _cycles_completed
std::vector< VariableSecond > _second_zero
bool _has_exception
Whether or not an exception has occurred.
bool _needs_old_newton_iter
Indicates that we need to compute variable values for previous Newton iteration.
bool _has_time_integrator
Indicates whether or not this executioner has a time integrator (during setup)
bool _ignore_zeros_in_jacobian
ExecuteMooseObjectWarehouse< Transfer > _from_multi_app_transfers
Transfers executed just after MultiApps to transfer data from them.
std::vector< std::shared_ptr< MaterialData > > _bnd_material_data
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
std::vector< std::unordered_map< BoundaryID, bool > > _bnd_mat_side_cache
Cache for calculating materials on side.
ExecuteMooseObjectWarehouse< Transfer > _transfers
Normal Transfers.
bool _calculate_jacobian_in_uo
std::vector< std::set< MooseVariable * > > _active_elemental_moose_variables
This is the set of MooseVariables that will actually get reinited by a call to reinit(elem) ...
Definition: SubProblem.h:451
ExecuteMooseObjectWarehouse< Transfer > _to_multi_app_transfers
Transfers executed just before MultiApps to transfer data to them.
bool _input_file_saved
whether input file has been written
Moose::CouplingType _coupling
Type of variable coupling.
PostprocessorData _pps_data
SubProblem(const InputParameters &parameters)
Definition: SubProblem.C:43
std::vector< std::unordered_map< SubdomainID, bool > > _block_mat_side_cache
Cache for calculating materials on side.
std::shared_ptr< AuxiliarySystem > _aux
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
MooseMesh & _mesh
unsigned int _max_shape_funcs
Maximum number of shape functions on any element in the problem.
Adaptivity _adaptivity
VectorPostprocessorData _vpps_data
bool _currently_computing_jacobian
Whether or not the system is currently computing the Jacobian matrix.
std::vector< VariablePhiSecond > _second_phi_zero
bool _started_initial_setup
At or beyond initialSteup stage.
bool _kernel_coverage_check
Determines whether a check to verify an active kernel on every subdomain.
std::unique_ptr< Resurrector > _resurrector
Object responsible for restart (read/write)
bool _solve
Whether or not to actually solve the nonlinear system.
friend class Restartable
bool _reinit_displaced_face
std::vector< VariableGradient > _grad_zero
std::vector< std::vector< MooseVariable * > > _uo_jacobian_moose_vars
std::vector< VariableValue > _zero
bool _skip_additional_restart_data
GeometricSearchData _geometric_search_data
bool _has_initialized_stateful
Whether nor not stateful materials have been initialized.
unsigned int _max_qps
Maximum number of quadrature points used in the problem.
EquationSystems _eq
bool _has_constraints
Whether or not this system has any Constraints.
bool _const_jacobian
true if the Jacobian is constant
MaterialPropertyStorage & _material_props
MooseObjectWarehouseBase< Distribution > _distributions
distributions
bool _material_coverage_check
Determines whether a check to verify an active material on every subdomain.
Order _max_scalar_order
Maximum scalar variable order.
MooseObjectWarehouseBase< ScalarInitialCondition > _scalar_ics
std::vector< std::shared_ptr< MaterialData > > _material_data
MooseMesh * _displaced_mesh
Moose::KernelType _kernel_type
AuxGroupExecuteMooseObjectWarehouse< GeneralUserObject > _general_user_objects
bool _fail_next_linear_convergence_check
std::vector< Real > _real_zero
Convenience zeros.
FEProblemBase::~FEProblemBase ( )
virtual

Definition at line 307 of file FEProblemBase.C.

308 {
309  // Flush the Console stream, the underlying call to Console::mooseConsole
310  // relies on a call to Output::checkInterval that has references to
311  // _time, etc. If it is not flushed here memory problems arise if you have
312  // an unflushed stream and start destructing things.
313  _console << std::flush;
314 
315  unsigned int n_threads = libMesh::n_threads();
316  for (unsigned int i = 0; i < n_threads; i++)
317  {
318  _zero[i].release();
319  _grad_zero[i].release();
320  _second_zero[i].release();
321  _second_phi_zero[i].release();
322  }
323 }
std::vector< VariableSecond > _second_zero
std::vector< VariablePhiSecond > _second_phi_zero
std::vector< VariableGradient > _grad_zero
std::vector< VariableValue > _zero
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.

Member Function Documentation

void Problem::_setCLIOption ( )
inlineinherited

For Internal Use.

Definition at line 40 of file Problem.h.

40 { _cli_option_found = true; }
bool _cli_option_found
True if the CLI option is found.
Definition: Problem.h:51
Adaptivity& FEProblemBase::adaptivity ( )
inline

Definition at line 1071 of file FEProblemBase.h.

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

1071 { return _adaptivity; }
Adaptivity _adaptivity
void FEProblemBase::adaptMesh ( )
virtual

Definition at line 4458 of file FEProblemBase.C.

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

4459 {
4460  // reset cycle counter
4461  _cycles_completed = 0;
4462 
4464  return;
4465 
4466  unsigned int cycles_per_step = _adaptivity.getCyclesPerStep();
4467 
4468  Moose::perf_log.push("Adaptivity: adaptMesh()", "Execution");
4469 
4470  for (unsigned int i = 0; i < cycles_per_step; ++i)
4471  {
4472  _console << "Adaptivity step " << i + 1 << " of " << cycles_per_step << '\n';
4473  // Markers were already computed once by Executioner
4474  if (_adaptivity.getRecomputeMarkersFlag() && i > 0)
4475  computeMarkers();
4476  if (_adaptivity.adaptMesh())
4477  {
4478  meshChanged();
4480  }
4481  else
4482  {
4483  _console << "Mesh unchanged, skipping remaining steps..." << std::endl;
4484  break;
4485  }
4486 
4487  // Show adaptivity progress
4488  _console << std::flush;
4489  }
4490 
4491  Moose::perf_log.pop("Adaptivity: adaptMesh()", "Execution");
4492 }
bool adaptMesh(std::string marker_name=std::string())
Adapts the mesh based on the error estimator used.
Definition: Adaptivity.C:125
unsigned int _cycles_completed
virtual void computeMarkers()
bool getRecomputeMarkersFlag() const
Pull out the _recompute_markers_during_cycles flag previously set through the AdaptivityAction.
Definition: Adaptivity.h:121
unsigned int getCyclesPerStep() const
Pull out the number of cycles_per_step previously set through the AdaptivityAction.
Definition: Adaptivity.h:108
virtual void meshChanged() override
PerfLog perf_log
Perflog to be used by applications.
Adaptivity _adaptivity
bool isAdaptivityDue()
Query if an adaptivity step should be performed at the current time / time step.
Definition: Adaptivity.C:304
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
void FEProblemBase::addAuxKernel ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)

Definition at line 1904 of file FEProblemBase.C.

1907 {
1908  setInputParametersFEProblem(parameters);
1909  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
1910  {
1911  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1912  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
1913  parameters.set<SystemBase *>("_nl_sys") = &_displaced_problem->nlSys();
1914  if (!parameters.get<std::vector<BoundaryName>>("boundary").empty())
1915  _reinit_displaced_face = true;
1916  else
1917  _reinit_displaced_elem = true;
1918  }
1919  else
1920  {
1921  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
1922  {
1923  // We allow AuxKernels to request that they use_displaced_mesh,
1924  // but then be overridden when no displacements variables are
1925  // provided in the Mesh block. If that happened, update the value
1926  // of use_displaced_mesh appropriately for this AuxKernel.
1927  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1928  parameters.set<bool>("use_displaced_mesh") = false;
1929  }
1930 
1931  parameters.set<SubProblem *>("_subproblem") = this;
1932  parameters.set<SystemBase *>("_sys") = _aux.get();
1933  parameters.set<SystemBase *>("_nl_sys") = _nl.get();
1934  }
1935  _aux->addKernel(kernel_name, name, parameters);
1936 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
bool _reinit_displaced_elem
virtual void setInputParametersFEProblem(InputParameters &parameters)
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:91
std::shared_ptr< AuxiliarySystem > _aux
bool _reinit_displaced_face
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::addAuxScalarKernel ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)

Definition at line 1939 of file FEProblemBase.C.

1942 {
1943  setInputParametersFEProblem(parameters);
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->auxSys();
1948  }
1949  else
1950  {
1951  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
1952  {
1953  // We allow AuxScalarKernels to request that they use_displaced_mesh,
1954  // but then be overridden when no displacements variables are
1955  // provided in the Mesh block. If that happened, update the value
1956  // of use_displaced_mesh appropriately for this AuxScalarKernel.
1957  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1958  parameters.set<bool>("use_displaced_mesh") = false;
1959  }
1960 
1961  parameters.set<SubProblem *>("_subproblem") = this;
1962  parameters.set<SystemBase *>("_sys") = _aux.get();
1963  }
1964  _aux->addScalarKernel(kernel_name, name, parameters);
1965 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
virtual void setInputParametersFEProblem(InputParameters &parameters)
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:91
std::shared_ptr< AuxiliarySystem > _aux
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::addAuxScalarVariable ( const std::string &  var_name,
Order  order,
Real  scale_factor = 1.,
const std::set< SubdomainID > *const  active_subdomains = NULL 
)

Definition at line 1886 of file FEProblemBase.C.

1890 {
1891  if (order > _max_scalar_order)
1892  _max_scalar_order = order;
1893 
1894  FEType type(order, SCALAR);
1895  if (duplicateVariableCheck(var_name, type, /* is_aux = */ true))
1896  return;
1897 
1898  _aux->addScalarVariable(var_name, order, scale_factor, active_subdomains);
1899  if (_displaced_problem)
1900  _displaced_problem->addAuxScalarVariable(var_name, order, scale_factor, active_subdomains);
1901 }
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< AuxiliarySystem > _aux
MatType type
std::shared_ptr< DisplacedProblem > _displaced_problem
Order _max_scalar_order
Maximum scalar variable order.
void FEProblemBase::addAuxVariable ( const std::string &  var_name,
const FEType &  type,
const std::set< SubdomainID > *const  active_subdomains = NULL 
)

Definition at line 1873 of file FEProblemBase.C.

Referenced by MaterialOutputAction::buildMaterialOutputObjects().

1876 {
1877  if (duplicateVariableCheck(var_name, type, /* is_aux = */ true))
1878  return;
1879 
1880  _aux->addVariable(var_name, type, 1.0, active_subdomains);
1881  if (_displaced_problem)
1882  _displaced_problem->addAuxVariable(var_name, type, active_subdomains);
1883 }
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< AuxiliarySystem > _aux
MatType type
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::addBoundaryCondition ( const std::string &  bc_name,
const std::string &  name,
InputParameters  parameters 
)

Definition at line 1817 of file FEProblemBase.C.

1820 {
1821  setInputParametersFEProblem(parameters);
1822  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
1823  {
1824  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1825  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
1826  _reinit_displaced_face = true;
1827  }
1828  else
1829  {
1830  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
1831  {
1832  // We allow Materials to request that they use_displaced_mesh,
1833  // but then be overridden when no displacements variables are
1834  // provided in the Mesh block. If that happened, update the value
1835  // of use_displaced_mesh appropriately for this Material.
1836  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1837  parameters.set<bool>("use_displaced_mesh") = false;
1838  }
1839 
1840  parameters.set<SubProblem *>("_subproblem") = this;
1841  parameters.set<SystemBase *>("_sys") = _nl.get();
1842  }
1843  _nl->addBoundaryCondition(bc_name, name, parameters);
1844 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
virtual void setInputParametersFEProblem(InputParameters &parameters)
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:91
bool _reinit_displaced_face
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::addCachedJacobian ( SparseMatrix< Number > &  jacobian,
THREAD_ID  tid 
)
overridevirtual

Implements SubProblem.

Definition at line 1144 of file FEProblemBase.C.

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

1145 {
1146  _assembly[tid]->addCachedJacobian(jacobian);
1147  if (_displaced_problem)
1148  _displaced_problem->addCachedJacobian(jacobian, tid);
1149 }
std::vector< Assembly * > _assembly
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::addCachedResidual ( THREAD_ID  tid)
overridevirtual

Implements SubProblem.

Definition at line 1049 of file FEProblemBase.C.

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

1050 {
1051  _assembly[tid]->addCachedResiduals();
1052 
1053  if (_displaced_problem)
1054  _displaced_problem->addCachedResidual(tid);
1055 }
std::vector< Assembly * > _assembly
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::addCachedResidualDirectly ( NumericVector< Number > &  residual,
THREAD_ID  tid 
)
virtual

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

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

1059 {
1060  if (_nl->hasResidualVector(Moose::KT_TIME))
1061  _assembly[tid]->addCachedResidual(residual, Moose::KT_TIME);
1062  if (_nl->hasResidualVector(Moose::KT_NONTIME))
1064 
1065  if (_displaced_problem)
1066  _displaced_problem->addCachedResidualDirectly(residual, tid);
1067 }
std::shared_ptr< NonlinearSystemBase > _nl
std::vector< Assembly * > _assembly
virtual void addCachedResidual(THREAD_ID tid) override
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::addConstraint ( const std::string &  c_name,
const std::string &  name,
InputParameters  parameters 
)

Definition at line 1847 of file FEProblemBase.C.

1850 {
1851  _has_constraints = true;
1852 
1853  setInputParametersFEProblem(parameters);
1854  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
1855  {
1856  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1857  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
1858  _reinit_displaced_face = true;
1859  }
1860  else
1861  {
1862  // It might _want_ to use a displaced mesh... but we're not so set it to false
1863  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1864  parameters.set<bool>("use_displaced_mesh") = false;
1865 
1866  parameters.set<SubProblem *>("_subproblem") = this;
1867  parameters.set<SystemBase *>("_sys") = _nl.get();
1868  }
1869  _nl->addConstraint(c_name, name, parameters);
1870 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
virtual void setInputParametersFEProblem(InputParameters &parameters)
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:91
bool _reinit_displaced_face
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
std::shared_ptr< DisplacedProblem > _displaced_problem
bool _has_constraints
Whether or not this system has any Constraints.
void FEProblemBase::addDamper ( std::string  damper_name,
const std::string &  name,
InputParameters  parameters 
)

Definition at line 3027 of file FEProblemBase.C.

3030 {
3031  setInputParametersFEProblem(parameters);
3032  parameters.set<SubProblem *>("_subproblem") = this;
3033  parameters.set<SystemBase *>("_sys") = _nl.get();
3034 
3035  _has_dampers = true;
3036  _nl->addDamper(damper_name, name, parameters);
3037 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
virtual void setInputParametersFEProblem(InputParameters &parameters)
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:91
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
void FEProblemBase::addDGKernel ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)

Definition at line 2000 of file FEProblemBase.C.

2003 {
2004  setInputParametersFEProblem(parameters);
2005  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
2006  {
2007  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2008  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
2009  _reinit_displaced_face = true;
2010  }
2011  else
2012  {
2013  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
2014  {
2015  // We allow DGKernels to request that they use_displaced_mesh,
2016  // but then be overridden when no displacements variables are
2017  // provided in the Mesh block. If that happened, update the value
2018  // of use_displaced_mesh appropriately for this DGKernel.
2019  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2020  parameters.set<bool>("use_displaced_mesh") = false;
2021  }
2022 
2023  parameters.set<SubProblem *>("_subproblem") = this;
2024  parameters.set<SystemBase *>("_sys") = _nl.get();
2025  }
2026  _nl->addDGKernel(dg_kernel_name, name, parameters);
2027 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
virtual void setInputParametersFEProblem(InputParameters &parameters)
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:91
bool _reinit_displaced_face
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::addDiracKernel ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)

Definition at line 1968 of file FEProblemBase.C.

1971 {
1972  setInputParametersFEProblem(parameters);
1973  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
1974  {
1975  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1976  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
1977  _reinit_displaced_elem = true;
1978  }
1979  else
1980  {
1981  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
1982  {
1983  // We allow DiracKernels to request that they use_displaced_mesh,
1984  // but then be overridden when no displacements variables are
1985  // provided in the Mesh block. If that happened, update the value
1986  // of use_displaced_mesh appropriately for this DiracKernel.
1987  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1988  parameters.set<bool>("use_displaced_mesh") = false;
1989  }
1990 
1991  parameters.set<SubProblem *>("_subproblem") = this;
1992  parameters.set<SystemBase *>("_sys") = _nl.get();
1993  }
1994  _nl->addDiracKernel(kernel_name, name, parameters);
1995 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
bool _reinit_displaced_elem
virtual void setInputParametersFEProblem(InputParameters &parameters)
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:91
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::addDisplacedProblem ( std::shared_ptr< DisplacedProblem displaced_problem)
virtual

Definition at line 4373 of file FEProblemBase.C.

4374 {
4375  _displaced_mesh = &displaced_problem->mesh();
4376  _displaced_problem = displaced_problem;
4377 }
std::shared_ptr< DisplacedProblem > _displaced_problem
MooseMesh * _displaced_mesh
void FEProblemBase::addDistribution ( std::string  type,
const std::string &  name,
InputParameters  parameters 
)
virtual

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

Definition at line 1620 of file FEProblemBase.C.

1623 {
1624  setInputParametersFEProblem(parameters);
1625  parameters.set<std::string>("type") = type;
1626  std::shared_ptr<Distribution> dist = _factory.create<Distribution>(type, name, parameters);
1627  _distributions.addObject(dist);
1628 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
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:46
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:418
virtual void setInputParametersFEProblem(InputParameters &parameters)
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:28
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0)
Adds an object to the storage structure.
MatType type
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
MooseObjectWarehouseBase< Distribution > _distributions
distributions
void FEProblemBase::addExtraVectors ( )
virtual

A place to add extra vectors to the simulation.

It is called early during initialSetup.

Definition at line 406 of file FEProblemBase.C.

Referenced by initialSetup().

407 {
408  _nl->addExtraVectors();
409  _aux->addExtraVectors();
410 }
std::shared_ptr< NonlinearSystemBase > _nl
std::shared_ptr< AuxiliarySystem > _aux
void FEProblemBase::addFunction ( std::string  type,
const std::string &  name,
InputParameters  parameters 
)
virtual

Definition at line 1546 of file FEProblemBase.C.

Referenced by getFunction().

1547 {
1548  setInputParametersFEProblem(parameters);
1549  parameters.set<SubProblem *>("_subproblem") = this;
1550 
1551  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
1552  {
1553  std::shared_ptr<Function> func = _factory.create<Function>(type, name, parameters, tid);
1554  _functions.addObject(func, tid);
1555  }
1556 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
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:46
Base class for function objects.
Definition: Function.h:46
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:418
virtual void setInputParametersFEProblem(InputParameters &parameters)
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0)
Adds an object to the storage structure.
MatType type
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
MooseObjectWarehouse< Function > _functions
functions
unsigned int THREAD_ID
Definition: MooseTypes.h:79
void FEProblemBase::addGhostedBoundary ( BoundaryID  boundary_id)
overridevirtual

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

Implements SubProblem.

Definition at line 1223 of file FEProblemBase.C.

Referenced by DisplacedProblem::addGhostedBoundary().

1224 {
1225  _mesh.addGhostedBoundary(boundary_id);
1226  if (_displaced_problem)
1227  _displaced_mesh->addGhostedBoundary(boundary_id);
1228 }
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:2161
MooseMesh * _displaced_mesh
void FEProblemBase::addGhostedElem ( dof_id_type  elem_id)
overridevirtual

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

Implements SubProblem.

Definition at line 1216 of file FEProblemBase.C.

Referenced by DisplacedProblem::addGhostedElem().

1217 {
1218  if (_mesh.elemPtr(elem_id)->processor_id() != processor_id())
1219  _ghosted_elems.insert(elem_id);
1220 }
virtual Elem * elemPtr(const dof_id_type i)
Definition: MooseMesh.C:2062
std::set< dof_id_type > _ghosted_elems
Elements that should have Dofs ghosted to the local processor.
Definition: SubProblem.h:464
MooseMesh & _mesh
void FEProblemBase::addIndicator ( std::string  indicator_name,
const std::string &  name,
InputParameters  parameters 
)

Definition at line 3046 of file FEProblemBase.C.

3049 {
3050  setInputParametersFEProblem(parameters);
3051  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
3052  {
3053  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
3054  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
3055  _reinit_displaced_elem = true;
3056  }
3057  else
3058  {
3059  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
3060  {
3061  // We allow Indicators to request that they use_displaced_mesh,
3062  // but then be overridden when no displacements variables are
3063  // provided in the Mesh block. If that happened, update the value
3064  // of use_displaced_mesh appropriately for this Indicator.
3065  if (parameters.have_parameter<bool>("use_displaced_mesh"))
3066  parameters.set<bool>("use_displaced_mesh") = false;
3067  }
3068 
3069  parameters.set<SubProblem *>("_subproblem") = this;
3070  parameters.set<SystemBase *>("_sys") = _aux.get();
3071  }
3072 
3073  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
3074  {
3075  std::shared_ptr<Indicator> indicator =
3076  _factory.create<Indicator>(indicator_name, name, parameters, tid);
3077 
3078  std::shared_ptr<InternalSideIndicator> isi =
3079  std::dynamic_pointer_cast<InternalSideIndicator>(indicator);
3080  if (isi)
3082  else
3083  _indicators.addObject(indicator, tid);
3084  }
3085 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
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:46
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:418
virtual void setInputParametersFEProblem(InputParameters &parameters)
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0)
Adds an object to the storage structure.
Base class for a system (of equations)
Definition: SystemBase.h:91
MooseObjectWarehouse< InternalSideIndicator > _internal_side_indicators
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:53
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
std::shared_ptr< DisplacedProblem > _displaced_problem
unsigned int THREAD_ID
Definition: MooseTypes.h:79
void FEProblemBase::addInitialCondition ( const std::string &  ic_name,
const std::string &  name,
InputParameters  parameters 
)

Definition at line 2062 of file FEProblemBase.C.

2065 {
2066 
2067  // before we start to mess with the initial condition, we need to check parameters for errors.
2068  parameters.checkParams(name);
2069 
2070  setInputParametersFEProblem(parameters);
2071  parameters.set<SubProblem *>("_subproblem") = this;
2072 
2073  const std::string & var_name = parameters.get<VariableName>("variable");
2074  // field IC
2075  if (hasVariable(var_name))
2076  {
2077  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
2078  {
2079  MooseVariable & var = getVariable(tid, var_name);
2080  parameters.set<SystemBase *>("_sys") = &var.sys();
2081  std::shared_ptr<InitialCondition> ic =
2082  _factory.create<InitialCondition>(ic_name, name, parameters, tid);
2083  _ics.addObject(ic, tid);
2084  }
2085  }
2086 
2087  // scalar IC
2088  else if (hasScalarVariable(var_name))
2089  {
2090  MooseVariableScalar & var = getScalarVariable(0, var_name);
2091  parameters.set<SystemBase *>("_sys") = &var.sys();
2092  std::shared_ptr<ScalarInitialCondition> ic =
2094  _scalar_ics.addObject(ic);
2095  }
2096 
2097  else
2098  mooseError(
2099  "Variable '", var_name, "' requested in initial condition '", name, "' does not exist.");
2100 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
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:46
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:418
virtual void setInputParametersFEProblem(InputParameters &parameters)
Class for stuff related to variables.
Definition: MooseVariable.h:43
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0)
Adds an object to the storage structure.
Base class for a system (of equations)
Definition: SystemBase.h:91
InitialConditions are objects that set the initial value of variables.
virtual MooseVariableScalar & getScalarVariable(THREAD_ID tid, const std::string &var_name) override
Returns the scalar variable reference from whichever system contains it.
virtual bool hasVariable(const std::string &var_name) override
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:53
Class for scalar variables (they are different).
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
virtual bool hasScalarVariable(const std::string &var_name) override
Returns a Boolean indicating whether any system contains a variable with the name provided...
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
SystemBase & sys()
Get the system this variable is part of.
virtual MooseVariable & getVariable(THREAD_ID tid, const std::string &var_name) override
Returns the variable reference for requested variable which may be in any system. ...
MooseObjectWarehouseBase< ScalarInitialCondition > _scalar_ics
unsigned int THREAD_ID
Definition: MooseTypes.h:79
void addObject(std::shared_ptr< InitialCondition > object, THREAD_ID tid)
Add object to the warehouse.
void FEProblemBase::addInterfaceKernel ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)

Definition at line 2032 of file FEProblemBase.C.

2035 {
2036  setInputParametersFEProblem(parameters);
2037  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
2038  {
2039  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2040  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
2041  _reinit_displaced_face = true;
2042  }
2043  else
2044  {
2045  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
2046  {
2047  // We allow InterfaceKernels to request that they use_displaced_mesh,
2048  // but then be overridden when no displacements variables are
2049  // provided in the Mesh block. If that happened, update the value
2050  // of use_displaced_mesh appropriately for this InterfaceKernel.
2051  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2052  parameters.set<bool>("use_displaced_mesh") = false;
2053  }
2054 
2055  parameters.set<SubProblem *>("_subproblem") = this;
2056  parameters.set<SystemBase *>("_sys") = _nl.get();
2057  }
2058  _nl->addInterfaceKernel(interface_kernel_name, name, parameters);
2059 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
virtual void setInputParametersFEProblem(InputParameters &parameters)
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:91
bool _reinit_displaced_face
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::addJacobian ( SparseMatrix< Number > &  jacobian,
THREAD_ID  tid 
)
overridevirtual

Implements SubProblem.

Definition at line 1086 of file FEProblemBase.C.

Referenced by ComputeDiracThread::postElement().

1087 {
1088  _assembly[tid]->addJacobian(jacobian);
1090  _assembly[tid]->addJacobianNonlocal(jacobian);
1091  if (_displaced_problem)
1092  {
1093  _displaced_problem->addJacobian(jacobian, tid);
1095  _displaced_problem->addJacobianNonlocal(jacobian, tid);
1096  }
1097 }
bool _has_nonlocal_coupling
Indicates if nonlocal coupling is required/exists.
std::vector< Assembly * > _assembly
std::shared_ptr< DisplacedProblem > _displaced_problem
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 
)
overridevirtual

Implements SubProblem.

Definition at line 1152 of file FEProblemBase.C.

Referenced by ComputeJacobianBlocksThread::postElement().

1158 {
1159  _assembly[tid]->addJacobianBlock(jacobian, ivar, jvar, dof_map, dof_indices);
1161  if (_nonlocal_cm(ivar, jvar) != 0)
1162  {
1163  MooseVariable & jv = _nl->getVariable(tid, jvar);
1164  _assembly[tid]->addJacobianBlockNonlocal(
1165  jacobian, ivar, jvar, dof_map, dof_indices, jv.allDofIndices());
1166  }
1167 
1168  if (_displaced_problem)
1169  {
1170  _displaced_problem->addJacobianBlock(jacobian, ivar, jvar, dof_map, dof_indices, tid);
1172  if (_nonlocal_cm(ivar, jvar) != 0)
1173  {
1174  MooseVariable & jv = _nl->getVariable(tid, jvar);
1175  _displaced_problem->addJacobianBlockNonlocal(
1176  jacobian, ivar, jvar, dof_map, dof_indices, jv.allDofIndices(), tid);
1177  }
1178  }
1179 }
const std::vector< dof_id_type > & allDofIndices() const
Get all global dofindices for the variable.
Class for stuff related to variables.
Definition: MooseVariable.h:43
std::shared_ptr< NonlinearSystemBase > _nl
bool _has_nonlocal_coupling
Indicates if nonlocal coupling is required/exists.
std::vector< Assembly * > _assembly
DofMap & dof_map
std::shared_ptr< DisplacedProblem > _displaced_problem
CouplingMatrix _nonlocal_cm
Definition: SubProblem.h:420
void FEProblemBase::addJacobianNeighbor ( SparseMatrix< Number > &  jacobian,
THREAD_ID  tid 
)
overridevirtual

Implements SubProblem.

Definition at line 1100 of file FEProblemBase.C.

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

1101 {
1102  _assembly[tid]->addJacobianNeighbor(jacobian);
1103  if (_displaced_problem)
1104  _displaced_problem->addJacobianNeighbor(jacobian, tid);
1105 }
std::vector< Assembly * > _assembly
std::shared_ptr< DisplacedProblem > _displaced_problem
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 
)
overridevirtual

Implements SubProblem.

Definition at line 1182 of file FEProblemBase.C.

1189 {
1190  _assembly[tid]->addJacobianNeighbor(
1191  jacobian, ivar, jvar, dof_map, dof_indices, neighbor_dof_indices);
1192  if (_displaced_problem)
1193  _displaced_problem->addJacobianNeighbor(
1194  jacobian, ivar, jvar, dof_map, dof_indices, neighbor_dof_indices, tid);
1195 }
std::vector< Assembly * > _assembly
DofMap & dof_map
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::addJacobianOffDiagScalar ( SparseMatrix< Number > &  jacobian,
unsigned int  ivar,
THREAD_ID  tid = 0 
)
virtual

Definition at line 1114 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::computeScalarKernelsJacobians().

1117 {
1118  _assembly[tid]->addJacobianOffDiagScalar(jacobian, ivar);
1119 }
std::vector< Assembly * > _assembly
void FEProblemBase::addJacobianScalar ( SparseMatrix< Number > &  jacobian,
THREAD_ID  tid = 0 
)
virtual

Definition at line 1108 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::computeScalarKernelsJacobians().

1109 {
1110  _assembly[tid]->addJacobianScalar(jacobian);
1111 }
std::vector< Assembly * > _assembly
void FEProblemBase::addKernel ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)

Definition at line 1727 of file FEProblemBase.C.

1730 {
1731  setInputParametersFEProblem(parameters);
1732  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
1733  {
1734  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1735  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
1736  _reinit_displaced_elem = true;
1737  }
1738  else
1739  {
1740  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
1741  {
1742  // We allow Kernels to request that they use_displaced_mesh,
1743  // but then be overridden when no displacements variables are
1744  // provided in the Mesh block. If that happened, update the value
1745  // of use_displaced_mesh appropriately for this Kernel.
1746  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1747  parameters.set<bool>("use_displaced_mesh") = false;
1748  }
1749 
1750  parameters.set<SubProblem *>("_subproblem") = this;
1751  parameters.set<SystemBase *>("_sys") = _nl.get();
1752  }
1753 
1754  _nl->addKernel(kernel_name, name, parameters);
1755 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
bool _reinit_displaced_elem
virtual void setInputParametersFEProblem(InputParameters &parameters)
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:91
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::addMarker ( std::string  marker_name,
const std::string &  name,
InputParameters  parameters 
)

Definition at line 3088 of file FEProblemBase.C.

3091 {
3092  setInputParametersFEProblem(parameters);
3093  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
3094  {
3095  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
3096  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
3097  _reinit_displaced_elem = true;
3098  }
3099  else
3100  {
3101  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
3102  {
3103  // We allow Markers to request that they use_displaced_mesh,
3104  // but then be overridden when no displacements variables are
3105  // provided in the Mesh block. If that happened, update the value
3106  // of use_displaced_mesh appropriately for this Marker.
3107  if (parameters.have_parameter<bool>("use_displaced_mesh"))
3108  parameters.set<bool>("use_displaced_mesh") = false;
3109  }
3110 
3111  parameters.set<SubProblem *>("_subproblem") = this;
3112  parameters.set<SystemBase *>("_sys") = _aux.get();
3113  }
3114 
3115  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
3116  {
3117  std::shared_ptr<Marker> marker = _factory.create<Marker>(marker_name, name, parameters, tid);
3118  _markers.addObject(marker, tid);
3119  }
3120 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
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:46
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:418
virtual void setInputParametersFEProblem(InputParameters &parameters)
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Definition: Marker.h:42
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0)
Adds an object to the storage structure.
Base class for a system (of equations)
Definition: SystemBase.h:91
std::shared_ptr< AuxiliarySystem > _aux
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
std::shared_ptr< DisplacedProblem > _displaced_problem
MooseObjectWarehouse< Marker > _markers
unsigned int THREAD_ID
Definition: MooseTypes.h:79
void FEProblemBase::addMaterial ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)

Definition at line 2210 of file FEProblemBase.C.

2213 {
2214  setInputParametersFEProblem(parameters);
2215  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
2216  {
2217  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2218  _reinit_displaced_elem = true;
2219  }
2220  else
2221  {
2222  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
2223  {
2224  // We allow Materials to request that they use_displaced_mesh,
2225  // but then be overridden when no displacements variables are
2226  // provided in the Mesh block. If that happened, update the value
2227  // of use_displaced_mesh appropriately for this Material.
2228  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2229  parameters.set<bool>("use_displaced_mesh") = false;
2230  }
2231 
2232  parameters.set<SubProblem *>("_subproblem") = this;
2233  }
2234 
2235  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
2236  {
2237  // Create the general Block/Boundary Material object
2238  std::shared_ptr<Material> material = _factory.create<Material>(mat_name, name, parameters, tid);
2239  bool discrete = !material->getParam<bool>("compute");
2240 
2241  // If the object is boundary restricted do not create the neighbor and face objects
2242  if (material->boundaryRestricted())
2243  {
2244  _all_materials.addObject(material, tid);
2245  if (discrete)
2246  _discrete_materials.addObject(material, tid);
2247  else
2248  _materials.addObject(material, tid);
2249  }
2250 
2251  // Non-boundary restricted require face and neighbor objects
2252  else
2253  {
2254  // The name of the object being created, this is changed multiple times as objects are created
2255  // below
2256  std::string object_name;
2257 
2258  // Create a copy of the supplied parameters to the setting for "_material_data_type" isn't
2259  // used from a previous tid loop
2260  InputParameters current_parameters = parameters;
2261 
2262  // face material
2263  current_parameters.set<Moose::MaterialDataType>("_material_data_type") =
2265  object_name = name + "_face";
2266  std::shared_ptr<Material> face_material =
2267  _factory.create<Material>(mat_name, object_name, current_parameters, tid);
2268 
2269  // neighbor material
2270  current_parameters.set<Moose::MaterialDataType>("_material_data_type") =
2272  current_parameters.set<bool>("_neighbor") = true;
2273  object_name = name + "_neighbor";
2274  std::shared_ptr<Material> neighbor_material =
2275  _factory.create<Material>(mat_name, object_name, current_parameters, tid);
2276 
2277  // Store the material objects
2278  _all_materials.addObjects(material, neighbor_material, face_material, tid);
2279 
2280  if (discrete)
2281  _discrete_materials.addObjects(material, neighbor_material, face_material, tid);
2282  else
2283  _materials.addObjects(material, neighbor_material, face_material, tid);
2284 
2285  // link enabled parameter of face and neighbor materials
2286  MooseObjectParameterName name(MooseObjectName("Material", material->name()), "enabled");
2287  MooseObjectParameterName face_name(MooseObjectName("Material", face_material->name()),
2288  "enabled");
2289  MooseObjectParameterName neighbor_name(MooseObjectName("Material", neighbor_material->name()),
2290  "enabled");
2293  }
2294  }
2295 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
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:46
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:418
virtual void setInputParametersFEProblem(InputParameters &parameters)
InputParameterWarehouse & getInputParameterWarehouse()
Get the InputParameterWarehouse for MooseObjects.
Definition: MooseApp.C:1122
MaterialDataType
MaterialData types.
Definition: MooseTypes.h:129
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...
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0)
Adds an object to the storage structure.
void addControllableParameterConnection(const MooseObjectParameterName &master, const MooseObjectParameterName &slave)
Method for linking control parameters of different names.
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: MooseObject.h:122
Materials compute MaterialProperties.
Definition: Material.h:53
MaterialWarehouse _discrete_materials
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
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.
MaterialWarehouse _all_materials
unsigned int THREAD_ID
Definition: MooseTypes.h:79
MaterialWarehouse _materials
void FEProblemBase::addMultiApp ( const std::string &  multi_app_name,
const std::string &  name,
InputParameters  parameters 
)

Add a MultiApp to the problem.

Definition at line 3123 of file FEProblemBase.C.

3126 {
3127  setInputParametersFEProblem(parameters);
3128  parameters.set<MPI_Comm>("_mpi_comm") = _communicator.get();
3129  parameters.set<std::shared_ptr<CommandLine>>("_command_line") = _app.commandLine();
3130 
3131  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
3132  {
3133  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
3134  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
3135  _reinit_displaced_elem = true;
3136  }
3137  else
3138  {
3139  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
3140  {
3141  // We allow MultiApps to request that they use_displaced_mesh,
3142  // but then be overridden when no displacements variables are
3143  // provided in the Mesh block. If that happened, update the value
3144  // of use_displaced_mesh appropriately for this MultiApp.
3145  if (parameters.have_parameter<bool>("use_displaced_mesh"))
3146  parameters.set<bool>("use_displaced_mesh") = false;
3147  }
3148 
3149  parameters.set<SubProblem *>("_subproblem") = this;
3150  parameters.set<SystemBase *>("_sys") = _aux.get();
3151  }
3152 
3153  std::shared_ptr<MultiApp> multi_app = _factory.create<MultiApp>(multi_app_name, name, parameters);
3154 
3155  _multi_apps.addObject(multi_app);
3156 
3157  // Store TranseintMultiApp objects in another container, this is needed for calling computeDT
3158  std::shared_ptr<TransientMultiApp> trans_multi_app =
3159  std::dynamic_pointer_cast<TransientMultiApp>(multi_app);
3160  if (trans_multi_app)
3161  _transient_multi_apps.addObject(trans_multi_app);
3162 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
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:46
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:418
virtual void setInputParametersFEProblem(InputParameters &parameters)
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
MultiApp Implementation for Transient Apps.
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:91
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0)
Adds an object to the storage structure.
std::shared_ptr< CommandLine > commandLine()
Get the command line.
Definition: MooseApp.h:265
std::shared_ptr< AuxiliarySystem > _aux
ExecuteMooseObjectWarehouse< MultiApp > _multi_apps
MultiApp Warehouse.
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
std::shared_ptr< DisplacedProblem > _displaced_problem
A MultiApp represents one or more MOOSE applications that are running simultaneously.
Definition: MultiApp.h:59
void FEProblemBase::addNodalKernel ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)

Definition at line 1758 of file FEProblemBase.C.

1761 {
1762  setInputParametersFEProblem(parameters);
1763  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
1764  {
1765  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1766  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
1767  _reinit_displaced_elem = true;
1768  }
1769  else
1770  {
1771  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
1772  {
1773  // We allow NodalKernels to request that they use_displaced_mesh,
1774  // but then be overridden when no displacements variables are
1775  // provided in the Mesh block. If that happened, update the value
1776  // of use_displaced_mesh appropriately for this NodalKernel.
1777  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1778  parameters.set<bool>("use_displaced_mesh") = false;
1779  }
1780 
1781  parameters.set<SubProblem *>("_subproblem") = this;
1782  parameters.set<SystemBase *>("_sys") = _nl.get();
1783  }
1784  _nl->addNodalKernel(kernel_name, name, parameters);
1785 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
bool _reinit_displaced_elem
virtual void setInputParametersFEProblem(InputParameters &parameters)
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:91
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::addPostprocessor ( std::string  pp_name,
const std::string &  name,
InputParameters  parameters 
)
virtual

Definition at line 2509 of file FEProblemBase.C.

Referenced by Executioner::addAttributeReporter().

2512 {
2513  // Check for name collision
2515  mooseError(std::string("A UserObject with the name \"") + name +
2516  "\" already exists. You may not add a Postprocessor by the same name.");
2517 
2518  addUserObject(pp_name, name, parameters);
2520 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
bool hasActiveObject(const std::string &name, THREAD_ID tid=0) const
Convenience functions for checking/getting specific objects.
ExecuteMooseObjectWarehouse< UserObject > _all_user_objects
void initPostprocessorData(const std::string &name)
Initializes the postprocessor data.
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
virtual void addUserObject(std::string user_object_name, const std::string &name, InputParameters parameters)
void FEProblemBase::addPredictor ( const std::string &  type,
const std::string &  name,
InputParameters  parameters 
)
virtual

Definition at line 3943 of file FEProblemBase.C.

Referenced by AB2PredictorCorrector::AB2PredictorCorrector().

3946 {
3947  setInputParametersFEProblem(parameters);
3948  parameters.set<SubProblem *>("_subproblem") = this;
3949  std::shared_ptr<Predictor> predictor = _factory.create<Predictor>(type, name, parameters);
3950  _nl->setPredictor(predictor);
3951 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
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:46
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:418
virtual void setInputParametersFEProblem(InputParameters &parameters)
std::shared_ptr< NonlinearSystemBase > _nl
Base class for predictors.
Definition: Predictor.h:39
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
MatType type
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
void FEProblemBase::addResidual ( THREAD_ID  tid)
overridevirtual

Implements SubProblem.

Definition at line 1001 of file FEProblemBase.C.

Referenced by ComputeDiracThread::postElement().

1002 {
1003  if (_nl->hasResidualVector(Moose::KT_TIME))
1005  if (_nl->hasResidualVector(Moose::KT_NONTIME))
1007 
1008  if (_displaced_problem)
1009  _displaced_problem->addResidual(tid);
1010 }
virtual void addResidual(THREAD_ID tid) override
std::shared_ptr< NonlinearSystemBase > _nl
std::vector< Assembly * > _assembly
std::shared_ptr< DisplacedProblem > _displaced_problem
virtual NumericVector< Number > & residualVector(Moose::KernelType type)
void FEProblemBase::addResidualNeighbor ( THREAD_ID  tid)
overridevirtual

Implements SubProblem.

Definition at line 1013 of file FEProblemBase.C.

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

1014 {
1015  if (_nl->hasResidualVector(Moose::KT_TIME))
1017  if (_nl->hasResidualVector(Moose::KT_NONTIME))
1019  if (_displaced_problem)
1020  _displaced_problem->addResidualNeighbor(tid);
1021 }
virtual void addResidualNeighbor(THREAD_ID tid) override
std::shared_ptr< NonlinearSystemBase > _nl
std::vector< Assembly * > _assembly
std::shared_ptr< DisplacedProblem > _displaced_problem
virtual NumericVector< Number > & residualVector(Moose::KernelType type)
void FEProblemBase::addResidualScalar ( THREAD_ID  tid = 0)
virtual

Definition at line 1024 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::computeResidualInternal().

1025 {
1026  if (_nl->hasResidualVector(Moose::KT_TIME))
1028  if (_nl->hasResidualVector(Moose::KT_NONTIME))
1030 }
std::shared_ptr< NonlinearSystemBase > _nl
virtual void addResidualScalar(THREAD_ID tid=0)
std::vector< Assembly * > _assembly
virtual NumericVector< Number > & residualVector(Moose::KernelType type)
void FEProblemBase::addSampler ( std::string  type,
const std::string &  name,
InputParameters  parameters 
)
virtual

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

Definition at line 1640 of file FEProblemBase.C.

1641 {
1642  setInputParametersFEProblem(parameters);
1643  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
1644  {
1645  std::shared_ptr<Sampler> dist = _factory.create<Sampler>(type, name, parameters, tid);
1646  _samplers.addObject(dist, tid);
1647  }
1648 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
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:46
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:418
virtual void setInputParametersFEProblem(InputParameters &parameters)
This is the base class for Samplers.
Definition: Sampler.h:46
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0)
Adds an object to the storage structure.
ExecuteMooseObjectWarehouse< Sampler > _samplers
Samplers.
MatType type
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
unsigned int THREAD_ID
Definition: MooseTypes.h:79
void FEProblemBase::addScalarKernel ( const std::string &  kernel_name,
const std::string &  name,
InputParameters  parameters 
)

Definition at line 1788 of file FEProblemBase.C.

1791 {
1792  setInputParametersFEProblem(parameters);
1793  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
1794  {
1795  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
1796  parameters.set<SystemBase *>("_sys") = &_displaced_problem->nlSys();
1797  }
1798  else
1799  {
1800  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
1801  {
1802  // We allow ScalarKernels to request that they use_displaced_mesh,
1803  // but then be overridden when no displacements variables are
1804  // provided in the Mesh block. If that happened, update the value
1805  // of use_displaced_mesh appropriately for this ScalarKernel.
1806  if (parameters.have_parameter<bool>("use_displaced_mesh"))
1807  parameters.set<bool>("use_displaced_mesh") = false;
1808  }
1809 
1810  parameters.set<SubProblem *>("_subproblem") = this;
1811  parameters.set<SystemBase *>("_sys") = _nl.get();
1812  }
1813  _nl->addScalarKernel(kernel_name, name, parameters);
1814 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
virtual void setInputParametersFEProblem(InputParameters &parameters)
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:91
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::addScalarVariable ( const std::string &  var_name,
Order  order,
Real  scale_factor = 1.,
const std::set< SubdomainID > *const  active_subdomains = NULL 
)

Definition at line 1709 of file FEProblemBase.C.

1713 {
1714  if (order > _max_scalar_order)
1715  _max_scalar_order = order;
1716 
1717  FEType type(order, SCALAR);
1718  if (duplicateVariableCheck(var_name, type, /* is_aux = */ false))
1719  return;
1720 
1721  _nl->addScalarVariable(var_name, order, scale_factor, active_subdomains);
1722  if (_displaced_problem)
1723  _displaced_problem->addScalarVariable(var_name, order, scale_factor, active_subdomains);
1724 }
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
MatType type
std::shared_ptr< DisplacedProblem > _displaced_problem
Order _max_scalar_order
Maximum scalar variable order.
void FEProblemBase::addTimeIntegrator ( const std::string &  type,
const std::string &  name,
InputParameters  parameters 
)
virtual

Definition at line 3931 of file FEProblemBase.C.

Referenced by Transient::setupTimeIntegrator().

3934 {
3935  setInputParametersFEProblem(parameters);
3936  parameters.set<SubProblem *>("_subproblem") = this;
3937  _aux->addTimeIntegrator(type, name + ":aux", parameters);
3938  _nl->addTimeIntegrator(type, name, parameters);
3939  _has_time_integrator = true;
3940 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
virtual void setInputParametersFEProblem(InputParameters &parameters)
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)
std::shared_ptr< AuxiliarySystem > _aux
MatType type
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
void FEProblemBase::addTransfer ( const std::string &  transfer_name,
const std::string &  name,
InputParameters  parameters 
)

Add a Transfer to the problem.

Definition at line 3359 of file FEProblemBase.C.

3362 {
3363  setInputParametersFEProblem(parameters);
3364  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
3365  {
3366  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
3367  parameters.set<SystemBase *>("_sys") = &_displaced_problem->auxSys();
3368  _reinit_displaced_elem = true;
3369  }
3370  else
3371  {
3372  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
3373  {
3374  // We allow Transfers to request that they use_displaced_mesh,
3375  // but then be overridden when no displacements variables are
3376  // provided in the Mesh block. If that happened, update the value
3377  // of use_displaced_mesh appropriately for this Transfer.
3378  if (parameters.have_parameter<bool>("use_displaced_mesh"))
3379  parameters.set<bool>("use_displaced_mesh") = false;
3380  }
3381 
3382  parameters.set<SubProblem *>("_subproblem") = this;
3383  parameters.set<SystemBase *>("_sys") = _aux.get();
3384  }
3385 
3386  // Create the Transfer objects
3387  std::shared_ptr<Transfer> transfer = _factory.create<Transfer>(transfer_name, name, parameters);
3388 
3389  // Add MultiAppTransfer object
3390  std::shared_ptr<MultiAppTransfer> multi_app_transfer =
3391  std::dynamic_pointer_cast<MultiAppTransfer>(transfer);
3392  if (multi_app_transfer)
3393  {
3394  if (multi_app_transfer->direction() == MultiAppTransfer::TO_MULTIAPP)
3395  _to_multi_app_transfers.addObject(multi_app_transfer);
3396  else
3397  _from_multi_app_transfers.addObject(multi_app_transfer);
3398  }
3399  else
3400  _transfers.addObject(transfer);
3401 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
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:46
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:418
virtual void setInputParametersFEProblem(InputParameters &parameters)
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
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:91
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0)
Adds an object to the storage structure.
ExecuteMooseObjectWarehouse< Transfer > _transfers
Normal Transfers.
ExecuteMooseObjectWarehouse< Transfer > _to_multi_app_transfers
Transfers executed just before MultiApps to transfer data to them.
std::shared_ptr< AuxiliarySystem > _aux
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
Base class for all MultiAppTransfer objects.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
std::shared_ptr< DisplacedProblem > _displaced_problem
Base class for all Transfer objects.
Definition: Transfer.h:46
void FEProblemBase::addUserObject ( std::string  user_object_name,
const std::string &  name,
InputParameters  parameters 
)
virtual

Definition at line 2536 of file FEProblemBase.C.

Referenced by addPostprocessor(), and addVectorPostprocessor().

2539 {
2540  setInputParametersFEProblem(parameters);
2541  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
2542  parameters.set<SubProblem *>("_subproblem") = _displaced_problem.get();
2543  else
2544  {
2545  if (_displaced_problem == NULL && parameters.get<bool>("use_displaced_mesh"))
2546  {
2547  // We allow UserObjects to request that they use_displaced_mesh,
2548  // but then be overridden when no displacements variables are
2549  // provided in the Mesh block. If that happened, update the value
2550  // of use_displaced_mesh appropriately for this UserObject.
2551  if (parameters.have_parameter<bool>("use_displaced_mesh"))
2552  parameters.set<bool>("use_displaced_mesh") = false;
2553  }
2554 
2555  parameters.set<SubProblem *>("_subproblem") = this;
2556  }
2557 
2558  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
2559  {
2560  // Create the UserObject
2561  std::shared_ptr<UserObject> user_object =
2562  _factory.create<UserObject>(user_object_name, name, parameters, tid);
2563  _all_user_objects.addObject(user_object, tid);
2564 
2565  // Attempt to create all the possible UserObject types
2566  std::shared_ptr<ElementUserObject> euo =
2567  std::dynamic_pointer_cast<ElementUserObject>(user_object);
2568  std::shared_ptr<SideUserObject> suo = std::dynamic_pointer_cast<SideUserObject>(user_object);
2569  std::shared_ptr<InternalSideUserObject> isuo =
2570  std::dynamic_pointer_cast<InternalSideUserObject>(user_object);
2571  std::shared_ptr<NodalUserObject> nuo = std::dynamic_pointer_cast<NodalUserObject>(user_object);
2572  std::shared_ptr<GeneralUserObject> guo =
2573  std::dynamic_pointer_cast<GeneralUserObject>(user_object);
2574 
2575  // Account for displaced mesh use
2576  if (_displaced_problem != NULL && parameters.get<bool>("use_displaced_mesh"))
2577  {
2578  if (euo || nuo)
2579  _reinit_displaced_elem = true;
2580  else if (suo)
2581  _reinit_displaced_face = true;
2582  }
2583 
2584  // Add the object to the correct warehouse
2585  if (guo)
2586  {
2588  break; // not threaded
2589  }
2590  else if (nuo)
2591  _nodal_user_objects.addObject(nuo, tid);
2592  else if (suo)
2593  _side_user_objects.addObject(suo, tid);
2594  else if (isuo)
2596  else if (euo)
2598  }
2599 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
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:46
Factory & _factory
The Factory for building objects.
Definition: SubProblem.h:418
virtual void setInputParametersFEProblem(InputParameters &parameters)
AuxGroupExecuteMooseObjectWarehouse< NodalUserObject > _nodal_user_objects
AuxGroupExecuteMooseObjectWarehouse< ElementUserObject > _elemental_user_objects
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
ExecuteMooseObjectWarehouse< UserObject > _all_user_objects
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0)
Adds an object to the storage structure.
A user object that runs over all the nodes and does an aggregation step to compute a single value...
bool _reinit_displaced_face
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
AuxGroupExecuteMooseObjectWarehouse< SideUserObject > _side_user_objects
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
std::shared_ptr< DisplacedProblem > _displaced_problem
AuxGroupExecuteMooseObjectWarehouse< InternalSideUserObject > _internal_side_user_objects
Base class for user-specific data.
Definition: UserObject.h:42
AuxGroupExecuteMooseObjectWarehouse< GeneralUserObject > _general_user_objects
unsigned int THREAD_ID
Definition: MooseTypes.h:79
void FEProblemBase::addVariable ( const std::string &  var_name,
const FEType &  type,
Real  scale_factor,
const std::set< SubdomainID > *const  active_subdomains = NULL 
)

Definition at line 1695 of file FEProblemBase.C.

1699 {
1700  if (duplicateVariableCheck(var_name, type, /* is_aux = */ false))
1701  return;
1702 
1703  _nl->addVariable(var_name, type, scale_factor, active_subdomains);
1704  if (_displaced_problem)
1705  _displaced_problem->addVariable(var_name, type, scale_factor, active_subdomains);
1706 }
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
MatType type
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::addVectorPostprocessor ( std::string  pp_name,
const std::string &  name,
InputParameters  parameters 
)
virtual

Definition at line 2523 of file FEProblemBase.C.

2526 {
2527  // Check for name collision
2529  mooseError(std::string("A UserObject with the name \"") + name +
2530  "\" already exists. You may not add a VectorPostprocessor by the same name.");
2531 
2532  addUserObject(pp_name, name, parameters);
2533 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
bool hasActiveObject(const std::string &name, THREAD_ID tid=0) const
Convenience functions for checking/getting specific objects.
ExecuteMooseObjectWarehouse< UserObject > _all_user_objects
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
virtual void addUserObject(std::string user_object_name, const std::string &name, InputParameters parameters)
void FEProblemBase::advanceMultiApps ( ExecFlagType  type)

Advance the MultiApps associated with the ExecFlagType.

Definition at line 3273 of file FEProblemBase.C.

Referenced by Transient::incrementStepOrReject().

3274 {
3275  const auto & multi_apps = _multi_apps[type].getActiveObjects();
3276 
3277  if (multi_apps.size())
3278  {
3279  _console << COLOR_CYAN << "\nAdvancing MultiApps" << COLOR_DEFAULT << std::endl;
3280 
3281  for (const auto & multi_app : multi_apps)
3282  multi_app->advanceStep();
3283 
3284  _console << "Waiting For Other Processors To Finish" << std::endl;
3285  MooseUtils::parallelBarrierNotify(_communicator);
3286 
3287  _console << COLOR_CYAN << "Finished Advancing MultiApps\n" << COLOR_DEFAULT << std::endl;
3288  }
3289 }
ExecuteMooseObjectWarehouse< MultiApp > _multi_apps
MultiApp Warehouse.
MatType type
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
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)
This function implements a parallel barrier function but writes progress to stdout.
void FEProblemBase::advanceState ( )
virtual

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

Definition at line 3846 of file FEProblemBase.C.

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

3847 {
3848  _nl->copyOldSolutions();
3849  _aux->copyOldSolutions();
3850 
3851  if (_displaced_problem != NULL)
3852  {
3853  _displaced_problem->nlSys().copyOldSolutions();
3854  _displaced_problem->auxSys().copyOldSolutions();
3855  }
3856 
3858 
3861 
3864 }
void shift()
Shift the material properties in time.
MaterialPropertyStorage & _bnd_material_props
std::shared_ptr< NonlinearSystemBase > _nl
PostprocessorData _pps_data
std::shared_ptr< AuxiliarySystem > _aux
void copyValuesBack()
Copy the current Postprocessor values into old (i.e.
std::shared_ptr< DisplacedProblem > _displaced_problem
MaterialPropertyStorage & _material_props
void FEProblemBase::allowOutput ( bool  state)

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

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

3902 {
3904 }
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:108
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:841
template<typename T >
void FEProblemBase::allowOutput ( bool  state)

Definition at line 1553 of file FEProblemBase.h.

1554 {
1555  _app.getOutputWarehouse().allowOutput<T>(state);
1556 }
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:108
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:841
bool FEProblemBase::areCoupled ( unsigned int  ivar,
unsigned int  jvar 
)

Definition at line 3631 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::constraintJacobians().

3632 {
3633  return (*_cm)(ivar, jvar);
3634 }
std::unique_ptr< CouplingMatrix > _cm
Coupling matrix for variables.
virtual Assembly& FEProblemBase::assembly ( THREAD_ID  tid)
inlineoverridevirtual
void FEProblemBase::backupMultiApps ( ExecFlagType  type)

Backup the MultiApps associated with the ExecFlagType.

Definition at line 3292 of file FEProblemBase.C.

Referenced by initialSetup(), and Transient::takeStep().

3293 {
3294  const auto & multi_apps = _multi_apps[type].getActiveObjects();
3295 
3296  if (multi_apps.size())
3297  {
3298  _console << COLOR_CYAN << "\nBacking Up MultiApps" << COLOR_DEFAULT << std::endl;
3299 
3300  for (const auto & multi_app : multi_apps)
3301  multi_app->backup();
3302 
3303  _console << "Waiting For Other Processors To Finish" << std::endl;
3304  MooseUtils::parallelBarrierNotify(_communicator);
3305 
3306  _console << COLOR_CYAN << "Finished Backing Up MultiApps\n" << COLOR_DEFAULT << std::endl;
3307  }
3308 }
ExecuteMooseObjectWarehouse< MultiApp > _multi_apps
MultiApp Warehouse.
MatType type
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
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)
This function implements a parallel barrier function but writes progress to stdout.
void FEProblemBase::cacheJacobian ( THREAD_ID  tid)
overridevirtual

Implements SubProblem.

Definition at line 1122 of file FEProblemBase.C.

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

1123 {
1124  _assembly[tid]->cacheJacobian();
1126  _assembly[tid]->cacheJacobianNonlocal();
1127  if (_displaced_problem)
1128  {
1129  _displaced_problem->cacheJacobian(tid);
1131  _displaced_problem->cacheJacobianNonlocal(tid);
1132  }
1133 }
bool _has_nonlocal_coupling
Indicates if nonlocal coupling is required/exists.
std::vector< Assembly * > _assembly
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::cacheJacobianNeighbor ( THREAD_ID  tid)
overridevirtual

Implements SubProblem.

Definition at line 1136 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::constraintJacobians().

1137 {
1138  _assembly[tid]->cacheJacobianNeighbor();
1139  if (_displaced_problem)
1140  _displaced_problem->cacheJacobianNeighbor(tid);
1141 }
std::vector< Assembly * > _assembly
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::cacheResidual ( THREAD_ID  tid)
overridevirtual

Implements SubProblem.

Definition at line 1033 of file FEProblemBase.C.

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

1034 {
1035  _assembly[tid]->cacheResidual();
1036  if (_displaced_problem)
1037  _displaced_problem->cacheResidual(tid);
1038 }
std::vector< Assembly * > _assembly
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::cacheResidualNeighbor ( THREAD_ID  tid)
overridevirtual

Implements SubProblem.

Definition at line 1041 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::constraintResiduals().

1042 {
1043  _assembly[tid]->cacheResidualNeighbor();
1044  if (_displaced_problem)
1045  _displaced_problem->cacheResidualNeighbor(tid);
1046 }
std::vector< Assembly * > _assembly
std::shared_ptr< DisplacedProblem > _displaced_problem
void SubProblem::checkBlockMatProps ( )
virtualinherited

Checks block material properties integrity.

See also
FEProblemBase::checkProblemIntegrity

Definition at line 269 of file SubProblem.C.

Referenced by checkProblemIntegrity().

270 {
273 }
void checkMatProps(std::map< T, std::set< std::string >> &props, std::map< T, std::multimap< std::string, std::string >> &check_props, std::map< T, std::set< MaterialPropertyName >> &zero_props)
Helper method for performing material property checks.
Definition: SubProblem.C:358
std::map< SubdomainID, std::set< MaterialPropertyName > > _zero_block_material_props
Set of properties returned as zero properties.
Definition: SubProblem.h:434
std::map< SubdomainID, std::multimap< std::string, std::string > > _map_block_material_props_check
Data structures of the requested material properties.
Definition: SubProblem.h:446
std::map< SubdomainID, std::set< std::string > > _map_block_material_props
Map of material properties (block_id -> list of properties)
Definition: SubProblem.h:428
void SubProblem::checkBoundaryMatProps ( )
virtualinherited

Checks boundary material properties integrity.

See also
FEProblemBase::checkProblemIntegrity

Definition at line 276 of file SubProblem.C.

Referenced by checkProblemIntegrity().

277 {
281 }
std::map< BoundaryID, std::multimap< std::string, std::string > > _map_boundary_material_props_check
Definition: SubProblem.h:447
std::map< BoundaryID, std::set< MaterialPropertyName > > _zero_boundary_material_props
Definition: SubProblem.h:435
std::map< BoundaryID, std::set< std::string > > _map_boundary_material_props
Map for boundary material properties (boundary_id -> list of properties)
Definition: SubProblem.h:431
void checkMatProps(std::map< T, std::set< std::string >> &props, std::map< T, std::multimap< std::string, std::string >> &check_props, std::map< T, std::set< MaterialPropertyName >> &zero_props)
Helper method for performing material property checks.
Definition: SubProblem.C:358
void FEProblemBase::checkCoordinateSystems ( )
protected

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

Definition at line 4912 of file FEProblemBase.C.

Referenced by checkProblemIntegrity().

4913 {
4914  for (const auto & elem : _mesh.getMesh().element_ptr_range())
4915  {
4916  SubdomainID sid = elem->subdomain_id();
4917  if (_coord_sys[sid] == Moose::COORD_RZ && elem->dim() == 3)
4918  mooseError("An RZ coordinate system was requested for subdomain " + Moose::stringify(sid) +
4919  " which contains 3D elements.");
4920  if (_coord_sys[sid] == Moose::COORD_RSPHERICAL && elem->dim() > 1)
4921  mooseError("An RSPHERICAL coordinate system was requested for subdomain " +
4922  Moose::stringify(sid) + " which contains 2D or 3D elements.");
4923  }
4924 }
std::map< SubdomainID, Moose::CoordinateSystemType > _coord_sys
nonlocal coupling matrix;
Definition: SubProblem.h:423
subdomain_id_type SubdomainID
Definition: MooseTypes.h:77
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2355
MooseMesh & _mesh
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:66
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
void FEProblemBase::checkDependMaterialsHelper ( const std::map< SubdomainID, std::vector< std::shared_ptr< Material >>> &  materials_map)
protected

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

Referenced by checkProblemIntegrity().

4801 {
4802  auto & prop_names = _material_props.statefulPropNames();
4803 
4804  for (const auto & it : materials_map)
4805  {
4807  std::set<std::string> block_depend_props, block_supplied_props;
4808 
4809  for (const auto & mat1 : it.second)
4810  {
4811  const std::set<std::string> & depend_props = mat1->getRequestedItems();
4812  block_depend_props.insert(depend_props.begin(), depend_props.end());
4813 
4814  auto & alldeps = mat1->getMatPropDependencies(); // includes requested stateful props
4815  for (auto & dep : alldeps)
4816  {
4817  if (prop_names.count(dep) > 0)
4818  block_depend_props.insert(prop_names.at(dep));
4819  }
4820 
4821  // See if any of the active materials supply this property
4822  for (const auto & mat2 : it.second)
4823  {
4824  const std::set<std::string> & supplied_props = mat2->Material::getSuppliedItems();
4825  block_supplied_props.insert(supplied_props.begin(), supplied_props.end());
4826  }
4827  }
4828 
4829  // Add zero material properties specific to this block and unrestricted
4830  block_supplied_props.insert(_zero_block_material_props[it.first].begin(),
4831  _zero_block_material_props[it.first].end());
4832  block_supplied_props.insert(_zero_block_material_props[Moose::ANY_BLOCK_ID].begin(),
4834 
4835  // Error check to make sure all properties consumed by materials are supplied on this block
4836  std::set<std::string> difference;
4837  std::set_difference(block_depend_props.begin(),
4838  block_depend_props.end(),
4839  block_supplied_props.begin(),
4840  block_supplied_props.end(),
4841  std::inserter(difference, difference.end()));
4842 
4843  if (!difference.empty())
4844  {
4845  std::ostringstream oss;
4846  oss << "One or more Material Properties were not supplied on block " << it.first << ":\n";
4847  for (const auto & name : difference)
4848  oss << name << "\n";
4849  mooseError(oss.str());
4850  }
4851  }
4852 
4853  // This loop checks that materials are not supplied by multiple Material objects
4854  for (const auto & it : materials_map)
4855  {
4856  const auto & materials = it.second;
4857  std::set<std::string> inner_supplied, outer_supplied;
4858 
4859  for (const auto & outer_mat : materials)
4860  {
4861  // Storage for properties for this material (outer) and all other materials (inner)
4862  outer_supplied = outer_mat->getSuppliedItems();
4863  inner_supplied.clear();
4864 
4865  // Property to material map for error reporting
4866  std::map<std::string, std::set<std::string>> prop_to_mat;
4867  for (const auto & name : outer_supplied)
4868  prop_to_mat[name].insert(outer_mat->name());
4869 
4870  for (const auto & inner_mat : materials)
4871  {
4872  if (outer_mat == inner_mat)
4873  continue;
4874  inner_supplied.insert(inner_mat->getSuppliedItems().begin(),
4875  inner_mat->getSuppliedItems().end());
4876 
4877  for (const auto & inner_supplied_name : inner_supplied)
4878  prop_to_mat[inner_supplied_name].insert(inner_mat->name());
4879  }
4880 
4881  // Test that a property isn't supplied on multiple blocks
4882  std::set<std::string> intersection;
4883  std::set_intersection(outer_supplied.begin(),
4884  outer_supplied.end(),
4885  inner_supplied.begin(),
4886  inner_supplied.end(),
4887  std::inserter(intersection, intersection.end()));
4888 
4889  if (!intersection.empty())
4890  {
4891  std::ostringstream oss;
4892  oss << "The following material properties are declared on block " << it.first
4893  << " by multiple materials:\n";
4894  oss << ConsoleUtils::indent(2) << std::setw(30) << std::left << "Material Property"
4895  << "Material Objects\n";
4896  for (const auto & outer_name : intersection)
4897  {
4898  oss << ConsoleUtils::indent(2) << std::setw(30) << std::left << outer_name;
4899  for (const auto & inner_name : prop_to_mat[outer_name])
4900  oss << inner_name << " ";
4901  oss << '\n';
4902  }
4903 
4904  mooseError(oss.str());
4905  break;
4906  }
4907  }
4908  }
4909 }
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:47
std::string indent(unsigned int spaces)
Create empty string for indenting.
Definition: ConsoleUtils.C:34
const std::map< unsigned int, std::string > statefulPropNames() const
const SubdomainID ANY_BLOCK_ID
Definition: MooseTypes.h:117
std::map< SubdomainID, std::set< MaterialPropertyName > > _zero_block_material_props
Set of properties returned as zero properties.
Definition: SubProblem.h:434
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
MaterialPropertyStorage & _material_props
void FEProblemBase::checkDisplacementOrders ( )
protected

Verify that SECOND order mesh uses SECOND order displacements.

Definition at line 4719 of file FEProblemBase.C.

Referenced by checkProblemIntegrity().

4720 {
4721  if (_displaced_problem)
4722  {
4723  MeshBase::const_element_iterator it = _displaced_mesh->activeLocalElementsBegin(),
4725 
4726  bool mesh_has_second_order_elements = false;
4727  for (; it != end; ++it)
4728  {
4729  if ((*it)->default_order() == SECOND)
4730  {
4731  mesh_has_second_order_elements = true;
4732  break;
4733  }
4734  }
4735 
4736  // We checked our local elements, so take the max over all processors.
4737  _displaced_mesh->comm().max(mesh_has_second_order_elements);
4738 
4739  // If the Mesh has second order elements, make sure the
4740  // displacement variables are second-order.
4741  if (mesh_has_second_order_elements)
4742  {
4743  const std::vector<std::string> & displacement_variables =
4744  _displaced_problem->getDisplacementVarNames();
4745 
4746  for (const auto & var_name : displacement_variables)
4747  {
4748  MooseVariable & mv = _displaced_problem->getVariable(/*tid=*/0, var_name);
4749  if (mv.order() != SECOND)
4750  mooseError("Error: mesh has SECOND order elements, so all displacement variables must be "
4751  "SECOND order.");
4752  }
4753  }
4754  }
4755 }
MeshBase::const_element_iterator activeLocalElementsBegin()
Calls active_local_nodes_begin/end() on the underlying libMesh mesh object.
Definition: MooseMesh.C:2012
Class for stuff related to variables.
Definition: MooseVariable.h:43
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
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
const MeshBase::const_element_iterator activeLocalElementsEnd()
Definition: MooseMesh.C:2018
MooseMesh * _displaced_mesh
void FEProblemBase::checkExceptionAndStopSolve ( )
virtual

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

Referenced by computeBounds().

3773 {
3774  // See if any processor had an exception. If it did, get back the
3775  // processor that the exception occurred on.
3776  unsigned int processor_id;
3777 
3778  _communicator.maxloc(_has_exception, processor_id);
3779 
3780  if (_has_exception)
3781  {
3782  _communicator.broadcast(_exception_message, processor_id);
3783 
3784  // Print the message
3785  if (_communicator.rank() == 0)
3786  Moose::err << _exception_message << std::endl;
3787 
3788  // Stop the solve -- this entails setting
3789  // SNESSetFunctionDomainError() or directly inserting NaNs in the
3790  // residual vector to let PETSc >= 3.6 return DIVERGED_NANORINF.
3791  _nl->stopSolve();
3792 
3793  // We've handled this exception, so we no longer have one.
3794  _has_exception = false;
3795 
3796  // Force the next linear convergence check to fail.
3798 
3799  // Repropagate the exception, so it can be caught at a higher level, typically
3800  // this is NonlinearSystem::computeResidual().
3802  }
3803 }
std::shared_ptr< NonlinearSystemBase > _nl
bool _has_exception
Whether or not an exception has occurred.
std::string _exception_message
The error message to go with an exception.
Provides a way for users to bail out of the current solve.
bool _fail_next_linear_convergence_check
MooseLinearConvergenceReason FEProblemBase::checkLinearConvergence ( std::string &  msg,
const PetscInt  n,
const Real  rnorm,
const Real  rtol,
const Real  atol,
const Real  dtol,
const PetscInt  maxits 
)
virtual

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

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

5042 {
5044  {
5045  // Unset the flag
5047  return MOOSE_DIVERGED_NANORINF;
5048  }
5049 
5050  // We initialize the reason to something that basically means MOOSE
5051  // has not made a decision on convergence yet.
5053 
5054  // Get a reference to our Nonlinear System
5056 
5057  // If it's the beginning of a new set of iterations, reset
5058  // last_rnorm, otherwise record the most recent linear residual norm
5059  // in the NonlinearSystem.
5060  if (n == 0)
5061  system._last_rnorm = 1e99;
5062  else
5063  system._last_rnorm = rnorm;
5064 
5065  // If the linear residual norm is less than the System's linear absolute
5066  // step tolerance, we consider it to be converged and set the reason as
5067  // MOOSE_CONVERGED_RTOL.
5068  if (std::abs(rnorm - system._last_rnorm) < system._l_abs_step_tol)
5069  reason = MOOSE_CONVERGED_RTOL;
5070 
5071  // If we hit max its, then we consider that converged (rather than
5072  // KSP_DIVERGED_ITS).
5073  if (n >= maxits)
5074  reason = MOOSE_CONVERGED_ITS;
5075 
5076  // If either of our convergence criteria is met, store the number of linear
5077  // iterations in the System.
5078  if (reason == MOOSE_CONVERGED_ITS || reason == MOOSE_CONVERGED_RTOL)
5079  system._current_l_its.push_back(static_cast<unsigned int>(n));
5080 
5081  return reason;
5082 }
NonlinearSystemBase & getNonlinearSystemBase()
Nonlinear system to be solved.
MooseLinearConvergenceReason
nl system()
std::vector< unsigned int > _current_l_its
PetscInt n
bool _fail_next_linear_convergence_check
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 Real  initial_residual_before_preset_bcs,
const Real  div_threshold 
)
virtual

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

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

4969 {
4972 
4973  // This is the first residual before any iterations have been done,
4974  // but after PresetBCs (if any) have been imposed on the solution
4975  // vector. We save it, and use it to detect convergence if
4976  // compute_initial_residual_before_preset_bcs=false.
4977  if (it == 0)
4978  system._initial_residual_after_preset_bcs = fnorm;
4979 
4980  std::ostringstream oss;
4981  if (fnorm != fnorm)
4982  {
4983  oss << "Failed to converge, function norm is NaN\n";
4984  reason = MOOSE_DIVERGED_FNORM_NAN;
4985  }
4986  else if (fnorm < abstol)
4987  {
4988  oss << "Converged due to function norm " << fnorm << " < " << abstol << '\n';
4989  reason = MOOSE_CONVERGED_FNORM_ABS;
4990  }
4991  else if (nfuncs >= max_funcs)
4992  {
4993  oss << "Exceeded maximum number of function evaluations: " << nfuncs << " > " << max_funcs
4994  << '\n';
4996  }
4997  else if (it && fnorm > system._last_nl_rnorm && fnorm >= div_threshold)
4998  {
4999  oss << "Nonlinear solve was blowing up!\n";
5000  reason = MOOSE_DIVERGED_LINE_SEARCH;
5001  }
5002 
5003  if (it && !reason)
5004  {
5005  // If compute_initial_residual_before_preset_bcs==false, then use the
5006  // first residual computed by Petsc to determine convergence.
5007  Real the_residual = system._compute_initial_residual_before_preset_bcs
5008  ? initial_residual_before_preset_bcs
5010  if (fnorm <= the_residual * rtol)
5011  {
5012  oss << "Converged due to function norm " << fnorm << " < "
5013  << " (relative tolerance)\n";
5015  }
5016  else if (snorm < stol * xnorm)
5017  {
5018  oss << "Converged due to small update length: " << snorm << " < " << stol << " * " << xnorm
5019  << '\n';
5021  }
5022  }
5023 
5024  system._last_nl_rnorm = fnorm;
5025  system._current_nl_its = static_cast<unsigned int>(it);
5026 
5027  msg = oss.str();
5028  if (_app.multiAppLevel() > 0)
5030 
5031  return (reason);
5032 }
NonlinearSystemBase & getNonlinearSystemBase()
unsigned int multiAppLevel() const
The MultiApp Level.
Definition: MooseApp.h:465
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:438
const std::string & name() const
Get the name of the object.
Definition: MooseApp.h:70
Nonlinear system to be solved.
nl system()
MooseNonlinearConvergenceReason
Definition: FEProblemBase.h:89
bool _compute_initial_residual_before_preset_bcs
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
void FEProblemBase::checkNonlocalCoupling ( )
Returns
Flag indicating nonlocal coupling exists or not.

Definition at line 815 of file FEProblemBase.C.

Referenced by initialSetup().

816 {
817  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
818  {
819  const KernelWarehouse & all_kernels = _nl->getKernelWarehouse();
820  const auto & kernels = all_kernels.getObjects(tid);
821  for (const auto & kernel : kernels)
822  {
823  std::shared_ptr<NonlocalKernel> nonlocal_kernel =
824  std::dynamic_pointer_cast<NonlocalKernel>(kernel);
825  if (nonlocal_kernel)
826  {
829  _nonlocal_kernels.addObject(kernel, tid);
830  }
831  }
832  const MooseObjectWarehouse<IntegratedBC> & all_integrated_bcs = _nl->getIntegratedBCWarehouse();
833  const auto & integrated_bcs = all_integrated_bcs.getObjects(tid);
834  for (const auto & integrated_bc : integrated_bcs)
835  {
836  std::shared_ptr<NonlocalIntegratedBC> nonlocal_integrated_bc =
837  std::dynamic_pointer_cast<NonlocalIntegratedBC>(integrated_bc);
838  if (nonlocal_integrated_bc)
839  {
842  _nonlocal_integrated_bcs.addObject(integrated_bc, tid);
843  }
844  }
845  }
846 }
bool _requires_nonlocal_coupling
nonlocal coupling requirement flag
Definition: SubProblem.h:461
std::shared_ptr< NonlinearSystemBase > _nl
NonlocalIntegratedBC is used for solving integral terms in integro-differential equations.
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0)
Adds an object to the storage structure.
bool _calculate_jacobian_in_uo
MooseObjectWarehouse< IntegratedBC > _nonlocal_integrated_bcs
nonlocal integrated_bcs
Holds kernels and provides some services.
NonlocalKernel is used for solving integral terms in integro-differential equations.
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...
unsigned int THREAD_ID
Definition: MooseTypes.h:79
MooseObjectWarehouse< KernelBase > _nonlocal_kernels
nonlocal kernels
virtual bool SubProblem::checkNonlocalCouplingRequirement ( )
inlinevirtualinherited
void FEProblemBase::checkProblemIntegrity ( )
virtual

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 in EigenProblem.

Definition at line 4621 of file FEProblemBase.C.

Referenced by EigenProblem::checkProblemIntegrity().

4622 {
4623  // Check for unsatisfied actions
4624  const std::set<SubdomainID> & mesh_subdomains = _mesh.meshSubdomains();
4625 
4626  // Check kernel coverage of subdomains (blocks) in the mesh
4628  _nl->checkKernelCoverage(mesh_subdomains);
4629 
4630  // Check materials
4631  {
4632 #ifdef LIBMESH_ENABLE_AMR
4633  if (_adaptivity.isOn() &&
4635  {
4636  _console << "Using EXPERIMENTAL Stateful Material Property projection with Adaptivity!\n";
4637 
4638  if (n_processors() > 1)
4639  {
4640  if (_mesh.uniformRefineLevel() > 0 && _mesh.getMesh().skip_partitioning() == false)
4641  mooseError("This simulation is using uniform refinement on the mesh, with stateful "
4642  "properties and adaptivity. "
4643  "You must skip partitioning to run this case:\nMesh/skip_partitioning=true");
4644 
4645  _console << "\nWarning! Mesh re-partitioning is disabled while using stateful material "
4646  "properties! This can lead to large load imbalances and degraded "
4647  "performance!!\n\n";
4648  _mesh.getMesh().skip_partitioning(true);
4649 
4650  _mesh.errorIfDistributedMesh("StatefulMaterials + Adaptivity");
4651 
4652  if (_displaced_problem)
4653  _displaced_problem->mesh().getMesh().skip_partitioning(true);
4654  }
4655  }
4656 #endif
4657 
4658  std::set<SubdomainID> local_mesh_subs(mesh_subdomains);
4659 
4661  {
4666  bool check_material_coverage = false;
4667  std::set<SubdomainID> ids = _all_materials.getActiveBlocks();
4668  for (const auto & id : ids)
4669  {
4670  local_mesh_subs.erase(id);
4671  check_material_coverage = true;
4672  }
4673 
4674  // also exclude mortar spaces from the material check
4675  auto & mortar_ifaces = _mesh.getMortarInterfaces();
4676  for (const auto & mortar_iface : mortar_ifaces)
4677  local_mesh_subs.erase(mortar_iface->_id);
4678 
4679  // Check Material Coverage
4680  if (check_material_coverage && !local_mesh_subs.empty())
4681  {
4682  std::stringstream extra_subdomain_ids;
4684  std::copy(local_mesh_subs.begin(),
4685  local_mesh_subs.end(),
4686  std::ostream_iterator<unsigned int>(extra_subdomain_ids, " "));
4687 
4688  mooseError("The following blocks from your input mesh do not contain an active material: " +
4689  extra_subdomain_ids.str() + "\nWhen ANY mesh block contains a Material object, "
4690  "all blocks must contain a Material object.\n");
4691  }
4692  }
4693 
4694  // Check material properties on blocks and boundaries
4697 
4698  // Check that material properties exist when requested by other properties on a given block
4699  const auto & materials = _all_materials.getActiveObjects();
4700  for (const auto & material : materials)
4701  material->checkStatefulSanity();
4702 
4704  }
4705 
4706  // Check UserObjects and Postprocessors
4707  checkUserObjects();
4708 
4709  // Verify that we don't have any Element type/Coordinate Type conflicts
4711 
4712  // If using displacements, verify that the order of the displacement
4713  // variables matches the order of the elements in the displaced
4714  // mesh.
4716 }
MaterialPropertyStorage & _bnd_material_props
std::shared_ptr< NonlinearSystemBase > _nl
const std::set< SubdomainID > & meshSubdomains() const
Returns a read-only reference to the set of subdomains currently present in the Mesh.
Definition: MooseMesh.C:2104
void errorIfDistributedMesh(std::string name) const
Generate a unified error message if the underlying libMesh mesh is a DistributedMesh.
Definition: MooseMesh.C:2473
bool isOn()
Is adaptivity on?
Definition: Adaptivity.h:168
virtual void checkBoundaryMatProps()
Checks boundary material properties integrity.
Definition: SubProblem.C:276
std::vector< std::unique_ptr< MooseMesh::MortarInterface > > & getMortarInterfaces()
Definition: MooseMesh.h:777
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
Definition: MooseMesh.C:2355
void checkUserObjects()
void checkDisplacementOrders()
Verify that SECOND order mesh uses SECOND order displacements.
void checkDependMaterialsHelper(const std::map< SubdomainID, std::vector< std::shared_ptr< Material >>> &materials_map)
Helper method for checking Material object dependency.
MooseMesh & _mesh
virtual void checkBlockMatProps()
Checks block material properties integrity.
Definition: SubProblem.C:269
Adaptivity _adaptivity
unsigned int uniformRefineLevel() const
Returns the level of uniform refinement requested (zero if AMR is disabled).
Definition: MooseMesh.C:2149
bool _kernel_coverage_check
Determines whether a check to verify an active kernel on every subdomain.
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
bool _solve
Whether or not to actually solve the nonlinear system.
std::set< SubdomainID > getActiveBlocks(THREAD_ID tid=0) const
Return a set of active SubdomainsIDs.
std::shared_ptr< DisplacedProblem > _displaced_problem
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
MaterialPropertyStorage & _material_props
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...
bool _material_coverage_check
Determines whether a check to verify an active material on every subdomain.
MaterialWarehouse _all_materials
void checkCoordinateSystems()
Verify that there are no element type/coordinate type conflicts.
void FEProblemBase::checkUserObjectJacobianRequirement ( THREAD_ID  tid)

Definition at line 849 of file FEProblemBase.C.

Referenced by initialSetup().

850 {
851  std::set<MooseVariable *> uo_jacobian_moose_vars;
852  const auto & e_objects = _elemental_user_objects.getActiveObjects(tid);
853  for (const auto & uo : e_objects)
854  {
855  std::shared_ptr<ShapeElementUserObject> shape_element_uo =
856  std::dynamic_pointer_cast<ShapeElementUserObject>(uo);
857  if (shape_element_uo)
858  {
859  _calculate_jacobian_in_uo = shape_element_uo->computeJacobianFlag();
860  const std::set<MooseVariable *> & mv_deps = shape_element_uo->jacobianMooseVariables();
861  uo_jacobian_moose_vars.insert(mv_deps.begin(), mv_deps.end());
862  }
863  }
864  const auto & s_objects = _side_user_objects.getActiveObjects(tid);
865  for (const auto & uo : s_objects)
866  {
867  std::shared_ptr<ShapeSideUserObject> shape_side_uo =
868  std::dynamic_pointer_cast<ShapeSideUserObject>(uo);
869  if (shape_side_uo)
870  {
871  _calculate_jacobian_in_uo = shape_side_uo->computeJacobianFlag();
872  const std::set<MooseVariable *> & mv_deps = shape_side_uo->jacobianMooseVariables();
873  uo_jacobian_moose_vars.insert(mv_deps.begin(), mv_deps.end());
874  }
875  }
876  _uo_jacobian_moose_vars[tid].assign(uo_jacobian_moose_vars.begin(), uo_jacobian_moose_vars.end());
877  std::sort(
878  _uo_jacobian_moose_vars[tid].begin(), _uo_jacobian_moose_vars[tid].end(), sortMooseVariables);
879 }
AuxGroupExecuteMooseObjectWarehouse< ElementUserObject > _elemental_user_objects
bool _calculate_jacobian_in_uo
ElementUserObject class in which the _phi and _grad_phi shape function data is available and correctl...
std::vector< std::vector< MooseVariable * > > _uo_jacobian_moose_vars
AuxGroupExecuteMooseObjectWarehouse< SideUserObject > _side_user_objects
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...
SideUserObject class in which the _phi and _grad_phi shape function data is available and correctly i...
void FEProblemBase::checkUserObjects ( )
protected

Definition at line 4758 of file FEProblemBase.C.

Referenced by checkProblemIntegrity().

4759 {
4760  // Check user_objects block coverage
4761  std::set<SubdomainID> mesh_subdomains = _mesh.meshSubdomains();
4762  std::set<SubdomainID> user_objects_blocks;
4763 
4764  // gather names of all user_objects that were defined in the input file
4765  // and the blocks that they are defined on
4766  std::set<std::string> names;
4767 
4768  const auto & objects = _all_user_objects.getActiveObjects();
4769  for (const auto & obj : objects)
4770  names.insert(obj->name());
4771 
4772  // See if all referenced blocks are covered
4773  mesh_subdomains.insert(Moose::ANY_BLOCK_ID);
4774  std::set<SubdomainID> difference;
4775  std::set_difference(user_objects_blocks.begin(),
4776  user_objects_blocks.end(),
4777  mesh_subdomains.begin(),
4778  mesh_subdomains.end(),
4779  std::inserter(difference, difference.end()));
4780 
4781  if (!difference.empty())
4782  {
4783  std::ostringstream oss;
4784  oss << "One or more UserObjects is referencing a nonexistent block:\n";
4785  for (const auto & id : difference)
4786  oss << id << "\n";
4787  mooseError(oss.str());
4788  }
4789 
4790  // check that all requested UserObjects were defined in the input file
4791  for (const auto & it : _pps_data.values())
4792  {
4793  if (names.find(it.first) == names.end())
4794  mooseError("Postprocessor '" + it.first + "' requested but not specified in the input file.");
4795  }
4796 }
const std::set< SubdomainID > & meshSubdomains() const
Returns a read-only reference to the set of subdomains currently present in the Mesh.
Definition: MooseMesh.C:2104
ExecuteMooseObjectWarehouse< UserObject > _all_user_objects
PostprocessorData _pps_data
MooseMesh & _mesh
const std::map< std::string, PostprocessorValue * > & values() const
Get the map of names -> Postprocessor values.
const SubdomainID ANY_BLOCK_ID
Definition: MooseTypes.h:117
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
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 FEProblemBase::clearActiveElementalMooseVariables ( THREAD_ID  tid)
overridevirtual

Clear the active elemental MooseVariable.

If there are no active variables then they will all be reinited. Call this after finishing the computation that was using a restricted set of MooseVariables

Parameters
tidThe thread id

Reimplemented from SubProblem.

Definition at line 3481 of file FEProblemBase.C.

Referenced by ComputeMarkerThread::post(), ComputeElemAuxVarsThread::post(), ComputeDiracThread::post(), ComputeMaterialsObjectThread::post(), ComputeResidualThread::post(), ComputeIndicatorThread::post(), ComputeJacobianThread::post(), and ComputeUserObjectsThread::post().

3482 {
3484 
3485  if (_displaced_problem)
3486  _displaced_problem->clearActiveElementalMooseVariables(tid);
3487 }
virtual void clearActiveElementalMooseVariables(THREAD_ID tid)
Clear the active elemental MooseVariable.
Definition: SubProblem.C:82
std::shared_ptr< DisplacedProblem > _displaced_problem
void FEProblemBase::clearActiveMaterialProperties ( THREAD_ID  tid)
overridevirtual

Clear the active material properties.

Should be called at the end of every computing thread

Parameters
tidThe thread id

Reimplemented from SubProblem.

Definition at line 3512 of file FEProblemBase.C.

Referenced by LineMaterialSamplerBase< T >::execute(), ComputeElemAuxBcsThread::operator()(), ComputeElemAuxVarsThread::post(), ComputeDiracThread::post(), ComputeIndicatorThread::post(), ComputeResidualThread::post(), ComputeJacobianThread::post(), and ComputeUserObjectsThread::post().

3513 {
3515 
3516  if (_displaced_problem)
3517  _displaced_problem->clearActiveMaterialProperties(tid);
3518 }
std::shared_ptr< DisplacedProblem > _displaced_problem
virtual void clearActiveMaterialProperties(THREAD_ID tid)
Clear the active material properties.
Definition: SubProblem.C:108
void FEProblemBase::clearDiracInfo ( )
overridevirtual

Gets called before Dirac Kernels are asked to add the points they are supposed to be evaluated in.

Implements SubProblem.

Definition at line 1516 of file FEProblemBase.C.

Referenced by NonlinearSystemBase::computeDiracContributions().

1517 {
1519 
1520  if (_displaced_problem)
1521  _displaced_problem->clearDiracInfo();
1522 }
void clearPoints()
Remove all of the current points and elements.
std::shared_ptr< DisplacedProblem > _displaced_problem
DiracKernelInfo _dirac_kernel_info
Definition: SubProblem.h:425
void FEProblemBase::computeAuxiliaryKernels ( const ExecFlagType type)
virtual

Call compute methods on AuxKernels.

Definition at line 2804 of file FEProblemBase.C.

Referenced by execute().

2805 {
2806  _aux->compute(type);
2807 }
std::shared_ptr< AuxiliarySystem > _aux
MatType type
void FEProblemBase::computeBounds ( NonlinearImplicitSystem &  sys,
NumericVector< Number > &  lower,
NumericVector< Number > &  upper 
)
virtual

Definition at line 4184 of file FEProblemBase.C.

Referenced by Moose::compute_bounds().

4187 {
4188  if (!_nl->hasVector("lower_bound") || !_nl->hasVector("upper_bound"))
4189  return;
4190 
4191  NumericVector<Number> & _lower = _nl->getVector("lower_bound");
4192  NumericVector<Number> & _upper = _nl->getVector("upper_bound");
4193  _lower.swap(lower);
4194  _upper.swap(upper);
4195  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
4197 
4198  _aux->residualSetup();
4199  _aux->compute(EXEC_LINEAR);
4200  _lower.swap(lower);
4201  _upper.swap(upper);
4202 
4204 }
Object is evaluated in every residual computation.
Definition: MooseTypes.h:96
std::shared_ptr< NonlinearSystemBase > _nl
std::shared_ptr< AuxiliarySystem > _aux
MaterialWarehouse _all_materials
unsigned int THREAD_ID
Definition: MooseTypes.h:79
virtual void checkExceptionAndStopSolve()
Check to see if an exception has occurred on any processor and stop the solve.
virtual void residualSetup(THREAD_ID tid=0) const
Real FEProblemBase::computeDamping ( const NumericVector< Number > &  soln,
const NumericVector< Number > &  update 
)
virtual

Definition at line 4324 of file FEProblemBase.C.

Referenced by computePostCheck().

4326 {
4327  Moose::perf_log.push("compute_dampers()", "Execution");
4328 
4329  // Default to no damping
4330  Real damping = 1.0;
4331 
4332  if (_has_dampers)
4333  {
4334  // Save pointer to the current solution
4335  const NumericVector<Number> * _saved_current_solution = _nl->currentSolution();
4336 
4337  _nl->setSolution(soln);
4338  // For now, do not re-compute auxiliary variables. Doing so allows a wild solution increment
4339  // to get to the material models, which may not be able to cope with drastically different
4340  // values. Once more complete dependency checking is in place, auxiliary variables (and
4341  // material properties) will be computed as needed by dampers.
4342  // _aux.compute();
4343  damping = _nl->computeDamping(soln, update);
4344 
4345  // restore saved solution
4346  _nl->setSolution(*_saved_current_solution);
4347  }
4348 
4349  Moose::perf_log.pop("compute_dampers()", "Execution");
4350 
4351  return damping;
4352 }
std::shared_ptr< NonlinearSystemBase > _nl
bool _has_dampers
Whether or not this system has any Dampers associated with it.
PerfLog perf_log
Perflog to be used by applications.
void FEProblemBase::computeIndicators ( )
virtual

Definition at line 2698 of file FEProblemBase.C.

Referenced by computeIndicatorsAndMarkers(), Transient::endStep(), Steady::execute(), and initialAdaptMesh().

2699 {
2700  // Initialize indicator aux variable fields
2702  {
2703  Moose::perf_log.push("Adaptivity: computeIndicators()", "Execution");
2704 
2705  std::vector<std::string> fields;
2706 
2707  // Indicator Fields
2708  const auto & indicators = _indicators.getActiveObjects();
2709  for (const auto & indicator : indicators)
2710  fields.push_back(indicator->name());
2711 
2712  // InternalSideIndicator Fields
2713  const auto & internal_indicators = _internal_side_indicators.getActiveObjects();
2714  for (const auto & internal_indicator : internal_indicators)
2715  fields.push_back(internal_indicator->name());
2716 
2717  _aux->zeroVariables(fields);
2718 
2719  // compute Indicators
2720  ComputeIndicatorThread cit(*this);
2721  Threads::parallel_reduce(*_mesh.getActiveLocalElementRange(), cit);
2722  _aux->solution().close();
2723  _aux->update();
2724 
2725  ComputeIndicatorThread finalize_cit(*this, true);
2726  Threads::parallel_reduce(*_mesh.getActiveLocalElementRange(), finalize_cit);
2727  _aux->solution().close();
2728  _aux->update();
2729 
2730  Moose::perf_log.pop("Adaptivity: computeIndicators()", "Execution");
2731  }
2732 }
ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:685
MooseObjectWarehouse< InternalSideIndicator > _internal_side_indicators
std::shared_ptr< AuxiliarySystem > _aux
PerfLog perf_log
Perflog to be used by applications.
MooseMesh & _mesh
bool hasActiveObjects(THREAD_ID tid=0) const
Convenience functions for determining if objects exist.
MooseObjectWarehouse< Indicator > _indicators
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 FEProblemBase::computeIndicatorsAndMarkers ( )
virtual

Definition at line 2691 of file FEProblemBase.C.

2692 {
2694  computeMarkers();
2695 }
virtual void computeMarkers()
virtual void computeIndicators()
void FEProblemBase::computeJacobian ( NonlinearImplicitSystem &  sys,
const NumericVector< Number > &  soln,
SparseMatrix< Number > &  jacobian 
)
virtual

Definition at line 4069 of file FEProblemBase.C.

Referenced by Moose::compute_jacobian(), EigenProblem::computeJacobian(), computeTransientImplicitJacobian(), and EigenProblem::residualInitialed().

4072 {
4073  computeJacobian(soln, jacobian, Moose::KT_ALL);
4074 }
virtual void computeJacobian(NonlinearImplicitSystem &sys, const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian)
void FEProblemBase::computeJacobian ( const NumericVector< Number > &  soln,
SparseMatrix< Number > &  jacobian,
Moose::KernelType  kernel_type = Moose::KT_ALL 
)
virtual

Reimplemented in EigenProblem.

Definition at line 4077 of file FEProblemBase.C.

4080 {
4081  if (!_has_jacobian || !_const_jacobian)
4082  {
4083  _nl->setSolution(soln);
4084 
4085  _nl->zeroVariablesForJacobian();
4086  _aux->zeroVariablesForJacobian();
4087 
4088  unsigned int n_threads = libMesh::n_threads();
4089 
4090  // Random interface objects
4091  for (const auto & it : _random_data_objects)
4092  it.second->updateSeeds(EXEC_NONLINEAR);
4093 
4096 
4099 
4100  for (unsigned int tid = 0; tid < n_threads; tid++)
4101  reinitScalars(tid);
4102 
4104 
4105  if (_displaced_problem != NULL)
4106  _displaced_problem->updateMesh();
4107 
4108  for (unsigned int tid = 0; tid < n_threads; tid++)
4109  {
4112  }
4113 
4114  _aux->jacobianSetup();
4115 
4116  _aux->compute(EXEC_NONLINEAR);
4117 
4119 
4121 
4123 
4124  _nl->computeJacobian(jacobian, kernel_type);
4125 
4128  _has_jacobian = true;
4129  }
4130 
4132  {
4133  // This call is here to make sure the residual vector is up to date with any decisions that have
4134  // been made in
4135  // the Jacobian evaluation. That is important in JFNK because that residual is used for finite
4136  // differencing
4137  computeResidual(soln, _nl->RHS());
4138  _nl->RHS().close();
4139  }
4140 }
SolverParams _solver_params
ExecFlagType _current_execute_on_flag
Current execute_on flag.
std::shared_ptr< NonlinearSystemBase > _nl
bool _has_jacobian
Indicates if the Jacobian was computed.
virtual void jacobianSetup(THREAD_ID tid=0) const
void jacobianSetup()
Calls the jacobianSetup function for each of the output objects.
virtual void computeUserObjects(const ExecFlagType &type, const Moose::AuxGroup &group)
Call compute methods on UserObjects.
Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:248
virtual void jacobianSetup(THREAD_ID tid=0) const
std::shared_ptr< AuxiliarySystem > _aux
Moose::SolveType _type
Definition: SolverParams.h:25
bool _currently_computing_jacobian
Whether or not the system is currently computing the Jacobian matrix.
std::map< std::string, std::unique_ptr< RandomData > > _random_data_objects
A map of objects that consume random numbers.
virtual void reinitScalars(THREAD_ID tid) override
void executeControls(const ExecFlagType &exec_type)
Performs setup and execute calls for Control objects.
MooseApp & _app
The MooseApp this object is associated with.
Definition: MooseObject.h:108
std::shared_ptr< DisplacedProblem > _displaced_problem
MooseObjectWarehouse< Function > _functions
functions
Preconditioned Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:247
Object is evaluated in every jacobian computation.
Definition: MooseTypes.h:98
bool execMultiApps(ExecFlagType type, bool auto_advance=true)
Execute the MultiApps associated with the ExecFlagType.
virtual void computeResidual(NonlinearImplicitSystem &sys, const NumericVector< Number > &soln, NumericVector< Number > &residual)
bool _const_jacobian
true if the Jacobian is constant
MaterialWarehouse _all_materials
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
Definition: MooseApp.C:841
void execTransfers(ExecFlagType type)
Execute the Transfers associated with the ExecFlagType.
void FEProblemBase::computeJacobianBlock ( SparseMatrix< Number > &  jacobian,
libMesh::System &  precond_system,
unsigned int  ivar,
unsigned int  jvar 
)
virtual

Really not a good idea to use this.

It computes just one block of the Jacobian into a smaller matrix. Calling this in a loop is EXTREMELY ineffecient! Try to use computeJacobianBlocks() instead!

Parameters
jacobianThe matrix you want to fill
precond_systemThe libMesh::system of the preconditioning system
ivarthe block-row of the Jacobian
jvarthe block-column of the Jacobian

Definition at line 4171 of file FEProblemBase.C.

4175 {
4176  std::vector<JacobianBlock *> blocks;
4177  JacobianBlock * block = new JacobianBlock(precond_system, jacobian, ivar, jvar);
4178  blocks.push_back(block);
4179  computeJacobianBlocks(blocks);
4180  delete block;
4181 }
Helper class for holding the preconditioning blocks to fill.
virtual void computeJacobianBlocks(std::vector< JacobianBlock * > &blocks)
Computes several Jacobian blocks simultaneously, summing their contributions into smaller preconditio...
void FEProblemBase::computeJacobianBlocks ( std::vector< JacobianBlock * > &  blocks)
virtual

Computes several Jacobian blocks simultaneously, summing their contributions into smaller preconditioning matrices.

Used by Physics-based preconditioning

Parameters
blocksThe blocks to fill in (JacobianBlock is defined in ComputeJacobianBlocksThread)

Definition at line 4160 of file FEProblemBase.C.

Referenced by computeJacobianBlock(), and PhysicsBasedPreconditioner::setup().

4161 {
4162  if (_displaced_problem != NULL)
4163  _displaced_problem->updateMesh();
4164 
4165  _aux->compute(EXEC_NONLINEAR);
4166 
4167  _nl->computeJacobianBlocks(blocks);
4168 }
std::shared_ptr< NonlinearSystemBase > _nl
std::shared_ptr< AuxiliarySystem > _aux
std::shared_ptr< DisplacedProblem > _displaced_problem
Object is evaluated in every jacobian computation.
Definition: MooseTypes.h:98
void FEProblemBase::computeMarkers ( )
virtual

Definition at line 2735 of file FEProblemBase.C.

Referenced by adaptMesh(), computeIndicatorsAndMarkers(), Transient::endStep(), Steady::execute(), and initialAdaptMesh().

2736 {
2737  if (_markers.hasActiveObjects())
2738  {
2739  Moose::perf_log.push("Adaptivity: computeMarkers()", "Execution");
2740 
2741  std::vector<std::string> fields;
2742 
2743  // Marker Fields
2744  const auto & markers = _markers.getActiveObjects();
2745  for (const auto & marker : markers)
2746  fields.push_back(marker->name());
2747 
2748  _aux->zeroVariables(fields);
2749 
2751 
2752  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); ++tid)
2753  {
2754  const auto & markers = _markers.getActiveObjects(tid);
2755  for (const auto & marker : markers)
2756  marker->markerSetup();
2757  }
2758 
2759  ComputeMarkerThread cmt(*this);
2760  Threads::parallel_reduce(*_mesh.getActiveLocalElementRange(), cmt);
2761 
2762  _aux->solution().close();
2763  _aux->update();
2764 
2765  Moose::perf_log.pop("Adaptivity: computeMarkers()", "Execution");
2766  }
2767 }
ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:685
void updateErrorVectors()
Update the ErrorVectors that have been requested through calls to getErrorVector().
Definition: Adaptivity.C:285
std::shared_ptr< AuxiliarySystem > _aux
PerfLog perf_log
Perflog to be used by applications.
MooseMesh & _mesh
bool hasActiveObjects(THREAD_ID tid=0) const
Convenience functions for determining if objects exist.
Adaptivity _adaptivity
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...
MooseObjectWarehouse< Marker > _markers
unsigned int THREAD_ID
Definition: MooseTypes.h:79
Real FEProblemBase::computeMultiAppsDT ( ExecFlagType  type)

Find the smallest timestep over all MultiApps.

Definition at line 3335 of file FEProblemBase.C.

Referenced by Transient::computeConstrainedDT().

3336 {
3337  const auto & multi_apps = _transient_multi_apps[type].getActiveObjects();
3338 
3339  Real smallest_dt = std::numeric_limits<Real>::max();
3340 
3341  for (const auto & multi_app : multi_apps)
3342  smallest_dt = std::min(smallest_dt, multi_app->computeDT());
3343 
3344  return smallest_dt;
3345 }
ExecuteMooseObjectWarehouse< TransientMultiApp > _transient_multi_apps
Storage for TransientMultiApps (only needed for calling &#39;computeDT&#39;)
MatType type
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 FEProblemBase::computeNearNullSpace ( NonlinearImplicitSystem &  sys,
std::vector< NumericVector< Number > * > &  sp 
)
virtual

Definition at line 4207 of file FEProblemBase.C.

Referenced by Moose::compute_nearnullspace().

4209 {
4210  sp.clear();
4211  for (unsigned int i = 0; i < subspaceDim("NearNullSpace"); ++i)
4212  {
4213  std::stringstream postfix;
4214  postfix << "_" << i;
4215  std::string modename = "NearNullSpace" + postfix.str();
4216  sp.push_back(&_nl->getVector(modename));
4217  }
4218 }
std::shared_ptr< NonlinearSystemBase > _nl
unsigned int subspaceDim(const std::string &prefix) const
Dimension of the subspace spanned by vectors with a given prefix.
void FEProblemBase::computeNullSpace ( NonlinearImplicitSystem &  sys,
std::vector< NumericVector< Number > * > &  sp 
)
virtual

Definition at line 4221 of file FEProblemBase.C.

Referenced by Moose::compute_nullspace().

4223 {<