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

A system that holds auxiliary variables. More...

#include <AuxiliarySystem.h>

Inheritance diagram for AuxiliarySystem:
[legend]

Public Member Functions

 AuxiliarySystem (FEProblemBase &subproblem, const std::string &name)
 
virtual ~AuxiliarySystem ()
 
virtual void initialSetup () override
 Setup Functions. More...
 
virtual void timestepSetup () override
 
virtual void customSetup (const ExecFlagType &exec_type) override
 
virtual void subdomainSetup () override
 
virtual void residualSetup () override
 
virtual void jacobianSetup () override
 
virtual void updateActive (THREAD_ID tid)
 
virtual void addVariable (const std::string &var_type, const std::string &name, InputParameters &parameters) override
 Canonical method for adding a variable. More...
 
void addTimeIntegrator (const std::string &type, const std::string &name, InputParameters &parameters) override
 Add a time integrator. More...
 
void addDotVectors ()
 Adds u_dot, u_dotdot, u_dot_old and u_dotdot_old vectors if requested by the time integrator. More...
 
void addKernel (const std::string &kernel_name, const std::string &name, InputParameters &parameters)
 Adds an auxiliary kernel. More...
 
void addScalarKernel (const std::string &kernel_name, const std::string &name, InputParameters &parameters)
 Adds a scalar kernel. More...
 
virtual void reinitElem (const Elem *elem, THREAD_ID tid) override
 Reinit an element assembly info. More...
 
virtual void reinitElemFace (const Elem *elem, unsigned int side, BoundaryID bnd_id, THREAD_ID tid) override
 Reinit assembly info for a side of an element. More...
 
const NumericVector< Number > *const & currentSolution () const override
 The solution vector that is currently being operated on. More...
 
NumericVector< Number > * solutionUDot () override
 
NumericVector< Number > * solutionUDotDot () override
 
NumericVector< Number > * solutionUDotOld () override
 
NumericVector< Number > * solutionUDotDotOld () override
 
const NumericVector< Number > * solutionUDot () const override
 
const NumericVector< Number > * solutionUDotDot () const override
 
const NumericVector< Number > * solutionUDotOld () const override
 
const NumericVector< Number > * solutionUDotDotOld () const override
 
virtual void serializeSolution ()
 
virtual NumericVector< Number > & serializedSolution () override
 Returns a reference to a serialized version of the solution vector for this subproblem. More...
 
virtual void augmentSparsity (SparsityPattern::Graph &, std::vector< dof_id_type > &, std::vector< dof_id_type > &) override
 Will modify the sparsity pattern to add logical geometric connections. More...
 
virtual void compute (ExecFlagType type)
 Compute auxiliary variables. More...
 
std::set< std::string > getDependObjects (ExecFlagType type)
 Get a list of dependent UserObjects for this exec type. More...
 
std::set< std::string > getDependObjects ()
 
virtual Order getMinQuadratureOrder () override
 Get the minimum quadrature order for evaluating elemental auxiliary variables. More...
 
bool needMaterialOnSide (BoundaryID bnd_id)
 Indicated whether this system needs material properties on boundaries. More...
 
virtual System & sys ()
 
virtual System & system () override
 Get the reference to the libMesh system. More...
 
virtual const System & system () const override
 
virtual void setPreviousNewtonSolution ()
 
void setScalarVariableCoupleableTags (ExecFlagType type)
 
void clearScalarVariableCoupleableTags ()
 
const ExecuteMooseObjectWarehouse< AuxKernel > & nodalAuxWarehouse () const
 
const ExecuteMooseObjectWarehouse< VectorAuxKernel > & nodalVectorAuxWarehouse () const
 
const ExecuteMooseObjectWarehouse< ArrayAuxKernel > & nodalArrayAuxWarehouse () const
 
const ExecuteMooseObjectWarehouse< AuxKernel > & elemAuxWarehouse () const
 
const ExecuteMooseObjectWarehouse< VectorAuxKernel > & elemVectorAuxWarehouse () const
 
const ExecuteMooseObjectWarehouse< ArrayAuxKernel > & elemArrayAuxWarehouse () const
 
virtual void addTimeIntegrator (const std::string &, const std::string &, InputParameters &)
 
virtual void addTimeIntegrator (std::shared_ptr< TimeIntegrator >)
 
unsigned int number () const
 Gets the number of this system. More...
 
virtual MooseMeshmesh ()
 
virtual const MooseMeshmesh () const
 
virtual SubProblemsubproblem ()
 
virtual const SubProblemsubproblem () const
 
void applyScalingFactors (const std::vector< Real > &inverse_scaling_factors)
 Applies scaling factors to the system's variables. More...
 
bool computingScalingJacobian () const
 Whether we are computing an initial Jacobian for automatic variable scaling. More...
 
bool automaticScaling () const
 Getter for whether we are performing automatic scaling. More...
 
void automaticScaling (bool automatic_scaling)
 Setter for whether we are performing automatic scaling. More...
 
void setVerboseFlag (const bool &verbose)
 Sets the verbose flag. More...
 
virtual DofMap & dofMap ()
 Gets writeable reference to the dof map. More...
 
virtual const DofMap & dofMap () const
 Gets const reference to the dof map. More...
 
virtual void init ()
 Initialize the system. More...
 
virtual void initializeObjects ()
 Called only once, just before the solve begins so objects can do some precalculations. More...
 
virtual void update (bool update_libmesh_system=true)
 Update the system (doing libMesh magic) More...
 
virtual void solve ()
 Solve the system (using libMesh magic) More...
 
virtual void copyOldSolutions ()
 Shifts the solutions backwards in time. More...
 
virtual void restoreSolutions ()
 Restore current solutions (call after your solve failed) More...
 
NumericVector< Number > & solution ()
 
const NumericVector< Number > & solution () const
 
NumericVector< Number > & solutionOld ()
 
const NumericVector< Number > & solutionOld () const
 
NumericVector< Number > & solutionOlder ()
 
const NumericVector< Number > & solutionOlder () const
 
virtual const NumericVector< Number > * solutionPreviousNewton () const
 
virtual NumericVector< Number > * solutionPreviousNewton ()
 
virtual void initSolutionState ()
 Initializes the solution state. More...
 
virtual NumericVector< Number > & solutionState (const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
 Get a state of the solution (0 = current, 1 = old, 2 = older, etc). More...
 
virtual const NumericVector< Number > & solutionState (const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time) const
 Get a state of the solution (0 = current, 1 = old, 2 = older, etc). More...
 
virtual void needSolutionState (const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
 Registers that the solution state state is needed. More...
 
virtual bool hasSolutionState (const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time) const
 Whether or not the system has the solution state (0 = current, 1 = old, 2 = older, etc). More...
 
virtual NumberduDotDu ()
 
virtual const NumberduDotDu () const
 
virtual NumberduDotDotDu ()
 
virtual const NumberduDotDotDu () const
 
virtual void saveOldSolutions ()
 Save the old and older solutions. More...
 
virtual void restoreOldSolutions ()
 Restore the old and older solutions when the saved solutions present. More...
 
bool hasVector (const std::string &tag_name) const
 Check if the named vector exists in the system. More...
 
virtual bool hasVector (TagID tag_id) const
 Check if the tagged vector exists in the system. More...
 
virtual TagID timeVectorTag () const
 Ideally, we should not need this API. More...
 
virtual TagID systemMatrixTag () const
 Return the Matrix Tag ID for System. More...
 
virtual TagID nonTimeVectorTag () const
 
virtual TagID residualVectorTag () const
 
virtual std::set< TagIDdefaultVectorTags () const
 Get the default vector tags associated with this system. More...
 
virtual std::set< TagIDdefaultMatrixTags () const
 Get the default matrix tags associted with this system. More...
 
virtual void associateVectorToTag (NumericVector< Number > &vec, TagID tag)
 Associate a vector for a given tag. More...
 
virtual void disassociateVectorFromTag (NumericVector< Number > &vec, TagID tag)
 Disassociate a given vector from a given tag. More...
 
virtual void disassociateVectorFromTag (TagID tag)
 Disassociate any vector that is associated with a given tag. More...
 
virtual void disassociateDefaultVectorTags ()
 Disassociate the vectors associated with the default vector tags of this system. More...
 
virtual bool hasMatrix (TagID tag) const
 Check if the tagged matrix exists in the system. More...
 
virtual SparseMatrix< Number > & getMatrix (TagID tag)
 Get a raw SparseMatrix. More...
 
virtual const SparseMatrix< Number > & getMatrix (TagID tag) const
 Get a raw SparseMatrix. More...
 
virtual void activeAllMatrixTags ()
 Make all exsiting matrices ative. More...
 
virtual void activeMatrixTag (TagID tag)
 Active a matrix for tag. More...
 
virtual bool matrixTagActive (TagID tag) const
 If or not a matrix tag is active. More...
 
virtual void deactiveMatrixTag (TagID tag)
 deactive a matrix for tag More...
 
virtual void deactiveAllMatrixTags ()
 Make matrices inactive. More...
 
void closeTaggedMatrices (const std::set< TagID > &tags)
 Close all matrices associated the tags. More...
 
void flushTaggedMatrices (const std::set< TagID > &tags)
 flushes all matrices associated to tags. More...
 
virtual void associateMatrixToTag (SparseMatrix< Number > &matrix, TagID tag)
 Associate a matrix to a tag. More...
 
virtual void disassociateMatrixFromTag (SparseMatrix< Number > &matrix, TagID tag)
 Disassociate a matrix from a tag. More...
 
virtual void disassociateMatrixFromTag (TagID tag)
 Disassociate any matrix that is associated with a given tag. More...
 
virtual void disassociateDefaultMatrixTags ()
 Disassociate the matrices associated with the default matrix tags of this system. More...
 
virtual NumericVector< Number > & residualCopy ()
 
virtual NumericVector< Number > & residualGhosted ()
 
virtual void augmentSendList (std::vector< dof_id_type > &send_list)
 Will modify the send_list to add all of the extra ghosted dofs for this system. More...
 
virtual bool isArrayVariable (const std::string &var_name) const
 If a variable is an array variable. More...
 
virtual bool isScalarVariable (unsigned int var_name) const
 
MooseVariableFieldBasegetVariable (THREAD_ID tid, const std::string &var_name) const
 Gets a reference to a variable of with specified name. More...
 
MooseVariableFieldBasegetVariable (THREAD_ID tid, unsigned int var_number) const
 Gets a reference to a variable with specified number. More...
 
template<typename T >
MooseVariableFE< T > & getFieldVariable (THREAD_ID tid, const std::string &var_name)
 Gets a reference to a variable of with specified name. More...
 
template<typename T >
MooseVariableFE< T > & getFieldVariable (THREAD_ID tid, unsigned int var_number)
 Gets a reference to a variable with specified number. More...
 
template<typename T >
MooseVariableField< T > & getActualFieldVariable (THREAD_ID tid, const std::string &var_name)
 Returns a field variable pointer - this includes finite volume variables. More...
 
template<typename T >
MooseVariableField< T > & getActualFieldVariable (THREAD_ID tid, unsigned int var_number)
 Returns a field variable pointer - this includes finite volume variables. More...
 
template<typename T >
MooseVariableFV< T > & getFVVariable (THREAD_ID tid, const std::string &var_name)
 Return a finite volume variable. More...
 
virtual MooseVariableScalargetScalarVariable (THREAD_ID tid, const std::string &var_name) const
 Gets a reference to a scalar variable with specified number. More...
 
virtual MooseVariableScalargetScalarVariable (THREAD_ID tid, unsigned int var_number) const
 Gets a reference to a variable with specified number. More...
 
virtual const std::set< SubdomainID > * getVariableBlocks (unsigned int var_number)
 Get the block where a variable of this system is defined. More...
 
virtual unsigned int nVariables () const
 Get the number of variables in this system. More...
 
unsigned int nFieldVariables () const
 Get the number of field variables in this system. More...
 
unsigned int nFVVariables () const
 Get the number of finite volume variables in this system. More...
 
std::size_t getMaxVarNDofsPerElem () const
 Gets the maximum number of dofs used by any one variable on any one element. More...
 
std::size_t getMaxVarNDofsPerNode () const
 Gets the maximum number of dofs used by any one variable on any one node. More...
 
void assignMaxVarNDofsPerElem (std::size_t max_dofs)
 assign the maximum element dofs More...
 
void assignMaxVarNDofsPerNode (std::size_t max_dofs)
 assign the maximum node dofs More...
 
virtual void addVariableToZeroOnResidual (std::string var_name)
 Adds this variable to the list of variables to be zeroed during each residual evaluation. More...
 
virtual void addVariableToZeroOnJacobian (std::string var_name)
 Adds this variable to the list of variables to be zeroed during each Jacobian evaluation. More...
 
virtual void zeroVariables (std::vector< std::string > &vars_to_be_zeroed)
 Zero out the solution for the list of variables passed in. More...
 
virtual void zeroVariablesForResidual ()
 Zero out the solution for the variables that were registered as needing to have their solutions zeroed on out on residual evaluation by a call to addVariableToZeroOnResidual() More...
 
virtual void zeroVariablesForJacobian ()
 Zero out the solution for the variables that were registered as needing to have their solutions zeroed on out on Jacobian evaluation by a call to addVariableToZeroOnResidual() More...
 
virtual void prepare (THREAD_ID tid)
 Prepare the system for use. More...
 
virtual void prepareFace (THREAD_ID tid, bool resize_data)
 Prepare the system for use on sides. More...
 
virtual void prepareNeighbor (THREAD_ID tid)
 Prepare the system for use. More...
 
virtual void prepareLowerD (THREAD_ID tid)
 Prepare the system for use for lower dimensional elements. More...
 
virtual void reinitNeighborFace (const Elem *elem, unsigned int side, BoundaryID bnd_id, THREAD_ID tid)
 Compute the values of the variables at all the current points. More...
 
virtual void reinitNeighbor (const Elem *elem, THREAD_ID tid)
 Compute the values of the variables at all the current points. More...
 
virtual void reinitLowerD (THREAD_ID tid)
 Compute the values of the variables on the lower dimensional element. More...
 
virtual void reinitNode (const Node *node, THREAD_ID tid)
 Reinit nodal assembly info. More...
 
virtual void reinitNodeFace (const Node *node, BoundaryID bnd_id, THREAD_ID tid)
 Reinit nodal assembly info on a face. More...
 
virtual void reinitNodes (const std::vector< dof_id_type > &nodes, THREAD_ID tid)
 Reinit variables at a set of nodes. More...
 
virtual void reinitNodesNeighbor (const std::vector< dof_id_type > &nodes, THREAD_ID tid)
 Reinit variables at a set of neighbor nodes. More...
 
virtual void reinitScalars (THREAD_ID tid, bool reinit_for_derivative_reordering=false)
 Reinit scalar varaibles. More...
 
virtual void addVariableToCopy (const std::string &dest_name, const std::string &source_name, const std::string &timestep)
 Add info about variable that will be copied. More...
 
const std::vector< MooseVariableFieldBase * > & getVariables (THREAD_ID tid)
 
const std::vector< MooseVariableScalar * > & getScalarVariables (THREAD_ID tid)
 
const std::set< SubdomainID > & getSubdomainsForVar (unsigned int var_number) const
 
const std::set< SubdomainID > & getSubdomainsForVar (const std::string &var_name) const
 Get the block where a variable of this system is defined. More...
 
void removeVector (const std::string &name)
 Remove a vector from the system with the given name. More...
 
void removeVector (TagID tag_id)
 Remove a solution length vector from the system with the specified TagID. More...
 
NumericVector< Number > & addVector (const std::string &vector_name, const bool project, const ParallelType type)
 Adds a solution length vector to the system. More...
 
NumericVector< Number > & addVector (TagID tag, const bool project, const ParallelType type)
 Adds a solution length vector to the system with the specified TagID. More...
 
void closeTaggedVector (const TagID tag)
 Close vector with the given tag. More...
 
void closeTaggedVectors (const std::set< TagID > &tags)
 Close all vectors for given tags. More...
 
void zeroTaggedVector (const TagID tag)
 Zero vector with the given tag. More...
 
void zeroTaggedVectors (const std::set< TagID > &tags)
 Zero all vectors for given tags. More...
 
void setVariableGlobalDoFs (const std::string &var_name)
 set all the global dof indices for a variable More...
 
const std::vector< dof_id_type > & getVariableGlobalDoFs ()
 Get the global dof indices of a variable, this needs to be called after the indices have been set by setVariableGlobalDoFs More...
 
SparseMatrix< Number > & addMatrix (TagID tag)
 Adds a matrix with a given tag. More...
 
void removeMatrix (TagID tag)
 Removes a matrix with a given tag. More...
 
virtual const std::string & name () const
 
const std::vector< VariableName > & getVariableNames () const
 
void getStandardFieldVariableNames (std::vector< VariableName > &std_field_variables) const
 
unsigned int getMaxVariableNumber () const
 Returns the maximum number of all variables on the system. More...
 
virtual void computeVariables (const NumericVector< Number > &)
 
void copyVars (ExodusII_IO &io)
 
virtual void copySolutionsBackwards ()
 Copy current solution into old and older. More...
 
virtual void addTimeIntegrator (std::shared_ptr< TimeIntegrator >)
 
TimeIntegratorgetTimeIntegrator ()
 
const TimeIntegratorgetTimeIntegrator () const
 
std::shared_ptr< TimeIntegratorgetSharedTimeIntegrator ()
 
bool hasVarCopy () const
 Whether or not there are variables to be restarted from an Exodus mesh file. More...
 
void addScalingVector ()
 Add the scaling factor vector to the system. More...
 
bool solutionStatesInitialized () const
 Whether or not the solution states have been initialized via initSolutionState() More...
 
void clearAllDofIndices ()
 Clear all dof indices from moose variables. More...
 
void setActiveVariableCoupleableVectorTags (const std::set< TagID > &vtags, THREAD_ID tid)
 Set the active vector tags for the variables. More...
 
void setActiveScalarVariableCoupleableVectorTags (const std::set< TagID > &vtags, THREAD_ID tid)
 Set the active vector tags for the scalar variables. More...
 
Moose::VarKindType varKind () const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
PerfGraphperfGraph ()
 Get the PerfGraph. More...
 
virtual NumericVector< Number > & getVector (const std::string &name)
 Get a raw NumericVector by name. More...
 
virtual const NumericVector< Number > & getVector (const std::string &name) const
 
virtual NumericVector< Number > & getVector (TagID tag)
 Get a raw NumericVector by tag. More...
 
virtual const NumericVector< Number > & getVector (TagID tag) const
 
virtual bool hasVariable (const std::string &var_name) const
 Query a system for a variable. More...
 
virtual bool hasScalarVariable (const std::string &var_name) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Public Attributes

const ConsoleStream _console
 An instance of helper class to write streams to the Console objects. More...
 

Protected Member Functions

void computeScalarVars (ExecFlagType type)
 
void computeNodalVars (ExecFlagType type)
 
void computeMortarNodalVars (ExecFlagType type)
 
void computeNodalVecVars (ExecFlagType type)
 
void computeNodalArrayVars (ExecFlagType type)
 
void computeElementalVars (ExecFlagType type)
 
void computeElementalVecVars (ExecFlagType type)
 
void computeElementalArrayVars (ExecFlagType type)
 
template<typename AuxKernelType >
void computeElementalVarsHelper (const MooseObjectWarehouse< AuxKernelType > &warehouse)
 
template<typename AuxKernelType >
void computeNodalVarsHelper (const MooseObjectWarehouse< AuxKernelType > &warehouse)
 
NumericVector< Number > & solutionInternal () const override
 Internal getter for solution owned by libMesh. More...
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 Call to register a named section for timing. More...
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 Call to register a named section for timing. More...
 
std::string timedSectionName (const std::string &section_name) const
 

Protected Attributes

FEProblemBase_fe_problem
 
System & _sys
 
const NumericVector< Number > * _current_solution
 solution vector from nonlinear solver More...
 
std::unique_ptr< NumericVector< Number > > _serialized_solution
 Serialized version of the solution vector, or nullptr if a serialized solution is not needed. More...
 
NumericVector< Number > * _u_dot
 solution vector for u^dot More...
 
NumericVector< Number > * _u_dotdot
 solution vector for u^dotdot More...
 
NumericVector< Number > * _u_dot_old
 Old solution vector for u^dot. More...
 
NumericVector< Number > * _u_dotdot_old
 Old solution vector for u^dotdot. More...
 
std::vector< NumericVector< Number > * > _solution_state
 The current states of the solution (0 = current, 1 = old, etc) More...
 
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vars
 
ExecuteMooseObjectWarehouse< AuxScalarKernel_aux_scalar_storage
 
ExecuteMooseObjectWarehouse< AuxKernel_nodal_aux_storage
 
ExecuteMooseObjectWarehouse< AuxKernel_mortar_nodal_aux_storage
 
ExecuteMooseObjectWarehouse< AuxKernel_elemental_aux_storage
 
ExecuteMooseObjectWarehouse< VectorAuxKernel_nodal_vec_aux_storage
 
ExecuteMooseObjectWarehouse< VectorAuxKernel_elemental_vec_aux_storage
 
ExecuteMooseObjectWarehouse< ArrayAuxKernel_nodal_array_aux_storage
 
ExecuteMooseObjectWarehouse< ArrayAuxKernel_elemental_array_aux_storage
 
SubProblem_subproblem
 
MooseApp_app
 
Factory_factory
 
MooseMesh_mesh
 
std::string _name
 The name of this system. More...
 
std::vector< VariableWarehouse_vars
 Variable warehouses (one for each thread) More...
 
std::map< unsigned int, std::set< SubdomainID > > _var_map
 Map of variables (variable id -> array of subdomains where it lives) More...
 
unsigned int _max_var_number
 Maximum variable number. More...
 
std::vector< std::string > _vars_to_be_zeroed_on_residual
 
std::vector< std::string > _vars_to_be_zeroed_on_jacobian
 
Real _du_dot_du
 
Real _du_dotdot_du
 
std::vector< NumericVector< Number > * > _tagged_vectors
 Tagged vectors (pointer) More...
 
std::vector< SparseMatrix< Number > * > _tagged_matrices
 Tagged matrices (pointer) More...
 
std::vector< bool > _matrix_tag_active_flags
 Active flags for tagged matrices. More...
 
NumericVector< Real > * _saved_old
 
NumericVector< Real > * _saved_older
 
NumericVector< Real > * _saved_dot_old
 
NumericVector< Real > * _saved_dotdot_old
 
Moose::VarKindType _var_kind
 default kind of variables in this system More...
 
std::vector< VarCopyInfo_var_to_copy
 
size_t _max_var_n_dofs_per_elem
 Maximum number of dofs for any one variable on any one element. More...
 
size_t _max_var_n_dofs_per_node
 Maximum number of dofs for any one variable on any one node. More...
 
std::shared_ptr< TimeIntegrator_time_integrator
 Time integrator. More...
 
std::vector< std::vector< MooseVariableFieldBase * > > _numbered_vars
 Map variable number to its pointer. More...
 
bool _automatic_scaling
 Whether to automatically scale the variables. More...
 
bool _verbose
 True if printing out additional information. More...
 
bool _solution_states_initialized
 Whether or not the solution states have been initialized. More...
 
std::vector< dof_id_type_var_all_dof_indices
 Container for the dof indices of a given variable. More...
 
const Parallel::Communicator & _communicator
 
MooseApp_pg_moose_app
 The MooseApp that owns the PerfGraph. More...
 
const std::string _prefix
 A prefix to use for all sections. More...
 
std::vector< std::vector< MooseVariableFieldBase * > > _elem_vars
 Elemental variables. More...
 

Friends

class ComputeIndicatorThread
 
class ComputeMarkerThread
 
class FlagElementsThread
 
class ComputeNodalKernelsThread
 
class ComputeNodalKernelBcsThread
 
class ComputeNodalKernelJacobiansThread
 
class ComputeNodalKernelBCJacobiansThread
 

Detailed Description

A system that holds auxiliary variables.

Definition at line 41 of file AuxiliarySystem.h.

Constructor & Destructor Documentation

◆ AuxiliarySystem()

AuxiliarySystem::AuxiliarySystem ( FEProblemBase subproblem,
const std::string &  name 
)

Definition at line 35 of file AuxiliarySystem.C.

37  PerfGraphInterface(subproblem.getMooseApp().perfGraph(), "AuxiliarySystem"),
39  _sys(subproblem.es().add_system<System>(name)),
40  _current_solution(_sys.current_local_solution.get()),
41  _u_dot(NULL),
42  _u_dotdot(NULL),
43  _u_dot_old(NULL),
44  _u_dotdot_old(NULL),
53 {
56 
58  {
59  auto & dof_map = _sys.get_dof_map();
60  dof_map.remove_algebraic_ghosting_functor(dof_map.default_algebraic_ghosting());
61  dof_map.set_implicit_neighbor_dofs(false);
62  }
63 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _mortar_nodal_aux_storage
unsigned int n_threads()
NumericVector< Number > * _u_dotdot
solution vector for u^dotdot
NumericVector< Number > * _u_dot
solution vector for u^dot
const ExecFlagEnum & getExecuteOnEnum() const
Return the app level ExecFlagEnum, this contains all the available flags for the app.
Definition: MooseApp.h:983
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _nodal_array_aux_storage
const NumericVector< Number > * _current_solution
solution vector from nonlinear solver
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Definition: MooseBase.h:45
virtual EquationSystems & es()=0
virtual const std::string & name() const
Definition: SystemBase.C:1297
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _elemental_array_aux_storage
FEProblemBase & _fe_problem
virtual SubProblem & subproblem()
Definition: SystemBase.h:98
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vars
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
std::vector< std::vector< MooseVariableFieldBase * > > _elem_vars
Elemental variables.
MooseApp & _app
Definition: SystemBase.h:926
NumericVector< Number > * _u_dot_old
Old solution vector for u^dot.
SystemBase(SubProblem &subproblem, const std::string &name, Moose::VarKindType var_kind)
Definition: SystemBase.C:51
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
PerfGraphInterface(const MooseObject *moose_object)
For objects that are MooseObjects with a default prefix of type()
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage
NumericVector< Number > * _u_dotdot_old
Old solution vector for u^dotdot.
bool defaultGhosting()
Whether or not the user has requested default ghosting ot be on.
Definition: SubProblem.h:122
PerfGraph & perfGraph()
Get the PerfGraph for this app.
Definition: MooseApp.h:133

◆ ~AuxiliarySystem()

AuxiliarySystem::~AuxiliarySystem ( )
virtualdefault

Member Function Documentation

◆ activeAllMatrixTags()

void SystemBase::activeAllMatrixTags ( )
virtualinherited

Make all exsiting matrices ative.

Definition at line 1103 of file SystemBase.C.

Referenced by NonlinearSystemBase::computeJacobianInternal(), NonlinearSystemBase::computeResidualAndJacobianInternal(), and NonlinearSystemBase::computeResidualTags().

1104 {
1105  auto num_matrix_tags = _subproblem.numMatrixTags();
1106 
1107  _matrix_tag_active_flags.resize(num_matrix_tags);
1108 
1109  for (decltype(num_matrix_tags) tag = 0; tag < num_matrix_tags; tag++)
1110  if (hasMatrix(tag))
1111  _matrix_tag_active_flags[tag] = true;
1112  else
1113  _matrix_tag_active_flags[tag] = false;
1114 }
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:328
std::vector< bool > _matrix_tag_active_flags
Active flags for tagged matrices.
Definition: SystemBase.h:951
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual unsigned int numMatrixTags() const
The total number of tags.
Definition: SubProblem.h:210

◆ activeMatrixTag()

void SystemBase::activeMatrixTag ( TagID  tag)
virtualinherited

Active a matrix for tag.

Definition at line 1068 of file SystemBase.C.

1069 {
1070  mooseAssert(_subproblem.matrixTagExists(tag),
1071  "Cannot active Matrix with matrix_tag : " << tag << "that does not exist");
1072 
1073  if (_matrix_tag_active_flags.size() < tag + 1)
1074  _matrix_tag_active_flags.resize(tag + 1);
1075 
1076  _matrix_tag_active_flags[tag] = true;
1077 }
std::vector< bool > _matrix_tag_active_flags
Active flags for tagged matrices.
Definition: SystemBase.h:951
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:294

◆ addDotVectors()

void AuxiliarySystem::addDotVectors ( )

Adds u_dot, u_dotdot, u_dot_old and u_dotdot_old vectors if requested by the time integrator.

Definition at line 68 of file AuxiliarySystem.C.

69 {
71  _u_dot = &addVector("u_dot", true, GHOSTED);
73  _u_dotdot = &addVector("u_dotdot", true, GHOSTED);
75  _u_dot_old = &addVector("u_dot_old", true, GHOSTED);
77  _u_dotdot_old = &addVector("u_dotdot_old", true, GHOSTED);
78 }
virtual bool uDotDotOldRequested()
Get boolean flag to check whether old solution second time derivative needs to be stored...
NumericVector< Number > * _u_dotdot
solution vector for u^dotdot
NumericVector< Number > & addVector(const std::string &vector_name, const bool project, const ParallelType type)
Adds a solution length vector to the system.
Definition: SystemBase.C:597
NumericVector< Number > * _u_dot
solution vector for u^dot
virtual bool uDotRequested()
Get boolean flag to check whether solution time derivative needs to be stored.
virtual bool uDotDotRequested()
Get boolean flag to check whether solution second time derivative needs to be stored.
FEProblemBase & _fe_problem
virtual bool uDotOldRequested()
Get boolean flag to check whether old solution time derivative needs to be stored.
NumericVector< Number > * _u_dot_old
Old solution vector for u^dot.
NumericVector< Number > * _u_dotdot_old
Old solution vector for u^dotdot.

◆ addKernel()

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

Adds an auxiliary kernel.

Parameters
kernel_nameThe type of the kernel
nameThe name of the kernel
parametersParameters for this kernel

Definition at line 284 of file AuxiliarySystem.C.

287 {
288  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
289  {
290  if (parameters.get<std::string>("_moose_base") == "AuxKernel" ||
291  parameters.get<std::string>("_moose_base") == "Bounds")
292  {
293  std::shared_ptr<AuxKernel> kernel =
294  _factory.create<AuxKernel>(kernel_name, name, parameters, tid);
295  if (kernel->isNodal())
296  {
297  if (kernel->isMortar())
298  _mortar_nodal_aux_storage.addObject(kernel, tid);
299  else
300  _nodal_aux_storage.addObject(kernel, tid);
301  }
302  else
303  _elemental_aux_storage.addObject(kernel, tid);
304  }
305 
306  else if (parameters.get<std::string>("_moose_base") == "VectorAuxKernel")
307  {
308  std::shared_ptr<VectorAuxKernel> kernel =
309  _factory.create<VectorAuxKernel>(kernel_name, name, parameters, tid);
310  if (kernel->isNodal())
311  {
312  if (kernel->isMortar())
313  mooseError("Vector mortar aux kernels not yet implemented");
314  _nodal_vec_aux_storage.addObject(kernel, tid);
315  }
316  else
317  _elemental_vec_aux_storage.addObject(kernel, tid);
318  }
319 
320  else if (parameters.get<std::string>("_moose_base") == "ArrayAuxKernel")
321  {
322  std::shared_ptr<ArrayAuxKernel> kernel =
323  _factory.create<ArrayAuxKernel>(kernel_name, name, parameters, tid);
324  if (kernel->isNodal())
325  {
326  if (kernel->isMortar())
327  mooseError("Vector mortar aux kernels not yet implemented");
328  _nodal_array_aux_storage.addObject(kernel, tid);
329  }
330  else
331  _elemental_array_aux_storage.addObject(kernel, tid);
332  }
333  else
334  mooseAssert(false,
335  "Attempting to add AuxKernel of type '" + kernel_name + "' and name '" + name +
336  "' to the auxiliary system with invalid _moose_base: " +
337  parameters.get<std::string>("_moose_base"));
338  }
339 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _mortar_nodal_aux_storage
unsigned int n_threads()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _nodal_array_aux_storage
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters &parameters, THREAD_ID tid=0, bool print_deprecated=true)
Definition: Factory.C:110
Factory & _factory
Definition: SystemBase.h:927
virtual const std::string & name() const
Definition: SystemBase.C:1297
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _elemental_array_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage
unsigned int THREAD_ID
Definition: MooseTypes.h:198

◆ addMatrix()

SparseMatrix< Number > & SystemBase::addMatrix ( TagID  tag)
inherited

Adds a matrix with a given tag.

Parameters
tag_nameThe name of the tag

Definition at line 559 of file SystemBase.C.

560 {
561  if (!_subproblem.matrixTagExists(tag))
562  mooseError("Cannot add tagged matrix with TagID ",
563  tag,
564  " in system '",
565  name(),
566  "' because the tag does not exist in the problem");
567 
568  if (hasMatrix(tag))
569  return getMatrix(tag);
570 
571  const auto matrix_name = _subproblem.matrixTagName(tag);
572  SparseMatrix<Number> & mat = system().add_matrix(matrix_name);
573  associateMatrixToTag(mat, tag);
574 
575  return mat;
576 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:328
virtual const std::string & name() const
Definition: SystemBase.C:1297
virtual void associateMatrixToTag(SparseMatrix< Number > &matrix, TagID tag)
Associate a matrix to a tag.
Definition: SystemBase.C:1025
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual System & system()=0
Get the reference to the libMesh system.
virtual SparseMatrix< Number > & getMatrix(TagID tag)
Get a raw SparseMatrix.
Definition: SystemBase.C:973
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:294
virtual TagName matrixTagName(TagID tag)
Retrieve the name associated with a TagID.
Definition: SubProblem.C:323

◆ addScalarKernel()

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

Adds a scalar kernel.

Parameters
kernel_nameThe type of the kernel
nameThe name of the kernel
parametersKernel parameters

Definition at line 342 of file AuxiliarySystem.C.

345 {
346  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
347  {
348  std::shared_ptr<AuxScalarKernel> kernel =
349  _factory.create<AuxScalarKernel>(kernel_name, name, parameters, tid);
350  _aux_scalar_storage.addObject(kernel, tid);
351  }
352 }
void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.
unsigned int n_threads()
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters &parameters, THREAD_ID tid=0, bool print_deprecated=true)
Definition: Factory.C:110
Factory & _factory
Definition: SystemBase.h:927
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
virtual const std::string & name() const
Definition: SystemBase.C:1297
Base class for making kernels that work on auxiliary scalar variables.
unsigned int THREAD_ID
Definition: MooseTypes.h:198

◆ addScalingVector()

void SystemBase::addScalingVector ( )
inherited

Add the scaling factor vector to the system.

Definition at line 1474 of file SystemBase.C.

Referenced by MooseVariableBase::initialSetup().

1475 {
1476  addVector("scaling_factors", /*project=*/false, libMesh::ParallelType::GHOSTED);
1478 }
NumericVector< Number > & addVector(const std::string &vector_name, const bool project, const ParallelType type)
Adds a solution length vector to the system.
Definition: SystemBase.C:597
void hasScalingVector(const unsigned int nl_sys_num)
Tells this problem that the assembly associated with the given nonlinear system number involves a sca...
Definition: SubProblem.C:1115
SubProblem & _subproblem
Definition: SystemBase.h:924
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1125

◆ addTimeIntegrator() [1/4]

void AuxiliarySystem::addTimeIntegrator ( const std::string &  type,
const std::string &  name,
InputParameters parameters 
)
overridevirtual

Add a time integrator.

Parameters
typeType of the integrator
nameThe name of the integrator
parametersIntegrator params

Reimplemented from SystemBase.

Definition at line 274 of file AuxiliarySystem.C.

277 {
278  parameters.set<SystemBase *>("_sys") = this;
279  std::shared_ptr<TimeIntegrator> ti = _factory.create<TimeIntegrator>(type, name, parameters);
280  _time_integrator = ti;
281 }
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters &parameters, THREAD_ID tid=0, bool print_deprecated=true)
Definition: Factory.C:110
Factory & _factory
Definition: SystemBase.h:927
Base class for a system (of equations)
Definition: SystemBase.h:84
virtual const std::string & name() const
Definition: SystemBase.C:1297
Base class for time integrators.
std::shared_ptr< TimeIntegrator > _time_integrator
Time integrator.
Definition: SystemBase.h:973

◆ addTimeIntegrator() [2/4]

virtual void SystemBase::addTimeIntegrator
inline

Definition at line 861 of file SystemBase.h.

864  {
865  }

◆ addTimeIntegrator() [3/4]

virtual void SystemBase::addTimeIntegrator
inline

Definition at line 867 of file SystemBase.h.

867 {}

◆ addTimeIntegrator() [4/4]

virtual void SystemBase::addTimeIntegrator ( std::shared_ptr< TimeIntegrator )
inlinevirtualinherited

Reimplemented in DisplacedSystem.

Definition at line 867 of file SystemBase.h.

867 {}

◆ addVariable()

void AuxiliarySystem::addVariable ( const std::string &  var_type,
const std::string &  var_name,
InputParameters parameters 
)
overridevirtual

Canonical method for adding a variable.

Parameters
var_typethe type of the variable, e.g. MooseVariableScalar
var_namethe variable name, e.g. 'u'
paramsthe InputParameters from which to construct the variable

Reimplemented from SystemBase.

Definition at line 219 of file AuxiliarySystem.C.

222 {
223  SystemBase::addVariable(var_type, name, parameters);
224 
225  auto fe_type = FEType(Utility::string_to_enum<Order>(parameters.get<MooseEnum>("order")),
226  Utility::string_to_enum<FEFamily>(parameters.get<MooseEnum>("family")));
227 
228  if (var_type == "MooseVariableScalar")
229  return;
230 
231  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
232  {
233  if (fe_type.family == LAGRANGE_VEC || fe_type.family == NEDELEC_ONE ||
234  fe_type.family == MONOMIAL_VEC || fe_type.family == RAVIART_THOMAS)
235  {
236  auto * var = _vars[tid].getActualFieldVariable<RealVectorValue>(name);
237  if (var)
238  {
239  if (var->feType().family == LAGRANGE_VEC)
240  _nodal_vars[tid].push_back(var);
241  else
242  _elem_vars[tid].push_back(var);
243  }
244  }
245 
246  else
247  {
248  MooseVariableBase * var_base = _vars[tid].getVariable(name);
249 
250  auto * const var = dynamic_cast<MooseVariableField<Real> *>(var_base);
251 
252  if (var)
253  {
254  if (var->feType().family == LAGRANGE)
255  _nodal_vars[tid].push_back(var);
256  else
257  _elem_vars[tid].push_back(var);
258  }
259 
260  auto * const avar = dynamic_cast<MooseVariableField<RealEigenVector> *>(var_base);
261 
262  if (avar)
263  {
264  if (avar->feType().family == LAGRANGE)
265  _nodal_vars[tid].push_back(avar);
266  else
267  _elem_vars[tid].push_back(avar);
268  }
269  }
270  }
271 }
LAGRANGE
unsigned int n_threads()
LAGRANGE_VEC
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters &parameters)
Canonical method for adding a variable.
Definition: SystemBase.C:708
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
virtual const std::string & name() const
Definition: SystemBase.C:1297
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:31
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vars
std::vector< std::vector< MooseVariableFieldBase * > > _elem_vars
Elemental variables.
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934
unsigned int THREAD_ID
Definition: MooseTypes.h:198

◆ addVariableToCopy()

void SystemBase::addVariableToCopy ( const std::string &  dest_name,
const std::string &  source_name,
const std::string &  timestep 
)
virtualinherited

Add info about variable that will be copied.

Parameters
dest_nameName of the nodal variable being used for copying into (name is from the exodusII file)
source_nameName of the nodal variable being used for copying from (name is from the exodusII file)
timestepTimestep in the file being used

Definition at line 1143 of file SystemBase.C.

Referenced by CopyNodalVarsAction::act(), and PhysicsBase::copyVariablesFromMesh().

1146 {
1147  _var_to_copy.push_back(VarCopyInfo(dest_name, source_name, timestep));
1148 }
std::vector< VarCopyInfo > _var_to_copy
Definition: SystemBase.h:964
Information about variables that will be copied.
Definition: SystemBase.h:66

◆ addVariableToZeroOnJacobian()

void SystemBase::addVariableToZeroOnJacobian ( std::string  var_name)
virtualinherited

Adds this variable to the list of variables to be zeroed during each Jacobian evaluation.

Parameters
var_nameThe name of the variable to be zeroed.

Reimplemented in DisplacedSystem.

Definition at line 169 of file SystemBase.C.

Referenced by ADDGKernel::ADDGKernel(), DisplacedSystem::addVariableToZeroOnJacobian(), ADIntegratedBCTempl< T >::ADIntegratedBCTempl(), ADKernelTempl< T >::ADKernelTempl(), ArrayDGKernel::ArrayDGKernel(), ArrayIntegratedBC::ArrayIntegratedBC(), ArrayKernel::ArrayKernel(), DGKernel::DGKernel(), IntegratedBC::IntegratedBC(), InterfaceKernelTempl< T >::InterfaceKernelTempl(), Kernel::Kernel(), NodalBC::NodalBC(), and NodalKernel::NodalKernel().

170 {
171  _vars_to_be_zeroed_on_jacobian.push_back(var_name);
172 }
std::vector< std::string > _vars_to_be_zeroed_on_jacobian
Definition: SystemBase.h:941

◆ addVariableToZeroOnResidual()

void SystemBase::addVariableToZeroOnResidual ( std::string  var_name)
virtualinherited

Adds this variable to the list of variables to be zeroed during each residual evaluation.

Parameters
var_nameThe name of the variable to be zeroed.

Reimplemented in DisplacedSystem.

Definition at line 163 of file SystemBase.C.

Referenced by ADDGKernel::ADDGKernel(), DisplacedSystem::addVariableToZeroOnResidual(), ADIntegratedBCTempl< T >::ADIntegratedBCTempl(), ADKernelTempl< T >::ADKernelTempl(), ArrayDGKernel::ArrayDGKernel(), ArrayIntegratedBC::ArrayIntegratedBC(), ArrayKernel::ArrayKernel(), DGKernel::DGKernel(), IntegratedBC::IntegratedBC(), InterfaceKernelTempl< T >::InterfaceKernelTempl(), Kernel::Kernel(), NodalBC::NodalBC(), and NodalKernel::NodalKernel().

164 {
165  _vars_to_be_zeroed_on_residual.push_back(var_name);
166 }
std::vector< std::string > _vars_to_be_zeroed_on_residual
Definition: SystemBase.h:940

◆ addVector() [1/2]

NumericVector< Number > & SystemBase::addVector ( const std::string &  vector_name,
const bool  project,
const ParallelType  type 
)
inherited

Adds a solution length vector to the system.

Parameters
vector_nameThe name of the vector.
projectWhether or not to project this vector when doing mesh refinement. If the vector is just going to be recomputed then there is no need to project it.
typeWhat type of parallel vector. This is usually either PARALLEL or GHOSTED. GHOSTED is needed if you are going to be accessing off-processor entries. The ghosting pattern is the same as the solution vector.

Definition at line 597 of file SystemBase.C.

Referenced by addDotVectors(), NonlinearSystemBase::addDotVectors(), SystemBase::addScalingVector(), SecantSolve::allocateStorage(), SteffensenSolve::allocateStorage(), PicardSolve::allocateStorage(), AStableDirk4::AStableDirk4(), ExplicitTimeIntegrator::ExplicitTimeIntegrator(), NonlinearSystemBase::getResidualNonTimeVector(), NonlinearSystemBase::getResidualTimeVector(), CentralDifference::initialSetup(), LStableDirk3::LStableDirk3(), LStableDirk4::LStableDirk4(), SystemBase::needSolutionState(), NonlinearSystemBase::residualGhosted(), and SystemBase::saveOldSolutions().

598 {
599  if (hasVector(vector_name))
600  return getVector(vector_name);
601 
602  NumericVector<Number> & vec = system().add_vector(vector_name, project, type);
603  return vec;
604 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:873
virtual System & system()=0
Get the reference to the libMesh system.
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:882

◆ addVector() [2/2]

NumericVector< Number > & SystemBase::addVector ( TagID  tag,
const bool  project,
const ParallelType  type 
)
inherited

Adds a solution length vector to the system with the specified TagID.

Parameters
tag_nameThe name of the tag
projectWhether or not to project this vector when doing mesh refinement. If the vector is just going to be recomputed then there is no need to project it.
typeWhat type of parallel vector. This is usually either PARALLEL or GHOSTED. GHOSTED is needed if you are going to be accessing off-processor entries. The ghosting pattern is the same as the solution vector.

Definition at line 607 of file SystemBase.C.

608 {
609  if (!_subproblem.vectorTagExists(tag))
610  mooseError("Cannot add tagged vector with TagID ",
611  tag,
612  " in system '",
613  name(),
614  "' because the tag does not exist in the problem");
615 
616  if (hasVector(tag))
617  {
618  auto & vec = getVector(tag);
619 
620  if (type != ParallelType::AUTOMATIC && vec.type() != type)
621  mooseError("Cannot add tagged vector '",
623  "', in system '",
624  name(),
625  "' because a vector with the same name was found with a different parallel type");
626 
627  return vec;
628  }
629 
630  const auto vector_name = _subproblem.vectorTagName(tag);
631  NumericVector<Number> & vec = system().add_vector(vector_name, project, type);
632  associateVectorToTag(vec, tag);
633 
634  return vec;
635 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:873
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
virtual void associateVectorToTag(NumericVector< Number > &vec, TagID tag)
Associate a vector for a given tag.
Definition: SystemBase.C:930
virtual const std::string & name() const
Definition: SystemBase.C:1297
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
virtual System & system()=0
Get the reference to the libMesh system.
virtual TagName vectorTagName(const TagID tag) const
Retrieve the name associated with a TagID.
Definition: SubProblem.C:198
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:882

◆ applyScalingFactors()

void SystemBase::applyScalingFactors ( const std::vector< Real > &  inverse_scaling_factors)
inherited

Applies scaling factors to the system's variables.

Parameters
inverse_scaling_factorsA vector containing the inverse of each variable's scaling factor, e.g. 1 / scaling_factor

Definition at line 1424 of file SystemBase.C.

Referenced by NonlinearSystemBase::computeScaling().

1425 {
1426  for (MooseIndex(_vars) thread = 0; thread < _vars.size(); ++thread)
1427  {
1428  auto & field_variables = _vars[thread].fieldVariables();
1429  for (MooseIndex(field_variables) i = 0, p = 0; i < field_variables.size(); ++i)
1430  {
1431  auto factors = field_variables[i]->arrayScalingFactor();
1432  for (unsigned int j = 0; j < field_variables[i]->count(); ++j, ++p)
1433  factors[j] /= inverse_scaling_factors[p];
1434 
1435  field_variables[i]->scalingFactor(factors);
1436  }
1437 
1438  auto offset = field_variables.size();
1439 
1440  auto & scalar_variables = _vars[thread].scalars();
1441  for (MooseIndex(scalar_variables) i = 0; i < scalar_variables.size(); ++i)
1442  scalar_variables[i]->scalingFactor(
1443  {1. / inverse_scaling_factors[offset + i] * scalar_variables[i]->scalingFactor()});
1444 
1445  if (thread == 0 && _verbose)
1446  {
1447  _console << "Automatic scaling factors:\n";
1448  auto original_flags = _console.flags();
1449  auto original_precision = _console.precision();
1450  _console.unsetf(std::ios_base::floatfield);
1451  _console.precision(6);
1452 
1453  for (const auto & field_variable : field_variables)
1454  {
1455  const auto & factors = field_variable->arrayScalingFactor();
1456  _console << " " << field_variable->name() << ":";
1457  for (const auto i : make_range(field_variable->count()))
1458  _console << " " << factors[i];
1459  _console << "\n";
1460  }
1461  for (const auto & scalar_variable : scalar_variables)
1462  _console << " " << scalar_variable->name() << ": " << scalar_variable->scalingFactor()
1463  << "\n";
1464  _console << "\n" << std::endl;
1465 
1466  // restore state
1467  _console.flags(original_flags);
1468  _console.precision(original_precision);
1469  }
1470  }
1471 }
std::ios_base::fmtflags flags() const
Return the current flags.
Definition: ConsoleStream.C:58
void unsetf(std::ios_base::fmtflags mask) const
Unset format flags.
Definition: ConsoleStream.C:40
std::streamsize precision() const
Return the current precision.
Definition: ConsoleStream.C:46
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934
bool _verbose
True if printing out additional information.
Definition: SystemBase.h:982
IntRange< T > make_range(T beg, T end)
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.

◆ assignMaxVarNDofsPerElem()

void SystemBase::assignMaxVarNDofsPerElem ( std::size_t  max_dofs)
inlineinherited

assign the maximum element dofs

Definition at line 575 of file SystemBase.h.

575 { _max_var_n_dofs_per_elem = max_dofs; }
size_t _max_var_n_dofs_per_elem
Maximum number of dofs for any one variable on any one element.
Definition: SystemBase.h:967

◆ assignMaxVarNDofsPerNode()

void SystemBase::assignMaxVarNDofsPerNode ( std::size_t  max_dofs)
inlineinherited

assign the maximum node dofs

Definition at line 580 of file SystemBase.h.

580 { _max_var_n_dofs_per_node = max_dofs; }
size_t _max_var_n_dofs_per_node
Maximum number of dofs for any one variable on any one node.
Definition: SystemBase.h:970

◆ associateMatrixToTag()

void SystemBase::associateMatrixToTag ( SparseMatrix< Number > &  matrix,
TagID  tag 
)
virtualinherited

Associate a matrix to a tag.

Reimplemented in DisplacedSystem.

Definition at line 1025 of file SystemBase.C.

Referenced by SystemBase::addMatrix(), DisplacedSystem::associateMatrixToTag(), NonlinearSystemBase::computeJacobian(), FEProblemBase::computeJacobianInternal(), FEProblemBase::computeJacobianTag(), and FEProblemBase::computeResidualAndJacobian().

1026 {
1027  if (!_subproblem.matrixTagExists(tag))
1028  mooseError("Cannot associate matrix to tag ", tag, " because that tag does not exist");
1029 
1030  if (_tagged_matrices.size() < tag + 1)
1031  _tagged_matrices.resize(tag + 1);
1032 
1033  _tagged_matrices[tag] = &matrix;
1034 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< SparseMatrix< Number > * > _tagged_matrices
Tagged matrices (pointer)
Definition: SystemBase.h:949
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:294

◆ associateVectorToTag()

void SystemBase::associateVectorToTag ( NumericVector< Number > &  vec,
TagID  tag 
)
virtualinherited

Associate a vector for a given tag.

Reimplemented in DisplacedSystem.

Definition at line 930 of file SystemBase.C.

Referenced by SystemBase::addVector(), DisplacedSystem::associateVectorToTag(), NonlinearSystemBase::computeNodalBCs(), FEProblemBase::computeResidual(), FEProblemBase::computeResidualAndJacobian(), FEProblemBase::computeResidualInternal(), NonlinearSystemBase::computeResidualTag(), FEProblemBase::computeResidualTag(), FEProblemBase::computeResidualType(), and NonlinearSystemBase::setSolution().

931 {
932  if (!_subproblem.vectorTagExists(tag))
933  mooseError("Cannot associate vector to tag ", tag, " because that tag does not exist");
934 
935  if (_tagged_vectors.size() < tag + 1)
936  _tagged_vectors.resize(tag + 1);
937 
938  _tagged_vectors[tag] = &vec;
939 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
std::vector< NumericVector< Number > * > _tagged_vectors
Tagged vectors (pointer)
Definition: SystemBase.h:947

◆ augmentSendList()

void SystemBase::augmentSendList ( std::vector< dof_id_type > &  send_list)
virtualinherited

Will modify the send_list to add all of the extra ghosted dofs for this system.

Reimplemented in DisplacedSystem.

Definition at line 441 of file SystemBase.C.

Referenced by DisplacedSystem::augmentSendList(), and extraSendList().

442 {
443  std::set<dof_id_type> & ghosted_elems = _subproblem.ghostedElems();
444 
445  DofMap & dof_map = dofMap();
446 
447  std::vector<dof_id_type> dof_indices;
448 
449  System & sys = system();
450 
451  unsigned int sys_num = sys.number();
452 
453  unsigned int n_vars = sys.n_vars();
454 
455  for (const auto & elem_id : ghosted_elems)
456  {
457  Elem * elem = _mesh.elemPtr(elem_id);
458 
459  if (elem->active())
460  {
461  dof_map.dof_indices(elem, dof_indices);
462 
463  // Only need to ghost it if it's actually not on this processor
464  for (const auto & dof : dof_indices)
465  if (dof < dof_map.first_dof() || dof >= dof_map.end_dof())
466  send_list.push_back(dof);
467 
468  // Now add the DoFs from all of the nodes. This is necessary because of block
469  // restricted variables. A variable might not live _on_ this element but it
470  // might live on nodes connected to this element.
471  for (unsigned int n = 0; n < elem->n_nodes(); n++)
472  {
473  Node * node = elem->node_ptr(n);
474 
475  // Have to get each variable's dofs
476  for (unsigned int v = 0; v < n_vars; v++)
477  {
478  const Variable & var = sys.variable(v);
479  unsigned int var_num = var.number();
480  unsigned int n_comp = var.n_components();
481 
482  // See if this variable has any dofs at this node
483  if (node->n_dofs(sys_num, var_num) > 0)
484  {
485  // Loop over components of the variable
486  for (unsigned int c = 0; c < n_comp; c++)
487  send_list.push_back(node->dof_number(sys_num, var_num, c));
488  }
489  }
490  }
491  }
492  }
493 }
virtual Elem * elemPtr(const dof_id_type i)
Definition: MooseMesh.C:2863
virtual DofMap & dofMap()
Gets writeable reference to the dof map.
Definition: SystemBase.C:1131
unsigned int n_vars
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual std::set< dof_id_type > & ghostedElems()
Return the list of elements that should have their DoFs ghosted to this processor.
Definition: SubProblem.h:627
virtual System & system()=0
Get the reference to the libMesh system.
MooseMesh & _mesh
Definition: SystemBase.h:929

◆ augmentSparsity()

void AuxiliarySystem::augmentSparsity ( SparsityPattern::Graph &  sparsity,
std::vector< dof_id_type > &  n_nz,
std::vector< dof_id_type > &  n_oz 
)
overridevirtual

Will modify the sparsity pattern to add logical geometric connections.

Implements SystemBase.

Definition at line 795 of file AuxiliarySystem.C.

799 {
800 }

◆ automaticScaling() [1/2]

bool SystemBase::automaticScaling ( ) const
inlineinherited

Getter for whether we are performing automatic scaling.

Returns
whether we are performing automatic scaling

Definition at line 117 of file SystemBase.h.

Referenced by SubProblem::automaticScaling().

117 { return _automatic_scaling; }
bool _automatic_scaling
Whether to automatically scale the variables.
Definition: SystemBase.h:979

◆ automaticScaling() [2/2]

void SystemBase::automaticScaling ( bool  automatic_scaling)
inlineinherited

Setter for whether we are performing automatic scaling.

Parameters
automatic_scalingA boolean representing whether we are performing automatic scaling

Definition at line 123 of file SystemBase.h.

123 { _automatic_scaling = automatic_scaling; }
bool _automatic_scaling
Whether to automatically scale the variables.
Definition: SystemBase.h:979

◆ clearAllDofIndices()

void SystemBase::clearAllDofIndices ( )
inherited

Clear all dof indices from moose variables.

Definition at line 1529 of file SystemBase.C.

Referenced by SubProblem::clearAllDofIndices().

1530 {
1531  for (auto & var_warehouse : _vars)
1532  var_warehouse.clearAllDofIndices();
1533 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ clearScalarVariableCoupleableTags()

void AuxiliarySystem::clearScalarVariableCoupleableTags ( )

Definition at line 645 of file AuxiliarySystem.C.

Referenced by computeScalarVars().

646 {
649 }
virtual void clearActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid) override
virtual void clearActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid) override
FEProblemBase & _fe_problem

◆ closeTaggedMatrices()

void SystemBase::closeTaggedMatrices ( const std::set< TagID > &  tags)
inherited

Close all matrices associated the tags.

Definition at line 1009 of file SystemBase.C.

Referenced by NonlinearSystemBase::computeJacobianInternal(), and NonlinearSystemBase::computeResidualAndJacobianTags().

1010 {
1011  for (auto tag : tags)
1012  if (hasMatrix(tag))
1013  getMatrix(tag).close();
1014 }
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:328
virtual void close()=0
virtual SparseMatrix< Number > & getMatrix(TagID tag)
Get a raw SparseMatrix.
Definition: SystemBase.C:973

◆ closeTaggedVector()

void SystemBase::closeTaggedVector ( const TagID  tag)
inherited

Close vector with the given tag.

Definition at line 638 of file SystemBase.C.

Referenced by SystemBase::closeTaggedVectors().

639 {
640  if (!_subproblem.vectorTagExists(tag))
641  mooseError("Cannot close vector with TagID ",
642  tag,
643  " in system '",
644  name(),
645  "' because that tag does not exist in the problem");
646  else if (!hasVector(tag))
647  mooseError("Cannot close vector tag with name '",
649  "' in system '",
650  name(),
651  "' because there is no vector associated with that tag");
652 
653  getVector(tag).close();
654 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:873
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
virtual const std::string & name() const
Definition: SystemBase.C:1297
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
virtual void close()=0
virtual TagName vectorTagName(const TagID tag) const
Retrieve the name associated with a TagID.
Definition: SubProblem.C:198
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:882

◆ closeTaggedVectors()

void SystemBase::closeTaggedVectors ( const std::set< TagID > &  tags)
inherited

Close all vectors for given tags.

Definition at line 657 of file SystemBase.C.

Referenced by NonlinearSystemBase::computeResidualAndJacobianTags(), and NonlinearSystemBase::computeResidualTags().

658 {
659  for (const auto tag : tags)
660  closeTaggedVector(tag);
661 }
void closeTaggedVector(const TagID tag)
Close vector with the given tag.
Definition: SystemBase.C:638

◆ compute()

void AuxiliarySystem::compute ( ExecFlagType  type)
virtual

Compute auxiliary variables.

Parameters
typeTime flag of which variables should be computed

Definition at line 413 of file AuxiliarySystem.C.

Referenced by setPreviousNewtonSolution().

414 {
415  // avoid division by dt which might be zero.
416  if (_fe_problem.dt() > 0. && _time_integrator)
417  _time_integrator->preStep();
418 
419  // We need to compute time derivatives every time each kind of the variables is finished, because:
420  //
421  // a) the user might want to use the aux variable value somewhere, thus we need to provide the
422  // up-to-date value
423  // b) time integration system works with the whole vectors of solutions, thus we cannot update
424  // only a part of the vector
425  //
426 
427  if (_vars[0].scalars().size() > 0)
428  {
429  computeScalarVars(type);
430  // compute time derivatives of scalar aux variables _after_ the values were updated
431  if (_fe_problem.dt() > 0. && _time_integrator)
432  _time_integrator->computeTimeDerivatives();
433  }
434 
435  if (_vars[0].fieldVariables().size() > 0)
436  {
437  computeNodalArrayVars(type);
438  computeNodalVecVars(type);
439  computeNodalVars(type);
443  computeElementalVars(type);
444 
445  // compute time derivatives of nodal aux variables _after_ the values were updated
446  if (_fe_problem.dt() > 0. && _time_integrator)
447  _time_integrator->computeTimeDerivatives();
448  }
449 
450  if (_serialized_solution.get())
452 }
std::unique_ptr< NumericVector< Number > > _serialized_solution
Serialized version of the solution vector, or nullptr if a serialized solution is not needed...
void computeScalarVars(ExecFlagType type)
void computeMortarNodalVars(ExecFlagType type)
void computeNodalArrayVars(ExecFlagType type)
void computeElementalVars(ExecFlagType type)
FEProblemBase & _fe_problem
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934
std::shared_ptr< TimeIntegrator > _time_integrator
Time integrator.
Definition: SystemBase.h:973
void computeNodalVars(ExecFlagType type)
virtual void serializeSolution()
void computeNodalVecVars(ExecFlagType type)
void computeElementalArrayVars(ExecFlagType type)
virtual Real & dt() const
void computeElementalVecVars(ExecFlagType type)

◆ computeElementalArrayVars()

void AuxiliarySystem::computeElementalArrayVars ( ExecFlagType  type)
protected

Definition at line 788 of file AuxiliarySystem.C.

Referenced by compute().

789 {
791  computeElementalVarsHelper<ArrayAuxKernel>(elemental);
792 }
A storage container for MooseObjects that inherit from SetupInterface.
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _elemental_array_aux_storage

◆ computeElementalVars()

void AuxiliarySystem::computeElementalVars ( ExecFlagType  type)
protected

Definition at line 770 of file AuxiliarySystem.C.

Referenced by compute().

771 {
772  TIME_SECTION("computeElementalVars", 3);
773 
775  computeElementalVarsHelper<AuxKernel>(elemental);
776 }
A storage container for MooseObjects that inherit from SetupInterface.
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage

◆ computeElementalVarsHelper()

template<typename AuxKernelType >
template void AuxiliarySystem::computeElementalVarsHelper< VectorAuxKernel > ( const MooseObjectWarehouse< AuxKernelType > &  warehouse)
protected

Definition at line 836 of file AuxiliarySystem.C.

837 {
838  if (warehouse.hasActiveBlockObjects())
839  {
840  // Block Elemental AuxKernels
841  PARALLEL_TRY
842  {
845  try
846  {
847  Threads::parallel_reduce(range, eavt);
848  }
849  catch (MooseException & e)
850  {
851  _fe_problem.setException("The following MooseException was raised during elemental "
852  "Auxiliary variable computation:\n" +
853  std::string(e.what()));
854  }
855  }
856  PARALLEL_CATCH;
857 
858  // We need to make sure we propagate exceptions to all processes before trying to close
859  // here, which is a parallel operation
860  solution().close();
861  _sys.update();
862  }
863 
864  // Boundary Elemental AuxKernels
865  if (warehouse.hasActiveBoundaryObjects())
866  {
867  TIME_SECTION("computeElementalVecVars", 3);
868 
869  PARALLEL_TRY
870  {
873  try
874  {
875  Threads::parallel_reduce(bnd_elems, eabt);
876  }
877  catch (MooseException & e)
878  {
879  _fe_problem.setException("The following MooseException was raised during boundary "
880  "elemental Auxiliary variable computation:\n" +
881  std::string(e.what()));
882  }
883  }
884  PARALLEL_CATCH;
885 
886  // We need to make sure we propagate exceptions to all processes before trying to close
887  // here, which is a parallel operation
888  solution().close();
889  _sys.update();
890  }
891 }
ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:1040
virtual const char * what() const
Get out the error message.
bool hasActiveBlockObjects(THREAD_ID tid=0) const
NumericVector< Number > & solution()
Definition: SystemBase.h:176
StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > ConstBndElemRange
Definition: MooseMesh.h:2027
virtual void setException(const std::string &message)
Set an exception, which is stored at this point by toggling a member variable in this class...
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
FEProblemBase & _fe_problem
virtual void close()=0
Provides a way for users to bail out of the current solve.
MooseMesh & _mesh
Definition: SystemBase.h:929
StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > * getBoundaryElementRange()
Definition: MooseMesh.C:1105

◆ computeElementalVecVars()

void AuxiliarySystem::computeElementalVecVars ( ExecFlagType  type)
protected

Definition at line 779 of file AuxiliarySystem.C.

Referenced by compute().

780 {
781  TIME_SECTION("computeElementalVecVars", 3);
782 
784  computeElementalVarsHelper<VectorAuxKernel>(elemental);
785 }
A storage container for MooseObjects that inherit from SetupInterface.
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ computeMortarNodalVars()

void AuxiliarySystem::computeMortarNodalVars ( ExecFlagType  type)
protected

Definition at line 718 of file AuxiliarySystem.C.

Referenced by compute().

719 {
720  TIME_SECTION("computeMortarNodalVars", 3);
721 
722  const MooseObjectWarehouse<AuxKernel> & mortar_nodal_warehouse = _mortar_nodal_aux_storage[type];
723 
724  mooseAssert(!mortar_nodal_warehouse.hasActiveBlockObjects(),
725  "We don't allow creation of block restricted mortar nodal aux kernels.");
726 
727  if (mortar_nodal_warehouse.hasActiveBoundaryObjects())
728  {
730  for (const auto & [bnd_id, mortar_nodal_auxes] :
731  mortar_nodal_warehouse.getActiveBoundaryObjects())
732  for (const auto index : index_range(mortar_nodal_auxes))
733  {
734  PARALLEL_TRY
735  {
736  try
737  {
739  _fe_problem, mortar_nodal_warehouse, bnd_id, index);
740  Threads::parallel_reduce(bnd_nodes, mnabt);
741  }
742  catch (libMesh::LogicError & e)
743  {
744  _fe_problem.setException("The following libMesh::LogicError was raised during mortar "
745  "nodal Auxiliary variable computation:\n" +
746  std::string(e.what()));
747  }
748  catch (MooseException & e)
749  {
750  _fe_problem.setException("The following MooseException was raised during mortar nodal "
751  "Auxiliary variable computation:\n" +
752  std::string(e.what()));
753  }
754  catch (MetaPhysicL::LogicError & e)
755  {
757  }
758  }
759  PARALLEL_CATCH;
760 
761  // We need to make sure we propagate exceptions to all processes before trying to close
762  // here, which is a parallel operation
763  solution().close();
764  _sys.update();
765  }
766  }
767 }
ExecuteMooseObjectWarehouse< AuxKernel > _mortar_nodal_aux_storage
virtual const char * what() const
Get out the error message.
bool hasActiveBlockObjects(THREAD_ID tid=0) const
This class evaluates a single mortar nodal aux kernel.
NumericVector< Number > & solution()
Definition: SystemBase.h:176
void translateMetaPhysicLError(const MetaPhysicL::LogicError &)
emit a relatively clear error message when we catch a MetaPhysicL logic error
Definition: MooseError.C:98
A storage container for MooseObjects that inherit from SetupInterface.
virtual void setException(const std::string &message)
Set an exception, which is stored at this point by toggling a member variable in this class...
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
FEProblemBase & _fe_problem
virtual void close()=0
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const
Provides a way for users to bail out of the current solve.
MooseMesh & _mesh
Definition: SystemBase.h:929
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > ConstBndNodeRange
Some useful StoredRange typedefs.
Definition: MooseMesh.h:2026
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > * getBoundaryNodeRange()
Definition: MooseMesh.C:1091
auto index_range(const T &sizable)

◆ computeNodalArrayVars()

void AuxiliarySystem::computeNodalArrayVars ( ExecFlagType  type)
protected

Definition at line 711 of file AuxiliarySystem.C.

Referenced by compute().

712 {
714  computeNodalVarsHelper<ArrayAuxKernel>(nodal);
715 }
A storage container for MooseObjects that inherit from SetupInterface.
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _nodal_array_aux_storage

◆ computeNodalVars()

void AuxiliarySystem::computeNodalVars ( ExecFlagType  type)
protected

Definition at line 693 of file AuxiliarySystem.C.

Referenced by compute().

694 {
695  TIME_SECTION("computeNodalVars", 3);
696 
698  computeNodalVarsHelper<AuxKernel>(nodal);
699 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
A storage container for MooseObjects that inherit from SetupInterface.

◆ computeNodalVarsHelper()

template<typename AuxKernelType >
template void AuxiliarySystem::computeNodalVarsHelper< VectorAuxKernel > ( const MooseObjectWarehouse< AuxKernelType > &  warehouse)
protected

Definition at line 895 of file AuxiliarySystem.C.

896 {
897  if (warehouse.hasActiveBlockObjects())
898  {
899  // Block Nodal AuxKernels
900  PARALLEL_TRY
901  {
904  Threads::parallel_reduce(range, navt);
905 
906  solution().close();
907  _sys.update();
908  }
909  PARALLEL_CATCH;
910  }
911 
912  if (warehouse.hasActiveBoundaryObjects())
913  {
914  TIME_SECTION("computeBoundaryObjects", 3);
915 
916  // Boundary Nodal AuxKernels
917  PARALLEL_TRY
918  {
921  Threads::parallel_reduce(bnd_nodes, nabt);
922 
923  solution().close();
924  _sys.update();
925  }
926  PARALLEL_CATCH;
927  }
928 }
bool hasActiveBlockObjects(THREAD_ID tid=0) const
NumericVector< Number > & solution()
Definition: SystemBase.h:176
ConstNodeRange * getLocalNodeRange()
Definition: MooseMesh.C:1077
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
FEProblemBase & _fe_problem
StoredRange< MeshBase::const_node_iterator, const Node *> ConstNodeRange
virtual void close()=0
MooseMesh & _mesh
Definition: SystemBase.h:929
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > ConstBndNodeRange
Some useful StoredRange typedefs.
Definition: MooseMesh.h:2026
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > * getBoundaryNodeRange()
Definition: MooseMesh.C:1091

◆ computeNodalVecVars()

void AuxiliarySystem::computeNodalVecVars ( ExecFlagType  type)
protected

Definition at line 702 of file AuxiliarySystem.C.

Referenced by compute().

703 {
704  TIME_SECTION("computeNodalVecVars", 3);
705 
707  computeNodalVarsHelper<VectorAuxKernel>(nodal);
708 }
A storage container for MooseObjects that inherit from SetupInterface.
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage

◆ computeScalarVars()

void AuxiliarySystem::computeScalarVars ( ExecFlagType  type)
protected

Definition at line 652 of file AuxiliarySystem.C.

Referenced by compute().

653 {
655 
656  // Reference to the current storage container
658 
659  if (storage.hasActiveObjects())
660  {
661  TIME_SECTION("computeScalarVars", 1);
662 
663  PARALLEL_TRY
664  {
665  // FIXME: run multi-threaded
666  THREAD_ID tid = 0;
667  if (storage.hasActiveObjects())
668  {
670 
671  const std::vector<std::shared_ptr<AuxScalarKernel>> & objects =
672  storage.getActiveObjects(tid);
673 
674  // Call compute() method on all active AuxScalarKernel objects
675  for (const auto & obj : objects)
676  obj->compute();
677 
678  const std::vector<MooseVariableScalar *> & scalar_vars = getScalarVariables(tid);
679  for (const auto & var : scalar_vars)
680  var->insert(solution());
681  }
682  }
683  PARALLEL_CATCH;
684 
685  solution().close();
686  _sys.update();
687  }
688 
690 }
const std::vector< MooseVariableScalar * > & getScalarVariables(THREAD_ID tid)
Definition: SystemBase.h:737
NumericVector< Number > & solution()
Definition: SystemBase.h:176
virtual void reinitScalars(const THREAD_ID tid, bool reinit_for_derivative_reordering=false) override
fills the VariableValue arrays for scalar variables from the solution vector
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
void setScalarVariableCoupleableTags(ExecFlagType type)
void clearScalarVariableCoupleableTags()
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...
FEProblemBase & _fe_problem
virtual void close()=0
bool hasActiveObjects(THREAD_ID tid=0) const
unsigned int THREAD_ID
Definition: MooseTypes.h:198

◆ computeVariables()

virtual void SystemBase::computeVariables ( const NumericVector< Number > &  )
inlinevirtualinherited

Definition at line 852 of file SystemBase.h.

852 {}

◆ computingScalingJacobian()

bool SystemBase::computingScalingJacobian ( ) const
inherited

Whether we are computing an initial Jacobian for automatic variable scaling.

Definition at line 1481 of file SystemBase.C.

Referenced by Assembly::addJacobianBlock(), Assembly::addJacobianBlockNonlocal(), Assembly::addJacobianNeighbor(), Assembly::cacheJacobianBlock(), VectorKernel::computeJacobian(), Kernel::computeJacobian(), EigenKernel::computeJacobian(), and FEProblemBase::computeJacobianTags().

1482 {
1484 }
virtual bool computingScalingJacobian() const =0
Getter for whether we&#39;re computing the scaling jacobian.
SubProblem & _subproblem
Definition: SystemBase.h:924

◆ copyOldSolutions()

void SystemBase::copyOldSolutions ( )
virtualinherited

Shifts the solutions backwards in time.

Definition at line 1254 of file SystemBase.C.

Referenced by EigenExecutionerBase::inversePowerIteration().

1255 {
1256  const auto states =
1257  _solution_states[static_cast<unsigned short>(Moose::SolutionIterationType::Time)].size();
1258  if (states > 1)
1259  for (unsigned int i = states - 1; i > 0; --i)
1260  solutionState(i) = solutionState(i - 1);
1261 
1262  if (solutionUDotOld())
1263  *solutionUDotOld() = *solutionUDot();
1264  if (solutionUDotDotOld())
1266  if (solutionPreviousNewton())
1268 }
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
virtual NumericVector< Number > * solutionUDot()=0
virtual NumericVector< Number > & solutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Get a state of the solution (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.C:1384
virtual NumericVector< Number > * solutionUDotDotOld()=0
std::array< std::vector< NumericVector< Number > * >, 2 > _solution_states
The solution states (0 = current, 1 = old, 2 = older, etc)
Definition: SystemBase.h:998
virtual const NumericVector< Number > * solutionPreviousNewton() const
Definition: SystemBase.C:1312
virtual NumericVector< Number > * solutionUDotOld()=0
virtual NumericVector< Number > * solutionUDotDot()=0

◆ copySolutionsBackwards()

void SystemBase::copySolutionsBackwards ( )
virtualinherited

Copy current solution into old and older.

Definition at line 1227 of file SystemBase.C.

1228 {
1229  system().update();
1230 
1231  // Copying the solutions backward so the current solution will become the old, and the old will
1232  // become older. The same applies to the nonlinear iterates.
1233  for (const auto iteration_index : index_range(_solution_states))
1234  {
1235  const auto states = _solution_states[iteration_index].size();
1236  if (states > 1)
1237  for (unsigned int i = states - 1; i > 0; --i)
1238  solutionState(i, Moose::SolutionIterationType(iteration_index)) =
1239  solutionState(i - 1, Moose::SolutionIterationType(iteration_index));
1240  }
1241 
1242  if (solutionUDotOld())
1243  *solutionUDotOld() = *solutionUDot();
1244  if (solutionUDotDotOld())
1246  if (solutionPreviousNewton())
1248 }
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
virtual NumericVector< Number > * solutionUDot()=0
virtual NumericVector< Number > & solutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Get a state of the solution (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.C:1384
virtual NumericVector< Number > * solutionUDotDotOld()=0
virtual System & system()=0
Get the reference to the libMesh system.
std::array< std::vector< NumericVector< Number > * >, 2 > _solution_states
The solution states (0 = current, 1 = old, 2 = older, etc)
Definition: SystemBase.h:998
virtual const NumericVector< Number > * solutionPreviousNewton() const
Definition: SystemBase.C:1312
virtual NumericVector< Number > * solutionUDotOld()=0
virtual NumericVector< Number > * solutionUDotDot()=0
auto index_range(const T &sizable)
SolutionIterationType
Definition: MooseTypes.h:229

◆ copyVars()

void SystemBase::copyVars ( ExodusII_IO &  io)
inherited

Definition at line 1151 of file SystemBase.C.

1152 {
1153  int n_steps = io.get_num_time_steps();
1154 
1155  bool did_copy = false;
1156  for (const auto & vci : _var_to_copy)
1157  {
1158  int timestep = -1;
1159 
1160  if (vci._timestep == "LATEST")
1161  // Use the last time step in the file from which to retrieve the solution
1162  timestep = n_steps;
1163  else
1164  {
1165  timestep = MooseUtils::convert<int>(vci._timestep);
1166  if (timestep > n_steps)
1167  mooseError("Invalid value passed as \"initial_from_file_timestep\". Expected \"LATEST\" or "
1168  "a valid integer between 1 and ",
1169  n_steps,
1170  " inclusive, received ",
1171  vci._timestep);
1172  }
1173 
1174  did_copy = true;
1175 
1176  if (hasVariable(vci._dest_name))
1177  {
1178  const auto & var = getVariable(0, vci._dest_name);
1179  if (var.isArray())
1180  {
1181  const auto & array_var = getFieldVariable<RealEigenVector>(0, vci._dest_name);
1182  for (MooseIndex(var.count()) i = 0; i < var.count(); ++i)
1183  {
1184  const auto exodus_var = _subproblem.arrayVariableComponent(vci._source_name, i);
1185  const auto system_var = array_var.componentName(i);
1186  if (var.isNodal())
1187  io.copy_nodal_solution(system(), exodus_var, system_var, timestep);
1188  else
1189  io.copy_elemental_solution(system(), exodus_var, system_var, timestep);
1190  }
1191  }
1192  else
1193  {
1194  if (var.isNodal())
1195  io.copy_nodal_solution(system(), vci._dest_name, vci._source_name, timestep);
1196  else
1197  io.copy_elemental_solution(system(), vci._dest_name, vci._source_name, timestep);
1198  }
1199  }
1200  else if (hasScalarVariable(vci._dest_name))
1201  io.copy_scalar_solution(system(), {vci._dest_name}, {vci._source_name}, timestep);
1202  else
1203  mooseError("Unrecognized variable ", vci._dest_name, " in variables to copy.");
1204  }
1205 
1206  if (did_copy)
1207  solution().close();
1208 }
NumericVector< Number > & solution()
Definition: SystemBase.h:176
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< VarCopyInfo > _var_to_copy
Definition: SystemBase.h:964
int convert< int >(const std::string &str, bool throw_on_failure)
Definition: MooseUtils.C:999
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual System & system()=0
Get the reference to the libMesh system.
virtual bool hasVariable(const std::string &var_name) const
Query a system for a variable.
Definition: SystemBase.C:800
virtual void close()=0
static std::string arrayVariableComponent(const std::string &var_name, unsigned int i)
Returns the variable name of a component of an array variable.
Definition: SubProblem.h:261
MooseVariableFieldBase & getVariable(THREAD_ID tid, const std::string &var_name) const
Gets a reference to a variable of with specified name.
Definition: SystemBase.C:79
virtual bool hasScalarVariable(const std::string &var_name) const
Definition: SystemBase.C:825

◆ currentSolution()

const NumericVector<Number>* const& AuxiliarySystem::currentSolution ( ) const
inlineoverridevirtual

The solution vector that is currently being operated on.

This is typically a ghosted vector that comes in from the Nonlinear solver.

Implements SystemBase.

Definition at line 99 of file AuxiliarySystem.h.

Referenced by FlagElementsThread::onElement(), AB2PredictorCorrector::step(), and DisplacedProblem::syncSolutions().

100  {
101  return _current_solution;
102  }
const NumericVector< Number > * _current_solution
solution vector from nonlinear solver

◆ customSetup()

void AuxiliarySystem::customSetup ( const ExecFlagType exec_type)
overridevirtual

Reimplemented from SystemBase.

Definition at line 134 of file AuxiliarySystem.C.

135 {
136  SystemBase::customSetup(exec_type);
137 
138  for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
139  {
140  _aux_scalar_storage.customSetup(exec_type, tid);
141  _nodal_aux_storage.customSetup(exec_type, tid);
142  _mortar_nodal_aux_storage.customSetup(exec_type, tid);
143  _nodal_vec_aux_storage.customSetup(exec_type, tid);
144  _nodal_array_aux_storage.customSetup(exec_type, tid);
145  _elemental_aux_storage.customSetup(exec_type, tid);
146  _elemental_vec_aux_storage.customSetup(exec_type, tid);
147  _elemental_array_aux_storage.customSetup(exec_type, tid);
148  }
149 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _mortar_nodal_aux_storage
unsigned int n_threads()
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _nodal_array_aux_storage
virtual void customSetup(const ExecFlagType &exec_type, THREAD_ID tid=0) const
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _elemental_array_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
virtual void customSetup(const ExecFlagType &exec_type)
Definition: SystemBase.C:1501
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ deactiveAllMatrixTags()

void SystemBase::deactiveAllMatrixTags ( )
virtualinherited

Make matrices inactive.

Definition at line 1092 of file SystemBase.C.

Referenced by NonlinearSystemBase::computeResidualTags(), and NonlinearSystemBase::setInitialSolution().

1093 {
1094  auto num_matrix_tags = _subproblem.numMatrixTags();
1095 
1096  _matrix_tag_active_flags.resize(num_matrix_tags);
1097 
1098  for (decltype(num_matrix_tags) tag = 0; tag < num_matrix_tags; tag++)
1099  _matrix_tag_active_flags[tag] = false;
1100 }
std::vector< bool > _matrix_tag_active_flags
Active flags for tagged matrices.
Definition: SystemBase.h:951
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual unsigned int numMatrixTags() const
The total number of tags.
Definition: SubProblem.h:210

◆ deactiveMatrixTag()

void SystemBase::deactiveMatrixTag ( TagID  tag)
virtualinherited

deactive a matrix for tag

Definition at line 1080 of file SystemBase.C.

1081 {
1082  mooseAssert(_subproblem.matrixTagExists(tag),
1083  "Cannot deactivate Matrix with matrix_tag : " << tag << "that does not exist");
1084 
1085  if (_matrix_tag_active_flags.size() < tag + 1)
1086  _matrix_tag_active_flags.resize(tag + 1);
1087 
1088  _matrix_tag_active_flags[tag] = false;
1089 }
std::vector< bool > _matrix_tag_active_flags
Active flags for tagged matrices.
Definition: SystemBase.h:951
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:294

◆ defaultMatrixTags()

virtual std::set<TagID> SystemBase::defaultMatrixTags ( ) const
inlinevirtualinherited

Get the default matrix tags associted with this system.

Reimplemented in NonlinearEigenSystem, and DisplacedSystem.

Definition at line 287 of file SystemBase.h.

Referenced by DisplacedSystem::defaultMatrixTags(), NonlinearEigenSystem::defaultMatrixTags(), and SystemBase::disassociateDefaultMatrixTags().

287 { return {systemMatrixTag()}; }
virtual TagID systemMatrixTag() const
Return the Matrix Tag ID for System.
Definition: SystemBase.h:265

◆ defaultVectorTags()

virtual std::set<TagID> SystemBase::defaultVectorTags ( ) const
inlinevirtualinherited

Get the default vector tags associated with this system.

Reimplemented in NonlinearEigenSystem, and DisplacedSystem.

Definition at line 280 of file SystemBase.h.

Referenced by DisplacedSystem::defaultVectorTags(), NonlinearEigenSystem::defaultVectorTags(), and SystemBase::disassociateDefaultVectorTags().

281  {
283  }
virtual TagID timeVectorTag() const
Ideally, we should not need this API.
Definition: SystemBase.h:260
virtual TagID nonTimeVectorTag() const
Definition: SystemBase.h:270
virtual TagID residualVectorTag() const
Definition: SystemBase.h:275

◆ disassociateDefaultMatrixTags()

void SystemBase::disassociateDefaultMatrixTags ( )
virtualinherited

Disassociate the matrices associated with the default matrix tags of this system.

Reimplemented in DisplacedSystem.

Definition at line 1059 of file SystemBase.C.

Referenced by DisplacedSystem::disassociateDefaultMatrixTags().

1060 {
1061  const auto tags = defaultMatrixTags();
1062  for (const auto tag : tags)
1063  if (_subproblem.matrixTagExists(tag))
1065 }
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual std::set< TagID > defaultMatrixTags() const
Get the default matrix tags associted with this system.
Definition: SystemBase.h:287
virtual void disassociateMatrixFromTag(SparseMatrix< Number > &matrix, TagID tag)
Disassociate a matrix from a tag.
Definition: SystemBase.C:1037
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:294

◆ disassociateDefaultVectorTags()

void SystemBase::disassociateDefaultVectorTags ( )
virtualinherited

Disassociate the vectors associated with the default vector tags of this system.

Reimplemented in DisplacedSystem.

Definition at line 964 of file SystemBase.C.

Referenced by DisplacedSystem::disassociateDefaultVectorTags().

965 {
966  const auto tags = defaultVectorTags();
967  for (const auto tag : tags)
968  if (_subproblem.vectorTagExists(tag))
970 }
virtual void disassociateVectorFromTag(NumericVector< Number > &vec, TagID tag)
Disassociate a given vector from a given tag.
Definition: SystemBase.C:942
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
virtual std::set< TagID > defaultVectorTags() const
Get the default vector tags associated with this system.
Definition: SystemBase.h:280

◆ disassociateMatrixFromTag() [1/2]

void SystemBase::disassociateMatrixFromTag ( SparseMatrix< Number > &  matrix,
TagID  tag 
)
virtualinherited

Disassociate a matrix from a tag.

Reimplemented in DisplacedSystem.

Definition at line 1037 of file SystemBase.C.

Referenced by NonlinearSystemBase::computeJacobian(), FEProblemBase::computeJacobianInternal(), FEProblemBase::computeJacobianTag(), FEProblemBase::computeResidualAndJacobian(), SystemBase::disassociateDefaultMatrixTags(), and DisplacedSystem::disassociateMatrixFromTag().

1038 {
1039  if (!_subproblem.matrixTagExists(tag))
1040  mooseError("Cannot disassociate matrix from tag ", tag, " because that tag does not exist");
1041  if (hasMatrix(tag) && &getMatrix(tag) != &matrix)
1042  mooseError("You can not disassociate a matrix from a tag which it was not associated to");
1043 
1045 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:328
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual void disassociateMatrixFromTag(SparseMatrix< Number > &matrix, TagID tag)
Disassociate a matrix from a tag.
Definition: SystemBase.C:1037
virtual SparseMatrix< Number > & getMatrix(TagID tag)
Get a raw SparseMatrix.
Definition: SystemBase.C:973
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:294

◆ disassociateMatrixFromTag() [2/2]

void SystemBase::disassociateMatrixFromTag ( TagID  tag)
virtualinherited

Disassociate any matrix that is associated with a given tag.

Reimplemented in DisplacedSystem.

Definition at line 1048 of file SystemBase.C.

1049 {
1050  if (!_subproblem.matrixTagExists(tag))
1051  mooseError("Cannot disassociate matrix from tag ", tag, " because that tag does not exist");
1052 
1053  if (_tagged_matrices.size() < tag + 1)
1054  _tagged_matrices.resize(tag + 1);
1055  _tagged_matrices[tag] = nullptr;
1056 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< SparseMatrix< Number > * > _tagged_matrices
Tagged matrices (pointer)
Definition: SystemBase.h:949
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:294

◆ disassociateVectorFromTag() [1/2]

void SystemBase::disassociateVectorFromTag ( NumericVector< Number > &  vec,
TagID  tag 
)
virtualinherited

Disassociate a given vector from a given tag.

Reimplemented in DisplacedSystem.

Definition at line 942 of file SystemBase.C.

Referenced by NonlinearSystemBase::computeNodalBCs(), FEProblemBase::computeResidualAndJacobian(), FEProblemBase::computeResidualInternal(), NonlinearSystemBase::computeResidualTag(), FEProblemBase::computeResidualTag(), FEProblemBase::computeResidualType(), SystemBase::disassociateDefaultVectorTags(), DisplacedSystem::disassociateVectorFromTag(), and CentralDifference::initialSetup().

943 {
944  if (!_subproblem.vectorTagExists(tag))
945  mooseError("Cannot disassociate vector from tag ", tag, " because that tag does not exist");
946  if (hasVector(tag) && &getVector(tag) != &vec)
947  mooseError("You can not disassociate a vector from a tag which it was not associated to");
948 
950 }
virtual void disassociateVectorFromTag(NumericVector< Number > &vec, TagID tag)
Disassociate a given vector from a given tag.
Definition: SystemBase.C:942
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:873
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:882

◆ disassociateVectorFromTag() [2/2]

void SystemBase::disassociateVectorFromTag ( TagID  tag)
virtualinherited

Disassociate any vector that is associated with a given tag.

Reimplemented in DisplacedSystem.

Definition at line 953 of file SystemBase.C.

954 {
955  if (!_subproblem.vectorTagExists(tag))
956  mooseError("Cannot disassociate vector from tag ", tag, " because that tag does not exist");
957 
958  if (_tagged_vectors.size() < tag + 1)
959  _tagged_vectors.resize(tag + 1);
960  _tagged_vectors[tag] = nullptr;
961 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
std::vector< NumericVector< Number > * > _tagged_vectors
Tagged vectors (pointer)
Definition: SystemBase.h:947

◆ dofMap() [1/2]

DofMap & SystemBase::dofMap ( )
virtualinherited

◆ dofMap() [2/2]

const DofMap & SystemBase::dofMap ( ) const
virtualinherited

Gets const reference to the dof map.

Definition at line 1137 of file SystemBase.C.

1138 {
1139  return system().get_dof_map();
1140 }
virtual System & system()=0
Get the reference to the libMesh system.

◆ duDotDotDu() [1/2]

virtual Number& SystemBase::duDotDotDu ( )
inlinevirtualinherited

Reimplemented in DisplacedSystem.

Definition at line 223 of file SystemBase.h.

Referenced by DisplacedSystem::duDotDotDu(), and MooseVariableScalar::reinit().

223 { return _du_dotdot_du; }
Real _du_dotdot_du
Definition: SystemBase.h:944

◆ duDotDotDu() [2/2]

virtual const Number& SystemBase::duDotDotDu ( ) const
inlinevirtualinherited

Reimplemented in DisplacedSystem.

Definition at line 225 of file SystemBase.h.

225 { return _du_dotdot_du; }
Real _du_dotdot_du
Definition: SystemBase.h:944

◆ duDotDu() [1/2]

virtual Number& SystemBase::duDotDu ( )
inlinevirtualinherited

Reimplemented in DisplacedSystem.

Definition at line 222 of file SystemBase.h.

Referenced by DisplacedSystem::duDotDu(), and MooseVariableScalar::reinit().

222 { return _du_dot_du; }
Real _du_dot_du
Definition: SystemBase.h:943

◆ duDotDu() [2/2]

virtual const Number& SystemBase::duDotDu ( ) const
inlinevirtualinherited

Reimplemented in DisplacedSystem.

Definition at line 224 of file SystemBase.h.

224 { return _du_dot_du; }
Real _du_dot_du
Definition: SystemBase.h:943

◆ elemArrayAuxWarehouse()

const ExecuteMooseObjectWarehouse< ArrayAuxKernel > & AuxiliarySystem::elemArrayAuxWarehouse ( ) const
inline

Definition at line 271 of file AuxiliarySystem.h.

272 {
274 }
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _elemental_array_aux_storage

◆ elemAuxWarehouse()

const ExecuteMooseObjectWarehouse< AuxKernel > & AuxiliarySystem::elemAuxWarehouse ( ) const
inline

Definition at line 259 of file AuxiliarySystem.h.

260 {
261  return _elemental_aux_storage;
262 }
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage

◆ elemVectorAuxWarehouse()

const ExecuteMooseObjectWarehouse< VectorAuxKernel > & AuxiliarySystem::elemVectorAuxWarehouse ( ) const
inline

Definition at line 265 of file AuxiliarySystem.h.

266 {
268 }
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ flushTaggedMatrices()

void SystemBase::flushTaggedMatrices ( const std::set< TagID > &  tags)
inherited

flushes all matrices associated to tags.

Flush assembles the matrix but doesn't shrink memory allocation

Definition at line 1017 of file SystemBase.C.

1018 {
1019  for (auto tag : tags)
1020  if (hasMatrix(tag))
1021  getMatrix(tag).flush();
1022 }
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:328
virtual void flush()
virtual SparseMatrix< Number > & getMatrix(TagID tag)
Get a raw SparseMatrix.
Definition: SystemBase.C:973

◆ getActualFieldVariable() [1/2]

template<typename T >
MooseVariableField< T > & SystemBase::getActualFieldVariable ( THREAD_ID  tid,
const std::string &  var_name 
)
inherited

Returns a field variable pointer - this includes finite volume variables.

Definition at line 107 of file SystemBase.C.

Referenced by BoundsBase::BoundsBase(), Assembly::copyFaceShapes(), Assembly::copyNeighborShapes(), and Assembly::copyShapes().

108 {
109  return *_vars[tid].getActualFieldVariable<T>(var_name);
110 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ getActualFieldVariable() [2/2]

template<typename T >
MooseVariableField< T > & SystemBase::getActualFieldVariable ( THREAD_ID  tid,
unsigned int  var_number 
)
inherited

Returns a field variable pointer - this includes finite volume variables.

Definition at line 128 of file SystemBase.C.

129 {
130  return *_vars[tid].getActualFieldVariable<T>(var_number);
131 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ getDependObjects() [1/2]

std::set< std::string > AuxiliarySystem::getDependObjects ( ExecFlagType  type)

Get a list of dependent UserObjects for this exec type.

Parameters
typeExecution flag type
Returns
a set of dependent user objects

Definition at line 455 of file AuxiliarySystem.C.

Referenced by groupUserObjects().

456 {
457  std::set<std::string> depend_objects;
458 
459  // Elemental AuxKernels
460  {
461  const std::vector<std::shared_ptr<AuxKernel>> & auxs =
462  _elemental_aux_storage[type].getActiveObjects();
463  for (const auto & aux : auxs)
464  {
465  const std::set<UserObjectName> & uo = aux->getDependObjects();
466  depend_objects.insert(uo.begin(), uo.end());
467  }
468  }
469 
470  // Elemental VectorAuxKernels
471  {
472  const std::vector<std::shared_ptr<VectorAuxKernel>> & auxs =
473  _elemental_vec_aux_storage[type].getActiveObjects();
474  for (const auto & aux : auxs)
475  {
476  const std::set<UserObjectName> & uo = aux->getDependObjects();
477  depend_objects.insert(uo.begin(), uo.end());
478  }
479  }
480 
481  // Elemental ArrayAuxKernels
482  {
483  const std::vector<std::shared_ptr<ArrayAuxKernel>> & auxs =
484  _elemental_array_aux_storage[type].getActiveObjects();
485  for (const auto & aux : auxs)
486  {
487  const std::set<UserObjectName> & uo = aux->getDependObjects();
488  depend_objects.insert(uo.begin(), uo.end());
489  }
490  }
491 
492  // Nodal AuxKernels
493  {
494  const std::vector<std::shared_ptr<AuxKernel>> & auxs =
495  _nodal_aux_storage[type].getActiveObjects();
496  for (const auto & aux : auxs)
497  {
498  const std::set<UserObjectName> & uo = aux->getDependObjects();
499  depend_objects.insert(uo.begin(), uo.end());
500  }
501  }
502 
503  // Mortar Nodal AuxKernels
504  {
505  const std::vector<std::shared_ptr<AuxKernel>> & auxs =
506  _mortar_nodal_aux_storage[type].getActiveObjects();
507  for (const auto & aux : auxs)
508  {
509  const std::set<UserObjectName> & uo = aux->getDependObjects();
510  depend_objects.insert(uo.begin(), uo.end());
511  }
512  }
513 
514  // Nodal VectorAuxKernels
515  {
516  const std::vector<std::shared_ptr<VectorAuxKernel>> & auxs =
517  _nodal_vec_aux_storage[type].getActiveObjects();
518  for (const auto & aux : auxs)
519  {
520  const std::set<UserObjectName> & uo = aux->getDependObjects();
521  depend_objects.insert(uo.begin(), uo.end());
522  }
523  }
524 
525  // Nodal ArrayAuxKernels
526  {
527  const std::vector<std::shared_ptr<ArrayAuxKernel>> & auxs =
528  _nodal_array_aux_storage[type].getActiveObjects();
529  for (const auto & aux : auxs)
530  {
531  const std::set<UserObjectName> & uo = aux->getDependObjects();
532  depend_objects.insert(uo.begin(), uo.end());
533  }
534  }
535 
536  return depend_objects;
537 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _mortar_nodal_aux_storage
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _nodal_array_aux_storage
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _elemental_array_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ getDependObjects() [2/2]

std::set< std::string > AuxiliarySystem::getDependObjects ( )

Definition at line 540 of file AuxiliarySystem.C.

541 {
542  std::set<std::string> depend_objects;
543 
544  // Elemental AuxKernels
545  {
546  const std::vector<std::shared_ptr<AuxKernel>> & auxs =
547  _elemental_aux_storage.getActiveObjects();
548  for (const auto & aux : auxs)
549  {
550  const std::set<UserObjectName> & uo = aux->getDependObjects();
551  depend_objects.insert(uo.begin(), uo.end());
552  }
553  }
554 
555  // Elemental VectorAuxKernels
556  {
557  const std::vector<std::shared_ptr<VectorAuxKernel>> & auxs =
558  _elemental_vec_aux_storage.getActiveObjects();
559  for (const auto & aux : auxs)
560  {
561  const std::set<UserObjectName> & uo = aux->getDependObjects();
562  depend_objects.insert(uo.begin(), uo.end());
563  }
564  }
565 
566  // Elemental ArrayAuxKernels
567  {
568  const std::vector<std::shared_ptr<ArrayAuxKernel>> & auxs =
569  _elemental_array_aux_storage.getActiveObjects();
570  for (const auto & aux : auxs)
571  {
572  const std::set<UserObjectName> & uo = aux->getDependObjects();
573  depend_objects.insert(uo.begin(), uo.end());
574  }
575  }
576 
577  // Nodal AuxKernels
578  {
579  const std::vector<std::shared_ptr<AuxKernel>> & auxs = _nodal_aux_storage.getActiveObjects();
580  for (const auto & aux : auxs)
581  {
582  const std::set<UserObjectName> & uo = aux->getDependObjects();
583  depend_objects.insert(uo.begin(), uo.end());
584  }
585  }
586 
587  // Mortar Nodal AuxKernels
588  {
589  const std::vector<std::shared_ptr<AuxKernel>> & auxs =
590  _mortar_nodal_aux_storage.getActiveObjects();
591  for (const auto & aux : auxs)
592  {
593  const std::set<UserObjectName> & uo = aux->getDependObjects();
594  depend_objects.insert(uo.begin(), uo.end());
595  }
596  }
597 
598  // Nodal VectorAuxKernels
599  {
600  const std::vector<std::shared_ptr<VectorAuxKernel>> & auxs =
601  _nodal_vec_aux_storage.getActiveObjects();
602  for (const auto & aux : auxs)
603  {
604  const std::set<UserObjectName> & uo = aux->getDependObjects();
605  depend_objects.insert(uo.begin(), uo.end());
606  }
607  }
608 
609  // Nodal ArrayAuxKernels
610  {
611  const std::vector<std::shared_ptr<ArrayAuxKernel>> & auxs =
612  _nodal_array_aux_storage.getActiveObjects();
613  for (const auto & aux : auxs)
614  {
615  const std::set<UserObjectName> & uo = aux->getDependObjects();
616  depend_objects.insert(uo.begin(), uo.end());
617  }
618  }
619 
620  return depend_objects;
621 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _mortar_nodal_aux_storage
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _nodal_array_aux_storage
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _elemental_array_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ getFieldVariable() [1/2]

template<typename T >
MooseVariableFE< T > & SystemBase::getFieldVariable ( THREAD_ID  tid,
const std::string &  var_name 
)
inherited

Gets a reference to a variable of with specified name.

This excludes and cannot return finite volume variables.

Parameters
tidThread id
var_namevariable name
Returns
reference the variable (class)

Definition at line 100 of file SystemBase.C.

Referenced by Marker::getMarkerValue().

101 {
102  return *_vars[tid].getFieldVariable<T>(var_name);
103 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ getFieldVariable() [2/2]

template<typename T >
MooseVariableFE< T > & SystemBase::getFieldVariable ( THREAD_ID  tid,
unsigned int  var_number 
)
inherited

Gets a reference to a variable with specified number.

This excludes and cannot return finite volume variables.

Parameters
tidThread id
var_numberlibMesh variable number
Returns
reference the variable (class)

Definition at line 121 of file SystemBase.C.

122 {
123  return *_vars[tid].getFieldVariable<T>(var_number);
124 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ getFVVariable()

template<typename T >
template MooseVariableFV< Real > & SystemBase::getFVVariable< Real > ( THREAD_ID  tid,
const std::string &  var_name 
)
inherited

Return a finite volume variable.

Definition at line 114 of file SystemBase.C.

115 {
116  return *_vars[tid].getFVVariable<T>(var_name);
117 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ getMatrix() [1/2]

SparseMatrix< Number > & SystemBase::getMatrix ( TagID  tag)
virtualinherited

Get a raw SparseMatrix.

Reimplemented in DisplacedSystem.

Definition at line 973 of file SystemBase.C.

Referenced by Assembly::addCachedJacobian(), NonlinearSystemBase::addImplicitGeometricCouplingEntries(), Assembly::addJacobianCoupledVarPair(), Assembly::addJacobianLowerD(), Assembly::addJacobianNeighbor(), Assembly::addJacobianNeighborLowerD(), Assembly::addJacobianNonlocal(), SystemBase::addMatrix(), SystemBase::closeTaggedMatrices(), NonlinearSystemBase::computeJacobianInternal(), FEProblemBase::computeJacobianTags(), FEProblemBase::computeResidualAndJacobian(), NonlinearSystemBase::computeResidualAndJacobianInternal(), NonlinearSystemBase::constraintJacobians(), SystemBase::disassociateMatrixFromTag(), NonlinearSystemBase::enforceNodalConstraintsJacobian(), SystemBase::flushTaggedMatrices(), DisplacedSystem::getMatrix(), MooseVariableScalar::reinit(), Assembly::setCachedJacobian(), and Assembly::zeroCachedJacobian().

974 {
975  if (!hasMatrix(tag))
976  {
977  if (!_subproblem.matrixTagExists(tag))
978  mooseError("Cannot retreive matrix with tag ", tag, " because that tag does not exist");
979  else
980  mooseError("Cannot retreive matrix with tag ",
981  tag,
982  " in system '",
983  name(),
984  "'\nbecause a matrix has not been associated with that tag.");
985  }
986 
987  return *_tagged_matrices[tag];
988 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< SparseMatrix< Number > * > _tagged_matrices
Tagged matrices (pointer)
Definition: SystemBase.h:949
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:328
virtual const std::string & name() const
Definition: SystemBase.C:1297
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:294

◆ getMatrix() [2/2]

const SparseMatrix< Number > & SystemBase::getMatrix ( TagID  tag) const
virtualinherited

Get a raw SparseMatrix.

Reimplemented in DisplacedSystem.

Definition at line 991 of file SystemBase.C.

992 {
993  if (!hasMatrix(tag))
994  {
995  if (!_subproblem.matrixTagExists(tag))
996  mooseError("Cannot retreive matrix with tag ", tag, " because that tag does not exist");
997  else
998  mooseError("Cannot retreive matrix with tag ",
999  tag,
1000  " in system '",
1001  name(),
1002  "'\nbecause a matrix has not been associated with that tag.");
1003  }
1004 
1005  return *_tagged_matrices[tag];
1006 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< SparseMatrix< Number > * > _tagged_matrices
Tagged matrices (pointer)
Definition: SystemBase.h:949
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:328
virtual const std::string & name() const
Definition: SystemBase.C:1297
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:294

◆ getMaxVariableNumber()

unsigned int SystemBase::getMaxVariableNumber ( ) const
inlineinherited

Returns the maximum number of all variables on the system.

Definition at line 850 of file SystemBase.h.

850 { return _max_var_number; }
unsigned int _max_var_number
Maximum variable number.
Definition: SystemBase.h:938

◆ getMaxVarNDofsPerElem()

std::size_t SystemBase::getMaxVarNDofsPerElem ( ) const
inlineinherited

Gets the maximum number of dofs used by any one variable on any one element.

Returns
The max

Definition at line 563 of file SystemBase.h.

Referenced by Moose::globalDofIndexToDerivative().

563 { return _max_var_n_dofs_per_elem; }
size_t _max_var_n_dofs_per_elem
Maximum number of dofs for any one variable on any one element.
Definition: SystemBase.h:967

◆ getMaxVarNDofsPerNode()

std::size_t SystemBase::getMaxVarNDofsPerNode ( ) const
inlineinherited

Gets the maximum number of dofs used by any one variable on any one node.

Returns
The max

Definition at line 570 of file SystemBase.h.

570 { return _max_var_n_dofs_per_node; }
size_t _max_var_n_dofs_per_node
Maximum number of dofs for any one variable on any one node.
Definition: SystemBase.h:970

◆ getMinQuadratureOrder()

Order AuxiliarySystem::getMinQuadratureOrder ( )
overridevirtual

Get the minimum quadrature order for evaluating elemental auxiliary variables.

Reimplemented from SystemBase.

Definition at line 803 of file AuxiliarySystem.C.

804 {
805  Order order = CONSTANT;
806  std::vector<MooseVariableFEBase *> vars = _vars[0].fieldVariables();
807  for (const auto & var : vars)
808  {
809  if (!var->isNodal()) // nodal aux variables do not need quadrature
810  {
811  FEType fe_type = var->feType();
812  if (fe_type.default_quadrature_order() > order)
813  order = fe_type.default_quadrature_order();
814  }
815  }
816 
817  return order;
818 }
Order
CONSTANT
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ getScalarVariable() [1/2]

MooseVariableScalar & SystemBase::getScalarVariable ( THREAD_ID  tid,
const std::string &  var_name 
) const
virtualinherited

Gets a reference to a scalar variable with specified number.

Parameters
tidThread id
var_nameA string which is the name of the variable to get.
Returns
reference the variable (class)

Definition at line 134 of file SystemBase.C.

Referenced by Assembly::addJacobianOffDiagScalar(), ODEKernel::computeOffDiagJacobianScalar(), VectorKernel::computeOffDiagJacobianScalar(), ArrayKernel::computeOffDiagJacobianScalar(), IntegratedBC::computeOffDiagJacobianScalar(), VectorIntegratedBC::computeOffDiagJacobianScalar(), Kernel::computeOffDiagJacobianScalar(), ArrayIntegratedBC::computeOffDiagJacobianScalar(), ScalarLagrangeMultiplier::computeOffDiagJacobianScalar(), MortarScalarBase::computeOffDiagJacobianScalar(), KernelScalarBase::computeOffDiagJacobianScalarLocal(), KernelScalarBase::computeScalarOffDiagJacobianScalar(), MortarScalarBase::computeScalarOffDiagJacobianScalar(), DMMooseSetVariables(), Assembly::init(), ReferenceResidualProblem::initialSetup(), and NonlinearSystemBase::setupScalingData().

135 {
136  MooseVariableScalar * var = dynamic_cast<MooseVariableScalar *>(_vars[tid].getVariable(var_name));
137  if (!var)
138  mooseError("Scalar variable '" + var_name + "' does not exist in this system");
139  return *var;
140 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934
Class for scalar variables (they are different).

◆ getScalarVariable() [2/2]

MooseVariableScalar & SystemBase::getScalarVariable ( THREAD_ID  tid,
unsigned int  var_number 
) const
virtualinherited

Gets a reference to a variable with specified number.

Parameters
tidThread id
var_numberlibMesh variable number
Returns
reference the variable (class)

Definition at line 143 of file SystemBase.C.

144 {
145  MooseVariableScalar * var =
146  dynamic_cast<MooseVariableScalar *>(_vars[tid].getVariable(var_number));
147  if (!var)
148  mooseError("variable #" + Moose::stringify(var_number) + " does not exist in this system");
149  return *var;
150 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:62
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934
Class for scalar variables (they are different).

◆ getScalarVariables()

const std::vector<MooseVariableScalar *>& SystemBase::getScalarVariables ( THREAD_ID  tid)
inlineinherited

◆ getSharedTimeIntegrator()

std::shared_ptr<TimeIntegrator> SystemBase::getSharedTimeIntegrator ( )
inlineinherited

Definition at line 872 of file SystemBase.h.

Referenced by DisplacedProblem::DisplacedProblem().

872 { return _time_integrator; }
std::shared_ptr< TimeIntegrator > _time_integrator
Time integrator.
Definition: SystemBase.h:973

◆ getStandardFieldVariableNames()

void SystemBase::getStandardFieldVariableNames ( std::vector< VariableName > &  std_field_variables) const
inherited

◆ getSubdomainsForVar() [1/2]

const std::set<SubdomainID>& SystemBase::getSubdomainsForVar ( unsigned int  var_number) const
inlineinherited

Definition at line 742 of file SystemBase.h.

Referenced by NonlinearSystemBase::checkKernelCoverage(), and SystemBase::getSubdomainsForVar().

743  {
744  return _var_map.at(var_number);
745  }
std::map< unsigned int, std::set< SubdomainID > > _var_map
Map of variables (variable id -> array of subdomains where it lives)
Definition: SystemBase.h:936

◆ getSubdomainsForVar() [2/2]

const std::set<SubdomainID>& SystemBase::getSubdomainsForVar ( const std::string &  var_name) const
inlineinherited

Get the block where a variable of this system is defined.

Parameters
var_nameThe name of the variable
Returns
the set of subdomain ids where the variable is active (defined)

Definition at line 753 of file SystemBase.h.

754  {
755  return getSubdomainsForVar(getVariable(0, var_name).number());
756  }
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1125
const std::set< SubdomainID > & getSubdomainsForVar(unsigned int var_number) const
Definition: SystemBase.h:742
MooseVariableFieldBase & getVariable(THREAD_ID tid, const std::string &var_name) const
Gets a reference to a variable of with specified name.
Definition: SystemBase.C:79

◆ getTimeIntegrator() [1/2]

TimeIntegrator* SystemBase::getTimeIntegrator ( )
inlineinherited

◆ getTimeIntegrator() [2/2]

const TimeIntegrator* SystemBase::getTimeIntegrator ( ) const
inlineinherited

Definition at line 870 of file SystemBase.h.

870 { return _time_integrator.get(); }
std::shared_ptr< TimeIntegrator > _time_integrator
Time integrator.
Definition: SystemBase.h:973

◆ getVariable() [1/2]

MooseVariableFieldBase & SystemBase::getVariable ( THREAD_ID  tid,
const std::string &  var_name 
) const
inherited

Gets a reference to a variable of with specified name.

Parameters
tidThread id
var_namevariable name
Returns
reference the variable (class)

Definition at line 79 of file SystemBase.C.

Referenced by AdaptivityAction::act(), Assembly::addJacobianBlock(), Assembly::addJacobianBlockNonlocal(), FEProblemBase::addJacobianBlockTags(), Assembly::addJacobianNeighbor(), NonlocalKernel::computeNonlocalOffDiagJacobian(), NonlocalIntegratedBC::computeNonlocalOffDiagJacobian(), Assembly::copyFaceShapes(), Assembly::copyNeighborShapes(), Assembly::copyShapes(), SystemBase::copyVars(), DMMooseSetVariables(), FieldSplitPreconditioner::FieldSplitPreconditioner(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), NodeElemConstraint::getConnectedDofIndices(), NodeFaceConstraint::getConnectedDofIndices(), SystemBase::getSubdomainsForVar(), ResidualObject::getVariable(), SubProblem::getVariableHelper(), Assembly::init(), NodalNormalsPreprocessor::initialize(), ReferenceResidualProblem::initialSetup(), Assembly::initNonlocalCoupling(), PNGOutput::makeMeshFunc(), FEProblemBase::prepare(), Assembly::prepareBlock(), Assembly::prepareBlockNonlocal(), AddPeriodicBCAction::setPeriodicVars(), NonlinearSystemBase::setupScalingData(), UpdateErrorVectorsThread::UpdateErrorVectorsThread(), and VariableCondensationPreconditioner::VariableCondensationPreconditioner().

80 {
82  dynamic_cast<MooseVariableFieldBase *>(_vars[tid].getVariable(var_name));
83  if (!var)
84  mooseError("Variable '", var_name, "' does not exist in this system");
85  return *var;
86 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
This class provides an interface for common operations on field variables of both FE and FV types wit...
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ getVariable() [2/2]

MooseVariableFieldBase & SystemBase::getVariable ( THREAD_ID  tid,
unsigned int  var_number 
) const
inherited

Gets a reference to a variable with specified number.

Parameters
tidThread id
var_numberlibMesh variable number
Returns
reference the variable (class)

Definition at line 89 of file SystemBase.C.

90 {
91  if (var_number < _numbered_vars[tid].size())
92  if (_numbered_vars[tid][var_number])
93  return *_numbered_vars[tid][var_number];
94 
95  mooseError("Variable #", Moose::stringify(var_number), " does not exist in this system");
96 }
std::vector< std::vector< MooseVariableFieldBase * > > _numbered_vars
Map variable number to its pointer.
Definition: SystemBase.h:976
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:62

◆ getVariableBlocks()

const std::set< SubdomainID > * SystemBase::getVariableBlocks ( unsigned int  var_number)
virtualinherited

Get the block where a variable of this system is defined.

Parameters
var_numberThe number of the variable
Returns
the set of subdomain ids where the variable is active (defined)

Definition at line 153 of file SystemBase.C.

Referenced by PhysicsBasedPreconditioner::addSystem().

154 {
155  mooseAssert(_var_map.find(var_number) != _var_map.end(), "Variable does not exist.");
156  if (_var_map[var_number].empty())
157  return nullptr;
158  else
159  return &_var_map[var_number];
160 }
std::map< unsigned int, std::set< SubdomainID > > _var_map
Map of variables (variable id -> array of subdomains where it lives)
Definition: SystemBase.h:936

◆ getVariableGlobalDoFs()

const std::vector<dof_id_type>& SystemBase::getVariableGlobalDoFs ( )
inlineinherited

Get the global dof indices of a variable, this needs to be called after the indices have been set by setVariableGlobalDoFs

Definition at line 825 of file SystemBase.h.

825 { return _var_all_dof_indices; }
std::vector< dof_id_type > _var_all_dof_indices
Container for the dof indices of a given variable.
Definition: SystemBase.h:988

◆ getVariableNames()

const std::vector<VariableName>& SystemBase::getVariableNames ( ) const
inlineinherited

◆ getVariables()

const std::vector<MooseVariableFieldBase *>& SystemBase::getVariables ( THREAD_ID  tid)
inlineinherited

◆ getVector() [1/4]

NumericVector< Number > & SystemBase::getVector ( const std::string &  name)
virtualinherited

Get a raw NumericVector by name.

Get a raw NumericVector with the given name.

Reimplemented in DisplacedSystem.

Definition at line 882 of file SystemBase.C.

Referenced by Assembly::addCachedResiduals(), Assembly::addResidual(), Assembly::addResidualLower(), Assembly::addResidualNeighbor(), Assembly::addResidualScalar(), SystemBase::addVector(), NonlinearSystemBase::assembleScalingVector(), SystemBase::closeTaggedVector(), FEProblemBase::computeBounds(), FEProblemBase::computeNearNullSpace(), FEProblemBase::computeNullSpace(), NonlinearSystemBase::computeResidualAndJacobianTags(), NonlinearSystemBase::computeResidualTags(), CentralDifference::computeTimeDerivatives(), FEProblemBase::computeTransposeNullSpace(), SystemBase::disassociateVectorFromTag(), DisplacedSystem::getVector(), Assembly::hasScalingVector(), SystemBase::needSolutionState(), ReferenceResidualProblem::ReferenceResidualProblem(), MooseVariableScalar::reinit(), SecantSolve::saveVariableValues(), SteffensenSolve::saveVariableValues(), PicardSolve::saveVariableValues(), NonlinearSystemBase::setPreviousNewtonSolution(), TaggingInterface::setResidual(), SystemBase::solutionPreviousNewton(), SystemBase::solutionState(), MultiAppDofCopyTransfer::transfer(), SecantSolve::transformVariables(), SteffensenSolve::transformVariables(), PicardSolve::transformVariables(), and SystemBase::zeroTaggedVector().

883 {
884  return system().get_vector(name);
885 }
virtual const std::string & name() const
Definition: SystemBase.C:1297
virtual System & system()=0
Get the reference to the libMesh system.

◆ getVector() [2/4]

const NumericVector< Number > & SystemBase::getVector ( const std::string &  name) const
virtualinherited

Reimplemented in DisplacedSystem.

Definition at line 888 of file SystemBase.C.

889 {
890  return system().get_vector(name);
891 }
virtual const std::string & name() const
Definition: SystemBase.C:1297
virtual System & system()=0
Get the reference to the libMesh system.

◆ getVector() [3/4]

NumericVector< Number > & SystemBase::getVector ( TagID  tag)
virtualinherited

Get a raw NumericVector by tag.

Reimplemented in DisplacedSystem.

Definition at line 894 of file SystemBase.C.

895 {
896  if (!hasVector(tag))
897  {
898  if (!_subproblem.vectorTagExists(tag))
899  mooseError("Cannot retreive vector with tag ", tag, " because that tag does not exist");
900  else
901  mooseError("Cannot retreive vector with tag ",
902  tag,
903  " in system '",
904  name(),
905  "'\nbecause a vector has not been associated with that tag.");
906  }
907 
908  return *_tagged_vectors[tag];
909 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:873
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
virtual const std::string & name() const
Definition: SystemBase.C:1297
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
std::vector< NumericVector< Number > * > _tagged_vectors
Tagged vectors (pointer)
Definition: SystemBase.h:947

◆ getVector() [4/4]

const NumericVector< Number > & SystemBase::getVector ( TagID  tag) const
virtualinherited

Reimplemented in DisplacedSystem.

Definition at line 912 of file SystemBase.C.

913 {
914  if (!hasVector(tag))
915  {
916  if (!_subproblem.vectorTagExists(tag))
917  mooseError("Cannot retreive vector with tag ", tag, " because that tag does not exist");
918  else
919  mooseError("Cannot retreive vector with tag ",
920  tag,
921  " in system '",
922  name(),
923  "'\nbecause a vector has not been associated with that tag.");
924  }
925 
926  return *_tagged_vectors[tag];
927 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:873
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
virtual const std::string & name() const
Definition: SystemBase.C:1297
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
std::vector< NumericVector< Number > * > _tagged_vectors
Tagged vectors (pointer)
Definition: SystemBase.h:947

◆ hasMatrix()

virtual bool SystemBase::hasMatrix ( TagID  tag) const
inlinevirtualinherited

Check if the tagged matrix exists in the system.

Reimplemented in DisplacedSystem.

Definition at line 328 of file SystemBase.h.

Referenced by SystemBase::activeAllMatrixTags(), Assembly::addCachedJacobian(), NonlinearSystemBase::addImplicitGeometricCouplingEntries(), Assembly::addJacobianCoupledVarPair(), Assembly::addJacobianLowerD(), Assembly::addJacobianNeighbor(), Assembly::addJacobianNeighborLowerD(), Assembly::addJacobianNonlocal(), SystemBase::addMatrix(), Assembly::cacheJacobian(), Assembly::cacheJacobianBlock(), Assembly::cacheJacobianBlockNonzero(), Assembly::cacheJacobianCoupledVarPair(), Assembly::cacheJacobianMortar(), Assembly::cacheJacobianNeighbor(), Assembly::cacheJacobianNonlocal(), SystemBase::closeTaggedMatrices(), NonlinearSystemBase::computeJacobianInternal(), FEProblemBase::computeJacobianTags(), FEProblemBase::computeResidualAndJacobian(), NonlinearSystemBase::computeResidualAndJacobianInternal(), NonlinearSystemBase::constraintJacobians(), SystemBase::disassociateMatrixFromTag(), NonlinearSystemBase::enforceNodalConstraintsJacobian(), SystemBase::flushTaggedMatrices(), SystemBase::getMatrix(), DisplacedSystem::hasMatrix(), MooseVariableScalar::reinit(), SystemBase::removeMatrix(), Assembly::setCachedJacobian(), and Assembly::zeroCachedJacobian().

329  {
330  return tag < _tagged_matrices.size() && _tagged_matrices[tag];
331  }
std::vector< SparseMatrix< Number > * > _tagged_matrices
Tagged matrices (pointer)
Definition: SystemBase.h:949

◆ hasScalarVariable()

bool SystemBase::hasScalarVariable ( const std::string &  var_name) const
virtualinherited

Definition at line 825 of file SystemBase.C.

Referenced by MortarScalarBase::computeJacobian(), NonlinearSystemBase::computeJacobianInternal(), ComputeFullJacobianThread::computeOnBoundary(), ComputeFullJacobianThread::computeOnElement(), SystemBase::copyVars(), NonlinearEigenSystem::postAddResidualObject(), AddPeriodicBCAction::setPeriodicVars(), and NonlinearSystemBase::setupScalingData().

826 {
827  if (system().has_variable(var_name))
828  return system().variable_type(var_name).family == SCALAR;
829  else
830  return false;
831 }
SCALAR
virtual System & system()=0
Get the reference to the libMesh system.

◆ hasSolutionState()

bool SystemBase::hasSolutionState ( const unsigned int  state,
Moose::SolutionIterationType  iteration_type = Moose::SolutionIterationType::Time 
) const
inlinevirtualinherited

Whether or not the system has the solution state (0 = current, 1 = old, 2 = older, etc).

Reimplemented in DisplacedSystem.

Definition at line 1004 of file SystemBase.h.

Referenced by PointwiseRenormalizeVector::execute(), PointwiseRenormalizeVector::finalize(), DisplacedSystem::hasSolutionState(), SystemBase::needSolutionState(), SystemBase::restoreSolutions(), ElementSubdomainModifier::setOldAndOlderSolutionsForMovedNodes(), and SystemBase::solutionState().

1006 {
1007  return _solution_states[static_cast<unsigned short>(iteration_type)].size() > state;
1008 }
std::array< std::vector< NumericVector< Number > * >, 2 > _solution_states
The solution states (0 = current, 1 = old, 2 = older, etc)
Definition: SystemBase.h:998

◆ hasVarCopy()

bool SystemBase::hasVarCopy ( ) const
inlineinherited

Whether or not there are variables to be restarted from an Exodus mesh file.

Definition at line 875 of file SystemBase.h.

875 { return _var_to_copy.size() > 0; }
std::vector< VarCopyInfo > _var_to_copy
Definition: SystemBase.h:964

◆ hasVariable()

bool SystemBase::hasVariable ( const std::string &  var_name) const
virtualinherited

Query a system for a variable.

Parameters
var_namename of the variable
Returns
true if the variable exists

Definition at line 800 of file SystemBase.C.

Referenced by ADDGKernel::ADDGKernel(), ArrayDGKernel::ArrayDGKernel(), SystemBase::copyVars(), DGKernel::DGKernel(), DMMooseSetVariables(), FEProblemBase::duplicateVariableCheck(), SubProblem::getVariableHelper(), InterfaceKernelTempl< T >::InterfaceKernelTempl(), PNGOutput::makeMeshFunc(), MultiAppVariableValueSamplePostprocessorTransfer::MultiAppVariableValueSamplePostprocessorTransfer(), NonlinearSystemBase::setupScalingData(), and Coupleable::writableCoupledValue().

801 {
802  auto & names = getVariableNames();
803  if (system().has_variable(var_name))
804  return system().variable_type(var_name).family != SCALAR;
805  if (std::find(names.begin(), names.end(), var_name) != names.end())
806  // array variable
807  return true;
808  else
809  return false;
810 }
SCALAR
virtual System & system()=0
Get the reference to the libMesh system.
const std::vector< VariableName > & getVariableNames() const
Definition: SystemBase.h:843

◆ hasVector() [1/2]

bool SystemBase::hasVector ( const std::string &  tag_name) const
inherited

◆ hasVector() [2/2]

virtual bool SystemBase::hasVector ( TagID  tag_id) const
inlinevirtualinherited

Check if the tagged vector exists in the system.

Reimplemented in DisplacedSystem.

Definition at line 249 of file SystemBase.h.

250  {
251  return tag_id < _tagged_vectors.size() && _tagged_vectors[tag_id];
252  }
std::vector< NumericVector< Number > * > _tagged_vectors
Tagged vectors (pointer)
Definition: SystemBase.h:947

◆ init()

virtual void SystemBase::init ( )
inlinevirtualinherited

Initialize the system.

Reimplemented in NonlinearSystemBase, and NonlinearSystem.

Definition at line 150 of file SystemBase.h.

Referenced by NonlinearSystemBase::init().

150 {};

◆ initializeObjects()

virtual void SystemBase::initializeObjects ( )
inlinevirtualinherited

Called only once, just before the solve begins so objects can do some precalculations.

Definition at line 155 of file SystemBase.h.

155 {};

◆ initialSetup()

void AuxiliarySystem::initialSetup ( )
overridevirtual

Setup Functions.

Reimplemented from SystemBase.

Definition at line 81 of file AuxiliarySystem.C.

82 {
83  TIME_SECTION("initialSetup", 3, "Initializing Auxiliary System");
84 
86 
87  for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
88  {
91 
92  _nodal_aux_storage.sort(tid);
93  _nodal_aux_storage.initialSetup(tid);
94 
95  _mortar_nodal_aux_storage.sort(tid);
96  _mortar_nodal_aux_storage.initialSetup(tid);
97 
98  _nodal_vec_aux_storage.sort(tid);
99  _nodal_vec_aux_storage.initialSetup(tid);
100 
101  _nodal_array_aux_storage.sort(tid);
102  _nodal_array_aux_storage.initialSetup(tid);
103 
104  _elemental_aux_storage.sort(tid);
105  _elemental_aux_storage.initialSetup(tid);
106 
107  _elemental_vec_aux_storage.sort(tid);
108  _elemental_vec_aux_storage.initialSetup(tid);
109 
111  _elemental_array_aux_storage.initialSetup(tid);
112  }
113 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _mortar_nodal_aux_storage
unsigned int n_threads()
void sort(THREAD_ID tid=0)
Performs a sort using the DependencyResolver.
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _nodal_array_aux_storage
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _elemental_array_aux_storage
virtual void initialSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods.
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage
virtual void initialSetup()
Setup Functions.
Definition: SystemBase.C:1487

◆ initSolutionState()

void SystemBase::initSolutionState ( )
virtualinherited

Initializes the solution state.

Reimplemented in DisplacedSystem.

Definition at line 1321 of file SystemBase.C.

Referenced by DisplacedSystem::initSolutionState().

1322 {
1323  // Default is the current solution
1324  unsigned int state = 0;
1325 
1326  // Add additional states as required by the variable states requested
1327  for (const auto & var : getVariables(/* tid = */ 0))
1328  state = std::max(state, var->oldestSolutionStateRequested());
1329  for (const auto & var : getScalarVariables(/* tid = */ 0))
1330  state = std::max(state, var->oldestSolutionStateRequested());
1331 
1333 
1335 }
virtual void needSolutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Registers that the solution state state is needed.
Definition: SystemBase.C:1393
const std::vector< MooseVariableFieldBase * > & getVariables(THREAD_ID tid)
Definition: SystemBase.h:732
const std::vector< MooseVariableScalar * > & getScalarVariables(THREAD_ID tid)
Definition: SystemBase.h:737
bool _solution_states_initialized
Whether or not the solution states have been initialized.
Definition: SystemBase.h:985
auto max(const L &left, const R &right)

◆ isArrayVariable()

bool SystemBase::isArrayVariable ( const std::string &  var_name) const
virtualinherited

If a variable is an array variable.

Definition at line 813 of file SystemBase.C.

814 {
815  auto & names = getVariableNames();
816  if (!system().has_variable(var_name) &&
817  std::find(names.begin(), names.end(), var_name) != names.end())
818  // array variable
819  return true;
820  else
821  return false;
822 }
virtual System & system()=0
Get the reference to the libMesh system.
const std::vector< VariableName > & getVariableNames() const
Definition: SystemBase.h:843

◆ isScalarVariable()

bool SystemBase::isScalarVariable ( unsigned int  var_name) const
virtualinherited

Definition at line 834 of file SystemBase.C.

Referenced by Assembly::init(), ReferenceResidualProblem::initialSetup(), and Assembly::initNonlocalCoupling().

835 {
836  return (system().variable(var_num).type().family == SCALAR);
837 }
virtual System & system()=0
Get the reference to the libMesh system.

◆ jacobianSetup()

void AuxiliarySystem::jacobianSetup ( )
overridevirtual

Reimplemented from SystemBase.

Definition at line 170 of file AuxiliarySystem.C.

171 {
173 
174  for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
175  {
177  _nodal_aux_storage.jacobianSetup(tid);
178  _mortar_nodal_aux_storage.jacobianSetup(tid);
179  _nodal_vec_aux_storage.jacobianSetup(tid);
180  _nodal_array_aux_storage.jacobianSetup(tid);
181  _elemental_aux_storage.jacobianSetup(tid);
182  _elemental_vec_aux_storage.jacobianSetup(tid);
183  _elemental_array_aux_storage.jacobianSetup(tid);
184  }
185 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _mortar_nodal_aux_storage
unsigned int n_threads()
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _nodal_array_aux_storage
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
virtual void jacobianSetup()
Definition: SystemBase.C:1522
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _elemental_array_aux_storage
void jacobianSetup(THREAD_ID tid=0) const override
Convenience methods for calling object setup methods.
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ matrixTagActive()

bool SystemBase::matrixTagActive ( TagID  tag) const
virtualinherited

If or not a matrix tag is active.

Definition at line 1117 of file SystemBase.C.

1118 {
1119  mooseAssert(_subproblem.matrixTagExists(tag), "Matrix tag " << tag << " does not exist");
1120 
1121  return tag < _matrix_tag_active_flags.size() && _matrix_tag_active_flags[tag];
1122 }
std::vector< bool > _matrix_tag_active_flags
Active flags for tagged matrices.
Definition: SystemBase.h:951
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:294

◆ mesh() [1/2]

virtual MooseMesh& SystemBase::mesh ( )
inlinevirtualinherited

◆ mesh() [2/2]

virtual const MooseMesh& SystemBase::mesh ( ) const
inlinevirtualinherited

Definition at line 97 of file SystemBase.h.

97 { return _mesh; }
MooseMesh & _mesh
Definition: SystemBase.h:929

◆ name()

const std::string & SystemBase::name ( ) const
virtualinherited

◆ needMaterialOnSide()

bool AuxiliarySystem::needMaterialOnSide ( BoundaryID  bnd_id)

Indicated whether this system needs material properties on boundaries.

Returns
Boolean if IntegratedBCs are active

Definition at line 821 of file AuxiliarySystem.C.

822 {
823  return _elemental_aux_storage.hasActiveBoundaryObjects(bnd_id) ||
824  _elemental_vec_aux_storage.hasActiveBoundaryObjects(bnd_id);
825 }
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ needSolutionState()

void SystemBase::needSolutionState ( const unsigned int  state,
Moose::SolutionIterationType  iteration_type = Moose::SolutionIterationType::Time 
)
virtualinherited

Registers that the solution state state is needed.

Reimplemented in DisplacedSystem.

Definition at line 1393 of file SystemBase.C.

Referenced by EigenExecutionerBase::EigenExecutionerBase(), SystemBase::initSolutionState(), DisplacedSystem::needSolutionState(), and SystemBase::solutionState().

1395 {
1396  libmesh_parallel_only(this->comm());
1397 
1398  if (hasSolutionState(state, iteration_type))
1399  return;
1400 
1401  auto & solution_states = _solution_states[static_cast<unsigned short>(iteration_type)];
1402  solution_states.resize(state + 1);
1403 
1404  // The 0-th (current) solution state is owned by libMesh
1405  if (!solution_states[0])
1406  solution_states[0] = &solutionInternal();
1407  else
1408  mooseAssert(solution_states[0] == &solutionInternal(), "Inconsistent current solution");
1409 
1410  // We will manually add all states past current
1411  for (unsigned int i = 1; i <= state; ++i)
1412  if (!solution_states[i])
1413  {
1414  auto tag = _subproblem.addVectorTag(oldSolutionStateVectorName(i, iteration_type),
1416  solution_states[i] = &addVector(tag, true, GHOSTED);
1417  }
1418  else
1419  mooseAssert(solution_states[i] == &getVector(oldSolutionStateVectorName(i, iteration_type)),
1420  "Inconsistent solution state");
1421 }
virtual NumericVector< Number > & solutionInternal() const =0
Internal getter for solution owned by libMesh.
NumericVector< Number > & addVector(const std::string &vector_name, const bool project, const ParallelType type)
Adds a solution length vector to the system.
Definition: SystemBase.C:597
virtual TagID addVectorTag(const TagName &tag_name, const Moose::VectorTagType type=Moose::VECTOR_TAG_RESIDUAL)
Create a Tag.
Definition: SubProblem.C:81
const Parallel::Communicator & comm() const
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool hasSolutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time) const
Whether or not the system has the solution state (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.h:1004
TagName oldSolutionStateVectorName(const unsigned int, Moose::SolutionIterationType iteration_type) const
Gets the vector name used for an old (not current) solution state.
Definition: SystemBase.C:1338
std::array< std::vector< NumericVector< Number > * >, 2 > _solution_states
The solution states (0 = current, 1 = old, 2 = older, etc)
Definition: SystemBase.h:998
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:882

◆ nFieldVariables()

unsigned int SystemBase::nFieldVariables ( ) const
inherited

Get the number of field variables in this system.

Returns
the number of field variables

Definition at line 849 of file SystemBase.C.

Referenced by SystemBase::nVariables().

850 {
851  unsigned int n = 0;
852  for (auto & var : _vars[0].fieldVariables())
853  n += var->count();
854 
855  return n;
856 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ nFVVariables()

unsigned int SystemBase::nFVVariables ( ) const
inherited

Get the number of finite volume variables in this system.

Returns
the number of finite volume variables

Definition at line 859 of file SystemBase.C.

Referenced by MooseMesh::cacheFVElementalDoFs().

860 {
861  unsigned int n = 0;
862  for (auto & var : _vars[0].fieldVariables())
863  if (var->isFV())
864  n += var->count();
865 
866  return n;
867 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ nodalArrayAuxWarehouse()

const ExecuteMooseObjectWarehouse< ArrayAuxKernel > & AuxiliarySystem::nodalArrayAuxWarehouse ( ) const
inline

Definition at line 253 of file AuxiliarySystem.h.

254 {
256 }
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _nodal_array_aux_storage

◆ nodalAuxWarehouse()

const ExecuteMooseObjectWarehouse< AuxKernel > & AuxiliarySystem::nodalAuxWarehouse ( ) const
inline

Definition at line 241 of file AuxiliarySystem.h.

242 {
243  return _nodal_aux_storage;
244 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage

◆ nodalVectorAuxWarehouse()

const ExecuteMooseObjectWarehouse< VectorAuxKernel > & AuxiliarySystem::nodalVectorAuxWarehouse ( ) const
inline

Definition at line 247 of file AuxiliarySystem.h.

248 {
249  return _nodal_vec_aux_storage;
250 }
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage

◆ nonTimeVectorTag()

virtual TagID SystemBase::nonTimeVectorTag ( ) const
inlinevirtualinherited

Reimplemented in NonlinearSystemBase, and DisplacedSystem.

Definition at line 270 of file SystemBase.h.

Referenced by SystemBase::defaultVectorTags(), and DisplacedSystem::nonTimeVectorTag().

270 { mooseError("Not implemented yet"); }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284

◆ number()

unsigned int SystemBase::number ( ) const
inherited

Gets the number of this system.

Returns
The number of this system

Definition at line 1125 of file SystemBase.C.

Referenced by FEProblemBase::addCachedResidualDirectly(), FEProblemBase::addJacobian(), FEProblemBase::addJacobianBlockTags(), FEProblemBase::addJacobianLowerD(), FEProblemBase::addJacobianNeighbor(), FEProblemBase::addJacobianNeighborLowerD(), FEProblemBase::addJacobianOffDiagScalar(), FEProblemBase::addJacobianScalar(), FEProblemBase::addResidual(), FEProblemBase::addResidualLower(), FEProblemBase::addResidualNeighbor(), FEProblemBase::addResidualScalar(), SystemBase::addScalingVector(), ADKernelTempl< T >::ADKernelTempl(), ArrayKernel::ArrayKernel(), NonlinearSystemBase::assembleScalingVector(), MooseMesh::cacheFaceInfoVariableOwnership(), MooseVariableScalar::computeAD(), FEProblemBase::computeBounds(), Assembly::computeFaceMap(), VectorNodalBC::computeJacobian(), ArrayNodalBC::computeJacobian(), NodalBC::computeJacobian(), FVBoundaryScalarLagrangeMultiplierConstraint::computeJacobian(), FVFluxBC::computeJacobian(), FVFluxKernel::computeJacobian(), FVInterfaceKernel::computeJacobian(), FEProblemBase::computeJacobianBlock(), NonlinearSystemBase::computeJacobianInternal(), FEProblemBase::computeNearNullSpace(), NonlinearSystemBase::computeNodalBCsResidualAndJacobian(), FEProblemBase::computeNullSpace(), VectorNodalBC::computeOffDiagJacobian(), ArrayNodalBC::computeOffDiagJacobian(), NodalBC::computeOffDiagJacobian(), NodalKernel::computeOffDiagJacobian(), ComputeFullJacobianThread::computeOnBoundary(), ComputeFullJacobianThread::computeOnElement(), ComputeFullJacobianThread::computeOnInterface(), ComputeFullJacobianThread::computeOnInternalFace(), FEProblemBase::computePostCheck(), EqualValueEmbeddedConstraint::computeQpJacobian(), EqualValueEmbeddedConstraint::computeQpOffDiagJacobian(), FVOrthogonalBoundaryDiffusion::computeQpResidual(), FVBoundaryScalarLagrangeMultiplierConstraint::computeResidual(), FVFluxBC::computeResidual(), FVFluxKernel::computeResidual(), FVInterfaceKernel::computeResidual(), Kernel::computeResidualAndJacobian(), NodalBC::computeResidualAndJacobian(), IntegratedBC::computeResidualAndJacobian(), NonlinearSystemBase::computeResidualAndJacobianInternal(), NonlinearSystemBase::computeResidualInternal(), NonlinearSystemBase::computeResidualTags(), NonlinearSystemBase::computeScaling(), Assembly::computeSinglePointMapAD(), FEProblemBase::computeTransposeNullSpace(), DebugResidualAux::computeValue(), NearestNodeValueAux::computeValue(), NonlinearSystemBase::constraintJacobians(), Coupleable::coupled(), FEProblemBase::currentNlSysNum(), PseudoTimestep::currentResidualNorm(), Moose::FV::determineElemOneAndTwo(), ComputeResidualThread::determineObjectWarehouses(), ComputeResidualAndJacobianThread::determineObjectWarehouses(), Moose::doDerivatives(), VariableResidual::execute(), GreaterThanLessThanPostprocessor::execute(), NodalNormalsCorner::execute(), NodalNormalsEvaluator::execute(), NodalNormalsPreprocessor::execute(), ElementSubdomainModifier::finalize(), NumNonlinearIterations::finalize(), BoundsBase::getDoFIndex(), NonlinearSystemBase::getNodeDofs(), SystemBase::getSubdomainsForVar(), NumLinearIterations::getValue(), NumResidualEvaluations::getValue(), Residual::getValue(), Moose::globalDofIndexToDerivative(), FVBoundaryCondition::hasFaceSide(), NonlinearSystemBase::initialSetup(), ActivateElementsUserObjectBase::initSolutions(), EigenExecutionerBase::inversePowerIteration(), Kernel::Kernel(), MooseVariableInterface< Real >::MooseVariableInterface(), EigenExecutionerBase::nonlinearSolve(), ComputeDiracThread::onElement(), ComputeNodalKernelBCJacobiansThread::onNode(), ComputeNodalKernelJacobiansThread::onNode(), PointwiseRenormalizeVector::PointwiseRenormalizeVector(), FEProblemBase::prepare(), FEProblemBase::prepareAssembly(), SystemBase::prepareFace(), FEProblemBase::prepareFaceShapes(), FEProblemBase::prepareNeighborShapes(), FEProblemBase::prepareShapes(), EqualValueEmbeddedConstraint::reinitConstraint(), FEProblemBase::reinitDirac(), FEProblemBase::reinitNeighborPhys(), FEProblemBase::reinitOffDiagScalars(), FEProblemBase::setResidual(), FEProblemBase::setResidualNeighbor(), PhysicsBasedPreconditioner::setup(), FVInterfaceKernel::setupData(), FEProblemSolve::solve(), ActuallyExplicitEuler::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), LStableDirk4::solve(), AStableDirk4::solve(), ExplicitRK2::solve(), ExplicitSSPRungeKutta::solveStage(), NonlinearThread::subdomainChanged(), UserObject::systemNumber(), MultiAppDofCopyTransfer::transferDofObject(), FVFluxBC::uOnGhost(), FVFluxBC::uOnUSub(), and MortarConstraintBase::zeroInactiveLMDofs().

1126 {
1127  return system().number();
1128 }
virtual System & system()=0
Get the reference to the libMesh system.

◆ nVariables()

unsigned int SystemBase::nVariables ( ) const
virtualinherited

Get the number of variables in this system.

Returns
the number of variables

Definition at line 840 of file SystemBase.C.

Referenced by AdaptivityAction::act(), FieldSplitPreconditioner::FieldSplitPreconditioner(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), NonlinearSystemBase::getNodeDofs(), Assembly::init(), MaxVarNDofsPerElem::onElement(), MaxVarNDofsPerNode::onNode(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), and SingleMatrixPreconditioner::SingleMatrixPreconditioner().

841 {
842  unsigned int n = nFieldVariables();
843  n += _vars[0].scalars().size();
844 
845  return n;
846 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934
unsigned int nFieldVariables() const
Get the number of field variables in this system.
Definition: SystemBase.C:849

◆ perfGraph()

PerfGraph & PerfGraphInterface::perfGraph ( )
inherited

Get the PerfGraph.

Definition at line 78 of file PerfGraphInterface.C.

Referenced by CommonOutputAction::act(), PerfGraphData::finalize(), and PerfGraphOutput::output().

79 {
80  return _pg_moose_app.perfGraph();
81 }
MooseApp & _pg_moose_app
The MooseApp that owns the PerfGraph.
PerfGraph & perfGraph()
Get the PerfGraph for this app.
Definition: MooseApp.h:133

◆ prepare()

void SystemBase::prepare ( THREAD_ID  tid)
virtualinherited

Prepare the system for use.

Parameters
tidID of the thread

Definition at line 245 of file SystemBase.C.

Referenced by SubProblem::reinitElemFaceRef().

246 {
248  {
249  const std::set<MooseVariableFieldBase *> & active_elemental_moose_variables =
251  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
252  for (const auto & var : vars)
253  var->clearDofIndices();
254 
255  for (const auto & var : active_elemental_moose_variables)
256  if (&(var->sys()) == this)
257  var->prepare();
258  }
259  else
260  {
261  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
262  for (const auto & var : vars)
263  var->prepare();
264  }
265 }
virtual const std::set< MooseVariableFieldBase * > & getActiveElementalMooseVariables(const THREAD_ID tid) const
Get the MOOSE variables to be reinited on each element.
Definition: SubProblem.C:420
SubProblem & _subproblem
Definition: SystemBase.h:924
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934
virtual bool hasActiveElementalMooseVariables(const THREAD_ID tid) const
Whether or not a list of active elemental moose variables has been set.
Definition: SubProblem.C:426

◆ prepareFace()

void SystemBase::prepareFace ( THREAD_ID  tid,
bool  resize_data 
)
virtualinherited

Prepare the system for use on sides.

This will try to reuse the preparation done on the element.

Parameters
tidID of the thread
resize_dataPass True if this system needs to resize residual and jacobian datastructures based on preparing this face

Definition at line 268 of file SystemBase.C.

269 {
270  // We only need to do something if the element prepare was restricted
272  {
273  const std::set<MooseVariableFieldBase *> & active_elemental_moose_variables =
275 
276  std::vector<MooseVariableFieldBase *> newly_prepared_vars;
277 
278  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
279  for (const auto & var : vars)
280  {
281  mooseAssert(&var->sys() == this,
282  "I will cry if we store variables in our warehouse that don't belong to us");
283 
284  // If it wasn't in the active list, we need to prepare it. This has the potential to duplicate
285  // prepare if we have these conditions:
286  //
287  // 1. We have a displaced problem
288  // 2. We are using AD
289  // 3. We are not using global AD indexing
290  //
291  // But I think I would rather risk duplicate prepare than introduce an additional member set
292  // variable for tracking prepared variables. Set insertion is slow and some simulations have a
293  // ton of variables
294  if (!active_elemental_moose_variables.count(var))
295  {
296  var->prepare();
297  newly_prepared_vars.push_back(var);
298  }
299  }
300 
301  // Make sure to resize the residual and jacobian datastructures for all the new variables
302  if (resize_data)
303  for (const auto var_ptr : newly_prepared_vars)
304  {
305  _subproblem.assembly(tid, number()).prepareVariable(var_ptr);
308  }
309  }
310 }
virtual const std::set< MooseVariableFieldBase * > & getActiveElementalMooseVariables(const THREAD_ID tid) const
Get the MOOSE variables to be reinited on each element.
Definition: SubProblem.C:420
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool checkNonlocalCouplingRequirement()
Definition: SubProblem.h:88
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1125
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934
void prepareVariableNonlocal(MooseVariableFieldBase *var)
Definition: Assembly.C:2768
void prepareVariable(MooseVariableFieldBase *var)
Used for preparing the dense residual and jacobian blocks for one particular variable.
Definition: Assembly.C:2740
virtual bool hasActiveElementalMooseVariables(const THREAD_ID tid) const
Whether or not a list of active elemental moose variables has been set.
Definition: SubProblem.C:426
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int nl_sys_num)=0

◆ prepareLowerD()

void SystemBase::prepareLowerD ( THREAD_ID  tid)
virtualinherited

Prepare the system for use for lower dimensional elements.

Parameters
tidID of the thread

Definition at line 321 of file SystemBase.C.

Referenced by SubProblem::reinitLowerDElem().

322 {
323  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
324  for (const auto & var : vars)
325  var->prepareLowerD();
326 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ prepareNeighbor()

void SystemBase::prepareNeighbor ( THREAD_ID  tid)
virtualinherited

Prepare the system for use.

Parameters
tidID of the thread

Definition at line 313 of file SystemBase.C.

Referenced by SubProblem::reinitNeighborFaceRef().

314 {
315  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
316  for (const auto & var : vars)
317  var->prepareNeighbor();
318 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ registerTimedSection() [1/2]

PerfID PerfGraphInterface::registerTimedSection ( const std::string &  section_name,
const unsigned int  level 
) const
protectedinherited

Call to register a named section for timing.

Parameters
section_nameThe name of the code section to be timed
levelThe importance of the timer - lower is more important (0 will always come out)
Returns
The ID of the section - use when starting timing

Definition at line 53 of file PerfGraphInterface.C.

55 {
56  const auto timed_section_name = timedSectionName(section_name);
57  if (!moose::internal::getPerfGraphRegistry().sectionExists(timed_section_name))
58  return moose::internal::getPerfGraphRegistry().registerSection(timed_section_name, level);
59  else
60  return moose::internal::getPerfGraphRegistry().sectionID(timed_section_name);
61 }
PerfID registerSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
std::string timedSectionName(const std::string &section_name) const
PerfID sectionID(const std::string &section_name) const
Given a name return the PerfID The name of the section.
PerfGraphRegistry & getPerfGraphRegistry()
Get the global PerfGraphRegistry singleton.

◆ registerTimedSection() [2/2]

PerfID PerfGraphInterface::registerTimedSection ( const std::string &  section_name,
const unsigned int  level,
const std::string &  live_message,
const bool  print_dots = true 
) const
protectedinherited

Call to register a named section for timing.

Parameters
section_nameThe name of the code section to be timed
levelThe importance of the timer - lower is more important (0 will always come out)
live_messageThe message to be printed to the screen during execution
print_dotsWhether or not progress dots should be printed for this section
Returns
The ID of the section - use when starting timing

Definition at line 64 of file PerfGraphInterface.C.

68 {
69  const auto timed_section_name = timedSectionName(section_name);
70  if (!moose::internal::getPerfGraphRegistry().sectionExists(timed_section_name))
72  timedSectionName(section_name), level, live_message, print_dots);
73  else
74  return moose::internal::getPerfGraphRegistry().sectionID(timed_section_name);
75 }
PerfID registerSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
std::string timedSectionName(const std::string &section_name) const
PerfID sectionID(const std::string &section_name) const
Given a name return the PerfID The name of the section.
PerfGraphRegistry & getPerfGraphRegistry()
Get the global PerfGraphRegistry singleton.

◆ reinitElem()

void AuxiliarySystem::reinitElem ( const Elem *  elem,
THREAD_ID  tid 
)
overridevirtual

Reinit an element assembly info.

Parameters
elemWhich element we are reinitializing for
tidID of the thread

Reimplemented from SystemBase.

Definition at line 355 of file AuxiliarySystem.C.

356 {
357  for (auto * var : _nodal_vars[tid])
358  var->computeElemValues();
359 
360  for (auto * var : _elem_vars[tid])
361  {
362  var->reinitAux();
363  var->computeElemValues();
364  }
365 }
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vars
std::vector< std::vector< MooseVariableFieldBase * > > _elem_vars
Elemental variables.

◆ reinitElemFace()

void AuxiliarySystem::reinitElemFace ( const Elem *  elem,
unsigned int  side,
BoundaryID  bnd_id,
THREAD_ID  tid 
)
overridevirtual

Reinit assembly info for a side of an element.

Parameters
elemThe element
sideSide of of the element
bnd_idBoundary id on that side
tidThread ID

Reimplemented from SystemBase.

Definition at line 368 of file AuxiliarySystem.C.

372 {
373  for (auto * var : _nodal_vars[tid])
374  var->computeElemValuesFace();
375 
376  for (auto * var : _elem_vars[tid])
377  {
378  var->reinitAux();
379  var->reinitAuxNeighbor();
380  var->computeElemValuesFace();
381  }
382 }
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vars
std::vector< std::vector< MooseVariableFieldBase * > > _elem_vars
Elemental variables.

◆ reinitLowerD()

void SystemBase::reinitLowerD ( THREAD_ID  tid)
virtualinherited

Compute the values of the variables on the lower dimensional element.

Definition at line 379 of file SystemBase.C.

Referenced by SubProblem::reinitLowerDElem().

380 {
381  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
382  for (const auto & var : vars)
383  var->computeLowerDValues();
384 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ reinitNeighbor()

void SystemBase::reinitNeighbor ( const Elem *  elem,
THREAD_ID  tid 
)
virtualinherited

Compute the values of the variables at all the current points.

Definition at line 371 of file SystemBase.C.

372 {
373  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
374  for (const auto & var : vars)
375  var->computeNeighborValues();
376 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ reinitNeighborFace()

void SystemBase::reinitNeighborFace ( const Elem *  elem,
unsigned int  side,
BoundaryID  bnd_id,
THREAD_ID  tid 
)
virtualinherited

Compute the values of the variables at all the current points.

Definition at line 360 of file SystemBase.C.

Referenced by SubProblem::reinitNeighborFaceRef().

364 {
365  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
366  for (const auto & var : vars)
367  var->computeNeighborValuesFace();
368 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ reinitNode()

void SystemBase::reinitNode ( const Node *  node,
THREAD_ID  tid 
)
virtualinherited

Reinit nodal assembly info.

Parameters
nodeNode to reinit for
tidThread ID

Definition at line 387 of file SystemBase.C.

388 {
389  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
390  for (const auto & var : vars)
391  {
392  var->reinitNode();
393  if (var->isNodalDefined())
394  var->computeNodalValues();
395  }
396 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ reinitNodeFace()

void SystemBase::reinitNodeFace ( const Node *  node,
BoundaryID  bnd_id,
THREAD_ID  tid 
)
virtualinherited

Reinit nodal assembly info on a face.

Parameters
nodeNode to reinit
bnd_idBoundary ID
tidThread ID

Definition at line 399 of file SystemBase.C.

400 {
401  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
402  for (const auto & var : vars)
403  {
404  var->reinitNode();
405  if (var->isNodalDefined())
406  var->computeNodalValues();
407  }
408 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ reinitNodes()

void SystemBase::reinitNodes ( const std::vector< dof_id_type > &  nodes,
THREAD_ID  tid 
)
virtualinherited

Reinit variables at a set of nodes.

Parameters
nodesList of node ids to reinit
tidThread ID

Definition at line 411 of file SystemBase.C.

412 {
413  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
414  for (const auto & var : vars)
415  {
416  var->reinitNodes(nodes);
417  var->computeNodalValues();
418  }
419 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ reinitNodesNeighbor()

void SystemBase::reinitNodesNeighbor ( const std::vector< dof_id_type > &  nodes,
THREAD_ID  tid 
)
virtualinherited

Reinit variables at a set of neighbor nodes.

Parameters
nodesList of node ids to reinit
tidThread ID

Definition at line 422 of file SystemBase.C.

423 {
424  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
425  for (const auto & var : vars)
426  {
427  var->reinitNodesNeighbor(nodes);
428  var->computeNodalNeighborValues();
429  }
430 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ reinitScalars()

void SystemBase::reinitScalars ( THREAD_ID  tid,
bool  reinit_for_derivative_reordering = false 
)
virtualinherited

Reinit scalar varaibles.

Parameters
tidThread ID
reinit_for_derivative_reorderingA flag indicating whether we are reinitializing for the purpose of re-ordering derivative information for ADNodalBCs

Definition at line 433 of file SystemBase.C.

434 {
435  const std::vector<MooseVariableScalar *> & vars = _vars[tid].scalars();
436  for (const auto & var : vars)
437  var->reinit(reinit_for_derivative_reordering);
438 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ removeMatrix()

void SystemBase::removeMatrix ( TagID  tag)
inherited

Removes a matrix with a given tag.

Parameters
tag_nameThe name of the tag

Definition at line 579 of file SystemBase.C.

580 {
581  if (!_subproblem.matrixTagExists(tag_id))
582  mooseError("Cannot remove the matrix with TagID ",
583  tag_id,
584  "\nin system '",
585  name(),
586  "', because that tag does not exist in the problem");
587 
588  if (hasMatrix(tag_id))
589  {
590  const auto matrix_name = _subproblem.matrixTagName(tag_id);
591  system().remove_matrix(matrix_name);
592  _tagged_matrices[tag_id] = nullptr;
593  }
594 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
std::vector< SparseMatrix< Number > * > _tagged_matrices
Tagged matrices (pointer)
Definition: SystemBase.h:949
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:328
virtual const std::string & name() const
Definition: SystemBase.C:1297
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual System & system()=0
Get the reference to the libMesh system.
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:294
virtual TagName matrixTagName(TagID tag)
Retrieve the name associated with a TagID.
Definition: SubProblem.C:323

◆ removeVector() [1/2]

void SystemBase::removeVector ( const std::string &  name)
inherited

Remove a vector from the system with the given name.

Definition at line 1291 of file SystemBase.C.

Referenced by SystemBase::restoreOldSolutions().

1292 {
1293  system().remove_vector(name);
1294 }
virtual const std::string & name() const
Definition: SystemBase.C:1297
virtual System & system()=0
Get the reference to the libMesh system.

◆ removeVector() [2/2]

void SystemBase::removeVector ( TagID  tag_id)
inherited

Remove a solution length vector from the system with the specified TagID.

Parameters
tag_idTag ID

Definition at line 690 of file SystemBase.C.

691 {
692  if (!_subproblem.vectorTagExists(tag_id))
693  mooseError("Cannot remove the vector with TagID ",
694  tag_id,
695  "\nin system '",
696  name(),
697  "', because that tag does not exist in the problem");
698 
699  if (hasVector(tag_id))
700  {
701  auto vector_name = _subproblem.vectorTagName(tag_id);
702  system().remove_vector(vector_name);
703  _tagged_vectors[tag_id] = nullptr;
704  }
705 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:873
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
virtual const std::string & name() const
Definition: SystemBase.C:1297
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
virtual System & system()=0
Get the reference to the libMesh system.
virtual TagName vectorTagName(const TagID tag) const
Retrieve the name associated with a TagID.
Definition: SubProblem.C:198
std::vector< NumericVector< Number > * > _tagged_vectors
Tagged vectors (pointer)
Definition: SystemBase.h:947

◆ residualCopy()

virtual NumericVector<Number>& SystemBase::residualCopy ( )
inlinevirtualinherited

Reimplemented in NonlinearSystemBase, and DisplacedSystem.

Definition at line 404 of file SystemBase.h.

Referenced by DisplacedSystem::residualCopy().

405  {
406  mooseError("This system does not support getting a copy of the residual");
407  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284

◆ residualGhosted()

virtual NumericVector<Number>& SystemBase::residualGhosted ( )
inlinevirtualinherited

Reimplemented in NonlinearSystemBase, and DisplacedSystem.

Definition at line 408 of file SystemBase.h.

Referenced by DisplacedSystem::residualGhosted().

409  {
410  mooseError("This system does not support getting a ghosted copy of the residual");
411  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284

◆ residualSetup()

void AuxiliarySystem::residualSetup ( )
overridevirtual

Reimplemented from SystemBase.

Definition at line 188 of file AuxiliarySystem.C.

189 {
191 
192  for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
193  {
195  _nodal_aux_storage.residualSetup(tid);
196  _mortar_nodal_aux_storage.residualSetup(tid);
197  _nodal_vec_aux_storage.residualSetup(tid);
198  _nodal_array_aux_storage.residualSetup(tid);
199  _elemental_aux_storage.residualSetup(tid);
200  _elemental_vec_aux_storage.residualSetup(tid);
201  _elemental_array_aux_storage.residualSetup(tid);
202  }
203 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _mortar_nodal_aux_storage
unsigned int n_threads()
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _nodal_array_aux_storage
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _elemental_array_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage
virtual void residualSetup()
Definition: SystemBase.C:1515
void residualSetup(THREAD_ID tid=0) const override

◆ residualVectorTag()

virtual TagID SystemBase::residualVectorTag ( ) const
inlinevirtualinherited

Reimplemented in NonlinearSystemBase, and DisplacedSystem.

Definition at line 275 of file SystemBase.h.

Referenced by SystemBase::defaultVectorTags(), and DisplacedSystem::residualVectorTag().

275 { mooseError("Not implemented yet"); }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284

◆ restoreOldSolutions()

void SystemBase::restoreOldSolutions ( )
virtualinherited

Restore the old and older solutions when the saved solutions present.

Definition at line 531 of file SystemBase.C.

532 {
533  const auto states =
534  _solution_states[static_cast<unsigned short>(Moose::SolutionIterationType::Time)].size();
535  if (states > 1)
536  for (unsigned int i = 1; i <= states - 1; ++i)
537  if (_saved_solution_states[i])
538  {
540  removeVector("save_solution_state_" + std::to_string(i));
541  _saved_solution_states[i] = nullptr;
542  }
543 
545  {
547  removeVector("save_solution_dot_old");
548  _saved_dot_old = nullptr;
549  }
551  {
553  removeVector("save_solution_dotdot_old");
554  _saved_dotdot_old = nullptr;
555  }
556 }
virtual NumericVector< Number > & solutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Get a state of the solution (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.C:1384
virtual NumericVector< Number > * solutionUDotDotOld()=0
NumericVector< Real > * _saved_dot_old
Definition: SystemBase.h:958
void removeVector(const std::string &name)
Remove a vector from the system with the given name.
Definition: SystemBase.C:1291
std::array< std::vector< NumericVector< Number > * >, 2 > _solution_states
The solution states (0 = current, 1 = old, 2 = older, etc)
Definition: SystemBase.h:998
NumericVector< Real > * _saved_dotdot_old
Definition: SystemBase.h:959
virtual NumericVector< Number > * solutionUDotOld()=0
std::vector< NumericVector< Number > * > _saved_solution_states
The saved solution states (0 = current, 1 = old, 2 = older, etc)
Definition: SystemBase.h:1000

◆ restoreSolutions()

void SystemBase::restoreSolutions ( )
virtualinherited

Restore current solutions (call after your solve failed)

Reimplemented in NonlinearSystemBase.

Definition at line 1274 of file SystemBase.C.

Referenced by NonlinearSystemBase::restoreSolutions().

1275 {
1276  if (!hasSolutionState(1))
1277  mooseError("Cannot restore solutions without old solution");
1278 
1279  *(const_cast<NumericVector<Number> *&>(currentSolution())) = solutionOld();
1280  solution() = solutionOld();
1281  if (solutionUDotOld())
1282  *solutionUDot() = *solutionUDotOld();
1283  if (solutionUDotDotOld())
1285  if (solutionPreviousNewton())
1287  system().update();
1288 }
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
virtual NumericVector< Number > * solutionUDot()=0
NumericVector< Number > & solution()
Definition: SystemBase.h:176
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
virtual NumericVector< Number > * solutionUDotDotOld()=0
virtual bool hasSolutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time) const
Whether or not the system has the solution state (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.h:1004
virtual System & system()=0
Get the reference to the libMesh system.
virtual const NumericVector< Number > * solutionPreviousNewton() const
Definition: SystemBase.C:1312
virtual NumericVector< Number > * solutionUDotOld()=0
virtual NumericVector< Number > * solutionUDotDot()=0
NumericVector< Number > & solutionOld()
Definition: SystemBase.h:177

◆ saveOldSolutions()

void SystemBase::saveOldSolutions ( )
virtualinherited

Save the old and older solutions.

Definition at line 499 of file SystemBase.C.

500 {
501  const auto states =
502  _solution_states[static_cast<unsigned short>(Moose::SolutionIterationType::Time)].size();
503  if (states > 1)
504  {
505  _saved_solution_states.resize(states);
506  for (unsigned int i = 1; i <= states - 1; ++i)
507  if (!_saved_solution_states[i])
509  &addVector("save_solution_state_" + std::to_string(i), false, PARALLEL);
510 
511  for (unsigned int i = 1; i <= states - 1; ++i)
513  }
514 
516  _saved_dot_old = &addVector("save_solution_dot_old", false, PARALLEL);
518  _saved_dotdot_old = &addVector("save_solution_dotdot_old", false, PARALLEL);
519 
520  if (solutionUDotOld())
522 
523  if (solutionUDotDotOld())
525 }
NumericVector< Number > & addVector(const std::string &vector_name, const bool project, const ParallelType type)
Adds a solution length vector to the system.
Definition: SystemBase.C:597
virtual NumericVector< Number > & solutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Get a state of the solution (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.C:1384
virtual NumericVector< Number > * solutionUDotDotOld()=0
NumericVector< Real > * _saved_dot_old
Definition: SystemBase.h:958
std::array< std::vector< NumericVector< Number > * >, 2 > _solution_states
The solution states (0 = current, 1 = old, 2 = older, etc)
Definition: SystemBase.h:998
NumericVector< Real > * _saved_dotdot_old
Definition: SystemBase.h:959
virtual NumericVector< Number > * solutionUDotOld()=0
std::vector< NumericVector< Number > * > _saved_solution_states
The saved solution states (0 = current, 1 = old, 2 = older, etc)
Definition: SystemBase.h:1000

◆ serializedSolution()

NumericVector< Number > & AuxiliarySystem::serializedSolution ( )
overridevirtual

Returns a reference to a serialized version of the solution vector for this subproblem.

Implements SystemBase.

Definition at line 385 of file AuxiliarySystem.C.

Referenced by PNGOutput::calculateRescalingValues(), and PNGOutput::makeMeshFunc().

386 {
387  if (!_serialized_solution.get())
388  {
390  _serialized_solution->init(_sys.n_dofs(), false, SERIAL);
391  }
392 
393  return *_serialized_solution;
394 }
std::unique_ptr< NumericVector< Number > > _serialized_solution
Serialized version of the solution vector, or nullptr if a serialized solution is not needed...
const Parallel::Communicator & comm() const
SERIAL
FEProblemBase & _fe_problem
static std::unique_ptr< NumericVector< Number > > build(const Parallel::Communicator &comm, const SolverPackage solver_package=libMesh::default_solver_package())

◆ serializeSolution()

void AuxiliarySystem::serializeSolution ( )
virtual

Definition at line 397 of file AuxiliarySystem.C.

Referenced by compute().

398 {
399  if (_serialized_solution.get() &&
400  _sys.n_dofs() > 0) // libMesh does not like serializing of empty vectors
401  {
402  if (!_serialized_solution->initialized() || _serialized_solution->size() != _sys.n_dofs())
403  {
404  _serialized_solution->clear();
405  _serialized_solution->init(_sys.n_dofs(), false, SERIAL);
406  }
407 
409  }
410 }
std::unique_ptr< NumericVector< Number > > _serialized_solution
Serialized version of the solution vector, or nullptr if a serialized solution is not needed...
NumericVector< Number > & solution()
Definition: SystemBase.h:176
SERIAL
virtual void localize(std::vector< Number > &v_local) const =0

◆ setActiveScalarVariableCoupleableVectorTags()

void SystemBase::setActiveScalarVariableCoupleableVectorTags ( const std::set< TagID > &  vtags,
THREAD_ID  tid 
)
inherited

Set the active vector tags for the scalar variables.

Definition at line 1542 of file SystemBase.C.

Referenced by SubProblem::setActiveScalarVariableCoupleableVectorTags().

1544 {
1545  _vars[tid].setActiveScalarVariableCoupleableVectorTags(vtags);
1546 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ setActiveVariableCoupleableVectorTags()

void SystemBase::setActiveVariableCoupleableVectorTags ( const std::set< TagID > &  vtags,
THREAD_ID  tid 
)
inherited

Set the active vector tags for the variables.

Definition at line 1536 of file SystemBase.C.

Referenced by SubProblem::setActiveFEVariableCoupleableVectorTags().

1537 {
1538  _vars[tid].setActiveVariableCoupleableVectorTags(vtags);
1539 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:934

◆ setPreviousNewtonSolution()

void AuxiliarySystem::setPreviousNewtonSolution ( )
virtual

Definition at line 828 of file AuxiliarySystem.C.

829 {
830  // Evaluate aux variables to get the solution vector
832 }
const ExecFlagType EXEC_LINEAR
Definition: Moose.C:29
virtual void compute(ExecFlagType type)
Compute auxiliary variables.

◆ setScalarVariableCoupleableTags()

void AuxiliarySystem::setScalarVariableCoupleableTags ( ExecFlagType  type)

Definition at line 624 of file AuxiliarySystem.C.

Referenced by computeScalarVars().

625 {
627  const std::vector<std::shared_ptr<AuxScalarKernel>> & objects = storage.getActiveObjects(0);
628 
629  std::set<TagID> needed_sc_var_matrix_tags;
630  std::set<TagID> needed_sc_var_vector_tags;
631  for (const auto & obj : objects)
632  {
633  auto & sc_var_coup_vtags = obj->getScalarVariableCoupleableVectorTags();
634  needed_sc_var_vector_tags.insert(sc_var_coup_vtags.begin(), sc_var_coup_vtags.end());
635 
636  auto & sc_var_coup_mtags = obj->getScalarVariableCoupleableMatrixTags();
637  needed_sc_var_matrix_tags.insert(sc_var_coup_mtags.begin(), sc_var_coup_mtags.end());
638  }
639 
640  _fe_problem.setActiveScalarVariableCoupleableMatrixTags(needed_sc_var_matrix_tags, 0);
641  _fe_problem.setActiveScalarVariableCoupleableVectorTags(needed_sc_var_vector_tags, 0);
642 }
virtual void setActiveScalarVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid) override
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
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...
FEProblemBase & _fe_problem
virtual void setActiveScalarVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid) override

◆ setVariableGlobalDoFs()

void SystemBase::setVariableGlobalDoFs ( const std::string &  var_name)
inherited

set all the global dof indices for a variable

Parameters
var_nameThe name of the variable

Definition at line 175 of file SystemBase.C.

176 {
177  AllLocalDofIndicesThread aldit(_subproblem, {var_name});
179  Threads::parallel_reduce(elem_range, aldit);
180 
181  // Gather the dof indices across procs to get all the dof indices for var_name
182  aldit.dofIndicesSetUnion();
183 
184  const auto & all_dof_indices = aldit.getDofIndices();
185  _var_all_dof_indices.assign(all_dof_indices.begin(), all_dof_indices.end());
186 }
ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:1040
std::vector< dof_id_type > _var_all_dof_indices
Container for the dof indices of a given variable.
Definition: SystemBase.h:988
Grab all the (possibly semi)local dof indices for the variables passed in, in the system passed in...
SubProblem & _subproblem
Definition: SystemBase.h:924
MooseMesh & _mesh
Definition: SystemBase.h:929

◆ setVerboseFlag()

void SystemBase::setVerboseFlag ( const bool &  verbose)
inlineinherited

Sets the verbose flag.

Parameters
[in]verboseVerbose flag

Definition at line 129 of file SystemBase.h.

Referenced by Executioner::Executioner().

129 { _verbose = verbose; }
bool _verbose
True if printing out additional information.
Definition: SystemBase.h:982

◆ solution() [1/2]

NumericVector<Number>& SystemBase::solution ( )
inlineinherited

Definition at line 176 of file SystemBase.h.

Referenced by Adaptivity::adaptMesh(), TransientMultiApp::appTransferVector(), MooseEigenSystem::combineSystemSolution(), NonlinearSystemBase::computeDamping(), computeElementalVarsHelper(), NonlinearSystemBase::computeJacobianInternal(), computeMortarNodalVars(), NonlinearSystemBase::computeNodalBCs(), computeNodalVarsHelper(), NonlinearSystemBase::computeResidualTags(), computeScalarVars(), NonlinearSystemBase::constraintResiduals(), SystemBase::copyVars(), MultiAppPostprocessorToAuxScalarTransfer::execute(), MultiAppScalarToAuxScalarTransfer::execute(), NodalNormalsCorner::execute(), NodalNormalsEvaluator::execute(), MultiAppVariableValueSamplePostprocessorTransfer::execute(), NodalNormalsPreprocessor::execute(), NodalNormalsCorner::finalize(), NodalNormalsEvaluator::finalize(), NodalNormalsPreprocessor::finalize(), NodalNormalsCorner::initialize(), NodalNormalsEvaluator::initialize(), NodalNormalsPreprocessor::initialize(), MooseEigenSystem::initSystemSolution(), ComputeMarkerThread::onElement(), ComputeIndicatorThread::onElement(), ComputeUserObjectsThread::onElement(), ComputeNodalUserObjectsThread::onNode(), FEProblemBase::projectInitialConditionOnCustomRange(), FEProblemBase::projectSolution(), Transient::relativeSolutionDifferenceNorm(), SystemBase::restoreSolutions(), SecantSolve::saveVariableValues(), SteffensenSolve::saveVariableValues(), PicardSolve::saveVariableValues(), MooseEigenSystem::scaleSystemSolution(), serializeSolution(), NonlinearSystemBase::setConstraintSecondaryValues(), NonlinearSystemBase::setInitialSolution(), DisplacedSystem::solutionInternal(), NonlinearEigenSystem::solve(), MultiAppDofCopyTransfer::transfer(), SteffensenSolve::transformVariables(), SecantSolve::transformVariables(), PicardSolve::transformVariables(), and SystemBase::zeroVariables().

176 { return solutionState(0); }
virtual NumericVector< Number > & solutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Get a state of the solution (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.C:1384

◆ solution() [2/2]

const NumericVector<Number>& SystemBase::solution ( ) const
inlineinherited

Definition at line 179 of file SystemBase.h.

179 { return solutionState(0); }
virtual NumericVector< Number > & solutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Get a state of the solution (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.C:1384

◆ solutionInternal()

NumericVector<Number>& AuxiliarySystem::solutionInternal ( ) const
inlineoverrideprotectedvirtual

Internal getter for solution owned by libMesh.

Implements SystemBase.

Definition at line 237 of file AuxiliarySystem.h.

237 { return *_sys.solution; }

◆ solutionOld() [1/2]

NumericVector<Number>& SystemBase::solutionOld ( )
inlineinherited

◆ solutionOld() [2/2]

const NumericVector<Number>& SystemBase::solutionOld ( ) const
inlineinherited

Definition at line 180 of file SystemBase.h.

180 { return solutionState(1); }
virtual NumericVector< Number > & solutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Get a state of the solution (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.C:1384

◆ solutionOlder() [1/2]

NumericVector<Number>& SystemBase::solutionOlder ( )
inlineinherited

Definition at line 178 of file SystemBase.h.

Referenced by MooseEigenSystem::combineSystemSolution(), CentralDifference::computeTimeDerivatives(), ActivateElementsUserObjectBase::initSolutions(), MooseVariableScalar::reinit(), and ElementSubdomainModifier::setOldAndOlderSolutionsForMovedNodes().

178 { return solutionState(2); }
virtual NumericVector< Number > & solutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Get a state of the solution (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.C:1384

◆ solutionOlder() [2/2]

const NumericVector<Number>& SystemBase::solutionOlder ( ) const
inlineinherited

Definition at line 181 of file SystemBase.h.

181 { return solutionState(2); }
virtual NumericVector< Number > & solutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Get a state of the solution (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.C:1384

◆ solutionPreviousNewton() [1/2]

const NumericVector< Number > * SystemBase::solutionPreviousNewton ( ) const
virtualinherited

Reimplemented in DisplacedSystem.

Definition at line 1312 of file SystemBase.C.

Referenced by SystemBase::copyOldSolutions(), SystemBase::copySolutionsBackwards(), and SystemBase::restoreSolutions().

1313 {
1316  else
1317  return nullptr;
1318 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:873
const TagName PREVIOUS_NL_SOLUTION_TAG
Definition: MooseTypes.C:30
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:882

◆ solutionPreviousNewton() [2/2]

NumericVector< Number > * SystemBase::solutionPreviousNewton ( )
virtualinherited

Reimplemented in DisplacedSystem.

Definition at line 1303 of file SystemBase.C.

1304 {
1307  else
1308  return nullptr;
1309 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:873
const TagName PREVIOUS_NL_SOLUTION_TAG
Definition: MooseTypes.C:30
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:882

◆ solutionState() [1/2]

NumericVector< Number > & SystemBase::solutionState ( const unsigned int  state,
Moose::SolutionIterationType  iteration_type = Moose::SolutionIterationType::Time 
)
virtualinherited

Get a state of the solution (0 = current, 1 = old, 2 = older, etc).

If the state does not exist, it will be initialized in addition to any newer states before it that have not been initialized.

Reimplemented in DisplacedSystem.

Definition at line 1384 of file SystemBase.C.

Referenced by SystemBase::copyOldSolutions(), SystemBase::copySolutionsBackwards(), PointwiseRenormalizeVector::execute(), PointwiseRenormalizeVector::finalize(), SystemBase::restoreOldSolutions(), SystemBase::saveOldSolutions(), SystemBase::solution(), SystemBase::solutionOld(), SystemBase::solutionOlder(), and DisplacedSystem::solutionState().

1386 {
1387  if (!hasSolutionState(state, iteration_type))
1388  needSolutionState(state, iteration_type);
1389  return *_solution_states[static_cast<unsigned short>(iteration_type)][state];
1390 }
virtual void needSolutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Registers that the solution state state is needed.
Definition: SystemBase.C:1393
virtual bool hasSolutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time) const
Whether or not the system has the solution state (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.h:1004
std::array< std::vector< NumericVector< Number > * >, 2 > _solution_states
The solution states (0 = current, 1 = old, 2 = older, etc)
Definition: SystemBase.h:998

◆ solutionState() [2/2]

const NumericVector< Number > & SystemBase::solutionState ( const unsigned int  state,
Moose::SolutionIterationType  iteration_type = Moose::SolutionIterationType::Time 
) const
virtualinherited

Get a state of the solution (0 = current, 1 = old, 2 = older, etc).

Reimplemented in DisplacedSystem.

Definition at line 1357 of file SystemBase.C.

1359 {
1360  if (!hasSolutionState(state, iteration_type))
1361  mooseError("For iteration type '",
1362  Moose::stringify(iteration_type),
1363  "': solution state ",
1364  state,
1365  " was requested in ",
1366  name(),
1367  " but only up to state ",
1368  _solution_states[static_cast<unsigned short>(iteration_type)].size() - 1,
1369  " is available.");
1370 
1371  const auto & solution_states = _solution_states[static_cast<unsigned short>(iteration_type)];
1372 
1373  if (state == 0)
1374  mooseAssert(solution_states[0] == &solutionInternal(), "Inconsistent current solution");
1375  else
1376  mooseAssert(solution_states[state] ==
1377  &getVector(oldSolutionStateVectorName(state, iteration_type)),
1378  "Inconsistent solution state");
1379 
1380  return *solution_states[state];
1381 }
virtual NumericVector< Number > & solutionInternal() const =0
Internal getter for solution owned by libMesh.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
virtual const std::string & name() const
Definition: SystemBase.C:1297
virtual bool hasSolutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time) const
Whether or not the system has the solution state (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.h:1004
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:62
TagName oldSolutionStateVectorName(const unsigned int, Moose::SolutionIterationType iteration_type) const
Gets the vector name used for an old (not current) solution state.
Definition: SystemBase.C:1338
std::array< std::vector< NumericVector< Number > * >, 2 > _solution_states
The solution states (0 = current, 1 = old, 2 = older, etc)
Definition: SystemBase.h:998
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:882

◆ solutionStatesInitialized()

bool SystemBase::solutionStatesInitialized ( ) const
inlineinherited

Whether or not the solution states have been initialized via initSolutionState()

After the solution states have been initialized, additional solution states cannot be added.

Definition at line 888 of file SystemBase.h.

Referenced by ScalarKernelBase::uOld(), and AuxScalarKernel::uOld().

bool _solution_states_initialized
Whether or not the solution states have been initialized.
Definition: SystemBase.h:985

◆ solutionUDot() [1/2]

NumericVector<Number>* AuxiliarySystem::solutionUDot ( )
inlineoverridevirtual

Implements SystemBase.

Definition at line 104 of file AuxiliarySystem.h.

104 { return _u_dot; }
NumericVector< Number > * _u_dot
solution vector for u^dot

◆ solutionUDot() [2/2]

const NumericVector<Number>* AuxiliarySystem::solutionUDot ( ) const
inlineoverridevirtual

Implements SystemBase.

Definition at line 108 of file AuxiliarySystem.h.

108 { return _u_dot; }
NumericVector< Number > * _u_dot
solution vector for u^dot

◆ solutionUDotDot() [1/2]

NumericVector<Number>* AuxiliarySystem::solutionUDotDot ( )
inlineoverridevirtual

Implements SystemBase.

Definition at line 105 of file AuxiliarySystem.h.

105 { return _u_dotdot; }
NumericVector< Number > * _u_dotdot
solution vector for u^dotdot

◆ solutionUDotDot() [2/2]

const NumericVector<Number>* AuxiliarySystem::solutionUDotDot ( ) const
inlineoverridevirtual

Implements SystemBase.

Definition at line 109 of file AuxiliarySystem.h.

109 { return _u_dotdot; }
NumericVector< Number > * _u_dotdot
solution vector for u^dotdot

◆ solutionUDotDotOld() [1/2]

NumericVector<Number>* AuxiliarySystem::solutionUDotDotOld ( )
inlineoverridevirtual

Implements SystemBase.

Definition at line 107 of file AuxiliarySystem.h.

107 { return _u_dotdot_old; }
NumericVector< Number > * _u_dotdot_old
Old solution vector for u^dotdot.

◆ solutionUDotDotOld() [2/2]

const NumericVector<Number>* AuxiliarySystem::solutionUDotDotOld ( ) const
inlineoverridevirtual

Implements SystemBase.

Definition at line 111 of file AuxiliarySystem.h.

111 { return _u_dotdot_old; }
NumericVector< Number > * _u_dotdot_old
Old solution vector for u^dotdot.

◆ solutionUDotOld() [1/2]

NumericVector<Number>* AuxiliarySystem::solutionUDotOld ( )
inlineoverridevirtual

Implements SystemBase.

Definition at line 106 of file AuxiliarySystem.h.

106 { return _u_dot_old; }
NumericVector< Number > * _u_dot_old
Old solution vector for u^dot.

◆ solutionUDotOld() [2/2]

const NumericVector<Number>* AuxiliarySystem::solutionUDotOld ( ) const
inlineoverridevirtual

Implements SystemBase.

Definition at line 110 of file AuxiliarySystem.h.

110 { return _u_dot_old; }
NumericVector< Number > * _u_dot_old
Old solution vector for u^dot.

◆ solve()

void SystemBase::solve ( )
virtualinherited

Solve the system (using libMesh magic)

Reimplemented in NonlinearSystemBase, NonlinearEigenSystem, NonlinearSystem, and DumpObjectsNonlinearSystem.

Definition at line 1218 of file SystemBase.C.

1219 {
1220  system().solve();
1221 }
virtual System & system()=0
Get the reference to the libMesh system.

◆ subdomainSetup()

void AuxiliarySystem::subdomainSetup ( )
overridevirtual

Reimplemented from SystemBase.

Definition at line 152 of file AuxiliarySystem.C.

153 {
155 
156  for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
157  {
159  _nodal_aux_storage.subdomainSetup(tid);
160  _mortar_nodal_aux_storage.subdomainSetup(tid);
161  _nodal_vec_aux_storage.subdomainSetup(tid);
162  _nodal_array_aux_storage.subdomainSetup(tid);
163  _elemental_aux_storage.subdomainSetup(tid);
164  _elemental_vec_aux_storage.subdomainSetup(tid);
165  _elemental_array_aux_storage.subdomainSetup(tid);
166  }
167 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _mortar_nodal_aux_storage
unsigned int n_threads()
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _nodal_array_aux_storage
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _elemental_array_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
virtual void subdomainSetup()
Definition: SystemBase.C:1508
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage
virtual void subdomainSetup(THREAD_ID tid=0) const

◆ subproblem() [1/2]

virtual SubProblem& SystemBase::subproblem ( )
inlinevirtualinherited

◆ subproblem() [2/2]

virtual const SubProblem& SystemBase::subproblem ( ) const
inlinevirtualinherited

Definition at line 99 of file SystemBase.h.

99 { return _subproblem; }
SubProblem & _subproblem
Definition: SystemBase.h:924

◆ sys()

virtual System& AuxiliarySystem::sys ( )
inlinevirtual

◆ system() [1/2]

virtual System& AuxiliarySystem::system ( )
inlineoverridevirtual

◆ system() [2/2]

virtual const System& AuxiliarySystem::system ( ) const
inlineoverridevirtual

Implements SystemBase.

Definition at line 149 of file AuxiliarySystem.h.

149 { return _sys; }

◆ systemMatrixTag()

virtual TagID SystemBase::systemMatrixTag ( ) const
inlinevirtualinherited

Return the Matrix Tag ID for System.

Reimplemented in NonlinearSystemBase, and DisplacedSystem.

Definition at line 265 of file SystemBase.h.

Referenced by SystemBase::defaultMatrixTags(), and DisplacedSystem::systemMatrixTag().

265 { mooseError("Not implemented yet"); }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284

◆ timedSectionName()

std::string PerfGraphInterface::timedSectionName ( const std::string &  section_name) const
protectedinherited
Returns
The name of the timed section with the name section_name.

Optionally adds a prefix if one is defined.

Definition at line 47 of file PerfGraphInterface.C.

Referenced by PerfGraphInterface::registerTimedSection().

48 {
49  return _prefix.empty() ? "" : (_prefix + "::") + section_name;
50 }
const std::string _prefix
A prefix to use for all sections.

◆ timestepSetup()

void AuxiliarySystem::timestepSetup ( )
overridevirtual

Reimplemented from SystemBase.

Definition at line 116 of file AuxiliarySystem.C.

117 {
119 
120  for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
121  {
123  _nodal_aux_storage.timestepSetup(tid);
124  _mortar_nodal_aux_storage.timestepSetup(tid);
125  _nodal_vec_aux_storage.timestepSetup(tid);
126  _nodal_array_aux_storage.timestepSetup(tid);
127  _elemental_aux_storage.timestepSetup(tid);
128  _elemental_vec_aux_storage.timestepSetup(tid);
129  _elemental_array_aux_storage.timestepSetup(tid);
130  }
131 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _mortar_nodal_aux_storage
unsigned int n_threads()
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _nodal_array_aux_storage
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _elemental_array_aux_storage
virtual void timestepSetup(THREAD_ID tid=0) const
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage
virtual void timestepSetup()
Definition: SystemBase.C:1494

◆ timeVectorTag()

virtual TagID SystemBase::timeVectorTag ( ) const
inlinevirtualinherited

Ideally, we should not need this API.

There exists a really bad API "addCachedResidualDirectly " in FEProblem and DisplacedProblem This API should go away once addCachedResidualDirectly is removed in the future Return Tag ID for Time

Reimplemented in NonlinearSystemBase, and DisplacedSystem.

Definition at line 260 of file SystemBase.h.

Referenced by SystemBase::defaultVectorTags(), and DisplacedSystem::timeVectorTag().

260 { mooseError("Not implemented yet"); }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284

◆ update()

void SystemBase::update ( bool  update_libmesh_system = true)
virtualinherited

◆ updateActive()

void AuxiliarySystem::updateActive ( THREAD_ID  tid)
virtual

Definition at line 206 of file AuxiliarySystem.C.

207 {
209  _nodal_aux_storage.updateActive(tid);
210  _mortar_nodal_aux_storage.updateActive(tid);
211  _nodal_vec_aux_storage.updateActive(tid);
212  _nodal_array_aux_storage.updateActive(tid);
213  _elemental_aux_storage.updateActive(tid);
214  _elemental_vec_aux_storage.updateActive(tid);
215  _elemental_array_aux_storage.updateActive(tid);
216 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _mortar_nodal_aux_storage
void updateActive(THREAD_ID tid=0) override
Updates the active objects storage.
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _nodal_array_aux_storage
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _elemental_array_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ validParams()

InputParameters PerfGraphInterface::validParams ( )
staticinherited

Definition at line 16 of file PerfGraphInterface.C.

17 {
19  return params;
20 }
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters emptyInputParameters()

◆ varKind()

Moose::VarKindType SystemBase::varKind ( ) const
inlineinherited
Returns
the type of variables this system holds, e.g. nonlinear or auxiliary

Definition at line 916 of file SystemBase.h.

Referenced by Coupleable::coupled(), and UserObject::UserObject().

916 { return _var_kind; }
Moose::VarKindType _var_kind
default kind of variables in this system
Definition: SystemBase.h:962

◆ zeroTaggedVector()

void SystemBase::zeroTaggedVector ( const TagID  tag)
inherited

Zero vector with the given tag.

Definition at line 664 of file SystemBase.C.

Referenced by SystemBase::zeroTaggedVectors().

665 {
666  if (!_subproblem.vectorTagExists(tag))
667  mooseError("Cannot zero vector with TagID ",
668  tag,
669  " in system '",
670  name(),
671  "' because that tag does not exist in the problem");
672  else if (!hasVector(tag))
673  mooseError("Cannot zero vector tag with name '",
675  "' in system '",
676  name(),
677  "' because there is no vector associated with that tag");
678 
679  getVector(tag).zero();
680 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:873
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
virtual void zero()=0
virtual const std::string & name() const
Definition: SystemBase.C:1297
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:163
virtual TagName vectorTagName(const TagID tag) const
Retrieve the name associated with a TagID.
Definition: SubProblem.C:198
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:882

◆ zeroTaggedVectors()

void SystemBase::zeroTaggedVectors ( const std::set< TagID > &  tags)
inherited

Zero all vectors for given tags.

Definition at line 683 of file SystemBase.C.

Referenced by NonlinearSystemBase::computeResidualAndJacobianTags(), and NonlinearSystemBase::computeResidualTags().

684 {
685  for (const auto tag : tags)
686  zeroTaggedVector(tag);
687 }
void zeroTaggedVector(const TagID tag)
Zero vector with the given tag.
Definition: SystemBase.C:664

◆ zeroVariables()

void SystemBase::zeroVariables ( std::vector< std::string > &  vars_to_be_zeroed)
virtualinherited

Zero out the solution for the list of variables passed in.

@ param vars_to_be_zeroed The variable names in this vector will have their solutions set to zero after this call

Reimplemented in DisplacedSystem.

Definition at line 189 of file SystemBase.C.

Referenced by DisplacedSystem::zeroVariables(), SystemBase::zeroVariablesForJacobian(), and SystemBase::zeroVariablesForResidual().

190 {
191  if (vars_to_be_zeroed.size() > 0)
192  {
194 
195  auto problem = dynamic_cast<FEProblemBase *>(&_subproblem);
196  if (!problem)
197  mooseError("System needs to be registered in FEProblemBase for using zeroVariables.");
198 
199  AllLocalDofIndicesThread aldit(*problem, vars_to_be_zeroed, true);
201  Threads::parallel_reduce(elem_range, aldit);
202 
203  const auto & dof_indices_to_zero = aldit.getDofIndices();
204 
205  solution.close();
206 
207  for (const auto & dof : dof_indices_to_zero)
208  solution.set(dof, 0);
209 
210  solution.close();
211 
212  // Call update to update the current_local_solution for this system
213  system().update();
214  }
215 }
ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:1040
NumericVector< Number > & solution()
Definition: SystemBase.h:176
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:284
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Grab all the (possibly semi)local dof indices for the variables passed in, in the system passed in...
SubProblem & _subproblem
Definition: SystemBase.h:924
virtual System & system()=0
Get the reference to the libMesh system.
virtual void close()=0
MooseMesh & _mesh
Definition: SystemBase.h:929
virtual void set(const numeric_index_type i, const Number value)=0

◆ zeroVariablesForJacobian()

void SystemBase::zeroVariablesForJacobian ( )
virtualinherited

Zero out the solution for the variables that were registered as needing to have their solutions zeroed on out on Jacobian evaluation by a call to addVariableToZeroOnResidual()

Definition at line 224 of file SystemBase.C.

225 {
227 }
std::vector< std::string > _vars_to_be_zeroed_on_jacobian
Definition: SystemBase.h:941
virtual void zeroVariables(std::vector< std::string > &vars_to_be_zeroed)
Zero out the solution for the list of variables passed in.
Definition: SystemBase.C:189

◆ zeroVariablesForResidual()

void SystemBase::zeroVariablesForResidual ( )
virtualinherited

Zero out the solution for the variables that were registered as needing to have their solutions zeroed on out on residual evaluation by a call to addVariableToZeroOnResidual()

Definition at line 218 of file SystemBase.C.

219 {
221 }
std::vector< std::string > _vars_to_be_zeroed_on_residual
Definition: SystemBase.h:940
virtual void zeroVariables(std::vector< std::string > &vars_to_be_zeroed)
Zero out the solution for the list of variables passed in.
Definition: SystemBase.C:189

Friends And Related Function Documentation

◆ ComputeIndicatorThread

friend class ComputeIndicatorThread
friend

Definition at line 229 of file AuxiliarySystem.h.

◆ ComputeMarkerThread

friend class ComputeMarkerThread
friend

Definition at line 230 of file AuxiliarySystem.h.

◆ ComputeNodalKernelBCJacobiansThread

Definition at line 235 of file AuxiliarySystem.h.

◆ ComputeNodalKernelBcsThread

friend class ComputeNodalKernelBcsThread
friend

Definition at line 233 of file AuxiliarySystem.h.

◆ ComputeNodalKernelJacobiansThread

friend class ComputeNodalKernelJacobiansThread
friend

Definition at line 234 of file AuxiliarySystem.h.

◆ ComputeNodalKernelsThread

friend class ComputeNodalKernelsThread
friend

Definition at line 232 of file AuxiliarySystem.h.

◆ FlagElementsThread

friend class FlagElementsThread
friend

Definition at line 231 of file AuxiliarySystem.h.

Member Data Documentation

◆ _app

MooseApp& SystemBase::_app
protectedinherited

◆ _automatic_scaling

bool SystemBase::_automatic_scaling
protectedinherited

Whether to automatically scale the variables.

Definition at line 979 of file SystemBase.h.

Referenced by SystemBase::automaticScaling(), NonlinearSystem::init(), NonlinearSystemBase::initialSetup(), and NonlinearSystemBase::preSolve().

◆ _aux_scalar_storage

ExecuteMooseObjectWarehouse<AuxScalarKernel> AuxiliarySystem::_aux_scalar_storage
protected

◆ _console

const ConsoleStream ConsoleStreamInterface::_console
inherited

An instance of helper class to write streams to the Console objects.

Definition at line 31 of file ConsoleStreamInterface.h.

Referenced by IterationAdaptiveDT::acceptStep(), MeshOnlyAction::act(), SetupDebugAction::act(), MaterialOutputAction::act(), Adaptivity::adaptMesh(), FEProblemBase::adaptMesh(), PerfGraph::addToExecutionList(), SimplePredictor::apply(), SystemBase::applyScalingFactors(), MultiApp::backup(), FEProblemBase::backupMultiApps(), CoarsenedPiecewiseLinear::buildCoarsenedGrid(), MeshDiagnosticsGenerator::checkElementOverlap(), MeshDiagnosticsGenerator::checkElementTypes(), MeshDiagnosticsGenerator::checkElementVolumes(), FEProblemBase::checkExceptionAndStopSolve(), MeshDiagnosticsGenerator::checkLocalJacobians(), MeshDiagnosticsGenerator::checkNonConformalMesh(), MeshDiagnosticsGenerator::checkNonConformalMeshFromAdaptivity(), MeshDiagnosticsGenerator::checkNonPlanarSides(), FEProblemBase::checkProblemIntegrity(), ReferenceResidualProblem::checkRelativeConvergence(), MeshDiagnosticsGenerator::checkSidesetsOrientation(), IterationAdaptiveDT::computeAdaptiveDT(), Transient::computeConstrainedDT(), FixedPointSolve::computeCustomConvergencePostprocessor(), NonlinearSystemBase::computeDamping(), IterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeFailedDT(), IterationAdaptiveDT::computeInitialDT(), IterationAdaptiveDT::computeInterpolationDT(), NonlinearSystemBase::computeScaling(), Problem::console(), IterationAdaptiveDT::constrainStep(), TimeStepper::constrainStep(), MultiApp::createApp(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MessageFromInput::execute(), Steady::execute(), Eigenvalue::execute(), ActionWarehouse::executeActionsWithAction(), ActionWarehouse::executeAllActions(), ElementQualityChecker::finalize(), FEProblemBase::finishMultiAppStep(), MeshRepairGenerator::fixOverlappingNodes(), CoarsenBlockGenerator::generate(), MeshGenerator::generateInternal(), VariableCondensationPreconditioner::getDofToCondense(), InversePowerMethod::init(), NonlinearEigen::init(), FEProblemBase::initialAdaptMesh(), EigenExecutionerBase::inversePowerIteration(), FEProblemBase::joinAndFinalize(), Transient::keepGoing(), IterationAdaptiveDT::limitDTByFunction(), IterationAdaptiveDT::limitDTToPostprocessorValue(), FEProblemBase::logAdd(), EigenExecutionerBase::makeBXConsistent(), Console::meshChanged(), MooseBaseErrorInterface::mooseDeprecated(), MooseBaseErrorInterface::mooseInfo(), MooseBaseErrorInterface::mooseWarning(), MooseBaseErrorInterface::mooseWarningNonPrefixed(), ReferenceResidualProblem::nonlinearConvergenceSetup(), ReporterDebugOutput::output(), PerfGraphOutput::output(), MaterialPropertyDebugOutput::output(), DOFMapOutput::output(), VariableResidualNormsDebugOutput::output(), Console::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Console::outputInput(), Console::outputPostprocessors(), PseudoTimestep::outputPseudoTimestep(), Console::outputReporters(), Console::outputScalarVariables(), Console::outputSystemInformation(), FEProblemBase::possiblyRebuildGeomSearchPatches(), EigenExecutionerBase::postExecute(), AB2PredictorCorrector::postSolve(), ActionWarehouse::printActionDependencySets(), SolutionInvalidity::printDebug(), EigenExecutionerBase::printEigenvalue(), SecantSolve::printFixedPointConvergenceHistory(), SteffensenSolve::printFixedPointConvergenceHistory(), PicardSolve::printFixedPointConvergenceHistory(), FixedPointSolve::printFixedPointConvergenceReason(), PerfGraphLivePrint::printLiveMessage(), MaterialPropertyDebugOutput::printMaterialMap(), PerfGraphLivePrint::printStats(), AutomaticMortarGeneration::projectPrimaryNodesSinglePair(), AutomaticMortarGeneration::projectSecondaryNodesSinglePair(), CoarsenBlockGenerator::recursiveCoarsen(), SolutionTimeAdaptiveDT::rejectStep(), MultiApp::restore(), FEProblemBase::restoreMultiApps(), SimplePredictor::shouldApply(), Checkpoint::shouldOutput(), SubProblem::showFunctorRequestors(), SubProblem::showFunctors(), FullSolveMultiApp::showStatusMessage(), FEProblemSolve::solve(), FixedPointSolve::solve(), NonlinearSystem::solve(), EigenProblem::solve(), LStableDirk2::solve(), LStableDirk3::solve(), ImplicitMidpoint::solve(), ExplicitTVDRK2::solve(), LStableDirk4::solve(), AStableDirk4::solve(), ExplicitRK2::solve(), TransientMultiApp::solveStep(), FixedPointSolve::solveStep(), PerfGraphLivePrint::start(), AB2PredictorCorrector::step(), NonlinearEigen::takeStep(), Transient::takeStep(), Console::writeTimestepInformation(), Console::writeVariableNorms(), and FEProblemBase::~FEProblemBase().

◆ _current_solution

const NumericVector<Number>* AuxiliarySystem::_current_solution
protected

solution vector from nonlinear solver

Definition at line 186 of file AuxiliarySystem.h.

Referenced by currentSolution().

◆ _du_dot_du

Real SystemBase::_du_dot_du
protectedinherited

Definition at line 943 of file SystemBase.h.

Referenced by SystemBase::duDotDu().

◆ _du_dotdot_du

Real SystemBase::_du_dotdot_du
protectedinherited

Definition at line 944 of file SystemBase.h.

Referenced by SystemBase::duDotDotDu().

◆ _elem_vars

std::vector<std::vector<MooseVariableFieldBase *> > AuxiliarySystem::_elem_vars
protected

◆ _elemental_array_aux_storage

ExecuteMooseObjectWarehouse<ArrayAuxKernel> AuxiliarySystem::_elemental_array_aux_storage
protected

◆ _elemental_aux_storage

ExecuteMooseObjectWarehouse<AuxKernel> AuxiliarySystem::_elemental_aux_storage
protected

◆ _elemental_vec_aux_storage

ExecuteMooseObjectWarehouse<VectorAuxKernel> AuxiliarySystem::_elemental_vec_aux_storage
protected

◆ _factory

Factory& SystemBase::_factory
protectedinherited

◆ _fe_problem

FEProblemBase& AuxiliarySystem::_fe_problem
protected

◆ _matrix_tag_active_flags

std::vector<bool> SystemBase::_matrix_tag_active_flags
protectedinherited

◆ _max_var_n_dofs_per_elem

size_t SystemBase::_max_var_n_dofs_per_elem
protectedinherited

Maximum number of dofs for any one variable on any one element.

Definition at line 967 of file SystemBase.h.

Referenced by SystemBase::assignMaxVarNDofsPerElem(), and SystemBase::getMaxVarNDofsPerElem().

◆ _max_var_n_dofs_per_node

size_t SystemBase::_max_var_n_dofs_per_node
protectedinherited

Maximum number of dofs for any one variable on any one node.

Definition at line 970 of file SystemBase.h.

Referenced by SystemBase::assignMaxVarNDofsPerNode(), and SystemBase::getMaxVarNDofsPerNode().

◆ _max_var_number

unsigned int SystemBase::_max_var_number
protectedinherited

Maximum variable number.

Definition at line 938 of file SystemBase.h.

Referenced by SystemBase::addVariable(), and SystemBase::getMaxVariableNumber().

◆ _mesh

MooseMesh& SystemBase::_mesh
protectedinherited

◆ _mortar_nodal_aux_storage

ExecuteMooseObjectWarehouse<AuxKernel> AuxiliarySystem::_mortar_nodal_aux_storage
protected

◆ _name

std::string SystemBase::_name
protectedinherited

The name of this system.

Definition at line 931 of file SystemBase.h.

◆ _nodal_array_aux_storage

ExecuteMooseObjectWarehouse<ArrayAuxKernel> AuxiliarySystem::_nodal_array_aux_storage
protected

◆ _nodal_aux_storage

ExecuteMooseObjectWarehouse<AuxKernel> AuxiliarySystem::_nodal_aux_storage
protected

◆ _nodal_vars

std::vector<std::vector<MooseVariableFEBase *> > AuxiliarySystem::_nodal_vars
protected

◆ _nodal_vec_aux_storage

ExecuteMooseObjectWarehouse<VectorAuxKernel> AuxiliarySystem::_nodal_vec_aux_storage
protected

◆ _numbered_vars

std::vector<std::vector<MooseVariableFieldBase *> > SystemBase::_numbered_vars
protectedinherited

Map variable number to its pointer.

Definition at line 976 of file SystemBase.h.

Referenced by SystemBase::addVariable(), and SystemBase::getVariable().

◆ _pg_moose_app

MooseApp& PerfGraphInterface::_pg_moose_app
protectedinherited

The MooseApp that owns the PerfGraph.

Definition at line 124 of file PerfGraphInterface.h.

Referenced by PerfGraphInterface::perfGraph().

◆ _prefix

const std::string PerfGraphInterface::_prefix
protectedinherited

A prefix to use for all sections.

Definition at line 127 of file PerfGraphInterface.h.

Referenced by PerfGraphInterface::timedSectionName().

◆ _saved_dot_old

NumericVector<Real>* SystemBase::_saved_dot_old
protectedinherited

Definition at line 958 of file SystemBase.h.

Referenced by SystemBase::restoreOldSolutions(), and SystemBase::saveOldSolutions().

◆ _saved_dotdot_old

NumericVector<Real>* SystemBase::_saved_dotdot_old
protectedinherited

Definition at line 959 of file SystemBase.h.

Referenced by SystemBase::restoreOldSolutions(), and SystemBase::saveOldSolutions().

◆ _saved_old

NumericVector<Real>* SystemBase::_saved_old
protectedinherited

Definition at line 954 of file SystemBase.h.

◆ _saved_older

NumericVector<Real>* SystemBase::_saved_older
protectedinherited

Definition at line 955 of file SystemBase.h.

◆ _serialized_solution

std::unique_ptr<NumericVector<Number> > AuxiliarySystem::_serialized_solution
protected

Serialized version of the solution vector, or nullptr if a serialized solution is not needed.

Definition at line 189 of file AuxiliarySystem.h.

Referenced by compute(), serializedSolution(), and serializeSolution().

◆ _solution_state

std::vector<NumericVector<Number> *> AuxiliarySystem::_solution_state
protected

The current states of the solution (0 = current, 1 = old, etc)

Definition at line 201 of file AuxiliarySystem.h.

◆ _solution_states_initialized

bool SystemBase::_solution_states_initialized
protectedinherited

Whether or not the solution states have been initialized.

Definition at line 985 of file SystemBase.h.

Referenced by SystemBase::initSolutionState(), and SystemBase::solutionStatesInitialized().

◆ _subproblem

SubProblem& SystemBase::_subproblem
protectedinherited

◆ _sys

System& AuxiliarySystem::_sys
protected

◆ _tagged_matrices

std::vector<SparseMatrix<Number> *> SystemBase::_tagged_matrices
protectedinherited

◆ _tagged_vectors

std::vector<NumericVector<Number> *> SystemBase::_tagged_vectors
protectedinherited

◆ _time_integrator

std::shared_ptr<TimeIntegrator> SystemBase::_time_integrator
protectedinherited

◆ _u_dot

NumericVector<Number>* AuxiliarySystem::_u_dot
protected

solution vector for u^dot

Definition at line 191 of file AuxiliarySystem.h.

Referenced by addDotVectors(), and solutionUDot().

◆ _u_dot_old

NumericVector<Number>* AuxiliarySystem::_u_dot_old
protected

Old solution vector for u^dot.

Definition at line 196 of file AuxiliarySystem.h.

Referenced by addDotVectors(), and solutionUDotOld().

◆ _u_dotdot

NumericVector<Number>* AuxiliarySystem::_u_dotdot
protected

solution vector for u^dotdot

Definition at line 193 of file AuxiliarySystem.h.

Referenced by addDotVectors(), and solutionUDotDot().

◆ _u_dotdot_old

NumericVector<Number>* AuxiliarySystem::_u_dotdot_old
protected

Old solution vector for u^dotdot.

Definition at line 198 of file AuxiliarySystem.h.

Referenced by addDotVectors(), and solutionUDotDotOld().

◆ _var_all_dof_indices

std::vector<dof_id_type> SystemBase::_var_all_dof_indices
protectedinherited

Container for the dof indices of a given variable.

Definition at line 988 of file SystemBase.h.

Referenced by SystemBase::getVariableGlobalDoFs(), and SystemBase::setVariableGlobalDoFs().

◆ _var_kind

Moose::VarKindType SystemBase::_var_kind
protectedinherited

default kind of variables in this system

Definition at line 962 of file SystemBase.h.

Referenced by SystemBase::varKind().

◆ _var_map

std::map<unsigned int, std::set<SubdomainID> > SystemBase::_var_map
protectedinherited

Map of variables (variable id -> array of subdomains where it lives)

Definition at line 936 of file SystemBase.h.

Referenced by SystemBase::addVariable(), SystemBase::getSubdomainsForVar(), and SystemBase::getVariableBlocks().

◆ _var_to_copy

std::vector<VarCopyInfo> SystemBase::_var_to_copy
protectedinherited

◆ _vars

std::vector<VariableWarehouse> SystemBase::_vars
protectedinherited

◆ _vars_to_be_zeroed_on_jacobian

std::vector<std::string> SystemBase::_vars_to_be_zeroed_on_jacobian
protectedinherited

◆ _vars_to_be_zeroed_on_residual

std::vector<std::string> SystemBase::_vars_to_be_zeroed_on_residual
protectedinherited

◆ _verbose

bool SystemBase::_verbose
protectedinherited

True if printing out additional information.

Definition at line 982 of file SystemBase.h.

Referenced by SystemBase::applyScalingFactors(), and SystemBase::setVerboseFlag().


The documentation for this class was generated from the following files: