https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private 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.
 
virtual void reinit () override
 Reinitialize the system when the degrees of freedom in this system have changed.
 
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.
 
void addKernel (const std::string &kernel_name, const std::string &name, InputParameters &parameters)
 Adds an auxiliary kernel.
 
void addKokkosKernel (const std::string &kernel_name, const std::string &name, InputParameters &parameters)
 
void addScalarKernel (const std::string &kernel_name, const std::string &name, InputParameters &parameters)
 Adds a scalar kernel.
 
virtual void reinitElem (const Elem *elem, THREAD_ID tid) override
 Reinit an element assembly info.
 
virtual void reinitElemFace (const Elem *elem, unsigned int side, THREAD_ID tid) override
 Reinit assembly info for a side of an element.
 
const NumericVector< Number > *const & currentSolution () const override
 The solution vector that is currently being operated on.
 
virtual void serializeSolution ()
 
virtual void augmentSparsity (libMesh::SparsityPattern::Graph &, std::vector< dof_id_type > &, std::vector< dof_id_type > &) override
 Will modify the sparsity pattern to add logical geometric connections.
 
virtual void compute (ExecFlagType type) override
 Compute auxiliary variables.
 
void kokkosCompute (ExecFlagType type)
 
std::set< std::string > getDependObjects (ExecFlagType type)
 Get a list of dependent UserObjects for this exec type.
 
std::set< std::string > getDependObjects ()
 
virtual libMesh::Order getMinQuadratureOrder () override
 Get the minimum quadrature order for evaluating elemental auxiliary variables.
 
bool needMaterialOnSide (BoundaryID bnd_id)
 Indicated whether this system needs material properties on boundaries.
 
virtual libMesh::Systemsys ()
 
virtual libMesh::Systemsystem () override
 Get the reference to the libMesh system.
 
virtual const libMesh::Systemsystem () const override
 
virtual void copyCurrentIntoPreviousNL ()
 Copies the current solution into the previous nonlinear iteration solution.
 
void setScalarVariableCoupleableTags (ExecFlagType type)
 
void clearScalarVariableCoupleableTags ()
 
const ExecuteMooseObjectWarehouse< AuxKernel > & nodalAuxWarehouse () const
 
const ExecuteMooseObjectWarehouse< AuxKernel > & mortarNodalAuxWarehouse () 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
 
const ExecuteMooseObjectWarehouse< AuxKernelBase > & kokkosNodalAuxWarehouse () const
 
const ExecuteMooseObjectWarehouse< AuxKernelBase > & kokkosElemAuxWarehouse () const
 
void variableWiseRelativeSolutionDifferenceNorm (std::vector< Number > &var_diffs) const
 Computes and stores ||current - old|| / ||current|| for each variable in the given vector.
 
const std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > & linearFVLimitedGradientContainer (const Moose::FV::GradientLimiterType limiter_type) const
 Access the stored raw or limited cell-centered gradient components.
 
void requestLinearFVLimitedGradients (const Moose::FV::GradientLimiterType limiter_type, unsigned int variable_number)
 Request storage and assembly of limiter-specific cell gradients.
 
unsigned int number () const
 Gets the number of this system.
 
MooseMeshmesh ()
 
const MooseMeshmesh () const
 
SubProblemsubproblem ()
 
const SubProblemsubproblem () const
 
FEProblemBasefeProblem ()
 
const FEProblemBasefeProblem () const
 
void applyScalingFactors (const std::vector< Real > &inverse_scaling_factors)
 Applies scaling factors to the system's variables.
 
bool computingScalingJacobian () const
 Whether we are computing an initial Jacobian for automatic variable scaling.
 
bool automaticScaling () const
 Getter for whether we are performing automatic scaling.
 
void automaticScaling (bool automatic_scaling)
 Setter for whether we are performing automatic scaling.
 
void setVerboseFlag (const bool &verbose)
 Sets the verbose flag.
 
virtual libMesh::DofMapdofMap ()
 Gets writeable reference to the dof map.
 
virtual const libMesh::DofMapdofMap () const
 Gets const reference to the dof map.
 
virtual void preInit ()
 This is called prior to the libMesh system has been init'd.
 
virtual void postInit ()
 
virtual void initializeObjects ()
 Called only once, just before the solve begins so objects can do some precalculations.
 
void update ()
 Update the system (doing libMesh magic)
 
virtual void solve ()
 Solve the system (using libMesh magic)
 
void copyOldSolutions ()
 Copy the solution back in time (older -> old, etc).
 
void copyPreviousSolutions (const Moose::SolutionIterationType iteration_type)
 Copy a specific type of solution back in time (older -> old, etc).
 
virtual void restoreSolutions ()
 Restore current solutions (call after your solve failed)
 
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.
 
const std::vector< NumericVector< Number > * > & getSolutionStates (const Moose::SolutionIterationType iteration_type) const
 Get all of the solution states (current, old, ...) for the given iteration type.
 
std::size_t getNumSolutionStates (const Moose::SolutionIterationType iteration_type) const
 Get the number of solution states (0 = current, 1 = current + old, ...) for the given iteration type.
 
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).
 
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).
 
libMesh::ParallelType solutionStateParallelType (const unsigned int state, const Moose::SolutionIterationType iteration_type) const
 Returns the parallel type of the given solution state.
 
virtual void needSolutionState (const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time, libMesh::ParallelType parallel_type=GHOSTED)
 Registers that the solution state state is needed.
 
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).
 
virtual void addDotVectors ()
 Add u_dot, u_dotdot, u_dot_old and u_dotdot_old vectors if requested by the time integrator.
 
virtual std::vector< Number > & duDotDus ()
 
virtual Number & duDotDotDu ()
 
virtual const Number & duDotDotDu () const
 
virtual const Number & duDotDu (unsigned int var_num=0) const
 
virtual NumericVector< Number > * solutionUDot ()
 
virtual const NumericVector< Number > * solutionUDot () const
 
virtual NumericVector< Number > * solutionUDotDot ()
 
virtual const NumericVector< Number > * solutionUDotDot () const
 
virtual NumericVector< Number > * solutionUDotOld ()
 
virtual const NumericVector< Number > * solutionUDotOld () const
 
virtual NumericVector< Number > * solutionUDotDotOld ()
 
virtual const NumericVector< Number > * solutionUDotDotOld () const
 
virtual void saveOldSolutions ()
 Save the old and older solutions.
 
virtual void restoreOldSolutions ()
 Restore the old and older solutions when the saved solutions present.
 
bool hasVector (const std::string &tag_name) const
 Check if the named vector exists in the system.
 
virtual bool hasVector (TagID tag_id) const
 Check if the tagged vector exists in the system.
 
virtual TagID timeVectorTag () const
 Ideally, we should not need this API.
 
virtual TagID systemMatrixTag () const
 Return the Matrix Tag ID for System.
 
virtual TagID nonTimeVectorTag () const
 
virtual TagID residualVectorTag () const
 
virtual std::set< TagIDdefaultVectorTags () const
 Get the default vector tags associated with this system.
 
virtual std::set< TagIDdefaultMatrixTags () const
 Get the default matrix tags associted with this system.
 
virtual void associateVectorToTag (NumericVector< Number > &vec, TagID tag)
 Associate a vector for a given tag.
 
virtual void disassociateVectorFromTag (NumericVector< Number > &vec, TagID tag)
 Disassociate a given vector from a given tag.
 
virtual void disassociateVectorFromTag (TagID tag)
 Disassociate any vector that is associated with a given tag.
 
virtual void disassociateDefaultVectorTags ()
 Disassociate the vectors associated with the default vector tags of this system.
 
virtual bool hasMatrix (TagID tag) const
 Check if the tagged matrix exists in the system.
 
virtual libMesh::SparseMatrix< Number > & getMatrix (TagID tag)
 Get a raw SparseMatrix.
 
virtual const libMesh::SparseMatrix< Number > & getMatrix (TagID tag) const
 Get a raw SparseMatrix.
 
virtual void activateAllMatrixTags ()
 Make all existing matrices active.
 
virtual bool matrixTagActive (TagID tag) const
 If or not a matrix tag is active.
 
virtual void deactivateAllMatrixTags ()
 Make matrices inactive.
 
void closeTaggedMatrices (const std::set< TagID > &tags)
 Close all matrices associated the tags.
 
void flushTaggedMatrices (const std::set< TagID > &tags)
 flushes all matrices associated to tags.
 
virtual void associateMatrixToTag (libMesh::SparseMatrix< Number > &matrix, TagID tag)
 Associate a matrix to a tag.
 
virtual void disassociateMatrixFromTag (libMesh::SparseMatrix< Number > &matrix, TagID tag)
 Disassociate a matrix from a tag.
 
virtual void disassociateMatrixFromTag (TagID tag)
 Disassociate any matrix that is associated with a given tag.
 
virtual void disassociateDefaultMatrixTags ()
 Disassociate the matrices associated with the default matrix tags of this system.
 
virtual NumericVector< Number > & serializedSolution ()
 Returns a reference to a serialized version of the solution vector for this subproblem.
 
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.
 
virtual bool isArrayVariable (const std::string &var_name) const
 If a variable is an array variable.
 
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.
 
MooseVariableFieldBasegetVariable (THREAD_ID tid, unsigned int var_number) const
 Gets a reference to a variable with specified number.
 
template<typename T >
MooseVariableFE< T > & getFieldVariable (THREAD_ID tid, const std::string &var_name)
 Gets a reference to a variable of with specified name.
 
template<typename T >
MooseVariableFE< T > & getFieldVariable (THREAD_ID tid, unsigned int var_number)
 Gets a reference to a variable with specified number.
 
template<typename T >
MooseVariableField< T > & getActualFieldVariable (THREAD_ID tid, const std::string &var_name)
 Returns a field variable pointer - this includes finite volume variables.
 
template<typename T >
MooseVariableField< T > & getActualFieldVariable (THREAD_ID tid, unsigned int var_number)
 Returns a field variable pointer - this includes finite volume variables.
 
template<typename T >
MooseVariableFV< T > & getFVVariable (THREAD_ID tid, const std::string &var_name)
 Return a finite volume variable.
 
virtual MooseVariableScalargetScalarVariable (THREAD_ID tid, const std::string &var_name) const
 Gets a reference to a scalar variable with specified number.
 
virtual MooseVariableScalargetScalarVariable (THREAD_ID tid, unsigned int var_number) const
 Gets a reference to a variable with specified number.
 
virtual const std::set< SubdomainID > * getVariableBlocks (unsigned int var_number)
 Get the block where a variable of this system is defined.
 
virtual unsigned int nVariables () const
 Get the number of variables in this system.
 
unsigned int nFieldVariables () const
 Get the number of field variables in this system.
 
unsigned int nFVVariables () const
 Get the number of finite volume variables in this system.
 
std::size_t getMaxVarNDofsPerElem () const
 Gets the maximum number of dofs used by any one variable on any one element.
 
std::size_t getMaxVarNDofsPerNode () const
 Gets the maximum number of dofs used by any one variable on any one node.
 
void assignMaxVarNDofsPerElem (std::size_t max_dofs)
 assign the maximum element dofs
 
void assignMaxVarNDofsPerNode (std::size_t max_dofs)
 assign the maximum node dofs
 
virtual void addVariableToZeroOnResidual (std::string var_name)
 Adds this variable to the list of variables to be zeroed during each residual evaluation.
 
virtual void addVariableToZeroOnJacobian (std::string var_name)
 Adds this variable to the list of variables to be zeroed during each Jacobian evaluation.
 
virtual void zeroVariables (std::vector< std::string > &vars_to_be_zeroed)
 Zero out the solution for the list of variables passed in.
 
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()
 
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()
 
virtual void prepare (THREAD_ID tid)
 Prepare the system for use.
 
virtual void prepareFace (THREAD_ID tid, bool resize_data)
 Prepare the system for use on sides.
 
virtual void prepareNeighbor (THREAD_ID tid)
 Prepare the system for use.
 
virtual void prepareLowerD (THREAD_ID tid)
 Prepare the system for use for lower dimensional elements.
 
virtual void reinitNeighborFace (const Elem *elem, unsigned int side, THREAD_ID tid)
 Compute the values of the variables at all the current points.
 
virtual void reinitNeighbor (const Elem *elem, THREAD_ID tid)
 Compute the values of the variables at all the current points.
 
virtual void reinitLowerD (THREAD_ID tid)
 Compute the values of the variables on the lower dimensional element.
 
virtual void reinitNode (const Node *node, THREAD_ID tid)
 Reinit nodal assembly info.
 
virtual void reinitNodeFace (const Node *node, BoundaryID bnd_id, THREAD_ID tid)
 Reinit nodal assembly info on a face.
 
virtual void reinitNodes (const std::vector< dof_id_type > &nodes, THREAD_ID tid)
 Reinit variables at a set of nodes.
 
virtual void reinitNodesNeighbor (const std::vector< dof_id_type > &nodes, THREAD_ID tid)
 Reinit variables at a set of neighbor nodes.
 
virtual void reinitScalars (THREAD_ID tid, bool reinit_for_derivative_reordering=false)
 Reinit scalar varaibles.
 
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.
 
const std::vector< MooseVariableFieldBase * > & getVariables (THREAD_ID tid)
 
const VariableWarehousevariableWarehouse (THREAD_ID tid=0) const
 
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.
 
void removeVector (const std::string &name)
 Remove a vector from the system with the given name.
 
void removeVector (TagID tag_id)
 Remove a solution length vector from the system with the specified TagID.
 
NumericVector< Number > & addVector (const std::string &vector_name, const bool project, const libMesh::ParallelType type)
 Adds a solution length vector to the system.
 
NumericVector< Number > & addVector (TagID tag, const bool project, const libMesh::ParallelType type)
 Adds a solution length vector to the system with the specified TagID.
 
void closeTaggedVector (const TagID tag)
 Close vector with the given tag.
 
void closeTaggedVectors (const std::set< TagID > &tags)
 Close all vectors for given tags.
 
void zeroTaggedVector (const TagID tag)
 Zero vector with the given tag.
 
void zeroTaggedVectors (const std::set< TagID > &tags)
 Zero all vectors for given tags.
 
void setVariableGlobalDoFs (const std::string &var_name)
 set all the global dof indices for a variable
 
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
 
libMesh::SparseMatrix< Number > & addMatrix (TagID tag)
 Adds a matrix with a given tag.
 
void removeMatrix (TagID tag)
 Removes a matrix with a given tag.
 
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.
 
virtual void computeVariables (const NumericVector< Number > &)
 
void copyVars (libMesh::ExodusII_IO &io)
 
virtual void copySolutionsBackwards ()
 Copy current solution into old and older.
 
void addTimeIntegrator (const std::string &type, const std::string &name, InputParameters &parameters)
 
bool hasVarCopy () const
 Whether or not there are variables to be restarted from an Exodus mesh file.
 
void addScalingVector ()
 Add the scaling factor vector to the system.
 
bool solutionStatesInitialized () const
 Whether or not the solution states have been initialized via initSolutionState()
 
void clearAllDofIndices ()
 Clear all dof indices from moose variables.
 
void setActiveVariableCoupleableVectorTags (const std::set< TagID > &vtags, THREAD_ID tid)
 Set the active vector tags for the variables.
 
void setActiveScalarVariableCoupleableVectorTags (const std::set< TagID > &vtags, THREAD_ID tid)
 Set the active vector tags for the scalar variables.
 
Moose::VarKindType varKind () const
 
void copyTimeIntegrators (const SystemBase &other_sys)
 Copy time integrators from another system.
 
const TimeIntegratorgetTimeIntegrator (const unsigned int var_num) const
 Retrieve the time integrator that integrates the given variable's equation.
 
const TimeIntegratorqueryTimeIntegrator (const unsigned int var_num) const
 Retrieve the time integrator that integrates the given variable's equation.
 
const std::vector< std::shared_ptr< TimeIntegrator > > & getTimeIntegrators ()
 
std::string prefix () const
 
void sizeVariableMatrixData ()
 size the matrix data for each variable for the number of matrix tags we have
 
void skipNextSolutionToOldCopy ()
 Skip the next copy from the solution vector to the old solution vector old -> older is still performed.
 
const Parallel::Communicatorcomm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
PerfGraphperfGraph ()
 Get the PerfGraph.
 
const std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > & linearFVGradientContainer () const
 Access the stored raw cell-centered gradient components.
 
const std::unordered_set< Moose::FV::GradientLimiterType > & requestedLinearFVLimitedGradientTypes () const
 Access the limiter types requested for this system.
 
virtual NumericVector< Number > & getVector (const std::string &name)
 Get a raw NumericVector by name.
 
virtual const NumericVector< Number > & getVector (const std::string &name) const
 
virtual NumericVector< Number > & getVector (TagID tag)
 Get a raw NumericVector by tag.
 
virtual const NumericVector< Number > & getVector (TagID tag) const
 
virtual bool hasVariable (const std::string &var_name) const
 Query a system for a variable.
 
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.
 

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.
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 Call to register a named section for timing.
 
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.
 
std::string timedSectionName (const std::string &section_name) const
 
void computeGradients ()
 Compute and store raw and requested limited Green-Gauss gradients for linear FV variables.
 
void rebuildLinearFVGradientStorage ()
 Rebuild persistent raw and temporary gradient storage after mesh/DOF changes.
 
std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > & temporaryLinearFVGradientContainer ()
 Return temporary storage for gradients during gradient assembly.
 
std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > & temporaryLinearFVLimitedGradientContainer (const Moose::FV::GradientLimiterType limiter_type)
 Return temporary storage for limited gradients during gradient assembly.
 
std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > & rawLinearFVLimitedGradientContainer (const Moose::FV::GradientLimiterType limiter_type)
 Access the persisted limited-gradient storage for a specific limiter.
 
const std::unordered_set< unsigned int > & requestedLinearFVLimitedGradientVariables (const Moose::FV::GradientLimiterType limiter_type) const
 Access the variable numbers that requested limited gradients for a specific limiter.
 
bool needsLinearFVGradientStorage () const
 
void initializeContainer (std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > &container) const
 

Protected Attributes

libMesh::System_sys
 
const NumericVector< Number > * _current_solution
 solution vector from nonlinear solver
 
std::vector< NumericVector< Number > * > _solution_state
 The current states of the solution (0 = current, 1 = old, etc)
 
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
 
ExecuteMooseObjectWarehouse< AuxKernelBase_kokkos_nodal_aux_storage
 
ExecuteMooseObjectWarehouse< AuxKernelBase_kokkos_elemental_aux_storage
 
SubProblem_subproblem
 The subproblem for whom this class holds variable data, etc; this can either be the governing finite element/volume problem or a subjugate displaced problem.
 
FEProblemBase_fe_problem
 the governing finite element/volume problem
 
MooseApp_app
 
Factory_factory
 
MooseMesh_mesh
 
std::string _name
 The name of this system.
 
std::vector< VariableWarehouse_vars
 Variable warehouses (one for each thread)
 
std::map< unsigned int, std::set< SubdomainID > > _var_map
 Map of variables (variable id -> array of subdomains where it lives)
 
unsigned int _max_var_number
 Maximum variable number.
 
std::vector< std::string > _vars_to_be_zeroed_on_residual
 
std::vector< std::string > _vars_to_be_zeroed_on_jacobian
 
NumericVector< Number > * _u_dot
 solution vector for u^dot
 
NumericVector< Number > * _u_dotdot
 solution vector for u^dotdot
 
NumericVector< Number > * _u_dot_old
 old solution vector for u^dot
 
NumericVector< Number > * _u_dotdot_old
 old solution vector for u^dotdot
 
std::vector< Real > _du_dot_du
 Derivative of time derivative of u with respect to uj.
 
Real _du_dotdot_du
 
std::vector< NumericVector< Number > * > _tagged_vectors
 Tagged vectors (pointer)
 
std::vector< libMesh::SparseMatrix< Number > * > _tagged_matrices
 Tagged matrices (pointer)
 
std::unordered_map< TagID, libMesh::SparseMatrix< Number > * > _active_tagged_matrices
 Active tagged matrices. A matrix is active if its tag-matrix pair is present in the map. We use a map instead of a vector so that users can easily add and remove to this container with calls to (de)activateMatrixTag.
 
std::vector< bool > _matrix_tag_active_flags
 Active flags for tagged matrices.
 
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
 
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.
 
size_t _max_var_n_dofs_per_node
 Maximum number of dofs for any one variable on any one node.
 
std::vector< std::shared_ptr< TimeIntegrator > > _time_integrators
 Time integrator.
 
std::vector< std::vector< MooseVariableFieldBase * > > _numbered_vars
 Map variable number to its pointer.
 
bool _automatic_scaling
 Whether to automatically scale the variables.
 
bool _verbose
 True if printing out additional information.
 
bool _solution_states_initialized
 Whether or not the solution states have been initialized.
 
std::vector< dof_id_type > _var_all_dof_indices
 Container for the dof indices of a given variable.
 
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_communicator
 
MooseApp_pg_moose_app
 The MooseApp that owns the PerfGraph.
 
const std::string _prefix
 A prefix to use for all sections.
 
std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > _temporary_gradient
 Scratch storage for raw gradients assembled during the current compute pass.
 
std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > _raw_grad_container
 Persisted raw cell-centered gradient components keyed by spatial direction.
 
std::unordered_set< Moose::FV::GradientLimiterType_requested_limited_gradient_types
 Set of requested limiter types for which limited gradients should be computed.
 
std::unordered_map< Moose::FV::GradientLimiterType, std::unordered_set< unsigned int > > _requested_limited_gradient_variables
 Variable numbers requesting limited gradients, keyed by limiter type.
 
std::unordered_map< Moose::FV::GradientLimiterType, std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > > _raw_limited_grad_containers
 Persisted limited gradient components keyed by limiter type.
 
std::unordered_map< Moose::FV::GradientLimiterType, std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > > _temporary_limited_gradient
 Scratch storage for limited gradients assembled during the current compute pass.
 
std::vector< std::vector< MooseVariableFieldBase * > > _elem_vars
 Elemental variables.
 

Private Member Functions

std::vector< NumericVector< Number > * > & getSolutionStates (const Moose::SolutionIterationType iteration_type)
 Get all of the solution states (current, old, ...) for the given iteration type.
 
TagName oldSolutionStateVectorName (const unsigned int, Moose::SolutionIterationType iteration_type) const
 Gets the vector name used for an old (not current) solution state.
 

Private Attributes

std::array< std::vector< NumericVector< Number > * >, static_cast< size_t >(Moose::SolutionIterationType::Count)> _solution_states
 2D array of solution state vector pointers.
 
std::vector< NumericVector< Number > * > _saved_solution_states
 The saved solution states (0 = current, 1 = old, 2 = older, etc)
 
bool _skip_next_solution_to_old_copy
 Whether to skip the next copy from the solution to the old vector.
 

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 43 of file AuxiliarySystem.h.

Constructor & Destructor Documentation

◆ AuxiliarySystem()

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

Definition at line 75 of file AuxiliarySystem.C.

76{
77 TIME_SECTION("initialSetup", 3, "Initializing Auxiliary System");
78
82
83 for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
84 {
87
88 _nodal_aux_storage.sort(tid);
89 _nodal_aux_storage.initialSetup(tid);
90
92 _mortar_nodal_aux_storage.initialSetup(tid);
93
94 _nodal_vec_aux_storage.sort(tid);
95 _nodal_vec_aux_storage.initialSetup(tid);
96
98 _nodal_array_aux_storage.initialSetup(tid);
99
100 _elemental_aux_storage.sort(tid);
101 _elemental_aux_storage.initialSetup(tid);
102
104 _elemental_vec_aux_storage.initialSetup(tid);
105
107 _elemental_array_aux_storage.initialSetup(tid);
108 }
109
110#ifdef MOOSE_KOKKOS_ENABLED
113
116#endif
117}
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _nodal_array_aux_storage
const NumericVector< Number > * _current_solution
solution vector from nonlinear solver
ExecuteMooseObjectWarehouse< AuxKernelBase > _kokkos_elemental_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< ArrayAuxKernel > _elemental_array_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _mortar_nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxKernelBase > _kokkos_nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
libMesh::System & _sys
void sort(THREAD_ID tid=0)
Performs a sort using the DependencyResolver.
void rebuildLinearFVGradientStorage()
Rebuild persistent raw and temporary gradient storage after mesh/DOF changes.
virtual void initialSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods.
virtual void initialSetup()
Setup Functions.
std::unique_ptr< NumericVector< Number > > current_local_solution
unsigned int n_threads()

◆ ~AuxiliarySystem()

virtual AuxiliarySystem::~AuxiliarySystem ( )
virtual

Member Function Documentation

◆ activateAllMatrixTags()

void SystemBase::activateAllMatrixTags ( )
virtualinherited

Make all existing matrices active.

Definition at line 1130 of file SystemBase.C.

1131{
1132 auto num_matrix_tags = _subproblem.numMatrixTags();
1133
1134 _matrix_tag_active_flags.resize(num_matrix_tags);
1136
1137 for (const auto tag : make_range(num_matrix_tags))
1138 if (hasMatrix(tag))
1139 {
1140 _matrix_tag_active_flags[tag] = true;
1141 _active_tagged_matrices.emplace(tag, &getMatrix(tag));
1142 }
1143 else
1144 _matrix_tag_active_flags[tag] = false;
1145}
virtual unsigned int numMatrixTags() const
The total number of tags.
Definition SubProblem.h:248
virtual libMesh::SparseMatrix< Number > & getMatrix(TagID tag)
Get a raw SparseMatrix.
std::unordered_map< TagID, libMesh::SparseMatrix< Number > * > _active_tagged_matrices
Active tagged matrices. A matrix is active if its tag-matrix pair is present in the map....
std::vector< bool > _matrix_tag_active_flags
Active flags for tagged matrices.
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition SystemBase.h:379
if(subdm)
IntRange< T > make_range(T beg, T end)

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

◆ addDotVectors()

void SystemBase::addDotVectors ( )
virtualinherited

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

Reimplemented in DisplacedSystem.

Definition at line 1632 of file SystemBase.C.

1633{
1635 _u_dot = &addVector("u_dot", true, GHOSTED);
1637 _u_dot_old = &addVector("u_dot_old", true, GHOSTED);
1639 _u_dotdot = &addVector("u_dotdot", true, GHOSTED);
1641 _u_dotdot_old = &addVector("u_dotdot_old", true, GHOSTED);
1642}
virtual bool uDotRequested()
Get boolean flag to check whether solution time derivative needs to be stored.
virtual bool uDotOldRequested()
Get boolean flag to check whether old solution time derivative needs to be stored.
virtual bool uDotDotRequested()
Get boolean flag to check whether solution second time derivative needs to be stored.
virtual bool uDotDotOldRequested()
Get boolean flag to check whether old solution second time derivative needs to be stored.
NumericVector< Number > * _u_dot
solution vector for u^dot
FEProblemBase & _fe_problem
the governing finite element/volume problem
NumericVector< Number > * _u_dotdot
solution vector for u^dotdot
NumericVector< Number > * _u_dotdot_old
old solution vector for u^dotdot
NumericVector< Number > * _u_dot_old
old solution vector for u^dot
NumericVector< Number > & addVector(const std::string &vector_name, const bool project, const libMesh::ParallelType type)
Adds a solution length vector to the system.
Definition SystemBase.C:607

Referenced by DisplacedSystem::addDotVectors().

◆ 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 312 of file AuxiliarySystem.C.

315{
316 for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
317 {
318 const auto & base = parameters.getBase();
319 if (base == "AuxKernel" || base == "Bounds")
320 {
321 std::shared_ptr<AuxKernel> kernel =
322 _factory.create<AuxKernel>(kernel_name, name, parameters, tid);
323 if (kernel->isNodal())
324 {
325 if (kernel->isMortar())
326 _mortar_nodal_aux_storage.addObject(kernel, tid);
327 else
328 _nodal_aux_storage.addObject(kernel, tid);
329 }
330 else
331 _elemental_aux_storage.addObject(kernel, tid);
332 }
333
334 else if (base == "VectorAuxKernel")
335 {
336 std::shared_ptr<VectorAuxKernel> kernel =
337 _factory.create<VectorAuxKernel>(kernel_name, name, parameters, tid);
338 if (kernel->isNodal())
339 {
340 if (kernel->isMortar())
341 mooseError("Vector mortar aux kernels not yet implemented");
342 _nodal_vec_aux_storage.addObject(kernel, tid);
343 }
344 else
345 _elemental_vec_aux_storage.addObject(kernel, tid);
346 }
347
348 else if (base == "ArrayAuxKernel")
349 {
350 std::shared_ptr<ArrayAuxKernel> kernel =
351 _factory.create<ArrayAuxKernel>(kernel_name, name, parameters, tid);
352 if (kernel->isNodal())
353 {
354 if (kernel->isMortar())
355 mooseError("Vector mortar aux kernels not yet implemented");
356 _nodal_array_aux_storage.addObject(kernel, tid);
357 }
358 else
359 _elemental_array_aux_storage.addObject(kernel, tid);
360 }
361 else
362 mooseAssert(false,
363 "Attempting to add AuxKernel of type '" + kernel_name + "' and name '" + name +
364 "' to the auxiliary system with invalid _moose_base: " + base);
365 }
366}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
unsigned int THREAD_ID
Definition MooseTypes.h:237
const std::string & getBase() const
Factory & _factory
virtual const std::string & name() const
virtual std::unique_ptr< Base > create()=0

◆ addKokkosKernel()

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

◆ 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 569 of file SystemBase.C.

570{
572 mooseError("Cannot add tagged matrix with TagID ",
573 tag,
574 " in system '",
575 name(),
576 "' because the tag does not exist in the problem");
577
578 if (hasMatrix(tag))
579 return getMatrix(tag);
580
581 const auto matrix_name = _subproblem.matrixTagName(tag);
582 SparseMatrix<Number> & mat = system().add_matrix(matrix_name);
583 associateMatrixToTag(mat, tag);
584
585 return mat;
586}
virtual TagName matrixTagName(TagID tag)
Retrieve the name associated with a TagID.
Definition SubProblem.C:358
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition SubProblem.C:329
virtual void associateMatrixToTag(libMesh::SparseMatrix< Number > &matrix, TagID tag)
Associate a matrix to a tag.
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
SparseMatrix< Number > & add_matrix(std::string_view mat_name, ParallelType type=PARALLEL, MatrixBuildType mat_build_type=MatrixBuildType::AUTOMATIC)

◆ 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 369 of file AuxiliarySystem.C.

372{
373 for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
374 {
375 std::shared_ptr<AuxScalarKernel> kernel =
376 _factory.create<AuxScalarKernel>(kernel_name, name, parameters, tid);
377 _aux_scalar_storage.addObject(kernel, tid);
378 }
379}
Base class for making kernels that work on auxiliary scalar variables.
void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.

◆ addScalingVector()

void SystemBase::addScalingVector ( )
inherited

Add the scaling factor vector to the system.

Definition at line 1557 of file SystemBase.C.

1558{
1559 addVector("scaling_factors", /*project=*/false, libMesh::ParallelType::GHOSTED);
1561}
void hasScalingVector(const unsigned int nl_sys_num)
Tells this problem that the assembly associated with the given nonlinear system number involves a sca...
unsigned int number() const
Gets the number of this system.

Referenced by MooseVariableBase::initialSetup().

◆ addTimeIntegrator()

void SystemBase::addTimeIntegrator ( const std::string &  type,
const std::string &  name,
InputParameters parameters 
)
inherited

Definition at line 1657 of file SystemBase.C.

1660{
1661 parameters.set<SystemBase *>("_sys") = this;
1662 _time_integrators.push_back(_factory.create<TimeIntegrator>(type, name, parameters));
1663}
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Base class for a system (of equations)
Definition SystemBase.h:87
std::vector< std::shared_ptr< TimeIntegrator > > _time_integrators
Time integrator.
Base class for time integrators.

◆ 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 258 of file AuxiliarySystem.C.

261{
262 SystemBase::addVariable(var_type, name, parameters);
263
264 auto fe_type = FEType(Utility::string_to_enum<Order>(parameters.get<MooseEnum>("order")),
265 Utility::string_to_enum<FEFamily>(parameters.get<MooseEnum>("family")));
266
267 if (var_type == "MooseVariableScalar")
268 return;
269
270 for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
271 {
272 if (FEInterface::field_type(fe_type) == TYPE_VECTOR)
273 {
274 auto * var = _vars[tid].getActualFieldVariable<RealVectorValue>(name);
275 if (var)
276 {
277 if (var->feType().family == LAGRANGE_VEC)
278 _nodal_vars[tid].push_back(var);
279 else
280 _elem_vars[tid].push_back(var);
281 }
282 }
283
284 else
285 {
286 MooseVariableBase * var_base = _vars[tid].getVariable(name);
287
288 auto * const var = dynamic_cast<MooseVariableField<Real> *>(var_base);
289
290 if (var)
291 {
292 if (var->feType().family == LAGRANGE)
293 _nodal_vars[tid].push_back(var);
294 else
295 _elem_vars[tid].push_back(var);
296 }
297
298 auto * const avar = dynamic_cast<MooseVariableField<RealEigenVector> *>(var_base);
299
300 if (avar)
301 {
302 if (avar->feType().family == LAGRANGE)
303 _nodal_vars[tid].push_back(avar);
304 else
305 _elem_vars[tid].push_back(avar);
306 }
307 }
308 }
309}
std::vector< std::vector< MooseVariableFieldBase * > > _elem_vars
Elemental variables.
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vars
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.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55
Base variable class.
Class for stuff related to variables.
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters &parameters)
Canonical method for adding a variable.
Definition SystemBase.C:717
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
static FEFieldType field_type(const FEType &fe_type)

◆ 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 1174 of file SystemBase.C.

1177{
1178 _var_to_copy.push_back(VarCopyInfo(dest_name, source_name, timestep));
1179}
std::vector< VarCopyInfo > _var_to_copy
Information about variables that will be copied.
Definition SystemBase.h:68

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

◆ addVariableToZeroOnJacobian()

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

◆ addVariableToZeroOnResidual()

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

◆ addVector() [1/2]

NumericVector< Number > & SystemBase::addVector ( const std::string &  vector_name,
const bool  project,
const libMesh::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 607 of file SystemBase.C.

608{
609 if (hasVector(vector_name))
610 return getVector(vector_name);
611
612 NumericVector<Number> & vec = system().add_vector(vector_name, project, type);
613 return vec;
614}
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition SystemBase.C:923
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition SystemBase.C:932
NumericVector< Number > & add_vector(std::string_view vec_name, const bool projections=true, const ParallelType type=PARALLEL)

Referenced by SystemBase::addDotVectors(), SystemBase::addScalingVector(), NonlinearTimeIntegratorInterface::addVector(), PicardSolve::allocateStorage(), SecantSolve::allocateStorage(), SteffensenSolve::allocateStorage(), NonlinearSystemBase::getResidualNonTimeVector(), NonlinearSystemBase::getResidualTimeVector(), CentralDifference::initialSetup(), SystemBase::needSolutionState(), NonlinearSystemBase::residualGhosted(), and SystemBase::saveOldSolutions().

◆ addVector() [2/2]

NumericVector< Number > & SystemBase::addVector ( TagID  tag,
const bool  project,
const libMesh::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 617 of file SystemBase.C.

618{
620 mooseError("Cannot add tagged vector with TagID ",
621 tag,
622 " in system '",
623 name(),
624 "' because the tag does not exist in the problem");
625
626 if (hasVector(tag))
627 {
628 auto & vec = getVector(tag);
629
630 if (type != ParallelType::AUTOMATIC && vec.type() != type)
631 mooseError("Cannot add tagged vector '",
633 "', in system '",
634 name(),
635 "' because a vector with the same name was found with a different parallel type");
636
637 return vec;
638 }
639
640 const auto vector_name = _subproblem.vectorTagName(tag);
641 NumericVector<Number> & vec = system().add_vector(vector_name, project, type);
642 associateVectorToTag(vec, tag);
643
644 return vec;
645}
virtual TagName vectorTagName(const TagID tag) const
Retrieve the name associated with a TagID.
Definition SubProblem.C:222
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition SubProblem.h:201
virtual void associateVectorToTag(NumericVector< Number > &vec, TagID tag)
Associate a vector for a given tag.
Definition SystemBase.C:980

◆ 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 1507 of file SystemBase.C.

1508{
1509 for (MooseIndex(_vars) thread = 0; thread < _vars.size(); ++thread)
1510 {
1511 auto & field_variables = _vars[thread].fieldVariables();
1512 for (MooseIndex(field_variables) i = 0, p = 0; i < field_variables.size(); ++i)
1513 {
1514 auto factors = field_variables[i]->arrayScalingFactor();
1515 for (unsigned int j = 0; j < field_variables[i]->count(); ++j, ++p)
1516 factors[j] /= inverse_scaling_factors[p];
1517
1518 field_variables[i]->scalingFactor(factors);
1519 }
1520
1521 auto offset = field_variables.size();
1522
1523 auto & scalar_variables = _vars[thread].scalars();
1524 for (MooseIndex(scalar_variables) i = 0; i < scalar_variables.size(); ++i)
1525 scalar_variables[i]->scalingFactor(
1526 {1. / inverse_scaling_factors[offset + i] * scalar_variables[i]->scalingFactor()});
1527
1528 if (thread == 0 && _verbose)
1529 {
1530 _console << "Automatic scaling factors:\n";
1531 auto original_flags = _console.flags();
1532 auto original_precision = _console.precision();
1533 _console.unsetf(std::ios_base::floatfield);
1535
1536 for (const auto & field_variable : field_variables)
1537 {
1538 const auto & factors = field_variable->arrayScalingFactor();
1539 _console << " " << field_variable->name() << ":";
1540 for (const auto i : make_range(field_variable->count()))
1541 _console << " " << factors[i];
1542 _console << "\n";
1543 }
1544 for (const auto & scalar_variable : scalar_variables)
1545 _console << " " << scalar_variable->name() << ": " << scalar_variable->scalingFactor()
1546 << "\n";
1547 _console << "\n" << std::endl;
1548
1549 // restore state
1550 _console.flags(original_flags);
1551 _console.precision(original_precision);
1552 }
1553 }
1554}
unsigned int count
Definition MortarUtils.C:53
const ConsoleStream _console
An instance of helper class to write streams to the Console objects.
std::ios_base::fmtflags flags() const
Return the current flags.
std::streamsize precision() const
Return the current precision.
void unsetf(std::ios_base::fmtflags mask) const
Unset format flags.
bool _verbose
True if printing out additional information.

Referenced by NonlinearSystemBase::computeScaling().

◆ assignMaxVarNDofsPerElem()

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

assign the maximum element dofs

Definition at line 616 of file SystemBase.h.

616{ _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.

◆ assignMaxVarNDofsPerNode()

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

assign the maximum node dofs

Definition at line 621 of file SystemBase.h.

621{ _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.

◆ associateMatrixToTag()

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

Associate a matrix to a tag.

Reimplemented in DisplacedSystem.

Definition at line 1075 of file SystemBase.C.

1076{
1077 if (!_subproblem.matrixTagExists(tag))
1078 mooseError("Cannot associate matrix to tag ", tag, " because that tag does not exist");
1079
1080 if (_tagged_matrices.size() < tag + 1)
1081 _tagged_matrices.resize(tag + 1);
1082
1083 _tagged_matrices[tag] = &matrix;
1084}
std::vector< libMesh::SparseMatrix< Number > * > _tagged_matrices
Tagged matrices (pointer)

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

◆ associateVectorToTag()

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

Associate a vector for a given tag.

Reimplemented in DisplacedSystem.

Definition at line 980 of file SystemBase.C.

981{
983 mooseError("Cannot associate vector to tag ", tag, " because that tag does not exist");
984
985 if (_tagged_vectors.size() < tag + 1)
986 _tagged_vectors.resize(tag + 1);
987
988 _tagged_vectors[tag] = &vec;
989}
std::vector< NumericVector< Number > * > _tagged_vectors
Tagged vectors (pointer)

Referenced by SystemBase::addVector(), DisplacedSystem::associateVectorToTag(), FEProblemBase::computeLinearSystemSys(), NonlinearSystemBase::computeNodalBCsResidual(), NonlinearSystemBase::computeNodalBCsResidual(), FEProblemBase::computeResidualAndJacobian(), FEProblemBase::computeResidualInternal(), FEProblemBase::computeResidualTag(), NonlinearSystemBase::computeResidualTag(), FEProblemBase::computeResidualType(), LinearSystem::LinearSystem(), and SolverSystem::setSolution().

◆ 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 453 of file SystemBase.C.

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

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

◆ augmentSparsity()

void AuxiliarySystem::augmentSparsity ( libMesh::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 875 of file AuxiliarySystem.C.

879{
880}

◆ 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 123 of file SystemBase.h.

123{ return _automatic_scaling; }
bool _automatic_scaling
Whether to automatically scale the variables.

Referenced by SubProblem::automaticScaling(), and SubProblem::automaticScaling().

◆ 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 129 of file SystemBase.h.

129{ _automatic_scaling = automatic_scaling; }

◆ clearAllDofIndices()

void SystemBase::clearAllDofIndices ( )
inherited

Clear all dof indices from moose variables.

Definition at line 1612 of file SystemBase.C.

1613{
1614 for (auto & var_warehouse : _vars)
1615 var_warehouse.clearAllDofIndices();
1616}
void clearAllDofIndices()
Clear all dof indices from moose variables.

Referenced by SubProblem::clearAllDofIndices().

◆ clearScalarVariableCoupleableTags()

void AuxiliarySystem::clearScalarVariableCoupleableTags ( )

Definition at line 719 of file AuxiliarySystem.C.

720{
723}
virtual void clearActiveScalarVariableCoupleableMatrixTags(const THREAD_ID tid) override
virtual void clearActiveScalarVariableCoupleableVectorTags(const THREAD_ID tid) override

Referenced by computeScalarVars().

◆ closeTaggedMatrices()

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

Close all matrices associated the tags.

Definition at line 1059 of file SystemBase.C.

1060{
1061 for (auto tag : tags)
1062 if (hasMatrix(tag))
1063 getMatrix(tag).close();
1064}

Referenced by NonlinearSystemBase::computeJacobianInternal(), LinearSystem::computeLinearSystemInternal(), NonlinearSystemBase::computeNodalBCsJacobian(), and NonlinearSystemBase::computeResidualAndJacobianTags().

◆ closeTaggedVector()

void SystemBase::closeTaggedVector ( const TagID  tag)
inherited

Close vector with the given tag.

Definition at line 648 of file SystemBase.C.

649{
651 mooseError("Cannot close vector with TagID ",
652 tag,
653 " in system '",
654 name(),
655 "' because that tag does not exist in the problem");
656 else if (!hasVector(tag))
657 mooseError("Cannot close vector tag with name '",
659 "' in system '",
660 name(),
661 "' because there is no vector associated with that tag");
662 getVector(tag).close();
663}
virtual void close()=0

Referenced by SystemBase::closeTaggedVectors().

◆ closeTaggedVectors()

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

Close all vectors for given tags.

Definition at line 666 of file SystemBase.C.

667{
668 for (const auto tag : tags)
670}
void closeTaggedVector(const TagID tag)
Close vector with the given tag.
Definition SystemBase.C:648

Referenced by NonlinearSystemBase::computeResidualAndJacobianTags(), NonlinearSystemBase::computeResidualTags(), LinearSystem::stopSolve(), and NonlinearSystem::stopSolve().

◆ compute()

void AuxiliarySystem::compute ( ExecFlagType  type)
overridevirtual

Compute auxiliary variables.

Parameters
typeTime flag of which variables should be computed

Implements SystemBase.

Definition at line 425 of file AuxiliarySystem.C.

426{
427 // avoid division by dt which might be zero.
428 if (_fe_problem.dt() > 0.)
429 for (auto & ti : _time_integrators)
430 ti->preStep();
431
432 // We need to compute time derivatives every time each kind of the variables is finished, because:
433 //
434 // a) the user might want to use the aux variable value somewhere, thus we need to provide the
435 // up-to-date value
436 // b) time integration system works with the whole vectors of solutions, thus we cannot update
437 // only a part of the vector
438 //
439
440 if (_vars[0].scalars().size() > 0)
441 {
442 computeScalarVars(type);
443 // compute time derivatives of scalar aux variables _after_ the values were updated
444 if (_fe_problem.dt() > 0.)
445 for (auto & ti : _time_integrators)
446 ti->computeTimeDerivatives();
447 }
448
449 if (_vars[0].fieldVariables().size() > 0)
450 {
453 computeNodalVars(type);
458
459#ifdef MOOSE_KOKKOS_ENABLED
460 kokkosCompute(type);
461#endif
462
463 if (!_raw_grad_container.empty())
464 {
465 solution().close();
466 _sys.update();
468 }
469
470 // compute time derivatives of nodal aux variables _after_ the values were updated
471 if (_fe_problem.dt() > 0.)
472 for (auto & ti : _time_integrators)
473 ti->computeTimeDerivatives();
474 }
475
476 if (_serialized_solution.get())
478}
void computeScalarVars(ExecFlagType type)
void kokkosCompute(ExecFlagType type)
void computeMortarNodalVars(ExecFlagType type)
void computeElementalVars(ExecFlagType type)
void computeNodalVecVars(ExecFlagType type)
void computeElementalVecVars(ExecFlagType type)
void computeElementalArrayVars(ExecFlagType type)
void computeNodalVars(ExecFlagType type)
virtual void serializeSolution()
void computeNodalArrayVars(ExecFlagType type)
virtual Real & dt() const
std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > _raw_grad_container
Persisted raw cell-centered gradient components keyed by spatial direction.
void computeGradients()
Compute and store raw and requested limited Green-Gauss gradients for linear FV variables.
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:203
virtual void update()

◆ computeElementalArrayVars()

void AuxiliarySystem::computeElementalArrayVars ( ExecFlagType  type)
protected

Definition at line 868 of file AuxiliarySystem.C.

869{
871 computeElementalVarsHelper<ArrayAuxKernel>(elemental);
872}
A storage container for MooseObjects that inherit from SetupInterface.

Referenced by compute().

◆ computeElementalVars()

void AuxiliarySystem::computeElementalVars ( ExecFlagType  type)
protected

Definition at line 850 of file AuxiliarySystem.C.

851{
852 TIME_SECTION("computeElementalVars", 3);
853
855 computeElementalVarsHelper<AuxKernel>(elemental);
856}

Referenced by compute().

◆ computeElementalVarsHelper()

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

Definition at line 916 of file AuxiliarySystem.C.

917{
918 if (warehouse.hasActiveBlockObjects())
919 {
920 // Block Elemental AuxKernels
921 PARALLEL_TRY
922 {
925 try
926 {
927 Threads::parallel_reduce(range, eavt);
928 }
929 catch (MooseException & e)
930 {
931 _fe_problem.setException("The following MooseException was raised during elemental "
932 "Auxiliary variable computation:\n" +
933 std::string(e.what()));
934 }
935 }
936 PARALLEL_CATCH;
937
938 // We need to make sure we propagate exceptions to all processes before trying to close
939 // here, which is a parallel operation
940 solution().close();
941 _sys.update();
942 }
943
944 // Boundary Elemental AuxKernels
945 if (warehouse.hasActiveBoundaryObjects())
946 {
947 TIME_SECTION("computeElementalVecVars", 3);
948
949 PARALLEL_TRY
950 {
953 try
954 {
955 Threads::parallel_reduce(bnd_elems, eabt);
956 }
957 catch (MooseException & e)
958 {
959 _fe_problem.setException("The following MooseException was raised during boundary "
960 "elemental Auxiliary variable computation:\n" +
961 std::string(e.what()));
962 }
963 }
964 PARALLEL_CATCH;
965
966 // We need to make sure we propagate exceptions to all processes before trying to close
967 // here, which is a parallel operation
968 solution().close();
969 _sys.update();
970 }
971}
virtual void setException(const std::string &message)
Set an exception, which is stored at this point by toggling a member variable in this class,...
Provides a way for users to bail out of the current solve.
virtual const char * what() const
Get out the error message.
const libMesh::ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems,...
Definition MooseMesh.C:1242
libMesh::StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > * getBoundaryElementRange()
Definition MooseMesh.C:1298
bool hasActiveBlockObjects(THREAD_ID tid=0) const
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
void parallel_reduce(const Range &range, Body &body, unsigned int n_threads=libMesh::n_threads())

◆ computeElementalVecVars()

void AuxiliarySystem::computeElementalVecVars ( ExecFlagType  type)
protected

Definition at line 859 of file AuxiliarySystem.C.

860{
861 TIME_SECTION("computeElementalVecVars", 3);
862
864 computeElementalVarsHelper<VectorAuxKernel>(elemental);
865}

Referenced by compute().

◆ computeGradients()

void LinearFVGradientInterface::computeGradients ( )
protectedinherited

Compute and store raw and requested limited Green-Gauss gradients for linear FV variables.

Definition at line 27 of file LinearFVGradientInterface.C.

28{
29 // No gradients have been requested, by now we should have set up the
30 // containers to receive the gradients. Time to early return.
31 if (_raw_grad_container.empty())
32 return;
33
34 auto & temporary_gradient = temporaryLinearFVGradientContainer();
35 mooseAssert(temporary_gradient.size() == _raw_grad_container.size(),
36 "Temporary and raw gradient containers must have the same size.");
37 for (auto & vec : temporary_gradient)
38 vec->zero();
39
40 auto & fe_problem = _sys.feProblem();
41 auto * const perf_graph_interface = dynamic_cast<PerfGraphInterface *>(&_sys);
42 mooseAssert(perf_graph_interface,
43 "LinearFVGradientInterface requires its owning system to implement "
44 "PerfGraphInterface.");
45 const auto perf_id = perf_graph_interface->registerTimedSection("LinearVariableFV_Gradients", 3);
46 mooseAssert(!Threads::in_threads, "PerfGraph timing cannot be used within threaded sections");
47 PerfGuard time_guard(perf_graph_interface->perfGraph(), perf_id);
48
49 PARALLEL_TRY
50 {
52 FaceInfoRange face_info_range(fe_problem.mesh().ownedFaceInfoBegin(),
53 fe_problem.mesh().ownedFaceInfoEnd());
54
56 fe_problem, _sys, temporary_gradient);
57 Threads::parallel_reduce(face_info_range, gradient_face_thread);
58 }
59 fe_problem.checkExceptionAndStopSolve();
60
61 for (auto & vec : temporary_gradient)
62 vec->close();
63
64 PARALLEL_TRY
65 {
67 ElemInfoRange elem_info_range(fe_problem.mesh().ownedElemInfoBegin(),
68 fe_problem.mesh().ownedElemInfoEnd());
69
71 fe_problem, _sys, temporary_gradient);
72 Threads::parallel_reduce(elem_info_range, gradient_volume_thread);
73 }
74 fe_problem.checkExceptionAndStopSolve();
75
76 for (const auto i : index_range(_raw_grad_container))
77 temporary_gradient[i]->close();
78
79 _raw_grad_container.swap(temporary_gradient);
80
82 {
84 ElemInfoRange elem_info_range(fe_problem.mesh().ownedElemInfoBegin(),
85 fe_problem.mesh().ownedElemInfoEnd());
86
87 for (const auto limiter_type : requestedLinearFVLimitedGradientTypes())
88 {
89 if (limiter_type == Moose::FV::GradientLimiterType::None)
90 continue;
91
92 auto & raw_container = rawLinearFVLimitedGradientContainer(limiter_type);
93 auto & temporary_container = temporaryLinearFVLimitedGradientContainer(limiter_type);
94 mooseAssert(temporary_container.size() == raw_container.size(),
95 "Temporary and raw limited gradient containers must have the same size.");
96 for (auto & vec : temporary_container)
97 vec->zero();
98
99 PARALLEL_TRY
100 {
101 ComputeLinearFVLimitedGradientThread limited_gradient_thread(
102 fe_problem,
103 _sys,
105 temporary_container,
106 limiter_type,
108 Threads::parallel_reduce(elem_info_range, limited_gradient_thread);
109 }
110 fe_problem.checkExceptionAndStopSolve();
111
112 for (auto & vec : temporary_container)
113 vec->close();
114
115 raw_container.swap(temporary_container);
116 }
117 }
118}
The gradient in a volume using Green Gauss theorem and a cell-centered finite-volume approximation ca...
The gradient in a volume using Green Gauss theorem and a cell-centered finite-volume approximation ca...
Compute limited cell gradients for linear FV variables.
std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > & temporaryLinearFVLimitedGradientContainer(const Moose::FV::GradientLimiterType limiter_type)
Return temporary storage for limited gradients during gradient assembly.
std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > & temporaryLinearFVGradientContainer()
Return temporary storage for gradients during gradient assembly.
SystemBase & _sys
Reference to the system object.
const std::unordered_set< unsigned int > & requestedLinearFVLimitedGradientVariables(const Moose::FV::GradientLimiterType limiter_type) const
Access the variable numbers that requested limited gradients for a specific limiter.
const std::unordered_set< Moose::FV::GradientLimiterType > & requestedLinearFVLimitedGradientTypes() const
Access the limiter types requested for this system.
std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > & rawLinearFVLimitedGradientContainer(const Moose::FV::GradientLimiterType limiter_type)
Access the persisted limited-gradient storage for a specific limiter.
Interface for objects interacting with the PerfGraph.
Scope guard for starting and stopping timing for a node.
Definition PerfGuard.h:26
FEProblemBase & feProblem()
Definition SystemBase.h:104
@ None
No gradient limiting.
auto index_range(const T &sizable)
const Number zero

Referenced by compute().

◆ computeMortarNodalVars()

void AuxiliarySystem::computeMortarNodalVars ( ExecFlagType  type)
protected

Definition at line 792 of file AuxiliarySystem.C.

793{
794 TIME_SECTION("computeMortarNodalVars", 3);
795
796 const MooseObjectWarehouse<AuxKernel> & mortar_nodal_warehouse = _mortar_nodal_aux_storage[type];
797
798 mooseAssert(!mortar_nodal_warehouse.hasActiveBlockObjects(),
799 "We don't allow creation of block restricted mortar nodal aux kernels.");
800
801 if (mortar_nodal_warehouse.hasActiveBoundaryObjects())
802 {
804 for (const auto & [bnd_id, mortar_nodal_auxes] :
805 mortar_nodal_warehouse.getActiveBoundaryObjects())
806 for (const auto index : index_range(mortar_nodal_auxes))
807 {
808 PARALLEL_TRY
809 {
810 try
811 {
813 _fe_problem, mortar_nodal_warehouse, bnd_id, index);
814 Threads::parallel_reduce(bnd_nodes, mnabt);
815 }
816 catch (MooseException & e)
817 {
818 _fe_problem.setException("The following MooseException was raised during mortar nodal "
819 "Auxiliary variable computation:\n" +
820 std::string(e.what()));
821 }
822 catch (MetaPhysicL::LogicError & e)
823 {
825 }
826 catch (std::exception & e)
827 {
828 // Continue if we find a libMesh degenerate map exception, but
829 // just re-throw for any real error
830 if (!strstr(e.what(), "Jacobian") && !strstr(e.what(), "singular") &&
831 !strstr(e.what(), "det != 0"))
832 throw;
833
834 _fe_problem.setException("We caught a libMesh degeneracy exception during mortar "
835 "nodal Auxiliary variable computation:\n" +
836 std::string(e.what()));
837 }
838 }
839 PARALLEL_CATCH;
840
841 // We need to make sure we propagate exceptions to all processes before trying to close
842 // here, which is a parallel operation
843 solution().close();
844 _sys.update();
845 }
846 }
847}
for(PetscInt i=0;i< nvars;++i)
This class evaluates a single mortar nodal aux kernel.
libMesh::StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > * getBoundaryNodeRange()
Definition MooseMesh.C:1285
void translateMetaPhysicLError(const MetaPhysicL::LogicError &)
emit a relatively clear error message when we catch a MetaPhysicL logic error
Definition MooseError.C:155

Referenced by compute().

◆ computeNodalArrayVars()

void AuxiliarySystem::computeNodalArrayVars ( ExecFlagType  type)
protected

Definition at line 785 of file AuxiliarySystem.C.

786{
788 computeNodalVarsHelper<ArrayAuxKernel>(nodal);
789}

Referenced by compute().

◆ computeNodalVars()

void AuxiliarySystem::computeNodalVars ( ExecFlagType  type)
protected

Definition at line 767 of file AuxiliarySystem.C.

768{
769 TIME_SECTION("computeNodalVars", 3);
770
772 computeNodalVarsHelper<AuxKernel>(nodal);
773}

Referenced by compute().

◆ computeNodalVarsHelper()

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

Definition at line 975 of file AuxiliarySystem.C.

976{
977 if (warehouse.hasActiveBlockObjects())
978 {
979 // Block Nodal AuxKernels
980 PARALLEL_TRY
981 {
984 Threads::parallel_reduce(range, navt);
985
986 solution().close();
987 _sys.update();
988 }
989 PARALLEL_CATCH;
990 }
991
992 if (warehouse.hasActiveBoundaryObjects())
993 {
994 TIME_SECTION("computeBoundaryObjects", 3);
995
996 // Boundary Nodal AuxKernels
997 PARALLEL_TRY
998 {
1001 Threads::parallel_reduce(bnd_nodes, nabt);
1002
1003 solution().close();
1004 _sys.update();
1005 }
1006 PARALLEL_CATCH;
1007 }
1008}
libMesh::ConstNodeRange * getLocalNodeRange()
Definition MooseMesh.C:1271

◆ computeNodalVecVars()

void AuxiliarySystem::computeNodalVecVars ( ExecFlagType  type)
protected

Definition at line 776 of file AuxiliarySystem.C.

777{
778 TIME_SECTION("computeNodalVecVars", 3);
779
781 computeNodalVarsHelper<VectorAuxKernel>(nodal);
782}

Referenced by compute().

◆ computeScalarVars()

void AuxiliarySystem::computeScalarVars ( ExecFlagType  type)
protected

Definition at line 726 of file AuxiliarySystem.C.

727{
729
730 // Reference to the current storage container
732
733 if (storage.hasActiveObjects())
734 {
735 TIME_SECTION("computeScalarVars", 1);
736
737 PARALLEL_TRY
738 {
739 // FIXME: run multi-threaded
740 THREAD_ID tid = 0;
741 if (storage.hasActiveObjects())
742 {
744
745 const std::vector<std::shared_ptr<AuxScalarKernel>> & objects =
746 storage.getActiveObjects(tid);
747
748 // Call compute() method on all active AuxScalarKernel objects
749 for (const auto & obj : objects)
750 obj->compute();
751
752 const std::vector<MooseVariableScalar *> & scalar_vars = getScalarVariables(tid);
753 for (const auto & var : scalar_vars)
754 var->insert(solution());
755 }
756 }
757 PARALLEL_CATCH;
758
759 solution().close();
760 _sys.update();
761 }
762
764}
void clearScalarVariableCoupleableTags()
virtual void compute(ExecFlagType type) override
Compute auxiliary variables.
void setScalarVariableCoupleableTags(ExecFlagType type)
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
bool hasActiveObjects(THREAD_ID tid=0) const
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.
const std::vector< MooseVariableScalar * > & getScalarVariables(THREAD_ID tid)
Definition SystemBase.h:777

Referenced by compute().

◆ computeVariables()

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

Definition at line 890 of file SystemBase.h.

890{}

◆ computingScalingJacobian()

bool SystemBase::computingScalingJacobian ( ) const
inherited

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

Definition at line 1564 of file SystemBase.C.

1565{
1567}
virtual bool computingScalingJacobian() const =0
Getter for whether we're computing the scaling jacobian.

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

◆ copyCurrentIntoPreviousNL()

void AuxiliarySystem::copyCurrentIntoPreviousNL ( )
virtual

Copies the current solution into the previous nonlinear iteration solution.

Definition at line 908 of file AuxiliarySystem.C.

909{
912}
const NumericVector< Number > *const & currentSolution() const override
The solution vector that is currently being operated on.
virtual const NumericVector< Number > * solutionPreviousNewton() const

◆ copyOldSolutions()

void SystemBase::copyOldSolutions ( )
inherited

Copy the solution back in time (older -> old, etc).

Shifts the solutions backwards in time.

Definition at line 1305 of file SystemBase.C.

1306{
1308}
void copyPreviousSolutions(const Moose::SolutionIterationType iteration_type)
Copy a specific type of solution back in time (older -> old, etc).

Referenced by EigenExecutionerBase::inversePowerIteration().

◆ copyPreviousSolutions()

void SystemBase::copyPreviousSolutions ( const Moose::SolutionIterationType  iteration_type)
inherited

Copy a specific type of solution back in time (older -> old, etc).

Definition at line 1265 of file SystemBase.C.

1266{
1267 const auto num_states = getNumSolutionStates(iteration_type);
1268 if (num_states > 1)
1269 {
1270 // Normally copy through old (index 1). For Time, optionally stop at older
1271 // and leave old unchanged.
1272 const bool skip_old =
1274
1275 const std::size_t stop = skip_old ? 1 : 0;
1276 for (std::size_t i = num_states - 1; i > stop; --i)
1277 solutionState(i, iteration_type) = solutionState(i - 1, iteration_type);
1278 }
1279
1280 // Custom logic for changing state based on iteration type
1281 switch (iteration_type)
1282 {
1285 if (solutionUDotOld())
1287 if (solutionUDotDotOld())
1289 break;
1293 break;
1297 break;
1298 }
1299}
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
virtual NumericVector< Number > * solutionUDot()
Definition SystemBase.h:280
virtual NumericVector< Number > * solutionUDotOld()
Definition SystemBase.h:282
std::size_t getNumSolutionStates(const Moose::SolutionIterationType iteration_type) const
Get the number of solution states (0 = current, 1 = current + old, ...) for the given iteration type.
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).
bool _skip_next_solution_to_old_copy
Whether to skip the next copy from the solution to the old vector.
virtual NumericVector< Number > * solutionUDotDotOld()
Definition SystemBase.h:283
virtual NumericVector< Number > * solutionUDotDot()
Definition SystemBase.h:281
void stop(const char *file, int line, const char *date, const char *time)

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

◆ copySolutionsBackwards()

void SystemBase::copySolutionsBackwards ( )
virtualinherited

Copy current solution into old and older.

Definition at line 1257 of file SystemBase.C.

◆ copyTimeIntegrators()

void SystemBase::copyTimeIntegrators ( const SystemBase other_sys)
inherited

Copy time integrators from another system.

Definition at line 1666 of file SystemBase.C.

1667{
1669}

◆ copyVars()

void SystemBase::copyVars ( libMesh::ExodusII_IO io)
inherited

Definition at line 1182 of file SystemBase.C.

1183{
1184 int n_steps = io.get_num_time_steps();
1185
1186 bool did_copy = false;
1187 for (const auto & vci : _var_to_copy)
1188 {
1189 int timestep = -1;
1190
1191 if (vci._timestep == "LATEST")
1192 // Use the last time step in the file from which to retrieve the solution
1193 timestep = n_steps;
1194 else
1195 {
1196 timestep = MooseUtils::convert<int>(vci._timestep);
1197 if (timestep > n_steps)
1198 mooseError("Invalid value passed as \"initial_from_file_timestep\". Expected \"LATEST\" or "
1199 "a valid integer between 1 and ",
1200 n_steps,
1201 " inclusive, received ",
1202 vci._timestep);
1203 }
1204
1205 did_copy = true;
1206
1207 if (hasVariable(vci._dest_name))
1208 {
1209 const auto & var = getVariable(0, vci._dest_name);
1210 if (var.isArray())
1211 {
1212 const auto & array_var = getFieldVariable<RealEigenVector>(0, vci._dest_name);
1213 for (MooseIndex(var.count()) i = 0; i < var.count(); ++i)
1214 {
1215 const auto & exodus_var = var.arrayVariableComponent(i);
1216 const auto & system_var = array_var.componentName(i);
1217 if (var.isNodal())
1218 io.copy_nodal_solution(system(), exodus_var, system_var, timestep);
1219 else
1220 io.copy_elemental_solution(system(), exodus_var, system_var, timestep);
1221 }
1222 }
1223 else
1224 {
1225 if (var.isNodal())
1226 io.copy_nodal_solution(system(), vci._dest_name, vci._source_name, timestep);
1227 else
1228 io.copy_elemental_solution(system(), vci._dest_name, vci._source_name, timestep);
1229 }
1230 }
1231 else if (hasScalarVariable(vci._dest_name))
1232 io.copy_scalar_solution(system(), {vci._dest_name}, {vci._source_name}, timestep);
1233 else
1234 mooseError("Unrecognized variable ", vci._dest_name, " in variables to copy.");
1235 }
1236
1237 if (did_copy)
1238 solution().close();
1239}
MooseVariableFieldBase & getVariable(THREAD_ID tid, const std::string &var_name) const
Gets a reference to a variable of with specified name.
Definition SystemBase.C:91
virtual bool hasScalarVariable(const std::string &var_name) const
Definition SystemBase.C:875
virtual bool hasVariable(const std::string &var_name) const
Query a system for a variable.
Definition SystemBase.C:850
void copy_scalar_solution(System &system, std::vector< std::string > system_var_names, std::vector< std::string > exodus_var_names, unsigned int timestep=1)
void copy_nodal_solution(System &system, std::string system_var_name, std::string exodus_var_name, unsigned int timestep=1)
void copy_elemental_solution(System &system, std::string system_var_name, std::string exodus_var_name, unsigned int timestep=1)

◆ 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 93 of file AuxiliarySystem.h.

94 {
95 return _current_solution;
96 }

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

◆ customSetup()

void AuxiliarySystem::customSetup ( const ExecFlagType exec_type)
overridevirtual

Reimplemented from SystemBase.

Definition at line 150 of file AuxiliarySystem.C.

151{
152 SystemBase::customSetup(exec_type);
153
154 for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
155 {
156 _aux_scalar_storage.customSetup(exec_type, tid);
157 _nodal_aux_storage.customSetup(exec_type, tid);
158 _mortar_nodal_aux_storage.customSetup(exec_type, tid);
159 _nodal_vec_aux_storage.customSetup(exec_type, tid);
160 _nodal_array_aux_storage.customSetup(exec_type, tid);
161 _elemental_aux_storage.customSetup(exec_type, tid);
162 _elemental_vec_aux_storage.customSetup(exec_type, tid);
163 _elemental_array_aux_storage.customSetup(exec_type, tid);
164 }
165
166#ifdef MOOSE_KOKKOS_ENABLED
167 _kokkos_nodal_aux_storage.customSetup(exec_type, /*tid=*/0);
168 _kokkos_elemental_aux_storage.customSetup(exec_type, /*tid=*/0);
169#endif
170}
virtual void customSetup(const ExecFlagType &exec_type, THREAD_ID tid=0) const
virtual void customSetup(const ExecFlagType &exec_type)

◆ deactivateAllMatrixTags()

void SystemBase::deactivateAllMatrixTags ( )
virtualinherited

Make matrices inactive.

Definition at line 1118 of file SystemBase.C.

1119{
1120 auto num_matrix_tags = _subproblem.numMatrixTags();
1121
1122 _matrix_tag_active_flags.resize(num_matrix_tags);
1123
1124 for (decltype(num_matrix_tags) tag = 0; tag < num_matrix_tags; tag++)
1125 _matrix_tag_active_flags[tag] = false;
1127}

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

◆ defaultMatrixTags()

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

Get the default matrix tags associted with this system.

Reimplemented in DisplacedSystem, and NonlinearEigenSystem.

Definition at line 338 of file SystemBase.h.

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

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

◆ defaultVectorTags()

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

Get the default vector tags associated with this system.

Reimplemented in DisplacedSystem, and NonlinearEigenSystem.

Definition at line 331 of file SystemBase.h.

332 {
334 }
virtual TagID residualVectorTag() const
Definition SystemBase.h:326
virtual TagID timeVectorTag() const
Ideally, we should not need this API.
Definition SystemBase.h:311
virtual TagID nonTimeVectorTag() const
Definition SystemBase.h:321

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

◆ disassociateDefaultMatrixTags()

void SystemBase::disassociateDefaultMatrixTags ( )
virtualinherited

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

Reimplemented in DisplacedSystem.

Definition at line 1109 of file SystemBase.C.

1110{
1111 const auto tags = defaultMatrixTags();
1112 for (const auto tag : tags)
1113 if (_subproblem.matrixTagExists(tag))
1115}
virtual std::set< TagID > defaultMatrixTags() const
Get the default matrix tags associted with this system.
Definition SystemBase.h:338
virtual void disassociateMatrixFromTag(libMesh::SparseMatrix< Number > &matrix, TagID tag)
Disassociate a matrix from a tag.

Referenced by DisplacedSystem::disassociateDefaultMatrixTags().

◆ disassociateDefaultVectorTags()

void SystemBase::disassociateDefaultVectorTags ( )
virtualinherited

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

Reimplemented in DisplacedSystem.

Definition at line 1014 of file SystemBase.C.

1015{
1016 const auto tags = defaultVectorTags();
1017 for (const auto tag : tags)
1018 if (_subproblem.vectorTagExists(tag))
1020}
virtual void disassociateVectorFromTag(NumericVector< Number > &vec, TagID tag)
Disassociate a given vector from a given tag.
Definition SystemBase.C:992
virtual std::set< TagID > defaultVectorTags() const
Get the default vector tags associated with this system.
Definition SystemBase.h:331

Referenced by DisplacedSystem::disassociateDefaultVectorTags().

◆ disassociateMatrixFromTag() [1/2]

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

Disassociate a matrix from a tag.

Reimplemented in DisplacedSystem.

Definition at line 1087 of file SystemBase.C.

1088{
1089 if (!_subproblem.matrixTagExists(tag))
1090 mooseError("Cannot disassociate matrix from tag ", tag, " because that tag does not exist");
1091 if (hasMatrix(tag) && &getMatrix(tag) != &matrix)
1092 mooseError("You can not disassociate a matrix from a tag which it was not associated to");
1093
1095}

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

◆ 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 1098 of file SystemBase.C.

1099{
1100 if (!_subproblem.matrixTagExists(tag))
1101 mooseError("Cannot disassociate matrix from tag ", tag, " because that tag does not exist");
1102
1103 if (_tagged_matrices.size() < tag + 1)
1104 _tagged_matrices.resize(tag + 1);
1105 _tagged_matrices[tag] = nullptr;
1106}

◆ disassociateVectorFromTag() [1/2]

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

◆ 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 1003 of file SystemBase.C.

1004{
1005 if (!_subproblem.vectorTagExists(tag))
1006 mooseError("Cannot disassociate vector from tag ", tag, " because that tag does not exist");
1007
1008 if (_tagged_vectors.size() < tag + 1)
1009 _tagged_vectors.resize(tag + 1);
1010 _tagged_vectors[tag] = nullptr;
1011}

◆ 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 1168 of file SystemBase.C.

1169{
1170 return system().get_dof_map();
1171}

◆ duDotDotDu() [1/2]

virtual Number & SystemBase::duDotDotDu ( )
inlinevirtualinherited

Reimplemented in DisplacedSystem.

Definition at line 276 of file SystemBase.h.

276{ return _du_dotdot_du; }
Real _du_dotdot_du

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

◆ duDotDotDu() [2/2]

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

Reimplemented in DisplacedSystem.

Definition at line 278 of file SystemBase.h.

278{ return _du_dotdot_du; }

◆ duDotDu()

const Number & SystemBase::duDotDu ( unsigned int  var_num = 0) const
virtualinherited

Reimplemented in DisplacedSystem.

Definition at line 1700 of file SystemBase.C.

1701{
1702 return _du_dot_du[var_num];
1703}
std::vector< Real > _du_dot_du
Derivative of time derivative of u with respect to uj.

Referenced by DisplacedSystem::duDotDu(), MooseVariableScalar::reinit(), Moose::Kokkos::VariableGradientTempl< is_ad >::VariableGradientTempl(), and Moose::Kokkos::VariableValueTempl< is_ad >::VariableValueTempl().

◆ duDotDus()

virtual std::vector< Number > & SystemBase::duDotDus ( )
inlinevirtualinherited

Reimplemented in DisplacedSystem.

Definition at line 275 of file SystemBase.h.

275{ return _du_dot_du; }

Referenced by DisplacedSystem::duDotDus().

◆ elemArrayAuxWarehouse()

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

Definition at line 271 of file AuxiliarySystem.h.

272{
274}

◆ elemAuxWarehouse()

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

Definition at line 259 of file AuxiliarySystem.h.

260{
262}

◆ elemVectorAuxWarehouse()

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

Definition at line 265 of file AuxiliarySystem.h.

266{
268}

◆ feProblem() [1/2]

FEProblemBase & SystemBase::feProblem ( )
inlineinherited

◆ feProblem() [2/2]

const FEProblemBase & SystemBase::feProblem ( ) const
inlineinherited

Definition at line 105 of file SystemBase.h.

105{ return _fe_problem; }

◆ 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 1067 of file SystemBase.C.

1068{
1069 for (auto tag : tags)
1070 if (hasMatrix(tag))
1071 getMatrix(tag).flush();
1072}

◆ getActualFieldVariable() [1/2]

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

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

Definition at line 119 of file SystemBase.C.

120{
121 return *_vars[tid].getActualFieldVariable<T>(var_name);
122}

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

◆ getActualFieldVariable() [2/2]

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

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

Definition at line 140 of file SystemBase.C.

141{
142 return *_vars[tid].getActualFieldVariable<T>(var_number);
143}

◆ getDependObjects() [1/2]

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

Definition at line 590 of file AuxiliarySystem.C.

591{
592 std::set<std::string> depend_objects;
593
594 // Elemental AuxKernels
595 {
596 const std::vector<std::shared_ptr<AuxKernel>> & auxs =
597 _elemental_aux_storage.getActiveObjects();
598 for (const auto & aux : auxs)
599 {
600 const std::set<UserObjectName> & uo = aux->getDependObjects();
601 depend_objects.insert(uo.begin(), uo.end());
602 }
603 }
604
605 // Elemental VectorAuxKernels
606 {
607 const std::vector<std::shared_ptr<VectorAuxKernel>> & auxs =
608 _elemental_vec_aux_storage.getActiveObjects();
609 for (const auto & aux : auxs)
610 {
611 const std::set<UserObjectName> & uo = aux->getDependObjects();
612 depend_objects.insert(uo.begin(), uo.end());
613 }
614 }
615
616 // Elemental ArrayAuxKernels
617 {
618 const std::vector<std::shared_ptr<ArrayAuxKernel>> & auxs =
619 _elemental_array_aux_storage.getActiveObjects();
620 for (const auto & aux : auxs)
621 {
622 const std::set<UserObjectName> & uo = aux->getDependObjects();
623 depend_objects.insert(uo.begin(), uo.end());
624 }
625 }
626
627 // Nodal AuxKernels
628 {
629 const std::vector<std::shared_ptr<AuxKernel>> & auxs = _nodal_aux_storage.getActiveObjects();
630 for (const auto & aux : auxs)
631 {
632 const std::set<UserObjectName> & uo = aux->getDependObjects();
633 depend_objects.insert(uo.begin(), uo.end());
634 }
635 }
636
637 // Mortar Nodal AuxKernels
638 {
639 const std::vector<std::shared_ptr<AuxKernel>> & auxs =
640 _mortar_nodal_aux_storage.getActiveObjects();
641 for (const auto & aux : auxs)
642 {
643 const std::set<UserObjectName> & uo = aux->getDependObjects();
644 depend_objects.insert(uo.begin(), uo.end());
645 }
646 }
647
648 // Nodal VectorAuxKernels
649 {
650 const std::vector<std::shared_ptr<VectorAuxKernel>> & auxs =
651 _nodal_vec_aux_storage.getActiveObjects();
652 for (const auto & aux : auxs)
653 {
654 const std::set<UserObjectName> & uo = aux->getDependObjects();
655 depend_objects.insert(uo.begin(), uo.end());
656 }
657 }
658
659 // Nodal ArrayAuxKernels
660 {
661 const std::vector<std::shared_ptr<ArrayAuxKernel>> & auxs =
662 _nodal_array_aux_storage.getActiveObjects();
663 for (const auto & aux : auxs)
664 {
665 const std::set<UserObjectName> & uo = aux->getDependObjects();
666 depend_objects.insert(uo.begin(), uo.end());
667 }
668 }
669
670#ifdef MOOSE_KOKKOS_ENABLED
671 // Nodal KokkosAuxKernels
672 {
673 const std::vector<std::shared_ptr<AuxKernelBase>> & auxs =
675 for (const auto & aux : auxs)
676 {
677 const std::set<UserObjectName> & uo = aux->getDependObjects();
678 depend_objects.insert(uo.begin(), uo.end());
679 }
680 }
681
682 // Elemental KokkosAuxKernels
683 {
684 const std::vector<std::shared_ptr<AuxKernelBase>> & auxs =
686 for (const auto & aux : auxs)
687 {
688 const std::set<UserObjectName> & uo = aux->getDependObjects();
689 depend_objects.insert(uo.begin(), uo.end());
690 }
691 }
692#endif
693
694 return depend_objects;
695}

◆ getDependObjects() [2/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 481 of file AuxiliarySystem.C.

482{
483 std::set<std::string> depend_objects;
484
485 // Elemental AuxKernels
486 {
487 const std::vector<std::shared_ptr<AuxKernel>> & auxs =
488 _elemental_aux_storage[type].getActiveObjects();
489 for (const auto & aux : auxs)
490 {
491 const std::set<UserObjectName> & uo = aux->getDependObjects();
492 depend_objects.insert(uo.begin(), uo.end());
493 }
494 }
495
496 // Elemental VectorAuxKernels
497 {
498 const std::vector<std::shared_ptr<VectorAuxKernel>> & auxs =
499 _elemental_vec_aux_storage[type].getActiveObjects();
500 for (const auto & aux : auxs)
501 {
502 const std::set<UserObjectName> & uo = aux->getDependObjects();
503 depend_objects.insert(uo.begin(), uo.end());
504 }
505 }
506
507 // Elemental ArrayAuxKernels
508 {
509 const std::vector<std::shared_ptr<ArrayAuxKernel>> & auxs =
510 _elemental_array_aux_storage[type].getActiveObjects();
511 for (const auto & aux : auxs)
512 {
513 const std::set<UserObjectName> & uo = aux->getDependObjects();
514 depend_objects.insert(uo.begin(), uo.end());
515 }
516 }
517
518 // Nodal AuxKernels
519 {
520 const std::vector<std::shared_ptr<AuxKernel>> & auxs =
521 _nodal_aux_storage[type].getActiveObjects();
522 for (const auto & aux : auxs)
523 {
524 const std::set<UserObjectName> & uo = aux->getDependObjects();
525 depend_objects.insert(uo.begin(), uo.end());
526 }
527 }
528
529 // Mortar Nodal AuxKernels
530 {
531 const std::vector<std::shared_ptr<AuxKernel>> & auxs =
532 _mortar_nodal_aux_storage[type].getActiveObjects();
533 for (const auto & aux : auxs)
534 {
535 const std::set<UserObjectName> & uo = aux->getDependObjects();
536 depend_objects.insert(uo.begin(), uo.end());
537 }
538 }
539
540 // Nodal VectorAuxKernels
541 {
542 const std::vector<std::shared_ptr<VectorAuxKernel>> & auxs =
543 _nodal_vec_aux_storage[type].getActiveObjects();
544 for (const auto & aux : auxs)
545 {
546 const std::set<UserObjectName> & uo = aux->getDependObjects();
547 depend_objects.insert(uo.begin(), uo.end());
548 }
549 }
550
551 // Nodal ArrayAuxKernels
552 {
553 const std::vector<std::shared_ptr<ArrayAuxKernel>> & auxs =
554 _nodal_array_aux_storage[type].getActiveObjects();
555 for (const auto & aux : auxs)
556 {
557 const std::set<UserObjectName> & uo = aux->getDependObjects();
558 depend_objects.insert(uo.begin(), uo.end());
559 }
560 }
561
562#ifdef MOOSE_KOKKOS_ENABLED
563 // Kokkos NodalAuxKernels
564 {
565 const std::vector<std::shared_ptr<AuxKernelBase>> & auxs =
567 for (const auto & aux : auxs)
568 {
569 const std::set<UserObjectName> & uo = aux->getDependObjects();
570 depend_objects.insert(uo.begin(), uo.end());
571 }
572 }
573
574 // Kokkos ElementalAuxKernels
575 {
576 const std::vector<std::shared_ptr<AuxKernelBase>> & auxs =
578 for (const auto & aux : auxs)
579 {
580 const std::set<UserObjectName> & uo = aux->getDependObjects();
581 depend_objects.insert(uo.begin(), uo.end());
582 }
583 }
584#endif
585
586 return depend_objects;
587}

Referenced by groupUserObjects().

◆ getFieldVariable() [1/2]

template<typename T >
template MooseVariableFE< RealEigenVector > & SystemBase::getFieldVariable< RealEigenVector > ( 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 112 of file SystemBase.C.

113{
114 return *_vars[tid].getFieldVariable<T>(var_name);
115}

Referenced by Marker::getMarkerValue().

◆ getFieldVariable() [2/2]

template<typename T >
template MooseVariableFE< RealEigenVector > & SystemBase::getFieldVariable< RealEigenVector > ( 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 133 of file SystemBase.C.

134{
135 return *_vars[tid].getFieldVariable<T>(var_number);
136}

◆ 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 126 of file SystemBase.C.

127{
128 return *_vars[tid].getFVVariable<T>(var_name);
129}

◆ getMatrix() [1/2]

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

Get a raw SparseMatrix.

Reimplemented in DisplacedSystem.

Definition at line 1023 of file SystemBase.C.

1024{
1025 if (!hasMatrix(tag))
1026 {
1027 if (!_subproblem.matrixTagExists(tag))
1028 mooseError("Cannot retrieve matrix with tag ", tag, " because that tag does not exist");
1029 else
1030 mooseError("Cannot retrieve matrix with tag ",
1031 tag,
1032 " in system '",
1033 name(),
1034 "'\nbecause a matrix has not been associated with that tag.");
1035 }
1036
1037 return *_tagged_matrices[tag];
1038}

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

◆ getMatrix() [2/2]

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

Get a raw SparseMatrix.

Reimplemented in DisplacedSystem.

Definition at line 1041 of file SystemBase.C.

1042{
1043 if (!hasMatrix(tag))
1044 {
1045 if (!_subproblem.matrixTagExists(tag))
1046 mooseError("Cannot retrieve matrix with tag ", tag, " because that tag does not exist");
1047 else
1048 mooseError("Cannot retrieve matrix with tag ",
1049 tag,
1050 " in system '",
1051 name(),
1052 "'\nbecause a matrix has not been associated with that tag.");
1053 }
1054
1055 return *_tagged_matrices[tag];
1056}

◆ getMaxVariableNumber()

unsigned int SystemBase::getMaxVariableNumber ( ) const
inlineinherited

Returns the maximum number of all variables on the system.

Definition at line 888 of file SystemBase.h.

888{ return _max_var_number; }
unsigned int _max_var_number
Maximum variable number.

◆ 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 604 of file SystemBase.h.

604{ return _max_var_n_dofs_per_elem; }

Referenced by Moose::globalDofIndexToDerivative().

◆ 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 611 of file SystemBase.h.

611{ return _max_var_n_dofs_per_node; }

◆ getMinQuadratureOrder()

Order AuxiliarySystem::getMinQuadratureOrder ( )
overridevirtual

Get the minimum quadrature order for evaluating elemental auxiliary variables.

Reimplemented from SystemBase.

Definition at line 883 of file AuxiliarySystem.C.

884{
885 Order order = CONSTANT;
886 std::vector<MooseVariableFEBase *> vars = _vars[0].fieldVariables();
887 for (const auto & var : vars)
888 {
889 if (!var->isNodal()) // nodal aux variables do not need quadrature
890 {
891 FEType fe_type = var->feType();
892 if (fe_type.default_quadrature_order() > order)
893 order = fe_type.default_quadrature_order();
894 }
895 }
896
897 return order;
898}
char ** vars
Order default_quadrature_order() const

◆ getNumSolutionStates()

std::size_t SystemBase::getNumSolutionStates ( const Moose::SolutionIterationType  iteration_type) const
inlineinherited

Get the number of solution states (0 = current, 1 = current + old, ...) for the given iteration type.

Definition at line 1134 of file SystemBase.h.

1135{
1136 return getSolutionStates(iteration_type).size();
1137}
const std::vector< NumericVector< Number > * > & getSolutionStates(const Moose::SolutionIterationType iteration_type) const
Get all of the solution states (current, old, ...) for the given iteration type.

Referenced by SystemBase::copyPreviousSolutions(), SystemBase::hasSolutionState(), SystemBase::restoreOldSolutions(), SystemBase::saveOldSolutions(), and SystemBase::solutionState().

◆ getScalarVariable() [1/2]

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

◆ 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 155 of file SystemBase.C.

156{
157 MooseVariableScalar * var =
158 dynamic_cast<MooseVariableScalar *>(_vars[tid].getVariable(var_number));
159 if (!var)
160 mooseError("variable #" + Moose::stringify(var_number) + " does not exist in this system");
161 return *var;
162}
std::string stringify(const T &t)
conversion to string
Definition Conversion.h:64

◆ getScalarVariables()

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

◆ getSolutionStates() [1/2]

std::vector< NumericVector< Number > * > & SystemBase::getSolutionStates ( const Moose::SolutionIterationType  iteration_type)
inlineprivateinherited

Get all of the solution states (current, old, ...) for the given iteration type.

Definition at line 1099 of file SystemBase.h.

1100 {
1101 return const_cast<std::vector<NumericVector<Number> *> &>(
1102 static_cast<const SystemBase *>(this)->getSolutionStates(iteration_type));
1103 }

◆ getSolutionStates() [2/2]

const std::vector< NumericVector< Number > * > & SystemBase::getSolutionStates ( const Moose::SolutionIterationType  iteration_type) const
inlineinherited

Get all of the solution states (current, old, ...) for the given iteration type.

Definition at line 1124 of file SystemBase.h.

1125{
1126 const auto iteration_type_index = static_cast<std::size_t>(iteration_type);
1127 mooseAssert(iteration_type_index < static_cast<std::size_t>(Moose::SolutionIterationType::Count),
1128 "Invalid solution iteration type");
1129 mooseAssert(iteration_type_index < _solution_states.size(), "_solution_states sized incorrectly");
1130 return _solution_states[iteration_type_index];
1131}
std::array< std::vector< NumericVector< Number > * >, static_cast< size_t >(Moose::SolutionIterationType::Count)> _solution_states
2D array of solution state vector pointers.

Referenced by SystemBase::getNumSolutionStates(), SystemBase::getSolutionStates(), SystemBase::needSolutionState(), SystemBase::solutionState(), SystemBase::solutionState(), and SystemBase::solutionStateParallelType().

◆ getStandardFieldVariableNames()

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

◆ getSubdomainsForVar() [1/2]

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

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 1706 of file SystemBase.C.

1707{
1708 return getSubdomainsForVar(getVariable(0, var_name).number());
1709}
const std::set< SubdomainID > & getSubdomainsForVar(unsigned int var_number) const
Definition SystemBase.h:782

◆ getSubdomainsForVar() [2/2]

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

Definition at line 782 of file SystemBase.h.

783 {
784 return _var_map.at(var_number);
785 }
std::map< unsigned int, std::set< SubdomainID > > _var_map
Map of variables (variable id -> array of subdomains where it lives)

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

◆ getTimeIntegrator()

const TimeIntegrator & SystemBase::getTimeIntegrator ( const unsigned int  var_num) const
inherited

Retrieve the time integrator that integrates the given variable's equation.

Definition at line 1682 of file SystemBase.C.

1683{
1684 const auto * const ti = queryTimeIntegrator(var_num);
1685
1686 if (ti)
1687 return *ti;
1688 else
1689 mooseError("No time integrator found that integrates variable number ",
1690 std::to_string(var_num));
1691}
const TimeIntegrator * queryTimeIntegrator(const unsigned int var_num) const
Retrieve the time integrator that integrates the given variable's equation.

Referenced by AB2PredictorCorrector::estimateTimeError().

◆ getTimeIntegrators()

const std::vector< std::shared_ptr< TimeIntegrator > > & SystemBase::getTimeIntegrators ( )
inherited
Returns
All the time integrators owned by this system

Definition at line 1694 of file SystemBase.C.

1695{
1696 return _time_integrators;
1697}

◆ 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 91 of file SystemBase.C.

92{
94 dynamic_cast<MooseVariableFieldBase *>(_vars[tid].getVariable(var_name));
95 if (!var)
96 mooseError("Variable '", var_name, "' does not exist in this system");
97 return *var;
98}
This class provides an interface for common operations on field variables of both FE and FV types wit...

Referenced by AdaptivityAction::act(), Assembly::addJacobianBlockNonlocal(), FEProblemBase::addJacobianBlockTags(), NonlocalIntegratedBC::computeNonlocalOffDiagJacobian(), NonlocalKernel::computeNonlocalOffDiagJacobian(), Assembly::copyFaceShapes(), Assembly::copyNeighborShapes(), Assembly::copyShapes(), SystemBase::copyVars(), DMMooseSetVariables(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), NodeElemConstraint::getConnectedDofIndices(), NodeFaceConstraint::getConnectedDofIndices(), SystemBase::getSubdomainsForVar(), ResidualObject::getVariable(), Assembly::init(), NodalNormalsPreprocessor::initialize(), LinearSystem::initialSetup(), ExplicitTimeIntegrator::initialSetup(), Assembly::initNonlocalCoupling(), PNGOutput::makeMeshFunc(), MooseStaticCondensationPreconditioner::MooseStaticCondensationPreconditioner(), UpdateErrorVectorsThread::onElement(), FEProblemBase::prepare(), Assembly::prepareBlock(), Assembly::prepareBlockNonlocal(), NonlinearSystemBase::setupScalingData(), and VariableCondensationPreconditioner::VariableCondensationPreconditioner().

◆ 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 101 of file SystemBase.C.

102{
103 if (var_number < _numbered_vars[tid].size())
104 if (_numbered_vars[tid][var_number])
105 return *_numbered_vars[tid][var_number];
106
107 mooseError("Variable #", Moose::stringify(var_number), " does not exist in this system");
108}
std::vector< std::vector< MooseVariableFieldBase * > > _numbered_vars
Map variable number to its pointer.

◆ 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 165 of file SystemBase.C.

166{
167 mooseAssert(_var_map.find(var_number) != _var_map.end(), "Variable does not exist.");
168 if (_var_map[var_number].empty())
169 return nullptr;
170 else
171 return &_var_map[var_number];
172}

Referenced by PhysicsBasedPreconditioner::addSystem().

◆ 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 863 of file SystemBase.h.

863{ return _var_all_dof_indices; }
std::vector< dof_id_type > _var_all_dof_indices
Container for the dof indices of a given variable.

◆ 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 932 of file SystemBase.C.

933{
934 return system().get_vector(name);
935}
const NumericVector< Number > & get_vector(std::string_view vec_name) const

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

◆ getVector() [2/4]

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

Reimplemented in DisplacedSystem.

Definition at line 938 of file SystemBase.C.

939{
940 return system().get_vector(name);
941}

◆ getVector() [3/4]

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

Get a raw NumericVector by tag.

Reimplemented in DisplacedSystem.

Definition at line 944 of file SystemBase.C.

945{
946 if (!hasVector(tag))
947 {
949 mooseError("Cannot retrieve vector with tag ", tag, " because that tag does not exist");
950 else
951 mooseError("Cannot retrieve vector with tag ",
952 tag,
953 " in system '",
954 name(),
955 "'\nbecause a vector has not been associated with that tag.");
956 }
957
958 return *_tagged_vectors[tag];
959}

◆ getVector() [4/4]

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

Reimplemented in DisplacedSystem.

Definition at line 962 of file SystemBase.C.

963{
964 if (!hasVector(tag))
965 {
967 mooseError("Cannot retrieve vector with tag ", tag, " because that tag does not exist");
968 else
969 mooseError("Cannot retrieve vector with tag ",
970 tag,
971 " in system '",
972 name(),
973 "'\nbecause a vector has not been associated with that tag.");
974 }
975
976 return *_tagged_vectors[tag];
977}

◆ hasMatrix()

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

◆ hasScalarVariable()

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

◆ hasSolutionState()

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

◆ hasVarCopy()

bool SystemBase::hasVarCopy ( ) const
inlineinherited

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

Definition at line 904 of file SystemBase.h.

904{ return _var_to_copy.size() > 0; }

◆ hasVariable()

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

◆ 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 300 of file SystemBase.h.

301 {
302 return tag_id < _tagged_vectors.size() && _tagged_vectors[tag_id];
303 }

◆ initializeContainer()

void LinearFVGradientInterface::initializeContainer ( std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > &  container) const
protectedinherited

Definition at line 131 of file LinearFVGradientInterface.C.

133{
134 container.clear();
135 mooseAssert(_sys.currentSolution(),
136 "Current solution must exist before building FV gradient storage.");
137 for (unsigned int i = 0; i < _sys.mesh().dimension(); ++i)
138 container.push_back(_sys.currentSolution()->zero_clone());
139}
MooseMesh & mesh()
Definition SystemBase.h:100
virtual std::unique_ptr< NumericVector< T > > zero_clone() const=0

Referenced by LinearFVGradientInterface::rebuildLinearFVGradientStorage(), and LinearFVGradientInterface::requestLinearFVLimitedGradients().

◆ initializeObjects()

virtual void SystemBase::initializeObjects ( )
inlinevirtualinherited

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

Definition at line 174 of file SystemBase.h.

174{}

◆ initialSetup()

virtual void AuxiliarySystem::initialSetup ( )
overridevirtual

Setup Functions.

Reimplemented from SystemBase.

◆ initSolutionState()

void SystemBase::initSolutionState ( )
virtualinherited

Initializes the solution state.

Reimplemented in DisplacedSystem.

Definition at line 1361 of file SystemBase.C.

1362{
1363 // Default is the current solution
1364 unsigned int state = 0;
1365
1366 // Add additional states as required by the variable states requested
1367 for (const auto & var : getVariables(/* tid = */ 0))
1368 state = std::max(state, var->oldestSolutionStateRequested());
1369 for (const auto & var : getScalarVariables(/* tid = */ 0))
1370 state = std::max(state, var->oldestSolutionStateRequested());
1371
1373
1375}
bool _solution_states_initialized
Whether or not the solution states have been initialized.
virtual void needSolutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time, libMesh::ParallelType parallel_type=GHOSTED)
Registers that the solution state state is needed.
const std::vector< MooseVariableFieldBase * > & getVariables(THREAD_ID tid)
Definition SystemBase.h:770
auto max(const L &left, const R &right)

Referenced by DisplacedSystem::initSolutionState().

◆ isArrayVariable()

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

If a variable is an array variable.

Definition at line 863 of file SystemBase.C.

864{
865 auto & names = getVariableNames();
866 if (!system().has_variable(var_name) &&
867 std::find(names.begin(), names.end(), var_name) != names.end())
868 // array variable
869 return true;
870 else
871 return false;
872}

◆ isScalarVariable()

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

Definition at line 884 of file SystemBase.C.

885{
886 return (system().variable(var_num).type().family == SCALAR);
887}

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

◆ jacobianSetup()

void AuxiliarySystem::jacobianSetup ( )
overridevirtual

Reimplemented from SystemBase.

Definition at line 191 of file AuxiliarySystem.C.

192{
194
195 for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
196 {
198 _nodal_aux_storage.jacobianSetup(tid);
199 _mortar_nodal_aux_storage.jacobianSetup(tid);
200 _nodal_vec_aux_storage.jacobianSetup(tid);
201 _nodal_array_aux_storage.jacobianSetup(tid);
202 _elemental_aux_storage.jacobianSetup(tid);
203 _elemental_vec_aux_storage.jacobianSetup(tid);
204 _elemental_array_aux_storage.jacobianSetup(tid);
205 }
206
207#ifdef MOOSE_KOKKOS_ENABLED
210#endif
211}
void jacobianSetup(THREAD_ID tid=0) const override
Convenience methods for calling object setup methods.
virtual void jacobianSetup()

◆ kokkosCompute()

void AuxiliarySystem::kokkosCompute ( ExecFlagType  type)

Referenced by compute().

◆ kokkosElemAuxWarehouse()

const ExecuteMooseObjectWarehouse< AuxKernelBase > & AuxiliarySystem::kokkosElemAuxWarehouse ( ) const
inline

Definition at line 284 of file AuxiliarySystem.h.

285{
287}

◆ kokkosNodalAuxWarehouse()

const ExecuteMooseObjectWarehouse< AuxKernelBase > & AuxiliarySystem::kokkosNodalAuxWarehouse ( ) const
inline

Definition at line 278 of file AuxiliarySystem.h.

279{
281}

◆ linearFVGradientContainer()

const std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > & LinearFVGradientInterface::linearFVGradientContainer ( ) const
inlineinherited

Access the stored raw cell-centered gradient components.

Returns
Raw cell-centered gradient vectors keyed by spatial direction.

Definition at line 45 of file LinearFVGradientInterface.h.

46 {
48 }

◆ linearFVLimitedGradientContainer()

const std::vector< std::unique_ptr< NumericVector< Number > > > & LinearFVGradientInterface::linearFVLimitedGradientContainer ( const Moose::FV::GradientLimiterType  limiter_type) const

Access the stored raw or limited cell-centered gradient components.

Parameters
limiter_typeThe limiter type whose gradient container is being requested.
Returns
The requested raw or limited gradient vectors ordered by spatial direction.

Definition at line 64 of file LinearFVGradientInterface.C.

200{
201 if (limiter_type == Moose::FV::GradientLimiterType::None)
202 return _raw_grad_container;
203
204 const auto it = _raw_limited_grad_containers.find(limiter_type);
205 if (it == _raw_limited_grad_containers.end())
206 mooseError("Limited gradient container was requested but not initialized on system '",
207 _sys.name(),
208 "'.");
209
210 return it->second;
211}
std::unordered_map< Moose::FV::GradientLimiterType, std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > > _raw_limited_grad_containers
Persisted limited gradient components keyed by limiter type.
const std::string & name() const

◆ matrixTagActive()

bool SystemBase::matrixTagActive ( TagID  tag) const
virtualinherited

If or not a matrix tag is active.

Definition at line 1148 of file SystemBase.C.

1149{
1150 mooseAssert(_subproblem.matrixTagExists(tag), "Matrix tag " << tag << " does not exist");
1151
1152 return tag < _matrix_tag_active_flags.size() && _matrix_tag_active_flags[tag];
1153}

◆ mesh() [1/2]

MooseMesh & SystemBase::mesh ( )
inlineinherited

◆ mesh() [2/2]

const MooseMesh & SystemBase::mesh ( ) const
inlineinherited

Definition at line 101 of file SystemBase.h.

101{ return _mesh; }

◆ mortarNodalAuxWarehouse()

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

Definition at line 241 of file AuxiliarySystem.h.

242{
244}

◆ name()

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

Definition at line 1337 of file SystemBase.C.

1338{
1339 return system().name();
1340}

Referenced by NonlinearSystemBase::addBoundaryCondition(), NonlinearSystemBase::addConstraint(), NonlinearSystemBase::addDamper(), NonlinearSystemBase::addDGKernel(), NonlinearSystemBase::addDiracKernel(), NonlinearSystemBase::addHDGKernel(), NonlinearSystemBase::addInterfaceKernel(), addKernel(), MooseEigenSystem::addKernel(), NonlinearSystemBase::addKernel(), SystemBase::addMatrix(), NonlinearSystemBase::addNodalKernel(), Moose::PetscSupport::addPetscOptionsFromCommandline(), addScalarKernel(), NonlinearSystemBase::addScalarKernel(), NonlinearSystemBase::addSplit(), SystemBase::addTimeIntegrator(), addVariable(), SystemBase::addVector(), DiffusionLHDGAssemblyHelper::checkCoupling(), SystemBase::closeTaggedVector(), LinearSystem::computeLinearSystemTags(), DisplacedProblem::DisplacedProblem(), SystemBase::getMatrix(), SystemBase::getMatrix(), NonlinearSystemBase::getSplit(), SystemBase::getVector(), SystemBase::getVector(), DisplacedSystem::getVector(), DisplacedSystem::getVector(), SystemBase::getVector(), SystemBase::getVector(), SystemBase::hasVector(), LinearSystem::initialSetup(), LinearFVGradientInterface::linearFVLimitedGradientContainer(), NonlinearEigenSystem::postAddResidualObject(), MooseStaticCondensationPreconditioner::prefix(), SystemBase::removeMatrix(), SystemBase::removeVector(), SystemBase::removeVector(), LinearFVGradientInterface::requestLinearFVLimitedGradients(), NonlinearSystemBase::setupScalingData(), SystemBase::solutionState(), LinearSystem::solve(), LinearTimeIntegratorInterface::timeDerivativeMatrixContribution(), LinearTimeIntegratorInterface::timeDerivativeRHSContribution(), and SystemBase::zeroTaggedVector().

◆ 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 901 of file AuxiliarySystem.C.

902{
903 return _elemental_aux_storage.hasActiveBoundaryObjects(bnd_id) ||
904 _elemental_vec_aux_storage.hasActiveBoundaryObjects(bnd_id);
905}

◆ needsLinearFVGradientStorage()

bool LinearFVGradientInterface::needsLinearFVGradientStorage ( ) const
protectedinherited

Definition at line 121 of file LinearFVGradientInterface.C.

122{
123 for (const auto * const field_var : _sys.variableWarehouse().fieldVariables())
124 if (field_var->needsGradientVectorStorage())
125 return true;
126
127 return false;
128}

Referenced by LinearFVGradientInterface::rebuildLinearFVGradientStorage().

◆ needSolutionState()

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

Registers that the solution state state is needed.

Reimplemented in DisplacedSystem.

Definition at line 1462 of file SystemBase.C.

1465{
1466 libmesh_parallel_only(this->comm());
1467 mooseAssert(!Threads::in_threads,
1468 "This routine is not thread-safe. Request the solution state before using it in "
1469 "a threaded region.");
1470
1471 if (hasSolutionState(state, iteration_type))
1472 return;
1473
1474 auto & solution_states = getSolutionStates(iteration_type);
1475 solution_states.resize(state + 1);
1476
1477 // The 0-th (current) solution state is owned by libMesh
1478 if (!solution_states[0])
1479 solution_states[0] = &solutionInternal();
1480 else
1481 mooseAssert(solution_states[0] == &solutionInternal(), "Inconsistent current solution");
1482
1483 // We will manually add all states past current
1484 for (unsigned int i = 1; i <= state; ++i)
1485 if (!solution_states[i])
1486 {
1487 auto tag = _subproblem.addVectorTag(oldSolutionStateVectorName(i, iteration_type),
1489 solution_states[i] = &addVector(tag, true, parallel_type);
1490 }
1491 else
1492 {
1493 // If the existing parallel type is PARALLEL and GHOSTED is now requested,
1494 // this would require an upgrade, which is risky if anybody has already
1495 // stored a pointer to the existing vector, since the upgrade would create
1496 // a new vector and make that pointer null. If the existing parallel type
1497 // is GHOSTED and PARALLEL is now requested, we don't need to do anything.
1498 if (parallel_type == GHOSTED && solutionStateParallelType(i, iteration_type) == PARALLEL)
1499 mooseError("The solution state has already been declared as PARALLEL");
1500
1501 mooseAssert(solution_states[i] == &getVector(oldSolutionStateVectorName(i, iteration_type)),
1502 "Inconsistent solution state");
1503 }
1504}
virtual TagID addVectorTag(const TagName &tag_name, const Moose::VectorTagType type=Moose::VECTOR_TAG_RESIDUAL)
Create a Tag.
Definition SubProblem.C:93
virtual NumericVector< Number > & solutionInternal() const =0
Internal getter for solution owned by libMesh.
TagName oldSolutionStateVectorName(const unsigned int, Moose::SolutionIterationType iteration_type) const
Gets the vector name used for an old (not current) solution state.
libMesh::ParallelType solutionStateParallelType(const unsigned int state, const Moose::SolutionIterationType iteration_type) const
Returns the parallel type of the given solution state.
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,...
const Parallel::Communicator & comm() const
@ VECTOR_TAG_SOLUTION

Referenced by PicardSolve::allocateStorage(), SecantSolve::allocateStorage(), EigenExecutionerBase::EigenExecutionerBase(), FEProblemSolve::initialSetup(), SystemBase::initSolutionState(), DisplacedSystem::needSolutionState(), and SystemBase::solutionState().

◆ 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 899 of file SystemBase.C.

900{
901 unsigned int n = 0;
902 for (auto & var : _vars[0].fieldVariables())
903 n += var->count();
904
905 return n;
906}

Referenced by SystemBase::nVariables().

◆ 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 909 of file SystemBase.C.

910{
911 unsigned int n = 0;
912 for (auto & var : _vars[0].fieldVariables())
913 if (var->isFV())
914 n += var->count();
915
916 return n;
917}

◆ nodalArrayAuxWarehouse()

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

Definition at line 253 of file AuxiliarySystem.h.

254{
256}

◆ nodalAuxWarehouse()

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

Definition at line 235 of file AuxiliarySystem.h.

236{
237 return _nodal_aux_storage;
238}

◆ nodalVectorAuxWarehouse()

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

Definition at line 247 of file AuxiliarySystem.h.

248{
250}

◆ nonTimeVectorTag()

virtual TagID SystemBase::nonTimeVectorTag ( ) const
inlinevirtualinherited

Reimplemented in DisplacedSystem, and NonlinearSystemBase.

Definition at line 321 of file SystemBase.h.

321{ mooseError("Not implemented yet"); }

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

◆ number()

unsigned int SystemBase::number ( ) const
inherited

Gets the number of this system.

Returns
The number of this system

Definition at line 1156 of file SystemBase.C.

1157{
1158 return system().number();
1159}

Referenced by SetupResidualDebugAction::act(), FEProblemBase::addCachedResidualDirectly(), FEProblemBase::addJacobian(), FEProblemBase::addJacobianBlockTags(), FEProblemBase::addJacobianLowerD(), FEProblemBase::addJacobianNeighbor(), FEProblemBase::addJacobianNeighborLowerD(), FEProblemBase::addJacobianOffDiagScalar(), FEProblemBase::addJacobianScalar(), FEProblemBase::addObjectParamsHelper(), FEProblemBase::addResidual(), FEProblemBase::addResidualLower(), FEProblemBase::addResidualNeighbor(), FEProblemBase::addResidualScalar(), SystemBase::addScalingVector(), ADKernelTempl< T >::ADKernelTempl(), ElementSubdomainModifierBase::applyIC(), ArrayKernel::ArrayKernel(), NonlinearSystemBase::assembleScalingVector(), NonlinearEigenSystem::attachPreconditioner(), DiffusionLHDGAssemblyHelper::checkCoupling(), SolverSystem::compute(), ComputeResidualAndJacobianThread::compute(), MooseVariableScalar::computeAD(), FEProblemBase::computeBounds(), Assembly::computeFaceMap(), InternalSideIndicatorBase::computeIndicator(), ArrayNodalBC::computeJacobian(), NodalBC::computeJacobian(), VectorNodalBC::computeJacobian(), FVFluxBC::computeJacobian(), FVInterfaceKernel::computeJacobian(), FVFluxKernel::computeJacobian(), FVBoundaryScalarLagrangeMultiplierConstraint::computeJacobian(), FEProblemBase::computeJacobianBlock(), NonlinearSystemBase::computeJacobianInternal(), LinearSystem::computeLinearSystemInternal(), FEProblemBase::computeNearNullSpace(), NonlinearSystemBase::computeNodalBCsJacobian(), NonlinearSystemBase::computeNodalBCsResidualAndJacobian(), FEProblemBase::computeNullSpace(), ArrayNodalBC::computeOffDiagJacobian(), NodalBC::computeOffDiagJacobian(), VectorNodalBC::computeOffDiagJacobian(), NodalKernel::computeOffDiagJacobian(), ComputeFullJacobianThread::computeOnBoundary(), ComputeFullJacobianThread::computeOnElement(), ComputeFullJacobianThread::computeOnInterface(), ComputeFullJacobianThread::computeOnInternalFace(), FEProblemBase::computePostCheck(), FVInterfaceKernel::computeResidual(), FVFluxKernel::computeResidual(), FVBoundaryScalarLagrangeMultiplierConstraint::computeResidual(), IntegratedBC::computeResidualAndJacobian(), NodalBC::computeResidualAndJacobian(), Kernel::computeResidualAndJacobian(), NonlinearSystemBase::computeResidualAndJacobianInternal(), NonlinearSystemBase::computeResidualInternal(), FEProblemBase::computeResidualL2Norm(), NonlinearSystemBase::computeResidualTags(), NonlinearSystemBase::computeScaling(), Assembly::computeSinglePointMapAD(), FEProblemBase::computeTransposeNullSpace(), DebugResidualAux::computeValue(), NearestNodeValueAux::computeValue(), SlepcEigenSolverConfiguration::configure_solver(), NonlinearSystemBase::constraintJacobians(), LinearSystem::containsTimeKernel(), Coupleable::coupled(), FEProblemBase::currentLinearSysNum(), FEProblemBase::currentNlSysNum(), PseudoTimestep::currentResidualNorm(), ComputeResidualAndJacobianThread::determineObjectWarehouses(), ComputeResidualThread::determineObjectWarehouses(), Moose::doDerivatives(), GreaterThanLessThanPostprocessor::execute(), VariableResidual::execute(), NodalNormalsCorner::execute(), NodalNormalsEvaluator::execute(), NodalNormalsPreprocessor::execute(), ExplicitTimeIntegrator::ExplicitTimeIntegrator(), InternalSideIndicatorBase::finalize(), NumNonlinearIterations::finalize(), NonlinearEigenSystem::finalNonlinearResidual(), BoundsBase::getDoFIndex(), NonlinearSystemBase::getFVSetupObjects(), NonlinearSystemBase::getNodeDofs(), NonlinearEigenSystem::getSNES(), SystemBase::getSubdomainsForVar(), NumLinearIterations::getValue(), NumResidualEvaluations::getValue(), Residual::getValue(), Moose::globalDofIndexToDerivative(), FVBoundaryCondition::hasFaceSide(), ExplicitTimeIntegrator::init(), AttribSysNum::initFrom(), AuxKernelBase::initialSetup(), LinearSystem::initialSetup(), NonlinearSystemBase::initialSetup(), ExplicitTimeIntegrator::initialSetup(), ActivateElementsUserObjectBase::initSolutions(), EigenExecutionerBase::inversePowerIteration(), MooseMesh::isTranslatedPeriodic(), Kernel::Kernel(), MooseMesh::minPeriodicDistance(), MooseMesh::minPeriodicVector(), Moose::SlepcSupport::mooseSlepcEigenFormFunctionA(), Moose::SlepcSupport::mooseSlepcEigenFormFunctionAB(), Moose::SlepcSupport::mooseSlepcEigenFormFunctionB(), Moose::SlepcSupport::mooseSlepcEigenFormJacobianA(), MooseStaticCondensationPreconditioner::MooseStaticCondensationPreconditioner(), NonlinearEigenSystem::nLinearIterations(), NonlinearEigenSystem::nNonlinearIterations(), EigenExecutionerBase::nonlinearSolve(), ComputeDiracThread::onElement(), ComputeNodalKernelBCJacobiansThread::onNode(), ComputeNodalKernelJacobiansThread::onNode(), VariableResidualNormsDebugOutput::output(), Moose::PetscSupport::petscLinearConverged(), Moose::PetscSupport::petscNonlinearConverged(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), PointwiseRenormalizeVector::PointwiseRenormalizeVector(), FEProblemBase::prepare(), FEProblemBase::prepareAssembly(), FEProblemBase::prepareAssemblyNeighbor(), SystemBase::prepareFace(), FEProblemBase::prepareFaceShapes(), FEProblemBase::prepareNeighborShapes(), FEProblemBase::prepareShapes(), MooseMesh::queryPeriodicDimensions(), FEProblemBase::reinitDirac(), FEProblemBase::reinitNeighborPhys(), FEProblemBase::reinitNeighborPhys(), FEProblemBase::reinitOffDiagScalars(), NonlinearSystem::residualAndJacobianTogether(), FEProblemBase::setResidual(), FEProblemBase::setResidualNeighbor(), PhysicsBasedPreconditioner::setup(), FVInterfaceKernel::setupData(), NonlinearSystemBase::shouldEvaluatePreSMOResidual(), NonlinearEigenSystem::solve(), ActuallyExplicitEuler::solve(), AStableDirk4::solve(), ExplicitRK2::solve(), ExplicitTVDRK2::solve(), ImplicitMidpoint::solve(), LStableDirk2::solve(), LStableDirk3::solve(), LStableDirk4::solve(), ExplicitSSPRungeKutta::solveStage(), UserObjectBase::systemNumber(), MultiAppDofCopyTransfer::transferDofObject(), FVQpFluxBC::uOnGhost(), FVQpFluxBC::uOnUSub(), FVFluxBC::updateCurrentFace(), NodalDamper::variableDefinedOnNode(), and MortarConstraintBase::zeroInactiveLMDofs().

◆ nVariables()

unsigned int SystemBase::nVariables ( ) const
virtualinherited

Get the number of variables in this system.

Returns
the number of variables

Definition at line 890 of file SystemBase.C.

891{
892 unsigned int n = nFieldVariables();
893 n += _vars[0].scalars().size();
894
895 return n;
896}
unsigned int nFieldVariables() const
Get the number of field variables in this system.
Definition SystemBase.C:899

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

◆ oldSolutionStateVectorName()

TagName SystemBase::oldSolutionStateVectorName ( const unsigned int  state,
Moose::SolutionIterationType  iteration_type 
) const
privateinherited

Gets the vector name used for an old (not current) solution state.

Definition at line 1378 of file SystemBase.C.

1380{
1381 mooseAssert(state != 0, "Not an old state");
1382 mooseAssert(static_cast<unsigned short>(iteration_type) <
1383 static_cast<unsigned short>(Moose::SolutionIterationType::Count),
1384 "Invalid iteration_type");
1385
1386 switch (iteration_type)
1387 {
1389 if (state == 1)
1391 else if (state == 2)
1393 break;
1395 if (state == 1)
1397 break;
1399 if (state == 1)
1401 break;
1403 if (state == 1)
1405 break;
1407 break;
1408 }
1409
1410 return "solution_state_" + std::to_string(state) + "_" + Moose::stringify(iteration_type);
1411}
const TagName PREVIOUS_MULTISYSTEM_FP_SOLUTION_TAG
Definition MooseTypes.C:30
const TagName OLDER_SOLUTION_TAG
Definition MooseTypes.C:27
const TagName PREVIOUS_NL_SOLUTION_TAG
Definition MooseTypes.C:28
const TagName PREVIOUS_MULTIAPP_FP_SOLUTION_TAG
Definition MooseTypes.C:29
const TagName OLD_SOLUTION_TAG
Definition MooseTypes.C:26

Referenced by SystemBase::needSolutionState(), and SystemBase::solutionState().

◆ perfGraph()

PerfGraph & PerfGraphInterface::perfGraph ( )
inherited

Get the PerfGraph.

Definition at line 86 of file PerfGraphInterface.C.

87{
88 return _pg_moose_app.perfGraph();
89}
PerfGraph & perfGraph()
Get the PerfGraph for this app.
Definition MooseApp.h:179
MooseApp & _pg_moose_app
The MooseApp that owns the PerfGraph.

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

◆ postInit()

virtual void SystemBase::postInit ( )
inlinevirtualinherited

Reimplemented in NonlinearEigenSystem.

Definition at line 163 of file SystemBase.h.

163{}

Referenced by NonlinearEigenSystem::postInit().

◆ prefix()

std::string SystemBase::prefix ( ) const
inherited
Returns
The prefix used for this system for solver settings for PETSc. This prefix is used to prevent collision of solver settings for different systems. Note that this prefix does not have a leading dash so it's appropriate for passage straight to PETSc APIs

Definition at line 1712 of file SystemBase.C.

1713{
1714 return system().prefix_with_name() ? system().prefix() : "";
1715}
void prefix_with_name(bool value)
std::string prefix() const

Referenced by FieldSplitPreconditioner::FieldSplitPreconditioner(), MoosePreconditioner::initialSetup(), and FieldSplitPreconditioner::prefix().

◆ preInit()

virtual void SystemBase::preInit ( )
inlinevirtualinherited

This is called prior to the libMesh system has been init'd.

MOOSE system wrappers can use this method to add vectors and matrices to the libMesh system

Reimplemented in LinearSystem, NonlinearSystemBase, and SolverSystem.

Definition at line 157 of file SystemBase.h.

157{}

Referenced by SolverSystem::preInit().

◆ prepare()

void SystemBase::prepare ( THREAD_ID  tid)
virtualinherited

Prepare the system for use.

Parameters
tidID of the thread

Definition at line 257 of file SystemBase.C.

258{
260 {
261 const std::set<MooseVariableFieldBase *> & active_elemental_moose_variables =
263 const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
264 for (const auto & var : vars)
265 var->clearDofIndices();
266
267 for (const auto & var : active_elemental_moose_variables)
268 if (&(var->sys()) == this)
269 var->prepare();
270 }
271 else
272 {
273 const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
274 for (const auto & var : vars)
275 var->prepare();
276 }
277}
virtual const std::set< MooseVariableFieldBase * > & getActiveElementalMooseVariables(const THREAD_ID tid) const
Get the MOOSE variables to be reinited on each element.
Definition SubProblem.C:455
virtual bool hasActiveElementalMooseVariables(const THREAD_ID tid) const
Whether or not a list of active elemental moose variables has been set.
Definition SubProblem.C:461
virtual void prepare(THREAD_ID tid)
Prepare the system for use.
Definition SystemBase.C:257

Referenced by SubProblem::reinitElemFaceRef().

◆ 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 280 of file SystemBase.C.

281{
282 // We only need to do something if the element prepare was restricted
284 {
285 const std::set<MooseVariableFieldBase *> & active_elemental_moose_variables =
287
288 std::vector<MooseVariableFieldBase *> newly_prepared_vars;
289
290 const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
291 for (const auto & var : vars)
292 {
293 mooseAssert(&var->sys() == this,
294 "I will cry if we store variables in our warehouse that don't belong to us");
295
296 // If it wasn't in the active list, we need to prepare it. This has the potential to duplicate
297 // prepare if we have these conditions:
298 //
299 // 1. We have a displaced problem
300 // 2. We are using AD
301 // 3. We are not using global AD indexing
302 //
303 // But I think I would rather risk duplicate prepare than introduce an additional member set
304 // variable for tracking prepared variables. Set insertion is slow and some simulations have a
305 // ton of variables
306 if (!active_elemental_moose_variables.count(var))
307 {
308 var->prepare();
309 newly_prepared_vars.push_back(var);
310 }
311 }
312
313 // Make sure to resize the residual and jacobian datastructures for all the new variables
314 if (resize_data)
315 for (const auto var_ptr : newly_prepared_vars)
316 {
320 }
321 }
322}
void prepareVariableNonlocal(MooseVariableFieldBase *var)
Definition Assembly.C:2782
void prepareVariable(MooseVariableFieldBase *var)
Used for preparing the dense residual and jacobian blocks for one particular variable.
Definition Assembly.C:2752
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num)=0
virtual bool checkNonlocalCouplingRequirement() const =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 333 of file SystemBase.C.

334{
335 const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
336 for (const auto & var : vars)
337 var->prepareLowerD();
338}
virtual void prepareLowerD(THREAD_ID tid)
Prepare the system for use for lower dimensional elements.
Definition SystemBase.C:333

Referenced by SubProblem::reinitLowerDElem().

◆ prepareNeighbor()

void SystemBase::prepareNeighbor ( THREAD_ID  tid)
virtualinherited

Prepare the system for use.

Parameters
tidID of the thread

Definition at line 325 of file SystemBase.C.

326{
327 const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
328 for (const auto & var : vars)
329 var->prepareNeighbor();
330}
virtual void prepareNeighbor(THREAD_ID tid)
Prepare the system for use.
Definition SystemBase.C:325

Referenced by SubProblem::reinitNeighborFaceRef().

◆ queryTimeIntegrator()

const TimeIntegrator * SystemBase::queryTimeIntegrator ( const unsigned int  var_num) const
inherited

Retrieve the time integrator that integrates the given variable's equation.

If no suitable time integrator is found (this could happen for instance if we're solving a non-transient problem), then a nullptr will be returned

Definition at line 1672 of file SystemBase.C.

1673{
1674 for (auto & ti : _time_integrators)
1675 if (ti->integratesVar(var_num))
1676 return ti.get();
1677
1678 return nullptr;
1679}
const Elem & get(const ElemType type_in)

Referenced by SystemBase::getTimeIntegrator(), HDGKernel::HDGKernel(), and MooseVariableData< OutputType >::MooseVariableData().

◆ rawLinearFVLimitedGradientContainer()

std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > & LinearFVGradientInterface::rawLinearFVLimitedGradientContainer ( const Moose::FV::GradientLimiterType  limiter_type)
inlineprotectedinherited

Access the persisted limited-gradient storage for a specific limiter.

Parameters
limiter_typeThe limiter type whose persisted storage is being accessed.
Returns
The persisted limited-gradient vectors keyed by spatial direction.

Definition at line 117 of file LinearFVGradientInterface.h.

118 {
119 return _raw_limited_grad_containers[limiter_type];
120 }

Referenced by LinearSystem::computeGradients().

◆ rebuildLinearFVGradientStorage()

void LinearFVGradientInterface::rebuildLinearFVGradientStorage ( )
protectedinherited

Rebuild persistent raw and temporary gradient storage after mesh/DOF changes.

Definition at line 142 of file LinearFVGradientInterface.C.

143{
144 _raw_grad_container.clear();
145 _temporary_gradient.clear();
148
150 return;
151
154
155 for (const auto limiter_type : _requested_limited_gradient_types)
156 {
157 if (limiter_type == Moose::FV::GradientLimiterType::None)
158 continue;
159
162 }
163}
std::unordered_map< Moose::FV::GradientLimiterType, std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > > _temporary_limited_gradient
Scratch storage for limited gradients assembled during the current compute pass.
void initializeContainer(std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > &container) const
std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > _temporary_gradient
Scratch storage for raw gradients assembled during the current compute pass.
std::unordered_set< Moose::FV::GradientLimiterType > _requested_limited_gradient_types
Set of requested limiter types for which limited gradients should be computed.

Referenced by AuxiliarySystem(), LinearSystem::initialSetup(), reinit(), and LinearSystem::reinit().

◆ 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 61 of file PerfGraphInterface.C.

63{
64 const auto timed_section_name = timedSectionName(section_name);
65 if (!moose::internal::getPerfGraphRegistry().sectionExists(timed_section_name))
66 return moose::internal::getPerfGraphRegistry().registerSection(timed_section_name, level);
67 else
68 return moose::internal::getPerfGraphRegistry().sectionID(timed_section_name);
69}
std::string timedSectionName(const std::string &section_name) const
PerfID sectionID(const std::string &section_name) const
Given a name return the PerfID @section_name The name of the section.
PerfID registerSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
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 72 of file PerfGraphInterface.C.

76{
77 const auto timed_section_name = timedSectionName(section_name);
78 if (!moose::internal::getPerfGraphRegistry().sectionExists(timed_section_name))
80 timedSectionName(section_name), level, live_message, print_dots);
81 else
82 return moose::internal::getPerfGraphRegistry().sectionID(timed_section_name);
83}

◆ reinit()

void AuxiliarySystem::reinit ( )
overridevirtual

Reinitialize the system when the degrees of freedom in this system have changed.

This is called after the libMesh system has been reinit'd

Reimplemented from SystemBase.

Definition at line 120 of file AuxiliarySystem.C.

◆ 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 382 of file AuxiliarySystem.C.

383{
384 for (auto * var : _nodal_vars[tid])
385 var->computeElemValues();
386
387 for (auto * var : _elem_vars[tid])
388 {
389 var->reinitAux();
390 var->computeElemValues();
391 }
392}

◆ reinitElemFace()

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

Reinit assembly info for a side of an element.

Parameters
elemThe element
sideSide of of the element
tidThread ID

Reimplemented from SystemBase.

Definition at line 395 of file AuxiliarySystem.C.

396{
397 for (auto * var : _nodal_vars[tid])
398 var->computeElemValuesFace();
399
400 for (auto * var : _elem_vars[tid])
401 {
402 var->reinitAux();
403 var->reinitAuxNeighbor();
404 var->computeElemValuesFace();
405 }
406}

◆ reinitLowerD()

void SystemBase::reinitLowerD ( THREAD_ID  tid)
virtualinherited

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

Definition at line 391 of file SystemBase.C.

392{
393 const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
394 for (const auto & var : vars)
395 var->computeLowerDValues();
396}

Referenced by SubProblem::reinitLowerDElem().

◆ 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 383 of file SystemBase.C.

384{
385 const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
386 for (const auto & var : vars)
387 var->computeNeighborValues();
388}

◆ reinitNeighborFace()

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

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

Definition at line 375 of file SystemBase.C.

376{
377 const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
378 for (const auto & var : vars)
379 var->computeNeighborValuesFace();
380}

Referenced by SubProblem::reinitNeighborFaceRef().

◆ 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 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}

◆ 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

Reimplemented in NonlinearSystemBase.

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->reinitNode();
417 if (var->isNodalDefined())
418 var->computeNodalValues();
419 }
420}

◆ 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 423 of file SystemBase.C.

424{
425 const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
426 for (const auto & var : vars)
427 {
428 var->reinitNodes(nodes);
429 var->computeNodalValues();
430 }
431}

◆ 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 434 of file SystemBase.C.

435{
436 const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
437 for (const auto & var : vars)
438 {
439 var->reinitNodesNeighbor(nodes);
440 var->computeNodalNeighborValues();
441 }
442}

◆ 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 445 of file SystemBase.C.

446{
447 const std::vector<MooseVariableScalar *> & vars = _vars[tid].scalars();
448 for (const auto & var : vars)
449 var->reinit(reinit_for_derivative_reordering);
450}
virtual void reinit()
Reinitialize the system when the degrees of freedom in this system have changed.
Definition SystemBase.h:169

◆ removeMatrix()

void SystemBase::removeMatrix ( TagID  tag)
inherited

Removes a matrix with a given tag.

Parameters
tag_nameThe name of the tag

Definition at line 589 of file SystemBase.C.

590{
591 if (!_subproblem.matrixTagExists(tag_id))
592 mooseError("Cannot remove the matrix with TagID ",
593 tag_id,
594 "\nin system '",
595 name(),
596 "', because that tag does not exist in the problem");
597
598 if (hasMatrix(tag_id))
599 {
600 const auto matrix_name = _subproblem.matrixTagName(tag_id);
601 system().remove_matrix(matrix_name);
602 _tagged_matrices[tag_id] = nullptr;
603 }
604}
void remove_matrix(std::string_view mat_name)

◆ removeVector() [1/2]

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

Remove a vector from the system with the given name.

Definition at line 1331 of file SystemBase.C.

1332{
1334}
void remove_vector(std::string_view vec_name)

Referenced by SystemBase::restoreOldSolutions().

◆ 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 699 of file SystemBase.C.

700{
701 if (!_subproblem.vectorTagExists(tag_id))
702 mooseError("Cannot remove the vector with TagID ",
703 tag_id,
704 "\nin system '",
705 name(),
706 "', because that tag does not exist in the problem");
707
708 if (hasVector(tag_id))
709 {
710 auto vector_name = _subproblem.vectorTagName(tag_id);
711 system().remove_vector(vector_name);
712 _tagged_vectors[tag_id] = nullptr;
713 }
714}

◆ requestedLinearFVLimitedGradientTypes()

const std::unordered_set< Moose::FV::GradientLimiterType > & LinearFVGradientInterface::requestedLinearFVLimitedGradientTypes ( ) const
inlineinherited

Access the limiter types requested for this system.

Returns
The set of limiter types whose limited gradients should be assembled. They are only assembled for the variable(s) for which they were requested not all of them

Definition at line 72 of file LinearFVGradientInterface.h.

73 {
75 }

Referenced by LinearSystem::computeGradients().

◆ requestedLinearFVLimitedGradientVariables()

const std::unordered_set< unsigned int > & LinearFVGradientInterface::requestedLinearFVLimitedGradientVariables ( const Moose::FV::GradientLimiterType  limiter_type) const
inlineprotectedinherited

Access the variable numbers that requested limited gradients for a specific limiter.

Parameters
limiter_typeThe limiter type whose request set is being accessed.
Returns
The set of variable numbers that requested the limiter.

Definition at line 128 of file LinearFVGradientInterface.h.

129 {
130 return libmesh_map_find(_requested_limited_gradient_variables, limiter_type);
131 }
std::unordered_map< Moose::FV::GradientLimiterType, std::unordered_set< unsigned int > > _requested_limited_gradient_variables
Variable numbers requesting limited gradients, keyed by limiter type.

Referenced by LinearSystem::computeGradients().

◆ requestLinearFVLimitedGradients()

void LinearFVGradientInterface::requestLinearFVLimitedGradients ( const Moose::FV::GradientLimiterType  limiter_type,
unsigned int  variable_number 
)

Request storage and assembly of limiter-specific cell gradients.

Parameters
limiter_typeThe limiter whose gradient storage should be made available.
variable_numberThe libMesh variable number requesting the limited gradients.

Definition at line 55 of file LinearFVGradientInterface.C.

168{
169 if (limiter_type == Moose::FV::GradientLimiterType::None)
170 return;
171
172 auto * const variable =
173 dynamic_cast<MooseVariableFieldBase *>(_sys.variableWarehouse().getVariable(variable_number));
174 if (!variable)
175 mooseError("Limited gradients were requested for variable number ",
176 variable_number,
177 " on system '",
178 _sys.name(),
179 "', but no field variable with that number exists on the system.");
180
181 if (!variable->needsGradientVectorStorage())
182 mooseError("Limited gradients were requested for variable '",
183 variable->name(),
184 "' on system '",
185 _sys.name(),
186 "', but regular gradients were not requested for that variable.");
187
188 _requested_limited_gradient_variables[limiter_type].insert(variable_number);
189
190 if (_requested_limited_gradient_types.insert(limiter_type).second && !_raw_grad_container.empty())
191 {
194 }
195}

◆ residualCopy()

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

Reimplemented in DisplacedSystem, and NonlinearSystemBase.

Definition at line 445 of file SystemBase.h.

446 {
447 mooseError("This system does not support getting a copy of the residual");
448 }

Referenced by DisplacedSystem::residualCopy().

◆ residualGhosted()

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

Reimplemented in DisplacedSystem, and NonlinearSystemBase.

Definition at line 449 of file SystemBase.h.

450 {
451 mooseError("This system does not support getting a ghosted copy of the residual");
452 }

Referenced by DisplacedSystem::residualGhosted().

◆ residualSetup()

void AuxiliarySystem::residualSetup ( )
overridevirtual

Reimplemented from SystemBase.

Definition at line 214 of file AuxiliarySystem.C.

215{
217
218 for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
219 {
221 _nodal_aux_storage.residualSetup(tid);
222 _mortar_nodal_aux_storage.residualSetup(tid);
223 _nodal_vec_aux_storage.residualSetup(tid);
224 _nodal_array_aux_storage.residualSetup(tid);
225 _elemental_aux_storage.residualSetup(tid);
226 _elemental_vec_aux_storage.residualSetup(tid);
227 _elemental_array_aux_storage.residualSetup(tid);
228 }
229
230#ifdef MOOSE_KOKKOS_ENABLED
233#endif
234}
void residualSetup(THREAD_ID tid=0) const override
virtual void residualSetup()

◆ residualVectorTag()

virtual TagID SystemBase::residualVectorTag ( ) const
inlinevirtualinherited

Reimplemented in DisplacedSystem, and NonlinearSystemBase.

Definition at line 326 of file SystemBase.h.

326{ mooseError("Not implemented yet"); }

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

◆ restoreOldSolutions()

void SystemBase::restoreOldSolutions ( )
virtualinherited

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

Definition at line 542 of file SystemBase.C.

543{
545 if (num_states > 1)
546 for (unsigned int i = 1; i <= num_states - 1; ++i)
548 {
550 removeVector("save_solution_state_" + std::to_string(i));
551 _saved_solution_states[i] = nullptr;
552 }
553
555 {
557 removeVector("save_solution_dot_old");
558 _saved_dot_old = nullptr;
559 }
561 {
563 removeVector("save_solution_dotdot_old");
564 _saved_dotdot_old = nullptr;
565 }
566}
void removeVector(const std::string &name)
Remove a vector from the system with the given name.
NumericVector< Real > * _saved_dotdot_old
NumericVector< Real > * _saved_dot_old
std::vector< NumericVector< Number > * > _saved_solution_states
The saved solution states (0 = current, 1 = old, 2 = older, etc)

◆ restoreSolutions()

void SystemBase::restoreSolutions ( )
virtualinherited

Restore current solutions (call after your solve failed)

Reimplemented in SolverSystem.

Definition at line 1314 of file SystemBase.C.

1315{
1316 if (!hasSolutionState(1))
1317 mooseError("Cannot restore solutions without old solution");
1318
1319 *(const_cast<NumericVector<Number> *&>(currentSolution())) = solutionOld();
1320 solution() = solutionOld();
1321 if (solutionUDotOld())
1323 if (solutionUDotDotOld())
1327 system().update();
1328}
NumericVector< Number > & solutionOld()
Definition SystemBase.h:204

Referenced by SolverSystem::restoreSolutions().

◆ saveOldSolutions()

void SystemBase::saveOldSolutions ( )
virtualinherited

Save the old and older solutions.

Definition at line 511 of file SystemBase.C.

512{
514 if (num_states > 1)
515 {
516 _saved_solution_states.resize(num_states);
517 for (unsigned int i = 1; i <= num_states - 1; ++i)
520 &addVector("save_solution_state_" + std::to_string(i), false, PARALLEL);
521
522 for (unsigned int i = 1; i <= num_states - 1; ++i)
524 }
525
527 _saved_dot_old = &addVector("save_solution_dot_old", false, PARALLEL);
529 _saved_dotdot_old = &addVector("save_solution_dotdot_old", false, PARALLEL);
530
531 if (solutionUDotOld())
533
534 if (solutionUDotDotOld())
536}

◆ serializedSolution()

NumericVector< Number > & SystemBase::serializedSolution ( )
virtualinherited

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

Reimplemented in DisplacedSystem.

Definition at line 1645 of file SystemBase.C.

1646{
1647 if (!_serialized_solution.get())
1648 {
1650 _serialized_solution->init(system().n_dofs(), false, SERIAL);
1651 }
1652
1653 return *_serialized_solution;
1654}
static std::unique_ptr< NumericVector< T > > build(const Parallel::Communicator &comm, SolverPackage solver_package=libMesh::default_solver_package(), ParallelType parallel_type=AUTOMATIC)
const Parallel::Communicator & _communicator

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

◆ serializeSolution()

void AuxiliarySystem::serializeSolution ( )
virtual

Definition at line 409 of file AuxiliarySystem.C.

410{
411 if (_serialized_solution.get() &&
412 _sys.n_dofs() > 0) // libMesh does not like serializing of empty vectors
413 {
414 if (!_serialized_solution->initialized() || _serialized_solution->size() != _sys.n_dofs())
415 {
416 _serialized_solution->clear();
417 _serialized_solution->init(_sys.n_dofs(), false, SERIAL);
418 }
419
421 }
422}
virtual void localize(std::vector< T > &v_local) const=0
dof_id_type n_dofs() const

Referenced by compute().

◆ 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 1625 of file SystemBase.C.

1627{
1628 _vars[tid].setActiveScalarVariableCoupleableVectorTags(vtags);
1629}

Referenced by SubProblem::setActiveScalarVariableCoupleableVectorTags().

◆ setActiveVariableCoupleableVectorTags()

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

Set the active vector tags for the variables.

Definition at line 1619 of file SystemBase.C.

1620{
1621 _vars[tid].setActiveVariableCoupleableVectorTags(vtags);
1622}

Referenced by SubProblem::setActiveFEVariableCoupleableVectorTags().

◆ setScalarVariableCoupleableTags()

void AuxiliarySystem::setScalarVariableCoupleableTags ( ExecFlagType  type)

Definition at line 698 of file AuxiliarySystem.C.

699{
701 const std::vector<std::shared_ptr<AuxScalarKernel>> & objects = storage.getActiveObjects(0);
702
703 std::set<TagID> needed_sc_var_matrix_tags;
704 std::set<TagID> needed_sc_var_vector_tags;
705 for (const auto & obj : objects)
706 {
707 auto & sc_var_coup_vtags = obj->getScalarVariableCoupleableVectorTags();
708 needed_sc_var_vector_tags.insert(sc_var_coup_vtags.begin(), sc_var_coup_vtags.end());
709
710 auto & sc_var_coup_mtags = obj->getScalarVariableCoupleableMatrixTags();
711 needed_sc_var_matrix_tags.insert(sc_var_coup_mtags.begin(), sc_var_coup_mtags.end());
712 }
713
714 _fe_problem.setActiveScalarVariableCoupleableMatrixTags(needed_sc_var_matrix_tags, 0);
715 _fe_problem.setActiveScalarVariableCoupleableVectorTags(needed_sc_var_vector_tags, 0);
716}
virtual void setActiveScalarVariableCoupleableVectorTags(std::set< TagID > &vtags, const THREAD_ID tid) override
virtual void setActiveScalarVariableCoupleableMatrixTags(std::set< TagID > &mtags, const THREAD_ID tid) override

Referenced by computeScalarVars().

◆ 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 187 of file SystemBase.C.

188{
189 AllLocalDofIndicesThread aldit(_subproblem, {var_name});
190 const ConstElemRange & elem_range = *_mesh.getActiveLocalElementRange();
191 Threads::parallel_reduce(elem_range, aldit);
192
193 // Gather the dof indices across procs to get all the dof indices for var_name
194 aldit.dofIndicesSetUnion();
195
196 const auto & all_dof_indices = aldit.getDofIndices();
197 _var_all_dof_indices.assign(all_dof_indices.begin(), all_dof_indices.end());
198}
Grab all the (possibly semi)local dof indices for the variables passed in, in the system passed in.

◆ setVerboseFlag()

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

Sets the verbose flag.

Parameters
[in]verboseVerbose flag

Definition at line 135 of file SystemBase.h.

135{ _verbose = verbose; }

Referenced by Executioner::Executioner().

◆ sizeVariableMatrixData()

void SystemBase::sizeVariableMatrixData ( )
inherited

size the matrix data for each variable for the number of matrix tags we have

Definition at line 1718 of file SystemBase.C.

1719{
1720 for (const auto & warehouse : _vars)
1721 for (const auto & [var_num, var_ptr] : warehouse.numberToVariableMap())
1722 var_ptr->sizeMatrixTagData();
1723}

◆ skipNextSolutionToOldCopy()

void SystemBase::skipNextSolutionToOldCopy ( )
inlineinherited

Skip the next copy from the solution vector to the old solution vector old -> older is still performed.

Definition at line 991 of file SystemBase.h.

◆ solution() [1/2]

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

Definition at line 203 of file SystemBase.h.

203{ return solutionState(0); }

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

◆ solution() [2/2]

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

Definition at line 206 of file SystemBase.h.

206{ return solutionState(0); }

◆ solutionInternal()

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

Internal getter for solution owned by libMesh.

Implements SystemBase.

Definition at line 231 of file AuxiliarySystem.h.

231{ return *_sys.solution; }
std::unique_ptr< NumericVector< Number > > solution

◆ solutionOld() [1/2]

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

◆ solutionOld() [2/2]

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

Definition at line 207 of file SystemBase.h.

207{ return solutionState(1); }

◆ solutionOlder() [1/2]

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

◆ solutionOlder() [2/2]

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

Definition at line 208 of file SystemBase.h.

208{ return solutionState(2); }

◆ solutionPreviousNewton() [1/2]

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

Reimplemented in DisplacedSystem.

Definition at line 1343 of file SystemBase.C.

1344{
1347 else
1348 return nullptr;
1349}

◆ solutionPreviousNewton() [2/2]

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

Reimplemented in DisplacedSystem.

Definition at line 1352 of file SystemBase.C.

1353{
1356 else
1357 return nullptr;
1358}

Referenced by copyCurrentIntoPreviousNL(), SystemBase::copyPreviousSolutions(), and SystemBase::restoreSolutions().

◆ 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 1444 of file SystemBase.C.

1446{
1447 if (!hasSolutionState(state, iteration_type))
1448 needSolutionState(state, iteration_type);
1449 return *getSolutionStates(iteration_type)[state];
1450}

Referenced by SolverSystem::applyFixedPointRelaxation(), SystemBase::copyPreviousSolutions(), PointwiseRenormalizeVector::execute(), PointwiseRenormalizeVector::finalize(), MooseVariableBase::getSolution(), SystemBase::restoreOldSolutions(), SystemBase::saveOldSolutions(), SystemBase::solution(), SystemBase::solution(), SystemBase::solutionOld(), SystemBase::solutionOld(), SystemBase::solutionOlder(), SystemBase::solutionOlder(), DisplacedSystem::solutionState(), and DisplacedSystem::solutionState().

◆ 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 1414 of file SystemBase.C.

1416{
1417 if (!hasSolutionState(state, iteration_type))
1418 {
1419 const auto num_states = getNumSolutionStates(iteration_type);
1420 mooseError("For iteration type '",
1421 Moose::stringify(iteration_type),
1422 "': solution state ",
1423 state,
1424 " was requested in ",
1425 name(),
1426 " but only up to state ",
1427 (num_states == 0) ? 0 : num_states - 1,
1428 " is available.");
1429 }
1430
1431 const auto & solution_states = getSolutionStates(iteration_type);
1432
1433 if (state == 0)
1434 mooseAssert(solution_states[0] == &solutionInternal(), "Inconsistent current solution");
1435 else
1436 mooseAssert(solution_states[state] ==
1437 &getVector(oldSolutionStateVectorName(state, iteration_type)),
1438 "Inconsistent solution state");
1439
1440 return *solution_states[state];
1441}

◆ solutionStateParallelType()

libMesh::ParallelType SystemBase::solutionStateParallelType ( const unsigned int  state,
const Moose::SolutionIterationType  iteration_type 
) const
inherited

Returns the parallel type of the given solution state.

Definition at line 1453 of file SystemBase.C.

1455{
1456 if (!hasSolutionState(state, iteration_type))
1457 mooseError("solutionStateParallelType() may only be called if the solution state exists.");
1458 return getSolutionStates(iteration_type)[state]->type();
1459}

Referenced by SolverSystem::applyFixedPointRelaxation(), and SystemBase::needSolutionState().

◆ 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 917 of file SystemBase.h.

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

◆ solutionUDot() [1/2]

virtual NumericVector< Number > * SystemBase::solutionUDot ( )
inlinevirtualinherited

◆ solutionUDot() [2/2]

virtual const NumericVector< Number > * SystemBase::solutionUDot ( ) const
inlinevirtualinherited

Reimplemented in DisplacedSystem.

Definition at line 284 of file SystemBase.h.

284{ return _u_dot; }

◆ solutionUDotDot() [1/2]

virtual NumericVector< Number > * SystemBase::solutionUDotDot ( )
inlinevirtualinherited

◆ solutionUDotDot() [2/2]

virtual const NumericVector< Number > * SystemBase::solutionUDotDot ( ) const
inlinevirtualinherited

Reimplemented in DisplacedSystem.

Definition at line 285 of file SystemBase.h.

285{ return _u_dotdot; }

◆ solutionUDotDotOld() [1/2]

virtual NumericVector< Number > * SystemBase::solutionUDotDotOld ( )
inlinevirtualinherited

◆ solutionUDotDotOld() [2/2]

virtual const NumericVector< Number > * SystemBase::solutionUDotDotOld ( ) const
inlinevirtualinherited

Reimplemented in DisplacedSystem.

Definition at line 287 of file SystemBase.h.

287{ return _u_dotdot_old; }

◆ solutionUDotOld() [1/2]

virtual NumericVector< Number > * SystemBase::solutionUDotOld ( )
inlinevirtualinherited

◆ solutionUDotOld() [2/2]

virtual const NumericVector< Number > * SystemBase::solutionUDotOld ( ) const
inlinevirtualinherited

Reimplemented in DisplacedSystem.

Definition at line 286 of file SystemBase.h.

286{ return _u_dot_old; }

◆ solve()

void SystemBase::solve ( )
virtualinherited

Solve the system (using libMesh magic)

Reimplemented in DumpObjectsLinearSystem, DumpObjectsNonlinearSystem, LinearSystem, NonlinearEigenSystem, NonlinearSystem, and NonlinearSystemBase.

Definition at line 1248 of file SystemBase.C.

1249{
1250 system().solve();
1251}
virtual void solve()

◆ subdomainSetup()

void AuxiliarySystem::subdomainSetup ( )
overridevirtual

Reimplemented from SystemBase.

Definition at line 173 of file AuxiliarySystem.C.

174{
176
177 for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
178 {
180 _nodal_aux_storage.subdomainSetup(tid);
181 _mortar_nodal_aux_storage.subdomainSetup(tid);
182 _nodal_vec_aux_storage.subdomainSetup(tid);
183 _nodal_array_aux_storage.subdomainSetup(tid);
184 _elemental_aux_storage.subdomainSetup(tid);
185 _elemental_vec_aux_storage.subdomainSetup(tid);
186 _elemental_array_aux_storage.subdomainSetup(tid);
187 }
188}
virtual void subdomainSetup(THREAD_ID tid=0) const
virtual void subdomainSetup()

◆ subproblem() [1/2]

SubProblem & SystemBase::subproblem ( )
inlineinherited

◆ subproblem() [2/2]

const SubProblem & SystemBase::subproblem ( ) const
inlineinherited

Definition at line 103 of file SystemBase.h.

103{ return _subproblem; }

◆ sys()

virtual libMesh::System & AuxiliarySystem::sys ( )
inlinevirtual

Definition at line 134 of file AuxiliarySystem.h.

134{ return _sys; }

◆ system() [1/2]

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

Implements SystemBase.

Definition at line 137 of file AuxiliarySystem.h.

137{ return _sys; }

◆ system() [2/2]

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

◆ systemMatrixTag()

virtual TagID SystemBase::systemMatrixTag ( ) const
inlinevirtualinherited

Return the Matrix Tag ID for System.

Reimplemented in DisplacedSystem, LinearSystem, and NonlinearSystemBase.

Definition at line 316 of file SystemBase.h.

316{ mooseError("Not implemented yet"); }

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

◆ temporaryLinearFVGradientContainer()

std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > & LinearFVGradientInterface::temporaryLinearFVGradientContainer ( )
inlineprotectedinherited

Return temporary storage for gradients during gradient assembly.

The returned vectors are persistent scratch storage reused across calls and swapped with the final gradient container before gradient assembly returns.

Definition at line 94 of file LinearFVGradientInterface.h.

95 {
97 }

Referenced by LinearFVGradientInterface::computeGradients().

◆ temporaryLinearFVLimitedGradientContainer()

std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > > & LinearFVGradientInterface::temporaryLinearFVLimitedGradientContainer ( const Moose::FV::GradientLimiterType  limiter_type)
inlineprotectedinherited

Return temporary storage for limited gradients during gradient assembly.

The returned vectors are persistent scratch storage reused across calls and swapped with the final limited-gradient container before gradient assembly returns.

Parameters
limiter_typeThe limiter type whose temporary storage is being accessed.

Definition at line 106 of file LinearFVGradientInterface.h.

107 {
108 return _temporary_limited_gradient[limiter_type];
109 }

Referenced by LinearSystem::computeGradients().

◆ 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 55 of file PerfGraphInterface.C.

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

Referenced by PerfGraphInterface::registerTimedSection(), and PerfGraphInterface::registerTimedSection().

◆ timestepSetup()

void AuxiliarySystem::timestepSetup ( )
overridevirtual

Reimplemented from SystemBase.

Definition at line 127 of file AuxiliarySystem.C.

128{
130
131 for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
132 {
134 _nodal_aux_storage.timestepSetup(tid);
135 _mortar_nodal_aux_storage.timestepSetup(tid);
136 _nodal_vec_aux_storage.timestepSetup(tid);
137 _nodal_array_aux_storage.timestepSetup(tid);
138 _elemental_aux_storage.timestepSetup(tid);
139 _elemental_vec_aux_storage.timestepSetup(tid);
140 _elemental_array_aux_storage.timestepSetup(tid);
141 }
142
143#ifdef MOOSE_KOKKOS_ENABLED
146#endif
147}
virtual void timestepSetup(THREAD_ID tid=0) const
virtual void timestepSetup()

◆ 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 DisplacedSystem, and NonlinearSystemBase.

Definition at line 311 of file SystemBase.h.

311{ mooseError("Not implemented yet"); }

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

◆ update()

void SystemBase::update ( )
inherited

◆ updateActive()

void AuxiliarySystem::updateActive ( THREAD_ID  tid)
virtual

Definition at line 237 of file AuxiliarySystem.C.

238{
240 _nodal_aux_storage.updateActive(tid);
241 _mortar_nodal_aux_storage.updateActive(tid);
242 _nodal_vec_aux_storage.updateActive(tid);
243 _nodal_array_aux_storage.updateActive(tid);
244 _elemental_aux_storage.updateActive(tid);
245 _elemental_vec_aux_storage.updateActive(tid);
246 _elemental_array_aux_storage.updateActive(tid);
247
248#ifdef MOOSE_KOKKOS_ENABLED
249 if (tid == 0)
250 {
253 }
254#endif
255}
void updateActive(THREAD_ID tid=0) override
Updates the active objects storage.

◆ validParams()

InputParameters PerfGraphInterface::validParams ( )
staticinherited

Definition at line 16 of file PerfGraphInterface.C.

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

Referenced by Convergence::validParams().

◆ variableWarehouse()

const VariableWarehouse & SystemBase::variableWarehouse ( THREAD_ID  tid = 0) const
inlineinherited

◆ variableWiseRelativeSolutionDifferenceNorm()

void AuxiliarySystem::variableWiseRelativeSolutionDifferenceNorm ( std::vector< Number > &  var_diffs) const

Computes and stores ||current - old|| / ||current|| for each variable in the given vector.

Parameters
var_diffsa vector being filled with the L2 norm of the solution difference

Definition at line 1011 of file AuxiliarySystem.C.

1013{
1014 rel_diff_norms.resize(nVariables(), 0);
1015 // Get dof map from system
1016 const auto & dof_map = _sys.get_dof_map();
1017
1018 for (const auto n : make_range(nVariables()))
1019 {
1020 // Get local indices from dof map for each variable
1021 std::vector<dof_id_type> local_indices_n;
1022 dof_map.local_variable_indices(local_indices_n, _mesh, n);
1023 Number diff_norm_n = 0;
1024 Number norm_n = 0;
1025 // Get values from system, update norm
1026 for (const auto local_index : local_indices_n)
1027 {
1028 const Number & value = solution()(local_index);
1029 const Number & value_old = solutionOld()(local_index);
1030 diff_norm_n += Utility::pow<2, Number>(value - value_old);
1031 norm_n += Utility::pow<2, Number>(value);
1032 }
1033 // Aggregate norm over proceccors
1034 _communicator.sum(diff_norm_n);
1035 _communicator.sum(norm_n);
1036 diff_norm_n = sqrt(diff_norm_n);
1037 norm_n = sqrt(norm_n);
1038 rel_diff_norms[n] = diff_norm_n > 0 ? diff_norm_n / norm_n : 0.0;
1039 }
1040}
virtual unsigned int nVariables() const
Get the number of variables in this system.
Definition SystemBase.C:890
void local_variable_indices(T &idx, const MeshBase &mesh, unsigned int var_num) const
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
Real Number

Referenced by DefaultSteadyStateConvergence::checkConvergence().

◆ varKind()

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

Definition at line 945 of file SystemBase.h.

945{ return _var_kind; }
Moose::VarKindType _var_kind
default kind of variables in this system

Referenced by Coupleable::coupled().

◆ zeroTaggedVector()

void SystemBase::zeroTaggedVector ( const TagID  tag)
inherited

Zero vector with the given tag.

Definition at line 673 of file SystemBase.C.

674{
676 mooseError("Cannot zero vector with TagID ",
677 tag,
678 " in system '",
679 name(),
680 "' because that tag does not exist in the problem");
681 else if (!hasVector(tag))
682 mooseError("Cannot zero vector tag with name '",
684 "' in system '",
685 name(),
686 "' because there is no vector associated with that tag");
688 getVector(tag).zero();
689}
bool vectorTagNotZeroed(const TagID tag) const
Checks if a vector tag is in the list of vectors that will not be zeroed when other tagged vectors ar...
Definition SubProblem.C:156
virtual void zero()=0

Referenced by SystemBase::zeroTaggedVectors().

◆ zeroTaggedVectors()

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

Zero all vectors for given tags.

Definition at line 692 of file SystemBase.C.

693{
694 for (const auto tag : tags)
695 zeroTaggedVector(tag);
696}
void zeroTaggedVector(const TagID tag)
Zero vector with the given tag.
Definition SystemBase.C:673

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

◆ 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 201 of file SystemBase.C.

202{
203 if (vars_to_be_zeroed.size() > 0)
204 {
206
207 auto problem = dynamic_cast<FEProblemBase *>(&_subproblem);
208 if (!problem)
209 mooseError("System needs to be registered in FEProblemBase for using zeroVariables.");
210
211 AllLocalDofIndicesThread aldit(*problem, vars_to_be_zeroed, true);
212 const ConstElemRange & elem_range = *_mesh.getActiveLocalElementRange();
213 Threads::parallel_reduce(elem_range, aldit);
214
215 const auto & dof_indices_to_zero = aldit.getDofIndices();
216
217 solution.close();
218
219 for (const auto & dof : dof_indices_to_zero)
220 solution.set(dof, 0);
221
222 solution.close();
223
224 // Call update to update the current_local_solution for this system
225 system().update();
226 }
227}
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.

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

◆ 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 236 of file SystemBase.C.

237{
239}
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:201

◆ 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 230 of file SystemBase.C.

Friends And Related Symbol Documentation

◆ ComputeIndicatorThread

friend class ComputeIndicatorThread
friend

Definition at line 223 of file AuxiliarySystem.h.

◆ ComputeMarkerThread

friend class ComputeMarkerThread
friend

Definition at line 224 of file AuxiliarySystem.h.

◆ ComputeNodalKernelBCJacobiansThread

Definition at line 229 of file AuxiliarySystem.h.

◆ ComputeNodalKernelBcsThread

friend class ComputeNodalKernelBcsThread
friend

Definition at line 227 of file AuxiliarySystem.h.

◆ ComputeNodalKernelJacobiansThread

friend class ComputeNodalKernelJacobiansThread
friend

Definition at line 228 of file AuxiliarySystem.h.

◆ ComputeNodalKernelsThread

friend class ComputeNodalKernelsThread
friend

Definition at line 226 of file AuxiliarySystem.h.

◆ FlagElementsThread

friend class FlagElementsThread
friend

Definition at line 225 of file AuxiliarySystem.h.

Member Data Documentation

◆ _active_tagged_matrices

std::unordered_map<TagID, libMesh::SparseMatrix<Number> *> SystemBase::_active_tagged_matrices
protectedinherited

Active tagged matrices. A matrix is active if its tag-matrix pair is present in the map. We use a map instead of a vector so that users can easily add and remove to this container with calls to (de)activateMatrixTag.

Definition at line 1043 of file SystemBase.h.

Referenced by SystemBase::activateAllMatrixTags(), SystemBase::deactivateAllMatrixTags(), and SystemBase::reinitElem().

◆ _app

MooseApp& SystemBase::_app
protectedinherited

◆ _automatic_scaling

bool SystemBase::_automatic_scaling
protectedinherited

Whether to automatically scale the variables.

Definition at line 1073 of file SystemBase.h.

Referenced by SystemBase::automaticScaling(), SystemBase::automaticScaling(), 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(), MaterialOutputAction::act(), MeshOnlyAction::act(), SetupDebugAction::act(), FEProblemBase::adaptMesh(), Adaptivity::adaptMesh(), PerfGraph::addToExecutionList(), SimplePredictor::apply(), SystemBase::applyScalingFactors(), MultiApp::backup(), FEProblemBase::backupMultiApps(), CoarsenedPiecewiseLinear::buildCoarsenedGrid(), DefaultSteadyStateConvergence::checkConvergence(), MeshDiagnosticsGenerator::checkElementOverlap(), MeshDiagnosticsGenerator::checkElementTypes(), MeshDiagnosticsGenerator::checkElementVolumes(), FEProblemBase::checkExceptionAndStopSolve(), SolverSystem::checkInvalidSolution(), MeshDiagnosticsGenerator::checkLocalJacobians(), MeshDiagnosticsGenerator::checkNonConformalMesh(), MeshDiagnosticsGenerator::checkNonConformalMeshFromAdaptivity(), MeshDiagnosticsGenerator::checkNonMatchingEdges(), MeshDiagnosticsGenerator::checkNonPlanarSides(), MeshDiagnosticsGenerator::checkPolygons(), FEProblemBase::checkProblemIntegrity(), ReferenceResidualConvergence::checkResidualConvergence(), MeshDiagnosticsGenerator::checkSidesetsOrientation(), MeshDiagnosticsGenerator::checkWatertightNodesets(), MeshDiagnosticsGenerator::checkWatertightSidesets(), IterationAdaptiveDT::computeAdaptiveDT(), TransientBase::computeConstrainedDT(), DefaultMultiAppFixedPointConvergence::computeCustomConvergencePostprocessor(), NonlinearSystemBase::computeDamping(), FixedPointIterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeDT(), IterationAdaptiveDT::computeFailedDT(), IterationAdaptiveDT::computeInitialDT(), IterationAdaptiveDT::computeInterpolationDT(), FEProblemBase::computeLinearSystemTags(), LinearSystem::computeLinearSystemTags(), NonlinearSystemBase::computeScaling(), Problem::console(), TimeStepper::constrainStep(), IterationAdaptiveDT::constrainStep(), MultiApp::createApp(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), Eigenvalue::execute(), SteadyBase::execute(), MFEMSteady::execute(), MessageFromInput::execute(), ActionWarehouse::executeActionsWithAction(), ActionWarehouse::executeAllActions(), MeshGeneratorSystem::executeMeshGenerators(), SidesetAroundSubdomainUpdater::finalize(), ElementQualityChecker::finalize(), FEProblemBase::finishMultiAppStep(), MeshRepairGenerator::fixOverlappingNodes(), SurfaceSubdomainsDelaunayRemesher::General2DDelaunay(), CoarsenBlockGenerator::generate(), OrientSurfaceMeshGenerator::generate(), PolyLineMeshFollowingNodeSetGenerator::generate(), MeshGenerator::generateInternal(), VariableCondensationPreconditioner::getDofToCondense(), InversePowerMethod::init(), NonlinearEigen::init(), FEProblemBase::initialAdaptMesh(), DefaultMultiAppFixedPointConvergence::initialize(), SubProblem::initialSetup(), EigenExecutionerBase::inversePowerIteration(), FEProblemBase::joinAndFinalize(), TransientBase::keepGoing(), IterationAdaptiveDT::limitDTByFunction(), IterationAdaptiveDT::limitDTToPostprocessorValue(), FEProblemBase::logAdd(), EigenExecutionerBase::makeBXConsistent(), Console::meshChanged(), SurfaceDelaunayGeneratorBase::meshNormalDeviation2D(), MooseBase::mooseDeprecated(), MooseBase::mooseDeprecatedNoTrace(), MooseBase::mooseInfo(), MooseBase::mooseWarning(), MooseBase::mooseWarningNonPrefixed(), ReferenceResidualConvergence::nonlinearConvergenceSetup(), Console::output(), DOFMapOutput::output(), MaterialPropertyDebugOutput::output(), PerfGraphOutput::output(), ReporterDebugOutput::output(), SolutionInvalidityOutput::output(), VariableResidualNormsDebugOutput::output(), ControlOutput::outputActiveObjects(), ControlOutput::outputChangedControls(), ControlOutput::outputControls(), Console::outputInput(), WebServerControl::outputMessage(), Console::outputPostprocessors(), PseudoTimestep::outputPseudoTimestep(), Console::outputReporters(), DefaultMultiAppFixedPointConvergence::outputResidualNorm(), Console::outputScalarVariables(), Console::outputSystemInformation(), FEProblemBase::possiblyRebuildGeomSearchPatches(), EigenExecutionerBase::postExecute(), AB2PredictorCorrector::postSolve(), ActionWarehouse::printActionDependencySets(), BlockRestrictionDebugOutput::printBlockRestrictionGroups(), BlockRestrictionDebugOutput::printBlockRestrictionMap(), BlockRestrictionDebugOutput::printBoundaryRestrictionGroups(), SolutionInvalidity::printDebug(), EigenExecutionerBase::printEigenvalue(), PicardSolve::printFixedPointConvergenceHistory(), SecantSolve::printFixedPointConvergenceHistory(), SteffensenSolve::printFixedPointConvergenceHistory(), FixedPointSolve::printFixedPointConvergenceReason(), PerfGraphLivePrint::printLiveMessage(), MaterialPropertyDebugOutput::printMaterialMap(), PerfGraphLivePrint::printStats(), NEML2Action::printSummary(), AutomaticMortarGeneration::projectPrimaryNodesSinglePair(), AutomaticMortarGeneration::projectSecondaryNodesSinglePair(), CoarsenBlockGenerator::recursiveCoarsen(), SolutionTimeAdaptiveDT::rejectStep(), MultiApp::restore(), FEProblemBase::restoreMultiApps(), FEProblemBase::restoreSolutions(), NonlinearSystemBase::setInitialSolution(), MooseApp::setupOptions(), Checkpoint::shouldOutput(), SubProblem::showFunctorRequestors(), SubProblem::showFunctors(), FullSolveMultiApp::showStatusMessage(), FEProblemSolve::solve(), FixedPointSolve::solve(), LinearSystem::solve(), NonlinearSystem::solve(), AStableDirk4::solve(), ExplicitRK2::solve(), ExplicitTVDRK2::solve(), ImplicitMidpoint::solve(), LStableDirk2::solve(), LStableDirk3::solve(), LStableDirk4::solve(), EigenProblem::solve(), FixedPointSolve::solveStep(), TransientMultiApp::solveStep(), MeshRepairGenerator::splitNonConvexPolygons(), PerfGraphLivePrint::start(), WebServerControl::startServer(), AB2PredictorCorrector::step(), NonlinearEigen::takeStep(), TransientBase::takeStep(), MFEMTransient::takeStep(), TerminateChainControl::terminate(), SubProblem::timestepSetup(), FEProblemBase::updateMeshXFEM(), Convergence::verboseOutput(), 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 AuxiliarySystem(), currentSolution(), and reinit().

◆ _du_dot_du

std::vector<Real> SystemBase::_du_dot_du
protectedinherited

Derivative of time derivative of u with respect to uj.

This depends on the time integration scheme

Definition at line 1035 of file SystemBase.h.

Referenced by SystemBase::duDotDu(), and SystemBase::duDotDus().

◆ _du_dotdot_du

Real SystemBase::_du_dotdot_du
protectedinherited

Definition at line 1036 of file SystemBase.h.

Referenced by SystemBase::duDotDotDu(), and SystemBase::duDotDotDu().

◆ _elem_vars

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

Elemental variables.

These may be either finite element or finite volume variables

Definition at line 198 of file AuxiliarySystem.h.

Referenced by addVariable(), ComputeIndicatorThread::onElement(), ComputeMarkerThread::onElement(), ComputeIndicatorThread::onInternalSide(), reinitElem(), reinitElemFace(), and ComputeMarkerThread::subdomainChanged().

◆ _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& SystemBase::_fe_problem
protectedinherited

the governing finite element/volume problem

Definition at line 1004 of file SystemBase.h.

Referenced by NonlinearSystemBase::addBoundaryCondition(), NonlinearSystemBase::addConstraint(), NonlinearSystemBase::addDGKernel(), NonlinearSystemBase::addDiracKernel(), SystemBase::addDotVectors(), NonlinearSystemBase::addHDGKernel(), NonlinearSystemBase::addInterfaceKernel(), NonlinearSystemBase::addKernel(), NonlinearSystemBase::addNodalKernel(), NonlinearSystemBase::addScalarKernel(), NonlinearSystemBase::addSplit(), NonlinearSystemBase::assembleScalingVector(), NonlinearSystemBase::augmentSparsity(), SolverSystem::checkInvalidSolution(), NonlinearSystemBase::checkKernelCoverage(), clearScalarVariableCoupleableTags(), compute(), LinearSystem::compute(), SolverSystem::compute(), NonlinearSystemBase::computeDamping(), NonlinearSystemBase::computeDiracContributions(), computeElementalVarsHelper(), NonlinearSystemBase::computeJacobian(), NonlinearSystemBase::computeJacobianBlocks(), NonlinearSystemBase::computeJacobianBlocks(), NonlinearSystemBase::computeJacobianInternal(), LinearSystem::computeLinearSystemInternal(), LinearSystem::computeLinearSystemTags(), computeMortarNodalVars(), NonlinearSystemBase::computeNodalBCsJacobian(), NonlinearSystemBase::computeNodalBCsResidual(), NonlinearSystemBase::computeNodalBCsResidual(), NonlinearSystemBase::computeNodalBCsResidualAndJacobian(), computeNodalVarsHelper(), NonlinearSystemBase::computeResidualAndJacobianInternal(), NonlinearSystemBase::computeResidualInternal(), NonlinearSystemBase::computeResidualTags(), NonlinearSystemBase::computeScalarKernelsJacobians(), computeScalarVars(), NonlinearSystemBase::computeScaling(), NonlinearSystem::computeScalingJacobian(), NonlinearSystem::computeScalingResidual(), NonlinearSystemBase::constraintJacobians(), NonlinearSystemBase::constraintResiduals(), LinearSystem::containsTimeKernel(), NonlinearSystem::converged(), NonlinearSystemBase::customSetup(), MooseEigenSystem::eigenKernelOnCurrent(), MooseEigenSystem::eigenKernelOnOld(), NonlinearSystemBase::enforceNodalConstraintsJacobian(), NonlinearSystemBase::enforceNodalConstraintsResidual(), SystemBase::feProblem(), SystemBase::feProblem(), NonlinearSystemBase::getFVSetupObjects(), NonlinearSystemBase::getResidualNonTimeVector(), NonlinearSystemBase::getResidualTimeVector(), LinearSystem::initialSetup(), NonlinearSystemBase::initialSetup(), NonlinearSystemBase::jacobianSetup(), LinearSystem::LinearSystem(), NonlinearSystemBase::NonlinearSystemBase(), NonlinearSystemBase::overwriteNodeFace(), NonlinearSystem::potentiallySetupFiniteDifferencing(), LinearSystem::preInit(), NonlinearSystemBase::preInit(), NonlinearSystemBase::reinitNodeFace(), NonlinearSystem::residualAndJacobianTogether(), NonlinearSystemBase::residualSetup(), NonlinearSystemBase::setConstraintSecondaryValues(), NonlinearSystemBase::setInitialSolution(), setScalarVariableCoupleableTags(), NonlinearSystemBase::shouldEvaluatePreSMOResidual(), NonlinearSystem::solve(), and NonlinearSystemBase::timestepSetup().

◆ _kokkos_elemental_aux_storage

ExecuteMooseObjectWarehouse<AuxKernelBase> AuxiliarySystem::_kokkos_elemental_aux_storage
protected

◆ _kokkos_nodal_aux_storage

ExecuteMooseObjectWarehouse<AuxKernelBase> AuxiliarySystem::_kokkos_nodal_aux_storage
protected

◆ _matrix_tag_active_flags

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

Active flags for tagged matrices.

Definition at line 1045 of file SystemBase.h.

Referenced by SystemBase::activateAllMatrixTags(), SystemBase::deactivateAllMatrixTags(), and SystemBase::matrixTagActive().

◆ _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 1061 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 1064 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 1018 of file SystemBase.h.

Referenced by 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 1011 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 1070 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 135 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 138 of file PerfGraphInterface.h.

Referenced by PerfGraphInterface::timedSectionName().

◆ _raw_grad_container

std::vector<std::unique_ptr<libMesh::NumericVector<libMesh::Number> > > LinearFVGradientInterface::_raw_grad_container
protectedinherited

◆ _raw_limited_grad_containers

std::unordered_map<Moose::FV::GradientLimiterType, std::vector<std::unique_ptr<libMesh::NumericVector<libMesh::Number> > > > LinearFVGradientInterface::_raw_limited_grad_containers
protectedinherited

◆ _requested_limited_gradient_types

std::unordered_set<Moose::FV::GradientLimiterType> LinearFVGradientInterface::_requested_limited_gradient_types
protectedinherited

◆ _requested_limited_gradient_variables

std::unordered_map<Moose::FV::GradientLimiterType, std::unordered_set<unsigned int> > LinearFVGradientInterface::_requested_limited_gradient_variables
protectedinherited

Variable numbers requesting limited gradients, keyed by limiter type.

Definition at line 152 of file LinearFVGradientInterface.h.

Referenced by LinearFVGradientInterface::requestedLinearFVLimitedGradientVariables(), and LinearFVGradientInterface::requestLinearFVLimitedGradients().

◆ _saved_dot_old

NumericVector<Real>* SystemBase::_saved_dot_old
protectedinherited

Definition at line 1052 of file SystemBase.h.

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

◆ _saved_dotdot_old

NumericVector<Real>* SystemBase::_saved_dotdot_old
protectedinherited

Definition at line 1053 of file SystemBase.h.

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

◆ _saved_old

NumericVector<Real>* SystemBase::_saved_old
protectedinherited

Definition at line 1048 of file SystemBase.h.

◆ _saved_older

NumericVector<Real>* SystemBase::_saved_older
protectedinherited

Definition at line 1049 of file SystemBase.h.

◆ _saved_solution_states

std::vector<NumericVector<Number> *> SystemBase::_saved_solution_states
privateinherited

The saved solution states (0 = current, 1 = old, 2 = older, etc)

Definition at line 1118 of file SystemBase.h.

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

◆ _serialized_solution

std::unique_ptr<NumericVector<Number> > SystemBase::_serialized_solution
protectedinherited

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

Definition at line 1086 of file SystemBase.h.

Referenced by compute(), SolverSystem::preInit(), SystemBase::serializedSolution(), serializeSolution(), SolverSystem::serializeSolution(), and SolverSystem::setSolution().

◆ _skip_next_solution_to_old_copy

bool SystemBase::_skip_next_solution_to_old_copy
privateinherited

Whether to skip the next copy from the solution to the old vector.

Definition at line 1120 of file SystemBase.h.

Referenced by SystemBase::copyPreviousSolutions(), and SystemBase::skipNextSolutionToOldCopy().

◆ _solution_state

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

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

Definition at line 189 of file AuxiliarySystem.h.

◆ _solution_states

std::array<std::vector<NumericVector<Number> *>, static_cast<size_t>(Moose::SolutionIterationType::Count)> SystemBase::_solution_states
privateinherited

2D array of solution state vector pointers.

Outer (array) index: SolutionIterationType (Time, Nonlinear, ...) Inner (vector) index: State (0=current, 1=old, ...)

Should only be accessed through getSolutionStates() when possible for bounds checking.

Definition at line 1116 of file SystemBase.h.

Referenced by SystemBase::getSolutionStates().

◆ _solution_states_initialized

bool SystemBase::_solution_states_initialized
protectedinherited

Whether or not the solution states have been initialized.

Definition at line 1079 of file SystemBase.h.

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

◆ _subproblem

SubProblem& SystemBase::_subproblem
protectedinherited

◆ _sys

libMesh::System& AuxiliarySystem::_sys
protected

◆ _tagged_matrices

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

◆ _tagged_vectors

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

◆ _temporary_gradient

std::vector<std::unique_ptr<libMesh::NumericVector<libMesh::Number> > > LinearFVGradientInterface::_temporary_gradient
protectedinherited

Scratch storage for raw gradients assembled during the current compute pass.

Definition at line 142 of file LinearFVGradientInterface.h.

Referenced by LinearFVGradientInterface::rebuildLinearFVGradientStorage(), and LinearFVGradientInterface::temporaryLinearFVGradientContainer().

◆ _temporary_limited_gradient

std::unordered_map<Moose::FV::GradientLimiterType, std::vector<std::unique_ptr<libMesh::NumericVector<libMesh::Number> > > > LinearFVGradientInterface::_temporary_limited_gradient
protectedinherited

◆ _time_integrators

std::vector<std::shared_ptr<TimeIntegrator> > SystemBase::_time_integrators
protectedinherited

◆ _u_dot

NumericVector<Number>* SystemBase::_u_dot
protectedinherited

◆ _u_dot_old

NumericVector<Number>* SystemBase::_u_dot_old
protectedinherited

◆ _u_dotdot

NumericVector<Number>* SystemBase::_u_dotdot
protectedinherited

◆ _u_dotdot_old

NumericVector<Number>* SystemBase::_u_dotdot_old
protectedinherited

◆ _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 1082 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 1056 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 1016 of file SystemBase.h.

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

◆ _var_to_copy

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

◆ _vars

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

Variable warehouses (one for each thread)

Definition at line 1014 of file SystemBase.h.

Referenced by NonlinearSystemBase::addBoundaryCondition(), NonlinearSystemBase::addInterfaceKernel(), addVariable(), SystemBase::applyScalingFactors(), NonlinearSystemBase::assembleScalingVector(), SystemBase::clearAllDofIndices(), compute(), SystemBase::customSetup(), SystemBase::getActualFieldVariable(), SystemBase::getActualFieldVariable(), SystemBase::getFieldVariable(), SystemBase::getFieldVariable(), SystemBase::getFVVariable(), SystemBase::getMinQuadratureOrder(), getMinQuadratureOrder(), SystemBase::getScalarVariable(), SystemBase::getScalarVariable(), SystemBase::getScalarVariables(), SystemBase::getVariable(), SystemBase::getVariableNames(), SystemBase::getVariables(), SystemBase::initialSetup(), LinearSystem::initialSetup(), SystemBase::jacobianSetup(), SystemBase::nFieldVariables(), SystemBase::nFVVariables(), SystemBase::nVariables(), SystemBase::prepare(), SystemBase::prepareFace(), SystemBase::prepareLowerD(), SystemBase::prepareNeighbor(), SystemBase::reinitElem(), SystemBase::reinitElemFace(), SystemBase::reinitLowerD(), SystemBase::reinitNeighbor(), SystemBase::reinitNeighborFace(), SystemBase::reinitNode(), SystemBase::reinitNodeFace(), SystemBase::reinitNodes(), SystemBase::reinitNodesNeighbor(), SystemBase::reinitScalars(), SystemBase::residualSetup(), SystemBase::setActiveScalarVariableCoupleableVectorTags(), SystemBase::setActiveVariableCoupleableVectorTags(), NonlinearSystemBase::setupScalingData(), SystemBase::sizeVariableMatrixData(), SystemBase::subdomainSetup(), SystemBase::timestepSetup(), and SystemBase::variableWarehouse().

◆ _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 1076 of file SystemBase.h.

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


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