https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
DumpObjectsLinearSystem Class Reference

Linear system for dumping objects TODO: consider creating a base class for LinearSystems to be able to create a more minimal linear system. More...

#include <DumpObjectsLinearSystem.h>

Inheritance diagram for DumpObjectsLinearSystem:
[legend]

Public Member Functions

 DumpObjectsLinearSystem (FEProblemBase &problem, const std::string &name)
 
virtual void solve () override
 Solve the system (using libMesh magic)
 
virtual void stopSolve (const ExecFlagType &, const std::set< TagID > &) override
 Quit the current solve as soon as possible.
 
virtual bool converged () override
 At the moment, this is only used for the multi-system fixed point iteration.
 
virtual void preInit () override
 This is called prior to the libMesh system has been init'd.
 
virtual void initSolutionState () override
 Initializes the solution state.
 
virtual void initialSetup () override
 Setup Functions.
 
virtual void reinit () override
 Reinitialize the system when the degrees of freedom in this system have changed.
 
void addKokkosKernel (const std::string &kernel_name, const std::string &name, InputParameters &parameters)
 Add a Kokkos linear finite volume kernel to this system.
 
void addKokkosBoundaryCondition (const std::string &bc_name, const std::string &name, InputParameters &parameters)
 Add a Kokkos linear finite volume boundary condition to this system.
 
virtual void residualSetup () override
 
virtual void jacobianSetup () override
 
virtual bool containsTimeKernel () override
 If the system has a kernel that corresponds to a time derivative.
 
virtual std::vector< std::string > timeKernelVariableNames () override
 Returns the names of the variables that have time derivative kernels in the system.
 
void computeLinearSystemTags (const std::set< TagID > &vector_tags, const std::set< TagID > &matrix_tags, const bool compute_gradients=true)
 Compute the right hand side and the system matrix of the system for given tags.
 
libMesh::LinearImplicitSystem & linearImplicitSystem ()
 Return a reference to the stored linear implicit system.
 
NumericVector< Number > & getRightHandSideTimeVector ()
 Return a numeric vector that is associated with the time tag.
 
NumericVector< Number > & getRightHandSideNonTimeVector ()
 Return a numeric vector that is associated with the nontime tag.
 
virtual void augmentSparsity (SparsityPattern::Graph &sparsity, std::vector< dof_id_type > &n_nz, std::vector< dof_id_type > &n_oz) override
 Will modify the sparsity pattern to add logical geometric connections.
 
unsigned int nLinearIterations () const
 Return the number of linear iterations.
 
virtual System & system () override
 Get the reference to the libMesh system.
 
virtual const System & system () const override
 
NumericVector< Number > & getRightHandSideVector ()
 Fetching the right hand side vector from the libmesh system.
 
const NumericVector< Number > & getRightHandSideVector () const
 
SparseMatrix< Number > & getSystemMatrix ()
 Fetching the system matrix from the libmesh system.
 
const SparseMatrix< Number > & getSystemMatrix () const
 
virtual void compute (ExecFlagType type) override
 Compute time derivatives, auxiliary variables, etc.
 
void computeGradients ()
 Compute and finalize all registered linear FV gradient fields.
 
LinearFVGradientReader registerFVGradient (unsigned int variable_number, const FVGradientMethod &method, unsigned int oldest_state=0)
 Register a variable for gradient values produced by a method object.
 
void updateFVGradient (const LinearFVGradientReader &reader)
 Update a registered gradient reader explicitly.
 
virtual void restoreSolutions () override final
 Restore current solutions (call after your solve failed)
 
void serializeSolution ()
 
void setSolution (const NumericVector< Number > &soln)
 Set the solution to a given vector.
 
void applyFixedPointRelaxation (const Real relaxation_factor, const Moose::SolutionIterationType iteration_type)
 Apply solution under/over-relaxation for fixed point iterations.
 
void setPCSide (MooseEnum pcs)
 Set the side on which the preconditioner is applied to.
 
Moose::PCSideType getPCSide ()
 Get the current preconditioner side.
 
void setMooseKSPNormType (MooseEnum kspnorm)
 Set the norm in which the linear convergence will be measured.
 
Moose::MooseKSPNormType getMooseKSPNormType ()
 Get the norm in which the linear convergence is measured.
 
virtual const NumericVector< Number > *const & currentSolution () const override final
 The solution vector that is currently being operated on.
 
unsigned int number () const
 Gets the number of this system.
 
MooseMesh & mesh ()
 
const MooseMesh & mesh () const
 
SubProblem & subproblem ()
 
const SubProblem & subproblem () const
 
FEProblemBase & feProblem ()
 
const FEProblemBase & feProblem () 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::DofMap & dofMap ()
 Gets writeable reference to the dof map.
 
virtual const libMesh::DofMap & dofMap () const
 Gets const reference to the dof map.
 
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)
 
void copyOldSolutions ()
 Copy the solution back in time (older -> old, etc).
 
void advanceStateHistory (Moose::SolutionIterationType iteration_type)
 Advance solution vectors and additional system-owned state together.
 
void copyPreviousSolutions (const Moose::SolutionIterationType iteration_type)
 Copy a specific type of solution back in time (current -> old -> older, etc).
 
void restoreStateHistory ()
 Restore solution vectors and additional system-owned state together.
 
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 ()
 
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 nonTimeVectorTag () const
 
virtual TagID residualVectorTag () const
 
virtual std::set< TagID > defaultVectorTags () const
 Get the default vector tags associated with this system.
 
virtual std::set< TagID > defaultMatrixTags () 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 void addVariable (const std::string &var_type, const std::string &var_name, InputParameters &parameters)
 Canonical method for adding a variable.
 
virtual bool isArrayVariable (const std::string &var_name) const
 If a variable is an array variable.
 
virtual bool isScalarVariable (unsigned int var_name) const
 
MooseVariableFieldBase & getVariable (THREAD_ID tid, const std::string &var_name) const
 Gets a reference to a variable of with specified name.
 
MooseVariableFieldBase & getVariable (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 MooseVariableScalar & getScalarVariable (THREAD_ID tid, const std::string &var_name) const
 Gets a reference to a scalar variable with specified number.
 
virtual MooseVariableScalar & getScalarVariable (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 libMesh::Order getMinQuadratureOrder ()
 Get minimal quadrature order needed for integrating variables in this system.
 
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 reinitElem (const Elem *elem, THREAD_ID tid)
 Reinit an element assembly info.
 
virtual void reinitElemFace (const Elem *elem, unsigned int side, THREAD_ID tid)
 Reinit assembly info for a side of an element.
 
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 VariableWarehouse & variableWarehouse (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 copyStateHistoryBackwards ()
 Copy solution vectors and additional system-owned state into older states.
 
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()
 
virtual void timestepSetup ()
 
virtual void customSetup (const ExecFlagType &exec_type)
 
virtual void subdomainSetup ()
 
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 TimeIntegrator & getTimeIntegrator (const unsigned int var_num) const
 Retrieve the time integrator that integrates the given variable's equation.
 
const TimeIntegrator * queryTimeIntegrator (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::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
PerfGraph & perfGraph ()
 Get the PerfGraph.
 
const FVGradientMethod & resolveFVGradientMethod (const GradientMethodName &method_name)
 Resolve a named gradient method, constructing a built-in method when needed.
 
TagID rightHandSideTimeVectorTag () const
 
TagID rightHandSideNonTimeVectorTag () const
 
TagID rightHandSideVectorTag () const
 
virtual TagID systemMatrixTag () const override
 Return the Matrix Tag ID for 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 Types

using GradientContainer = LinearFVGradientReader::GradientContainer
 Non-owning view with one vector per spatial component of a cell-centered gradient field.
 
using GradientStateContainer = LinearFVGradientReader::GradientStateContainer
 Gradient fields indexed by solution time state.
 
using OwnedGradientContainer = std::vector< std::unique_ptr< libMesh::NumericVector< libMesh::Number > > >
 Owned vectors used for the current gradient and its replacement.
 

Protected Member Functions

virtual void copyAdditionalStateBackwards (Moose::SolutionIterationType iteration_type, bool skip_current_to_old) override
 Copy system-owned state not represented by solution vectors.
 
virtual void restoreAdditionalStates () override
 Restore system-owned state not represented by solution vectors.
 
void computeLinearSystemInternal (const std::set< TagID > &vector_tags, const std::set< TagID > &matrix_tags, const bool compute_gradients=true)
 Compute the right hand side and system matrix for given tags.
 
void initialSetupKokkosLinearFV ()
 Perform the initial setup of the Kokkos linear finite volume kernels and boundary conditions.
 
void computeKokkosLinearSystem (const std::set< TagID > &vector_tags, const std::set< TagID > &matrix_tags)
 Assemble the Kokkos contributions to the linear system for the given tags.
 
void checkInvalidSolution ()
 
virtual NumericVector< Number > & solutionInternal () const override final
 Internal getter for solution owned by libMesh.
 
virtual bool matrixFromColoring () const
 Whether a system matrix is formed from coloring.
 
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 initializeLinearFVGradientStorage ()
 Initialize private current and replacement gradient storage.
 
void initializeLinearFVGradientHistoryStorage ()
 Register named system vectors for requested historical gradient states.
 
void rebuildLinearFVGradientStorage ()
 Rebuild cached gradient values and reusable scratch storage after mesh/DOF changes.
 
void copyPreviousGradientStates (Moose::SolutionIterationType iteration_type, bool skip_current_to_old)
 Copy published gradient values into requested older states.
 
void restoreGradientStates ()
 Restore current gradients from state one after a failed timestep.
 
bool hasLinearFVGradients () const
 Whether any linear finite-volume gradient fields have been registered to this object.
 
void initializeContainer (OwnedGradientContainer &container) const
 Allocate one zeroed vector per spatial component for gradient storage.
 
void resizeGradientStateStorage (LinearFVGradientContainer &container, unsigned int oldest_state)
 Ensure that a method container stores every requested time state.
 
void setCurrentGradientState (LinearFVGradientContainer &container) const
 Set solution state zero to the current gradient.
 
void checkRestartedGradientHistory (const FVGradientMethod &method, LinearFVGradientContainer &container)
 Validate and mark gradient history loaded during restart or recovery.
 
void initializeGradientStatesForTimeAdvance ()
 Compute and publish uninitialized gradients before their first time-state advancement.
 
LinearFVGradientContainer & computeLinearFVGradientContainer (const FVGradientMethod &method)
 Compute replacement field values for a registered gradient method.
 
void finalizeLinearFVGradientContainer (LinearFVGradientContainer &container)
 Replace the current gradient storage with the freshly computed new gradients.
 

Static Protected Member Functions

static std::string gradientStateVectorName (const FVGradientMethod &method, unsigned int state, unsigned int component)
 Return the stable system-vector name for one old gradient component.
 

Protected Attributes

NumericVector< Number > * _dummy
 
System & _sys
 Base class reference to the libmesh system.
 
unsigned int _current_l_its
 The linear iterations needed for convergence.
 
std::set< TagID > _vector_tags
 Vector tags to temporarily store all tags associated with the current system.
 
std::set< TagID > _matrix_tags
 Matrix tags to temporarily store all tags associated with the current system.
 
TagID _rhs_time_tag
 Tag for time contribution rhs.
 
NumericVector< Number > * _rhs_time
 right hand side vector for time contributions
 
TagID _rhs_non_time_tag
 Tag for non-time contribution rhs.
 
NumericVector< Number > * _rhs_non_time
 right hand side vector for non-time contributions
 
TagID _rhs_tag
 Used for the right hand side vector from PETSc.
 
TagID _system_matrix_non_time_tag
 Tag for non-time contribution to the system matrix.
 
TagID _system_matrix_tag
 Tag for every contribution to system matrix.
 
unsigned int _n_linear_iters
 Number of linear iterations.
 
Real _initial_linear_residual
 The initial linear residual.
 
Real _final_linear_residual
 The final linear residual.
 
bool _converged
 If the solve on the linear system converged.
 
libMesh::LinearImplicitSystem & _linear_implicit_system
 Base class reference to the linear implicit system in libmesh.
 
const NumericVector< Number > * _current_solution
 solution vector from solver
 
Moose::PCSideType _pc_side
 Preconditioning side.
 
Moose::MooseKSPNormType _ksp_norm
 KSP norm type.
 
bool _solution_is_invalid
 Boolean to see if solution is invalid.
 
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::unordered_map< const FVGradientMethod *, LinearFVGradientContainer > _linear_fv_gradient_container_by_method
 Gradient containers keyed by the method object that produces them.
 

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::vector< NumericVector< Number > * > _solution_state
 The current states of the solution (0 = current, 1 = old, etc)
 
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.
 

Detailed Description

Linear system for dumping objects TODO: consider creating a base class for LinearSystems to be able to create a more minimal linear system.

For now the additional code complexity is not worth it

Definition at line 25 of file DumpObjectsLinearSystem.h.

Member Typedef Documentation

◆ GradientContainer

Non-owning view with one vector per spatial component of a cell-centered gradient field.

Definition at line 65 of file LinearFVGradientManager.h.

◆ GradientStateContainer

Gradient fields indexed by solution time state.

Definition at line 68 of file LinearFVGradientManager.h.

◆ OwnedGradientContainer

using LinearFVGradientManager::OwnedGradientContainer = std::vector<std::unique_ptr<libMesh::NumericVector<libMesh::Number> >>
protectedinherited

Owned vectors used for the current gradient and its replacement.

Definition at line 71 of file LinearFVGradientManager.h.

Constructor & Destructor Documentation

◆ DumpObjectsLinearSystem()

DumpObjectsLinearSystem::DumpObjectsLinearSystem ( FEProblemBase &  problem,
const std::string &  name 
)

Definition at line 13 of file DumpObjectsLinearSystem.C.

14 : LinearSystem(problem, name), _dummy(nullptr)
15{
16}
NumericVector< Number > * _dummy
Linear system to be solved.
virtual const std::string & name() const

Member Function Documentation

◆ activateAllMatrixTags()

void SystemBase::activateAllMatrixTags ( )
virtualinherited

Make all existing matrices active.

Definition at line 1128 of file SystemBase.C.

1129{
1130 auto num_matrix_tags = _subproblem.numMatrixTags();
1131
1132 _matrix_tag_active_flags.resize(num_matrix_tags);
1134
1135 for (const auto tag : make_range(num_matrix_tags))
1136 if (hasMatrix(tag))
1137 {
1138 _matrix_tag_active_flags[tag] = true;
1139 _active_tagged_matrices.emplace(tag, &getMatrix(tag));
1140 }
1141 else
1142 _matrix_tag_active_flags[tag] = false;
1143}
if(!dmm->_nl) SETERRQ(PETSC_COMM_WORLD
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:388
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 1654 of file SystemBase.C.

1655{
1657 _u_dot = &addVector("u_dot", true, GHOSTED);
1659 _u_dot_old = &addVector("u_dot_old", true, GHOSTED);
1661 _u_dotdot = &addVector("u_dotdot", true, GHOSTED);
1663 _u_dotdot_old = &addVector("u_dotdot_old", true, GHOSTED);
1664}
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:605

Referenced by DisplacedSystem::addDotVectors().

◆ addKokkosBoundaryCondition()

void LinearSystem::addKokkosBoundaryCondition ( const std::string &  bc_name,
const std::string &  name,
InputParameters &  parameters 
)
inherited

Add a Kokkos linear finite volume boundary condition to this system.

Parameters
bc_nameThe type of the boundary condition to add
nameThe name of the boundary condition to add
parametersThe input parameters of the boundary condition

◆ addKokkosKernel()

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

Add a Kokkos linear finite volume kernel to this system.

Parameters
kernel_nameThe type of the kernel to add
nameThe name of the kernel to add
parametersThe input parameters of the kernel

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

568{
570 mooseError("Cannot add tagged matrix with TagID ",
571 tag,
572 " in system '",
573 name(),
574 "' because the tag does not exist in the problem");
575
576 if (hasMatrix(tag))
577 return getMatrix(tag);
578
579 const auto matrix_name = _subproblem.matrixTagName(tag);
580 SparseMatrix<Number> & mat = system().add_matrix(matrix_name);
581 associateMatrixToTag(mat, tag);
582
583 return mat;
584}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
virtual TagName matrixTagName(TagID tag)
Retrieve the name associated with a TagID.
Definition SubProblem.C:346
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition SubProblem.C:317
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)

◆ addScalingVector()

void SystemBase::addScalingVector ( )
inherited

Add the scaling factor vector to the system.

Definition at line 1579 of file SystemBase.C.

1580{
1581 addVector("scaling_factors", /*project=*/false, GHOSTED);
1583}
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 1679 of file SystemBase.C.

1682{
1683 parameters.set<SystemBase *>("_sys") = this;
1684 _time_integrators.push_back(_factory.create<TimeIntegrator>(type, name, parameters));
1685}
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters &parameters, THREAD_ID tid=0, bool print_deprecated=true)
Definition Factory.C:142
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.
Factory & _factory
Base class for time integrators.

◆ addVariable()

void SystemBase::addVariable ( const std::string &  var_type,
const std::string &  var_name,
InputParameters &  parameters 
)
virtualinherited

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

Definition at line 717 of file SystemBase.C.

720{
722
723 const auto components = parameters.get<unsigned int>("components");
724
725 // Convert the std::vector parameter provided by the user into a std::set for use by libMesh's
726 // System::add_variable method
727 std::set<SubdomainID> blocks;
728 const auto & block_param = parameters.get<std::vector<SubdomainName>>("block");
729 for (const auto & subdomain_name : block_param)
730 {
731 SubdomainID blk_id = _mesh.getSubdomainID(subdomain_name);
732 blocks.insert(blk_id);
733 }
734
735 const auto fe_type = MooseUtils::variableFEType(parameters);
736 const auto fe_field_type = FEInterface::field_type(fe_type);
737
738 unsigned int var_num;
739
740 if (var_type == "ArrayMooseVariable")
741 {
742 if (fe_field_type == libMesh::TYPE_VECTOR)
743 mooseError("Vector family type cannot be used in an array variable");
744
745 std::vector<std::string> array_var_component_names;
746 const bool has_array_names = parameters.isParamValid("array_var_component_names");
747 if (has_array_names)
748 {
749 array_var_component_names =
750 parameters.get<std::vector<std::string>>("array_var_component_names");
751 if (array_var_component_names.size() != components)
752 parameters.paramError("array_var_component_names",
753 "Must be the same size as 'components' (size ",
754 components,
755 ") for array variable '",
756 name,
757 "'");
758 }
759
760 // Build up the variable names
761 std::vector<std::string> var_names;
762 for (unsigned int i = 0; i < components; i++)
763 {
764 if (!has_array_names)
765 array_var_component_names.push_back(std::to_string(i));
766 var_names.push_back(name + "_" + array_var_component_names[i]);
767 }
768
769 // makes sure there is always a name, either the provided one or '1 2 3 ...'
770 parameters.set<std::vector<std::string>>("array_var_component_names") =
771 array_var_component_names;
772
773 // The number returned by libMesh is the _last_ variable number... we want to hold onto the
774 // _first_
775 var_num = system().add_variable_array(var_names, fe_type, &blocks) - (components - 1);
776
777 // Set as array variable
778 if (parameters.isParamSetByUser("array") && !parameters.get<bool>("array"))
779 parameters.paramError("array",
780 "Must be set to true for variable '",
781 name,
782 "' because 'components' > 1 (is an array variable)");
783 parameters.set<bool>("array") = true;
784 }
785 else
786 {
787 if (parameters.isParamSetByUser("array_var_component_names"))
788 parameters.paramError("array_var_component_names",
789 "Should not be set because this variable (",
790 name,
791 ") is a non-array variable");
792 var_num = system().add_variable(name, fe_type, &blocks);
793 }
794
795 parameters.set<unsigned int>("_var_num") = var_num;
796 parameters.set<SystemBase *>("_system_base") = this;
797
798 for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
799 {
800 parameters.set<THREAD_ID>("tid") = tid;
801 std::shared_ptr<MooseVariableBase> var =
802 _factory.create<MooseVariableBase>(var_type, name, parameters, tid);
803
804 _vars[tid].add(name, var);
805
806 if (auto fe_var = dynamic_cast<MooseVariableFieldBase *>(var.get()))
807 {
808 auto required_size = var_num + components;
809 if (required_size > _numbered_vars[tid].size())
810 _numbered_vars[tid].resize(required_size);
811 for (MooseIndex(components) component = 0; component < components; ++component)
812 _numbered_vars[tid][var_num + component] = fe_var;
813
814 if (auto * const functor = dynamic_cast<Moose::FunctorBase<ADReal> *>(fe_var))
815 _subproblem.addFunctor(name, *functor, tid);
816 else if (auto * const functor = dynamic_cast<Moose::FunctorBase<ADRealVectorValue> *>(fe_var))
817 _subproblem.addFunctor(name, *functor, tid);
818 else if (auto * const functor = dynamic_cast<Moose::FunctorBase<ADRealEigenVector> *>(fe_var))
819 _subproblem.addFunctor(name, *functor, tid);
820 else
821 mooseError("This should be a functor");
822 }
823
824 if (auto scalar_var = dynamic_cast<MooseVariableScalar *>(var.get()))
825 {
826 if (auto * const functor = dynamic_cast<Moose::FunctorBase<ADReal> *>(scalar_var))
827 _subproblem.addFunctor(name, *functor, tid);
828 else
829 mooseError("Scalar variables should be functors");
830 }
831
832 if (var->blockRestricted())
833 for (const SubdomainID & id : var->blockIDs())
834 for (MooseIndex(components) component = 0; component < components; ++component)
835 _var_map[var_num + component].insert(id);
836 else
837 for (MooseIndex(components) component = 0; component < components; ++component)
838 _var_map[var_num + component] = std::set<SubdomainID>();
839 }
840
841 // getMaxVariableNumber is an API method used in Rattlesnake
842 if (var_num > _max_var_number)
843 _max_var_number = var_num;
844 _du_dot_du.resize(var_num + 1);
845}
subdomain_id_type SubdomainID
unsigned int THREAD_ID
Definition MooseTypes.h:237
for(PetscInt i=0;i< nvars;++i)
char ** blocks
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was set by the user.
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.
void paramError(const std::string &param, Args... args) const
Emits a parameter error prefixed with the parameter location and object information if available.
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another,...
SubdomainID getSubdomainID(const SubdomainName &subdomain_name) const
Get the associated subdomain ID for the subdomain name.
Definition MooseMesh.C:1678
Base variable class.
This class provides an interface for common operations on field variables of both FE and FV types wit...
Class for scalar variables (they are different).
Base class template for functor objects.
void addFunctor(const std::string &name, const Moose::FunctorBase< T > &functor, const THREAD_ID tid)
add a functor to the problem functor container
std::vector< Real > _du_dot_du
Derivative of time derivative of u with respect to uj.
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
unsigned int _max_var_number
Maximum variable number.
std::map< unsigned int, std::set< SubdomainID > > _var_map
Map of variables (variable id -> array of subdomains where it lives)
MooseMesh & _mesh
std::vector< std::vector< MooseVariableFieldBase * > > _numbered_vars
Map variable number to its pointer.
unsigned int add_variable(std::string_view var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
unsigned int add_variable_array(const std::vector< std::string > &vars, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
libMesh::FEType variableFEType(const InputParameters &params)
Definition MooseUtils.C:98
unsigned int n_threads()

Referenced by AuxiliarySystem::addVariable().

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

1175{
1176 _var_to_copy.push_back(VarCopyInfo(dest_name, source_name, timestep));
1177}
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 605 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:921
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition SystemBase.C:930
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(), LinearFVGradientManager::initializeLinearFVGradientHistoryStorage(), 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 != 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:210
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:978

◆ advanceStateHistory()

void SystemBase::advanceStateHistory ( Moose::SolutionIterationType  iteration_type)
inherited

Advance solution vectors and additional system-owned state together.

Definition at line 1308 of file SystemBase.C.

1309{
1310 const bool skip_current_to_old =
1312 copyPreviousSolutions(iteration_type);
1313 copyAdditionalStateBackwards(iteration_type, skip_current_to_old);
1314}
void copyPreviousSolutions(const Moose::SolutionIterationType iteration_type)
Copy a specific type of solution back in time (current -> old -> older, etc).
bool _skip_next_solution_to_old_copy
Whether to skip the next copy from the solution to the old vector.
virtual void copyAdditionalStateBackwards(Moose::SolutionIterationType, bool)
Copy system-owned state not represented by solution vectors.

Referenced by SystemBase::copyStateHistoryBackwards(), and EigenExecutionerBase::inversePowerIteration().

◆ applyFixedPointRelaxation()

void SolverSystem::applyFixedPointRelaxation ( const Real  relaxation_factor,
const Moose::SolutionIterationType  iteration_type 
)
inherited

Apply solution under/over-relaxation for fixed point iterations.

The relaxed update is: u <- relaxation_factor * u_new + (1 - relaxation_factor) * u_old

Parameters
[in]relaxation_factorThe factor applied to the new solution
[in]iteration_typeType of iteration; which "previous" value to use

Definition at line 77 of file SolverSystem.C.

79{
80 if (MooseUtils::absoluteFuzzyEqual(relaxation_factor, 1.0))
81 return;
82
83 mooseAssert(hasSolutionState(1, iteration_type),
84 "Fixed point relaxation was requested but the old fixed point solution was not "
85 "saved.");
86
87 // This might be paranoid but who knows, maybe someone requests nonghosted
88 mooseAssert(solutionStateParallelType(1, iteration_type) == solution().type(),
89 "Fixed point relaxation requires the previous fixed point solution state to have "
90 "the same parallel type as the system solution.");
91
92 auto & sol = solution();
93 sol.scale(relaxation_factor);
94 sol.add(1.0 - relaxation_factor, solutionState(1, iteration_type));
95 sol.close();
96 update();
97}
libMesh::ParallelType solutionStateParallelType(const unsigned int state, const Moose::SolutionIterationType iteration_type) const
Returns the parallel type of the given solution state.
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 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,...
NumericVector< Number > & solution()
Definition SystemBase.h:212
void update()
Update the system (doing libMesh magic)

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

1530{
1531 for (MooseIndex(_vars) thread = 0; thread < _vars.size(); ++thread)
1532 {
1533 auto & field_variables = _vars[thread].fieldVariables();
1534 for (MooseIndex(field_variables) i = 0, p = 0; i < field_variables.size(); ++i)
1535 {
1536 auto factors = field_variables[i]->arrayScalingFactor();
1537 for (unsigned int j = 0; j < field_variables[i]->count(); ++j, ++p)
1538 factors[j] /= inverse_scaling_factors[p];
1539
1540 field_variables[i]->scalingFactor(factors);
1541 }
1542
1543 auto offset = field_variables.size();
1544
1545 auto & scalar_variables = _vars[thread].scalars();
1546 for (MooseIndex(scalar_variables) i = 0; i < scalar_variables.size(); ++i)
1547 scalar_variables[i]->scalingFactor(
1548 {1. / inverse_scaling_factors[offset + i] * scalar_variables[i]->scalingFactor()});
1549
1550 if (thread == 0 && _verbose)
1551 {
1552 _console << "Automatic scaling factors:\n";
1553 auto original_flags = _console.flags();
1554 auto original_precision = _console.precision();
1555 _console.unsetf(std::ios_base::floatfield);
1557
1558 for (const auto & field_variable : field_variables)
1559 {
1560 const auto & factors = field_variable->arrayScalingFactor();
1561 _console << " " << field_variable->name() << ":";
1562 for (const auto i : make_range(field_variable->count()))
1563 _console << " " << factors[i];
1564 _console << "\n";
1565 }
1566 for (const auto & scalar_variable : scalar_variables)
1567 _console << " " << scalar_variable->name() << ": " << scalar_variable->scalingFactor()
1568 << "\n";
1569 _console << "\n" << std::endl;
1570
1571 // restore state
1572 _console.flags(original_flags);
1573 _console.precision(original_precision);
1574 }
1575 }
1576}
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 625 of file SystemBase.h.

625{ _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 630 of file SystemBase.h.

630{ _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 1073 of file SystemBase.C.

1074{
1075 if (!_subproblem.matrixTagExists(tag))
1076 mooseError("Cannot associate matrix to tag ", tag, " because that tag does not exist");
1077
1078 if (_tagged_matrices.size() < tag + 1)
1079 _tagged_matrices.resize(tag + 1);
1080
1081 _tagged_matrices[tag] = &matrix;
1082}
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 978 of file SystemBase.C.

979{
981 mooseError("Cannot associate vector to tag ", tag, " because that tag does not exist");
982
983 if (_tagged_vectors.size() < tag + 1)
984 _tagged_vectors.resize(tag + 1);
985
986 _tagged_vectors[tag] = &vec;
987}
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 451 of file SystemBase.C.

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

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

◆ augmentSparsity()

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

Will modify the sparsity pattern to add logical geometric connections.

Implements SystemBase.

Definition at line 317 of file LinearSystem.C.

320{
321 mooseError("LinearSystem does not support AugmentSparsity!");
322}

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

◆ checkInvalidSolution()

void SolverSystem::checkInvalidSolution ( )
protectedinherited

Definition at line 132 of file SolverSystem.C.

133{
134 auto & solution_invalidity = _app.solutionInvalidity();
135
136 // sync all solution invalid counts to rank 0 process
137 solution_invalidity.syncIteration();
138
139 if (solution_invalidity.hasInvalidSolution())
140 {
143 solution_invalidity.print(_console);
144 else
145 mooseWarning("The Solution Invalidity warnings are detected but silenced! "
146 "Use Problem/show_invalid_solution_console=true to show solution counts");
147 else
148 // output the occurrence of solution invalid in a summary table
150 solution_invalidity.print(_console);
151 }
152}
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition MooseError.h:345
bool acceptInvalidSolution() const
Whether or not to accept the solution based on its invalidity.
bool showInvalidSolutionConsole() const
Whether or not to print out the invalid solutions summary table in console.
SolutionInvalidity & solutionInvalidity()
Get the SolutionInvalidity for this app.
Definition MooseApp.h:185
void syncIteration()
Sync iteration counts to main processor Sum across all processors.
MooseApp & _app

Referenced by LinearSystem::solve(), and NonlinearSystem::solve().

◆ checkRestartedGradientHistory()

void LinearFVGradientManager::checkRestartedGradientHistory ( const FVGradientMethod &  method,
LinearFVGradientContainer &  container 
)
protectedinherited

Validate and mark gradient history loaded during restart or recovery.

Definition at line 237 of file LinearFVGradientManager.C.

239{
240 if (container.has_checked_restart_history)
241 return;
242
243 container.has_checked_restart_history = true;
244 if (container.state_values.size() <= 1)
245 return;
246
247 const auto & app = _sys.feProblem().getMooseApp();
248 if (!app.isRestarting() && !app.isRecovering())
249 return;
250
251 const auto & restartable_equation_systems = _sys.feProblem().getRestartableEquationSystems();
252 for (const auto state : make_range(std::size_t(1), container.state_values.size()))
253 for (const auto component : index_range(container.state_values[state]))
254 {
255 const auto vector_name = gradientStateVectorName(method, state, component);
256 for (const auto variable_number : container.variable_numbers)
257 {
258 const auto & variable = _sys.getVariable(0, variable_number);
259 if (!restartable_equation_systems.isVariableRestored(
260 _sys.name(), vector_name, variable.name()))
261 mooseError("Linear FV gradient state ",
262 state,
263 " for variable '",
264 variable.name(),
265 "' using gradient method '",
266 method.name(),
267 "' was requested on system '",
268 _sys.name(),
269 "', but vector '",
270 vector_name,
271 "' was not available in the restart data.");
272 }
273 }
274
275 container.has_initialized_history = true;
276}
const RestartableEquationSystems & getRestartableEquationSystems() const
Get the RestartableEquationSystems object.
SystemBase & _sys
Reference to the system object.
static std::string gradientStateVectorName(const FVGradientMethod &method, unsigned int state, unsigned int component)
Return the stable system-vector name for one old gradient component.
const std::string & name() const
Get the name of the class.
Definition MooseBase.h:103
MooseApp & getMooseApp() const
Get the MooseApp this class is associated with.
Definition MooseBase.h:87
MooseVariableFieldBase & getVariable(THREAD_ID tid, const std::string &var_name) const
Gets a reference to a variable of with specified name.
Definition SystemBase.C:89
FEProblemBase & feProblem()
Definition SystemBase.h:104
auto index_range(const T &sizable)

Referenced by LinearFVGradientManager::initializeLinearFVGradientStorage().

◆ clearAllDofIndices()

void SystemBase::clearAllDofIndices ( )
inherited

Clear all dof indices from moose variables.

Definition at line 1634 of file SystemBase.C.

1635{
1636 for (auto & var_warehouse : _vars)
1637 var_warehouse.clearAllDofIndices();
1638}
void clearAllDofIndices()
Clear all dof indices from moose variables.

Referenced by SubProblem::clearAllDofIndices().

◆ closeTaggedMatrices()

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

Close all matrices associated the tags.

Definition at line 1057 of file SystemBase.C.

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

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 LinearSystem::compute ( ExecFlagType  type)
overridevirtualinherited

Compute time derivatives, auxiliary variables, etc.

Parameters
typeOur current execution stage

Reimplemented from SolverSystem.

Definition at line 383 of file LinearSystem.C.

384{
385 // - Linear system assembly is associated with EXEC_NONLINEAR
386 // - Avoid division by 0 dt
387 if (type == EXEC_NONLINEAR && _fe_problem.dt() > 0.)
388 for (auto & ti : _time_integrators)
389 // Do things like compute integration weights
390 ti->preStep();
391}
const ExecFlagType EXEC_NONLINEAR
Definition Moose.C:34
virtual Real & dt() const

Referenced by FEProblemBase::computeSystems().

◆ computeGradients()

void LinearFVGradientManager::computeGradients ( )
inherited

Compute and finalize all registered linear FV gradient fields.

Definition at line 75 of file LinearFVGradientManager.C.

111{
112 if (_linear_fv_gradient_container_by_method.empty() || !_sys.solutionStatesInitialized())
113 return;
114
115 auto * const perf_graph_interface = dynamic_cast<PerfGraphInterface *>(&_sys);
116 mooseAssert(perf_graph_interface,
117 "LinearFVGradientManager requires its owning system to implement "
118 "PerfGraphInterface.");
119 const auto perf_id = perf_graph_interface->registerTimedSection("LinearVariableFV_Gradients", 3);
120 mooseAssert(!Threads::in_threads, "PerfGraph timing cannot be used within threaded sections");
121 PerfGuard time_guard(perf_graph_interface->perfGraph(), perf_id);
122
123 // Keep current values unchanged until every replacement has been computed so boundary
124 // conditions consistently use gradients from the previous update.
125 // BCs may use cell gradients to compute the boundary face value, which is itself used to
126 // compute cell gradients
127 for (auto & method_container_pair : _linear_fv_gradient_container_by_method)
128 computeLinearFVGradientContainer(*method_container_pair.first);
129
130 for (auto & method_container_pair : _linear_fv_gradient_container_by_method)
131 finalizeLinearFVGradientContainer(method_container_pair.second);
132}
LinearFVGradientContainer & computeLinearFVGradientContainer(const FVGradientMethod &method)
Compute replacement field values for a registered gradient method.
void finalizeLinearFVGradientContainer(LinearFVGradientContainer &container)
Replace the current gradient storage with the freshly computed new gradients.
std::unordered_map< const FVGradientMethod *, LinearFVGradientContainer > _linear_fv_gradient_container_by_method
Gradient containers keyed by the method object that produces them.
System & _sys
Base class reference to the libmesh system.
Interface for objects interacting with the PerfGraph.
Scope guard for starting and stopping timing for a node.
Definition PerfGuard.h:26

Referenced by LinearSystem::computeLinearSystemInternal(), and FEProblemSolve::solve().

◆ computeKokkosLinearSystem()

void LinearSystem::computeKokkosLinearSystem ( const std::set< TagID > &  vector_tags,
const std::set< TagID > &  matrix_tags 
)
protectedinherited

Assemble the Kokkos contributions to the linear system for the given tags.

Parameters
vector_tagsThe vector (right-hand side) tags to assemble
matrix_tagsThe matrix tags to assemble

Referenced by LinearSystem::computeLinearSystemInternal().

◆ computeLinearFVGradientContainer()

LinearFVGradientManager::LinearFVGradientContainer & LinearFVGradientManager::computeLinearFVGradientContainer ( const FVGradientMethod &  method)
protectedinherited

Compute replacement field values for a registered gradient method.

Parameters
methodGradient method used to compute the replacement values.
Returns
Method container whose replacement values were computed.

Definition at line 279 of file LinearFVGradientManager.C.

280{
281 // Gradient requests can be registered before the current solution vector exists, so the current
282 // and replacement fields cannot always be created when the request is recorded. These fields
283 // must be zero clones of the solution vector to inherit its finalized layout and parallel type.
284 // Requests can also arrive after the normal initialization phase. Initializing immediately
285 // before computation handles both cases, while the empty checks make repeated calls harmless.
287
288 auto & container = libmesh_map_find(_linear_fv_gradient_container_by_method, &method);
289
290 mooseAssert(!container.state_values.empty(),
291 "Gradient state storage must contain a current state.");
292 mooseAssert(!container.state_values[0].empty(),
293 "Gradient storage must be initialized before gradient computation.");
294 mooseAssert(!container.next_values.empty(),
295 "Replacement gradient storage must be initialized before gradient computation.");
296 mooseAssert(container.next_values.size() == container.current_values.size(),
297 "Next and current gradient containers must have the same size.");
298
299 method.computeGradient(_sys, container.next_values, container.variable_numbers);
300
301 return container;
302}
void computeGradient(SystemBase &system, GradientContainer &gradient, const std::unordered_set< unsigned int > &variable_numbers) const
Compute the final gradient values for the requested variables.
void initializeLinearFVGradientStorage()
Initialize private current and replacement gradient storage.

Referenced by LinearFVGradientManager::computeGradients(), LinearFVGradientManager::initializeGradientStatesForTimeAdvance(), and LinearFVGradientManager::updateFVGradient().

◆ computeLinearSystemInternal()

void LinearSystem::computeLinearSystemInternal ( const std::set< TagID > &  vector_tags,
const std::set< TagID > &  matrix_tags,
const bool  compute_gradients = true 
)
protectedinherited

Compute the right hand side and system matrix for given tags.

Parameters
vector_tagsThe tags of kernels for which the right hand side is to be computed.
matrix_tagsThe tags of kernels for which the system matrix is to be computed.
compute_gradientsA flag to disable the computation of new gradients during the assembly, can be used to lag gradients

Definition at line 228 of file LinearSystem.C.

231{
232 TIME_SECTION("computeLinearSystemInternal", 3);
233
234 // Before we assemble we clear up the matrix and the vector
237
238 // Make matrix ready to use
240
241 for (auto tag : matrix_tags)
242 {
243 auto & matrix = getMatrix(tag);
244 // Necessary for speed
245 if (auto petsc_matrix = dynamic_cast<PetscMatrix<Number> *>(&matrix))
246 {
247 LibmeshPetscCall(MatSetOption(petsc_matrix->mat(),
248 MAT_KEEP_NONZERO_PATTERN, // This is changed in 3.1
249 PETSC_TRUE));
251 LibmeshPetscCall(
252 MatSetOption(petsc_matrix->mat(), MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE));
253 }
254 }
255
256 if (compute_gradients)
258
259#ifdef MOOSE_KOKKOS_ENABLED
260 // Kokkos assembly runs first: it accumulates via device-side atomics and syncs
261 // back to PETSc before the CPU path writes. The CPU queries below filter out
262 // Kokkos objects via AttribKokkos(false) so there is no double-counting.
264 computeKokkosLinearSystem(vector_tags, matrix_tags);
265#endif
266
267 // linear contributions from the domain
268 PARALLEL_TRY
269 {
270 TIME_SECTION("LinearFVKernels_FullSystem", 3 /*, "Computing LinearFVKernels"*/);
271
272 using ElemInfoRange = StoredRange<MooseMesh::const_elem_info_iterator, const ElemInfo *>;
273 ElemInfoRange elem_info_range(_fe_problem.mesh().ownedElemInfoBegin(),
275
276 using FaceInfoRange = StoredRange<MooseMesh::const_face_info_iterator, const FaceInfo *>;
277 FaceInfoRange face_info_range(_fe_problem.mesh().ownedFaceInfoBegin(),
279
281 _fe_problem, this->number(), vector_tags, matrix_tags);
282 Threads::parallel_reduce(elem_info_range, elem_thread);
283
285 this->number(),
287 vector_tags,
288 matrix_tags);
289 Threads::parallel_reduce(face_info_range, face_thread);
290 }
291 PARALLEL_CATCH;
292
293 closeTaggedMatrices(matrix_tags);
294
297
298 // Accumulate the occurrence of solution invalid warnings for the current iteration cumulative
299 // counters
302}
Adds contributions from volumetric terms discretized using the finite volume method to the matrix and...
Adds contributions from face terms discretized using the finite volume method to the matrix and right...
bool hasKokkosResidualObjects() const
virtual MooseMesh & mesh() override
bool errorOnJacobianNonzeroReallocation() const
Will return True if the user wants to get an error when a nonzero is reallocated in the Jacobian by P...
void computeKokkosLinearSystem(const std::set< TagID > &vector_tags, const std::set< TagID > &matrix_tags)
Assemble the Kokkos contributions to the linear system for the given tags.
void computeGradients()
Compute and finalize all registered linear FV gradient fields.
libMesh::LinearImplicitSystem & _linear_implicit_system
Base class reference to the linear implicit system in libmesh.
face_info_iterator ownedFaceInfoEnd()
Definition MooseMesh.C:1467
elem_info_iterator ownedElemInfoEnd()
Definition MooseMesh.C:1484
face_info_iterator ownedFaceInfoBegin()
Iterators to owned faceInfo objects.
Definition MooseMesh.C:1458
elem_info_iterator ownedElemInfoBegin()
Iterators to owned faceInfo objects.
Definition MooseMesh.C:1476
void accumulateIterationIntoTimeStepOccurences()
Pass the number of solution invalid occurrences from current iteration to cumulative counters.
virtual void activateAllMatrixTags()
Make all existing matrices active.
void closeTaggedMatrices(const std::set< TagID > &tags)
Close all matrices associated the tags.
NumericVector< Number > * rhs
SparseMatrix< Number > * matrix
virtual void zero()=0
virtual void close()=0
virtual void zero()=0
void parallel_reduce(const Range &range, Body &body, unsigned int n_threads=libMesh::n_threads())

Referenced by LinearSystem::computeLinearSystemTags().

◆ computeLinearSystemTags()

void LinearSystem::computeLinearSystemTags ( const std::set< TagID > &  vector_tags,
const std::set< TagID > &  matrix_tags,
const bool  compute_gradients = true 
)
inherited

Compute the right hand side and the system matrix of the system for given tags.

Parameters
vector_tagsThe IDs of the vector tags whose right hand side contribution should be included
matrix_tagsThe IDs of the matrix tags whose matrix contribution should be included
compute_gradientsA flag to disable the computation of new gradients during the assembly, can be used to lag gradients

Definition at line 202 of file LinearSystem.C.

205{
206 parallel_object_only();
207
208 TIME_SECTION("LinearSystem::computeLinearSystemTags", 5);
209
211
213
214 try
215 {
216 computeLinearSystemInternal(vector_tags, matrix_tags, compute_gradients);
217 }
218 catch (MooseException & e)
219 {
220 _console << "Exception detected " << e.what() << std::endl;
221 // The buck stops here, we have already handled the exception by
222 // calling stopSolve(), it is now up to PETSc to return a
223 // "diverged" reason during the next solve.
224 }
225}
void setCurrentLinearSystem(unsigned int sys_num)
Set the current linear system pointer.
unsigned int linearSysNum(const LinearSystemName &linear_sys_name) const override
Scope guard for starting and stopping Floating Point Exception Trapping.
void computeLinearSystemInternal(const std::set< TagID > &vector_tags, const std::set< TagID > &matrix_tags, const bool compute_gradients=true)
Compute the right hand side and system matrix for given tags.
Provides a way for users to bail out of the current solve.
virtual const char * what() const
Get out the error message.

Referenced by FEProblemBase::computeLinearSystemTags().

◆ computeVariables()

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

Definition at line 899 of file SystemBase.h.

899{}

◆ computingScalingJacobian()

bool SystemBase::computingScalingJacobian ( ) const
inherited

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

Definition at line 1586 of file SystemBase.C.

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

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

◆ containsTimeKernel()

bool LinearSystem::containsTimeKernel ( )
overridevirtualinherited

If the system has a kernel that corresponds to a time derivative.

Considering that we don't have transient capabilities for linear systems at the moment, this is false.

Implements SolverSystem.

Definition at line 361 of file LinearSystem.C.

362{
363 // Right now, FV kernels are in TheWarehouse so we have to use that.
364 std::vector<LinearFVKernel *> kernels;
365 auto base_query = _fe_problem.theWarehouse()
366 .query()
367 .template condition<AttribSysNum>(this->number())
368 .template condition<AttribSystem>("LinearFVKernel")
369 .queryInto(kernels);
370
371 bool contains_time_kernel = false;
372 for (const auto kernel : kernels)
373 {
374 contains_time_kernel = dynamic_cast<LinearFVTimeDerivative *>(kernel);
375 if (contains_time_kernel)
376 break;
377 }
378
379 return contains_time_kernel;
380}
TheWarehouse & theWarehouse() const
Kernel that adds contributions from a time derivative term to a linear system populated using the fin...
std::vector< T * > & queryInto(std::vector< T * > &results, Args &&... args)
queryInto executes the query and stores the results in the given vector.
Query query()
query creates and returns an initialized a query object for querying objects from the warehouse.

◆ converged()

virtual bool DumpObjectsLinearSystem::converged ( )
inlineoverridevirtual

At the moment, this is only used for the multi-system fixed point iteration.

We return true here since ther is no way to specify separate linear residuals in FEProblemSolve yet.

Reimplemented from LinearSystem.

Definition at line 32 of file DumpObjectsLinearSystem.h.

32{ return true; }

◆ copyAdditionalStateBackwards()

void LinearSystem::copyAdditionalStateBackwards ( Moose::SolutionIterationType  ,
bool   
)
overrideprotectedvirtualinherited

Copy system-owned state not represented by solution vectors.

The first argument selects the solution history being advanced. The second indicates that state 0 must not overwrite state 1 while deeper states still shift; additional state must honor this to remain aligned with the solution history. Default implementation does nothing.

Reimplemented from SystemBase.

Definition at line 188 of file LinearSystem.C.

190{
191 if (iteration_type == Moose::SolutionIterationType::Time)
192 LinearFVGradientManager::copyPreviousGradientStates(iteration_type, skip_current_to_old);
193}
void copyPreviousGradientStates(Moose::SolutionIterationType iteration_type, bool skip_current_to_old)
Copy published gradient values into requested older states.

◆ copyOldSolutions()

void SystemBase::copyOldSolutions ( )
inherited

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

Shifts the solutions backwards in time.

Definition at line 1320 of file SystemBase.C.

◆ copyPreviousGradientStates()

void LinearFVGradientManager::copyPreviousGradientStates ( Moose::SolutionIterationType  iteration_type,
bool  skip_current_to_old 
)
protectedinherited

Copy published gradient values into requested older states.

Non-time histories are ignored because only time gradient states are currently stored.

Parameters
iteration_typeType of solution history being advanced.
skip_current_to_oldWhether state zero should not overwrite state one while deeper states still shift, matching the owning system's solution-state advancement.

Definition at line 364 of file LinearFVGradientManager.C.

366{
367 mooseAssert(iteration_type != Moose::SolutionIterationType::Nonlinear,
368 "Linear FV gradient storage does not support nonlinear iteration states.");
369 if (iteration_type != Moose::SolutionIterationType::Time)
370 return;
371
372 mooseAssert(!Threads::in_threads, "Linear FV gradient state copying is not thread-safe.");
374
375 for (auto & [_, container] : _linear_fv_gradient_container_by_method)
376 {
377 const auto number_of_states = container.state_values.size();
378 if (number_of_states <= 1)
379 continue;
380
381 mooseAssert(container.has_computed_gradient,
382 "Current gradient state must be initialized before advancing time states.");
383 // Mirror solution-state advancement: some restore workflows preserve state 1 by skipping the
384 // current-to-old copy while still shifting every deeper state.
385 const std::size_t stop = skip_current_to_old ? 1 : 0;
386 for (std::size_t state = number_of_states - 1; state > stop; --state)
387 copyGradient(container.state_values[state - 1], container.state_values[state]);
388 }
389}
void initializeGradientStatesForTimeAdvance()
Compute and publish uninitialized gradients before their first time-state advancement.
void stop(const char *file, int line, const char *date, const char *time)

Referenced by AuxiliarySystem::copyAdditionalStateBackwards(), and LinearSystem::copyAdditionalStateBackwards().

◆ copyPreviousSolutions()

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

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

Definition at line 1271 of file SystemBase.C.

1272{
1273 // Normally copy through old (index 1). For Time, optionally stop at older
1274 // and leave old unchanged.
1275 const bool skip_old =
1277
1278 const auto num_states = getNumSolutionStates(iteration_type);
1279 if (num_states > 1)
1280 {
1281 const std::size_t stop = skip_old ? 1 : 0;
1282 for (std::size_t i = num_states - 1; i > stop; --i)
1283 solutionState(i, iteration_type) = solutionState(i - 1, iteration_type);
1284 }
1285
1286 // Custom logic for changing state based on iteration type
1287 switch (iteration_type)
1288 {
1291 if (solutionUDotOld())
1293 if (solutionUDotDotOld())
1295 break;
1299 break;
1303 break;
1304 }
1305}
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
virtual NumericVector< Number > * solutionUDot()
Definition SystemBase.h:289
virtual NumericVector< Number > * solutionUDotOld()
Definition SystemBase.h:291
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 const NumericVector< Number > * solutionPreviousNewton() const
virtual NumericVector< Number > * solutionUDotDotOld()
Definition SystemBase.h:292
virtual NumericVector< Number > * solutionUDotDot()
Definition SystemBase.h:290

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

◆ copySolutionsBackwards()

void SystemBase::copySolutionsBackwards ( )
virtualinherited

Copy current solution into old and older.

Definition at line 1255 of file SystemBase.C.

◆ copyStateHistoryBackwards()

void SystemBase::copyStateHistoryBackwards ( )
inherited

Copy solution vectors and additional system-owned state into older states.

Definition at line 1263 of file SystemBase.C.

1264{
1265 system().update();
1268}
void advanceStateHistory(Moose::SolutionIterationType iteration_type)
Advance solution vectors and additional system-owned state together.

◆ copyTimeIntegrators()

void SystemBase::copyTimeIntegrators ( const SystemBase &  other_sys)
inherited

Copy time integrators from another system.

Definition at line 1688 of file SystemBase.C.

1689{
1691}

◆ copyVars()

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

Definition at line 1180 of file SystemBase.C.

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

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

130{
131 return _current_solution;
132}
const NumericVector< Number > * _current_solution
solution vector from solver

Referenced by FEProblemBase::computeDamping(), FEProblemBase::computeLinearSystemSys(), FEProblemBase::computeResidualL2Norm(), FEProblemBase::computeResidualL2Norm(), and AB2PredictorCorrector::step().

◆ customSetup()

void SystemBase::customSetup ( const ExecFlagType &  exec_type)
virtualinherited

Reimplemented in AuxiliarySystem, and NonlinearSystemBase.

Definition at line 1606 of file SystemBase.C.

1607{
1608 for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
1609 _vars[tid].customSetup(exec_type);
1610}
virtual void customSetup(const ExecFlagType &exec_type)

Referenced by SystemBase::customSetup(), AuxiliarySystem::customSetup(), and NonlinearSystemBase::customSetup().

◆ deactivateAllMatrixTags()

void SystemBase::deactivateAllMatrixTags ( )
virtualinherited

Make matrices inactive.

Definition at line 1116 of file SystemBase.C.

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

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

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

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

341 {
343 }
virtual TagID residualVectorTag() const
Definition SystemBase.h:335
virtual TagID timeVectorTag() const
Ideally, we should not need this API.
Definition SystemBase.h:320
virtual TagID nonTimeVectorTag() const
Definition SystemBase.h:330

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

1108{
1109 const auto tags = defaultMatrixTags();
1110 for (const auto tag : tags)
1111 if (_subproblem.matrixTagExists(tag))
1113}
virtual std::set< TagID > defaultMatrixTags() const
Get the default matrix tags associted with this system.
Definition SystemBase.h:347
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 1012 of file SystemBase.C.

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

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

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

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

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

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

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

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

1167{
1168 return system().get_dof_map();
1169}

◆ duDotDotDu() [1/2]

virtual Number & SystemBase::duDotDotDu ( )
inlinevirtualinherited

Reimplemented in DisplacedSystem.

Definition at line 285 of file SystemBase.h.

285{ 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 287 of file SystemBase.h.

287{ return _du_dotdot_du; }

◆ duDotDu()

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

◆ duDotDus()

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

Reimplemented in DisplacedSystem.

Definition at line 284 of file SystemBase.h.

284{ return _du_dot_du; }

Referenced by DisplacedSystem::duDotDus().

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

◆ finalizeLinearFVGradientContainer()

void LinearFVGradientManager::finalizeLinearFVGradientContainer ( LinearFVGradientContainer &  container)
protectedinherited

Replace the current gradient storage with the freshly computed new gradients.

Parameters
containerMethod container whose gradient values should be finalized.

Definition at line 305 of file LinearFVGradientManager.C.

306{
307 mooseAssert(!container.state_values.empty(),
308 "Gradient state storage must contain a current state.");
309 mooseAssert(container.next_values.size() == container.current_values.size(),
310 "Next and current gradient containers must have the same size.");
311 container.current_values.swap(container.next_values);
312 setCurrentGradientState(container);
313
314 if (!container.has_initialized_history)
315 {
316 for (const auto state : make_range(std::size_t(1), container.state_values.size()))
317 copyGradient(container.state_values[0], container.state_values[state]);
318 container.has_initialized_history = true;
319 }
320
321 container.has_computed_gradient = true;
322}
void setCurrentGradientState(LinearFVGradientContainer &container) const
Set solution state zero to the current gradient.

Referenced by LinearFVGradientManager::computeGradients(), LinearFVGradientManager::initializeGradientStatesForTimeAdvance(), and LinearFVGradientManager::updateFVGradient().

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

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

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

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

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

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

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

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

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

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

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

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

◆ getMatrix() [1/2]

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

Get a raw SparseMatrix.

Reimplemented in DisplacedSystem.

Definition at line 1021 of file SystemBase.C.

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

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

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

◆ getMaxVariableNumber()

unsigned int SystemBase::getMaxVariableNumber ( ) const
inlineinherited

Returns the maximum number of all variables on the system.

Definition at line 897 of file SystemBase.h.

897{ return _max_var_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 613 of file SystemBase.h.

613{ 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 620 of file SystemBase.h.

620{ return _max_var_n_dofs_per_node; }

◆ getMinQuadratureOrder()

Order SystemBase::getMinQuadratureOrder ( )
virtualinherited

Get minimal quadrature order needed for integrating variables in this system.

Returns
The minimal order of quadrature

Reimplemented in AuxiliarySystem.

Definition at line 240 of file SystemBase.C.

241{
242 Order order = CONSTANT;
243 const std::vector<MooseVariableFieldBase *> & vars = _vars[0].fieldVariables();
244 for (const auto & var : vars)
245 {
246 FEType fe_type = var->feType();
247 if (fe_type.default_quadrature_order() > order)
248 order = fe_type.default_quadrature_order();
249 }
250
251 return order;
252}
char ** vars

◆ getMooseKSPNormType()

Moose::MooseKSPNormType SolverSystem::getMooseKSPNormType ( )
inlineinherited

Get the norm in which the linear convergence is measured.

Definition at line 99 of file SolverSystem.h.

99{ return _ksp_norm; }
Moose::MooseKSPNormType _ksp_norm
KSP norm type.

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

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

1164{
1165 return getSolutionStates(iteration_type).size();
1166}
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().

◆ getPCSide()

Moose::PCSideType SolverSystem::getPCSide ( )
inlineinherited

Get the current preconditioner side.

Definition at line 88 of file SolverSystem.h.

88{ return _pc_side; }
Moose::PCSideType _pc_side
Preconditioning side.

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

◆ getRightHandSideNonTimeVector()

NumericVector< Number > & LinearSystem::getRightHandSideNonTimeVector ( )
inherited

Return a numeric vector that is associated with the nontime tag.

Definition at line 311 of file LinearSystem.C.

312{
313 return *_rhs_non_time;
314}
NumericVector< Number > * _rhs_non_time
right hand side vector for non-time contributions

Referenced by LinearSystem::LinearSystem().

◆ getRightHandSideTimeVector()

NumericVector< Number > & LinearSystem::getRightHandSideTimeVector ( )
inherited

Return a numeric vector that is associated with the time tag.

Definition at line 305 of file LinearSystem.C.

306{
307 return *_rhs_time;
308}
NumericVector< Number > * _rhs_time
right hand side vector for time contributions

◆ getRightHandSideVector() [1/2]

NumericVector< Number > & LinearSystem::getRightHandSideVector ( )
inlineinherited

Fetching the right hand side vector from the libmesh system.

Definition at line 156 of file LinearSystem.h.

156{ return *_linear_implicit_system.rhs; }

Referenced by FEProblemBase::computeLinearSystemSys().

◆ getRightHandSideVector() [2/2]

const NumericVector< Number > & LinearSystem::getRightHandSideVector ( ) const
inlineinherited

Definition at line 157 of file LinearSystem.h.

158 {
160 }

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

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

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

1129 {
1130 return const_cast<std::vector<NumericVector<Number> *> &>(
1131 cast_ptr<const SystemBase *>(this)->getSolutionStates(iteration_type));
1132 }

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

1154{
1155 const auto iteration_type_index = static_cast<std::size_t>(iteration_type);
1156 mooseAssert(iteration_type_index < static_cast<std::size_t>(Moose::SolutionIterationType::Count),
1157 "Invalid solution iteration type");
1158 mooseAssert(iteration_type_index < _solution_states.size(), "_solution_states sized incorrectly");
1159 return _solution_states[iteration_type_index];
1160}
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::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 1728 of file SystemBase.C.

1729{
1730 return getSubdomainsForVar(getVariable(0, var_name).number());
1731}
const std::set< SubdomainID > & getSubdomainsForVar(unsigned int var_number) const
Definition SystemBase.h:791

◆ getSubdomainsForVar() [2/2]

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

Definition at line 791 of file SystemBase.h.

792 {
793 return _var_map.at(var_number);
794 }

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

◆ getSystemMatrix() [1/2]

SparseMatrix< Number > & LinearSystem::getSystemMatrix ( )
inlineinherited

Fetching the system matrix from the libmesh system.

Definition at line 163 of file LinearSystem.h.

Referenced by FEProblemBase::computeLinearSystemSys().

◆ getSystemMatrix() [2/2]

const SparseMatrix< Number > & LinearSystem::getSystemMatrix ( ) const
inlineinherited

Definition at line 164 of file LinearSystem.h.

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

1705{
1706 const auto * const ti = queryTimeIntegrator(var_num);
1707
1708 if (ti)
1709 return *ti;
1710 else
1711 mooseError("No time integrator found that integrates variable number ",
1712 std::to_string(var_num));
1713}
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 1716 of file SystemBase.C.

1717{
1718 return _time_integrators;
1719}

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

90{
92 dynamic_cast<MooseVariableFieldBase *>(_vars[tid].getVariable(var_name));
93 if (!var)
94 mooseError("Variable '", var_name, "' does not exist in this system");
95 return *var;
96}

Referenced by AdaptivityAction::act(), Assembly::addJacobianBlockNonlocal(), FEProblemBase::addJacobianBlockTags(), LinearFVGradientManager::checkRestartedGradientHistory(), NonlocalIntegratedBC::computeNonlocalOffDiagJacobian(), NonlocalKernel::computeNonlocalOffDiagJacobian(), Assembly::copyFaceShapes(), Assembly::copyNeighborShapes(), Assembly::copyShapes(), SystemBase::copyVars(), DMMooseSetVariables(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), NodeElemConstraint::getConnectedDofIndices(), NodeFaceConstraint::getConnectedDofIndices(), SystemBase::getSubdomainsForVar(), ResidualObject::getVariable(), SubProblem::getVariableHelper(), NodalNormalsPreprocessor::initialize(), LinearSystem::initialSetup(), ExplicitTimeIntegrator::initialSetup(), Assembly::initNonlocalCoupling(), PNGOutput::makeMeshFunc(), MooseStaticCondensationPreconditioner::MooseStaticCondensationPreconditioner(), UpdateErrorVectorsThread::onElement(), FEProblemBase::prepare(), Assembly::prepareBlock(), Assembly::prepareBlockNonlocal(), NonlinearSystemBase::setupScalingData(), LinearFVGradientReader::stateComponents(), 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 99 of file SystemBase.C.

100{
101 if (var_number < _numbered_vars[tid].size())
102 if (_numbered_vars[tid][var_number])
103 return *_numbered_vars[tid][var_number];
104
105 mooseError("Variable #", Moose::stringify(var_number), " does not exist in this system");
106}

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

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

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

872{ 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 930 of file SystemBase.C.

931{
932 return system().get_vector(name);
933}
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 936 of file SystemBase.C.

937{
938 return system().get_vector(name);
939}

◆ getVector() [3/4]

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

Get a raw NumericVector by tag.

Reimplemented in DisplacedSystem.

Definition at line 942 of file SystemBase.C.

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

◆ getVector() [4/4]

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

Reimplemented in DisplacedSystem.

Definition at line 960 of file SystemBase.C.

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

◆ gradientStateVectorName()

std::string LinearFVGradientManager::gradientStateVectorName ( const FVGradientMethod &  method,
unsigned int  state,
unsigned int  component 
)
staticprotectedinherited

Return the stable system-vector name for one old gradient component.

Definition at line 228 of file LinearFVGradientManager.C.

231{
232 return "linear_fv_gradient_" + method.name() + "_state_" + std::to_string(state) + "_component_" +
233 std::to_string(component);
234}

Referenced by LinearFVGradientManager::checkRestartedGradientHistory(), and LinearFVGradientManager::initializeLinearFVGradientHistoryStorage().

◆ hasLinearFVGradients()

bool LinearFVGradientManager::hasLinearFVGradients ( ) const
protectedinherited

Whether any linear finite-volume gradient fields have been registered to this object.

Definition at line 165 of file LinearFVGradientManager.C.

166{
168}

Referenced by AuxiliarySystem::compute().

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

918{ 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 309 of file SystemBase.h.

310 {
311 return tag_id < _tagged_vectors.size() && _tagged_vectors[tag_id];
312 }

◆ initializeContainer()

void LinearFVGradientManager::initializeContainer ( OwnedGradientContainer &  container) const
protectedinherited

Allocate one zeroed vector per spatial component for gradient storage.

Parameters
containerComponent-vector container to rebuild.

Definition at line 171 of file LinearFVGradientManager.C.

172{
173 container.clear();
174 const auto & current_solution = _sys.system().current_local_solution;
175 mooseAssert(current_solution && current_solution->initialized(),
176 "Current solution must exist before building FV gradient storage.");
177 container.resize(_sys.mesh().dimension());
178 for (auto & component : container)
179 component = current_solution->zero_clone();
180}
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh me...
Definition MooseMesh.C:2949
MooseMesh & mesh()
Definition SystemBase.h:100
std::unique_ptr< NumericVector< Number > > current_local_solution

Referenced by LinearFVGradientManager::initializeLinearFVGradientStorage(), and AuxiliarySystem::updateFVGradient().

◆ initializeGradientStatesForTimeAdvance()

void LinearFVGradientManager::initializeGradientStatesForTimeAdvance ( )
protectedinherited

Compute and publish uninitialized gradients before their first time-state advancement.

Definition at line 352 of file LinearFVGradientManager.C.

353{
354 for (auto & [method, container] : _linear_fv_gradient_container_by_method)
355 if (container.state_values.size() > 1 && !container.has_computed_gradient)
357
358 for (auto & [_, container] : _linear_fv_gradient_container_by_method)
359 if (container.state_values.size() > 1 && !container.has_computed_gradient)
361}
if(subdm)

Referenced by LinearFVGradientManager::copyPreviousGradientStates().

◆ initializeLinearFVGradientHistoryStorage()

void LinearFVGradientManager::initializeLinearFVGradientHistoryStorage ( )
protectedinherited

Register named system vectors for requested historical gradient states.

This must run after gradient state requirements are known and before restart or recovery data is loaded, so checkpoint data can be restored into these vectors. It does not initialize the current or replacement working storage.

Definition at line 201 of file LinearFVGradientManager.C.

202{
203 for (auto & [method, container] : _linear_fv_gradient_container_by_method)
204 for (const auto state : make_range(std::size_t(1), container.state_values.size()))
205 if (container.state_values[state].empty())
206 {
207 GradientContainer state_values(_sys.mesh().dimension());
208 for (const auto component : index_range(state_values))
209 state_values[component] = &_sys.addVector(
210 gradientStateVectorName(*method, state, component), true, libMesh::GHOSTED);
211 container.state_values[state] = std::move(state_values);
212 }
213}
LinearFVGradientReader::GradientContainer GradientContainer
Non-owning view with one vector per spatial component of a cell-centered gradient field.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...

Referenced by AuxiliarySystem::AuxiliarySystem(), and LinearSystem::initSolutionState().

◆ initializeLinearFVGradientStorage()

void LinearFVGradientManager::initializeLinearFVGradientStorage ( )
protectedinherited

Initialize private current and replacement gradient storage.

This must run after the current local solution has been created and initialized, and after restart or recovery data has been loaded. At that point, it also checks if the restored historical gradient storage is set up correctly.

Definition at line 325 of file LinearFVGradientManager.C.

326{
327 for (auto & [method, container] : _linear_fv_gradient_container_by_method)
328 {
329 if (container.current_values.empty())
330 initializeContainer(container.current_values);
331 if (container.next_values.empty())
332 initializeContainer(container.next_values);
333 setCurrentGradientState(container);
334 checkRestartedGradientHistory(*method, container);
335 }
336}
void initializeContainer(OwnedGradientContainer &container) const
Allocate one zeroed vector per spatial component for gradient storage.
void checkRestartedGradientHistory(const FVGradientMethod &method, LinearFVGradientContainer &container)
Validate and mark gradient history loaded during restart or recovery.

Referenced by LinearFVGradientManager::computeLinearFVGradientContainer(), AuxiliarySystem::initialSetup(), LinearSystem::initialSetup(), and LinearFVGradientManager::rebuildLinearFVGradientStorage().

◆ 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()

void LinearSystem::initialSetup ( )
overridevirtualinherited

Setup Functions.

Reimplemented from SystemBase.

Definition at line 122 of file LinearSystem.C.

123{
125 _current_solution = system().current_local_solution.get();
127 // Checking if somebody accidentally assigned nonlinear variables to this system
128 const auto & var_names = _vars[0].names();
129 for (const auto & name : var_names)
130 if (!dynamic_cast<MooseLinearVariableFVReal *>(_vars[0].getVariable(name)))
131 mooseError("You are trying to add a nonlinear variable to a linear system! The variable "
132 "which is assigned to the wrong system: ",
133 name);
134
135 // Calling initial setup for the linear kernels
136 for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
137 {
138 std::vector<LinearFVElementalKernel *> fv_elemental_kernels;
140 .query()
141 .template condition<AttribSysNum>(number())
142 .template condition<AttribSystem>("LinearFVElementalKernel")
143 .template condition<AttribKokkos>(false)
144 .template condition<AttribThread>(tid)
145 .queryInto(fv_elemental_kernels);
146
147 for (auto * fv_kernel : fv_elemental_kernels)
148 fv_kernel->initialSetup();
149
150 std::vector<LinearFVFluxKernel *> fv_flux_kernels;
152 .query()
153 .template condition<AttribSysNum>(number())
154 .template condition<AttribSystem>("LinearFVFluxKernel")
155 .template condition<AttribKokkos>(false)
156 .template condition<AttribThread>(tid)
157 .queryInto(fv_flux_kernels);
158
159 for (auto * fv_kernel : fv_flux_kernels)
160 fv_kernel->initialSetup();
161
162 std::vector<LinearFVBoundaryCondition *> fv_bcs;
164 .query()
165 .template condition<AttribSysNum>(number())
166 .template condition<AttribSystem>("LinearFVBoundaryCondition")
167 .template condition<AttribKokkos>(false)
168 .template condition<AttribThread>(tid)
169 .queryInto(fv_bcs);
170
171 for (auto * fv_bc : fv_bcs)
172 fv_bc->initialSetup();
173 }
174
175#ifdef MOOSE_KOKKOS_ENABLED
177#endif
178}
virtual void initialSetup() override
Setup Functions.
virtual System & system() override
Get the reference to the libMesh system.
void initialSetupKokkosLinearFV()
Perform the initial setup of the Kokkos linear finite volume kernels and boundary conditions.
virtual void initialSetup()
Setup Functions.
virtual void get(const std::vector< numeric_index_type > &index, T *values) const

◆ initialSetupKokkosLinearFV()

void LinearSystem::initialSetupKokkosLinearFV ( )
protectedinherited

Perform the initial setup of the Kokkos linear finite volume kernels and boundary conditions.

Referenced by LinearSystem::initialSetup().

◆ initSolutionState()

void LinearSystem::initSolutionState ( )
overridevirtualinherited

Initializes the solution state.

Reimplemented from SystemBase.

Definition at line 115 of file LinearSystem.C.

116{
119}
void initializeLinearFVGradientHistoryStorage()
Register named system vectors for requested historical gradient states.
virtual void initSolutionState()
Initializes the solution state.

◆ isArrayVariable()

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

If a variable is an array variable.

Definition at line 861 of file SystemBase.C.

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

◆ isScalarVariable()

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

Definition at line 882 of file SystemBase.C.

883{
884 return (system().variable(var_num).type().family == SCALAR);
885}

Referenced by Assembly::initNonlocalCoupling().

◆ jacobianSetup()

virtual void LinearSystem::jacobianSetup ( )
inlineoverridevirtualinherited

Reimplemented from SystemBase.

Definition at line 92 of file LinearSystem.h.

92{}

◆ linearImplicitSystem()

libMesh::LinearImplicitSystem & LinearSystem::linearImplicitSystem ( )
inlineinherited

Return a reference to the stored linear implicit system.

Definition at line 123 of file LinearSystem.h.

123{ return _linear_implicit_system; }

Referenced by FEProblemBase::computeResidualL2Norm(), and Moose::PetscSupport::petscSetDefaults().

◆ matrixFromColoring()

virtual bool SolverSystem::matrixFromColoring ( ) const
inlineprotectedvirtualinherited

Whether a system matrix is formed from coloring.

This influences things like when to compute time derivatives

Reimplemented in NonlinearSystem.

Definition at line 114 of file SolverSystem.h.

114{ return false; }

Referenced by SolverSystem::compute(), and NonlinearSystemBase::destroyColoring().

◆ matrixTagActive()

bool SystemBase::matrixTagActive ( TagID  tag) const
virtualinherited

If or not a matrix tag is active.

Definition at line 1146 of file SystemBase.C.

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

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

◆ name()

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

Definition at line 1359 of file SystemBase.C.

1360{
1361 return system().name();
1362}
const std::string & name() const

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

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

1487{
1488 libmesh_parallel_only(this->comm());
1489 mooseAssert(!Threads::in_threads,
1490 "This routine is not thread-safe. Request the solution state before using it in "
1491 "a threaded region.");
1492
1493 if (hasSolutionState(state, iteration_type))
1494 return;
1495
1496 auto & solution_states = getSolutionStates(iteration_type);
1497 solution_states.resize(state + 1);
1498
1499 // The 0-th (current) solution state is owned by libMesh
1500 if (!solution_states[0])
1501 solution_states[0] = &solutionInternal();
1502 else
1503 mooseAssert(solution_states[0] == &solutionInternal(), "Inconsistent current solution");
1504
1505 // We will manually add all states past current
1506 for (unsigned int i = 1; i <= state; ++i)
1507 if (!solution_states[i])
1508 {
1509 auto tag = _subproblem.addVectorTag(oldSolutionStateVectorName(i, iteration_type),
1511 solution_states[i] = &addVector(tag, true, parallel_type);
1512 }
1513 else
1514 {
1515 // If the existing parallel type is PARALLEL and GHOSTED is now requested,
1516 // this would require an upgrade, which is risky if anybody has already
1517 // stored a pointer to the existing vector, since the upgrade would create
1518 // a new vector and make that pointer null. If the existing parallel type
1519 // is GHOSTED and PARALLEL is now requested, we don't need to do anything.
1520 if (parallel_type == GHOSTED && solutionStateParallelType(i, iteration_type) == PARALLEL)
1521 mooseError("The solution state has already been declared as PARALLEL");
1522
1523 mooseAssert(solution_states[i] == &getVector(oldSolutionStateVectorName(i, iteration_type)),
1524 "Inconsistent solution state");
1525 }
1526}
virtual TagID addVectorTag(const TagName &tag_name, const Moose::VectorTagType type=Moose::VECTOR_TAG_RESIDUAL)
Create a Tag.
Definition SubProblem.C:81
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.
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 897 of file SystemBase.C.

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

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

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

◆ nLinearIterations()

unsigned int LinearSystem::nLinearIterations ( ) const
inlineinherited

Return the number of linear iterations.

Definition at line 142 of file LinearSystem.h.

142{ return _n_linear_iters; }
unsigned int _n_linear_iters
Number of linear iterations.

Referenced by IterationAdaptiveDT::acceptStep().

◆ nonTimeVectorTag()

virtual TagID SystemBase::nonTimeVectorTag ( ) const
inlinevirtualinherited

Reimplemented in DisplacedSystem, and NonlinearSystemBase.

Definition at line 330 of file SystemBase.h.

330{ 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 1154 of file SystemBase.C.

1155{
1156 return system().number();
1157}
unsigned int number() const

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(), FVFluxBC::checkFaceIntegrity(), SolverSystem::compute(), ComputeResidualAndJacobianThread::compute(), MooseVariableScalar::computeAD(), FEProblemBase::computeBounds(), Assembly::computeFaceMap(), InternalSideIndicatorBase::computeIndicator(), ArrayNodalBC::computeJacobian(), NodalBC::computeJacobian(), VectorNodalBC::computeJacobian(), MortarScalarBase::computeJacobian(), ODEKernel::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(), KernelScalarBase::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(), FunctorNodalCorrector::FunctorNodalCorrector(), 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(), MoveNodesByParsedExpressionModifier::MoveNodesByParsedExpressionModifier(), NonlinearEigenSystem::nLinearIterations(), NonlinearEigenSystem::nNonlinearIterations(), EigenExecutionerBase::nonlinearSolve(), ComputeDiracThread::onElement(), ComputeNodalKernelBCJacobiansThread::onNode(), ComputeNodalKernelJacobiansThread::onNode(), VariableResidualNormsDebugOutput::output(), Moose::PetscSupport::petscLinearConverged(), 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(), 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 888 of file SystemBase.C.

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

Referenced by AdaptivityAction::act(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), NonlinearSystemBase::getNodeDofs(), ExplicitTimeIntegrator::initialSetup(), MaxVarNDofsPerElem::onElement(), MaxVarNDofsPerNode::onNode(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), SingleMatrixPreconditioner::SingleMatrixPreconditioner(), and AuxiliarySystem::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 1400 of file SystemBase.C.

1402{
1403 mooseAssert(state != 0, "Not an old state");
1404 mooseAssert(static_cast<unsigned short>(iteration_type) <
1405 static_cast<unsigned short>(Moose::SolutionIterationType::Count),
1406 "Invalid iteration_type");
1407
1408 switch (iteration_type)
1409 {
1411 if (state == 1)
1413 else if (state == 2)
1415 break;
1417 if (state == 1)
1419 break;
1421 if (state == 1)
1423 break;
1425 if (state == 1)
1427 break;
1429 break;
1430 }
1431
1432 return "solution_state_" + std::to_string(state) + "_" + Moose::stringify(iteration_type);
1433}
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 1734 of file SystemBase.C.

1735{
1736 return system().prefix_with_name() ? system().prefix() : "";
1737}
void prefix_with_name(bool value)
std::string prefix() const

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

◆ preInit()

void LinearSystem::preInit ( )
overridevirtualinherited

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 from SolverSystem.

Definition at line 104 of file LinearSystem.C.

105{
107
108#ifdef MOOSE_KOKKOS_ENABLED
110 _sys.get_dof_map().full_sparsity_pattern_needed();
111#endif
112}
virtual void preInit() override
This is called prior to the libMesh system has been init'd.

◆ prepare()

void SystemBase::prepare ( THREAD_ID  tid)
virtualinherited

Prepare the system for use.

Parameters
tidID of the thread

Definition at line 255 of file SystemBase.C.

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

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

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

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

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

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

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

1695{
1696 for (auto & ti : _time_integrators)
1697 if (ti->integratesVar(var_num))
1698 return ti.get();
1699
1700 return nullptr;
1701}
const Elem & get(const ElemType type_in)

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

◆ rebuildLinearFVGradientStorage()

void LinearFVGradientManager::rebuildLinearFVGradientStorage ( )
protectedinherited

Rebuild cached gradient values and reusable scratch storage after mesh/DOF changes.

Definition at line 339 of file LinearFVGradientManager.C.

340{
341 for (auto & method_container_pair : _linear_fv_gradient_container_by_method)
342 {
343 method_container_pair.second.current_values.clear();
344 method_container_pair.second.next_values.clear();
345 method_container_pair.second.has_computed_gradient = false;
346 }
347
349}

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

◆ registerFVGradient()

LinearFVGradientReader LinearFVGradientManager::registerFVGradient ( unsigned int  variable_number,
const FVGradientMethod &  method,
unsigned int  oldest_state = 0 
)
inherited

Register a variable for gradient values produced by a method object.

Parameters
variable_numberVariable number whose gradient should be stored.
methodGradient method that computes the field values.
oldest_stateOldest time state that consumers need to read.

Definition at line 59 of file LinearFVGradientManager.C.

81{
82 auto * const variable =
83 dynamic_cast<MooseVariableFieldBase *>(_sys.variableWarehouse().getVariable(variable_number));
84 if (!variable)
85 mooseError("Linear FV gradients were requested for variable number ",
86 variable_number,
87 " on system '",
88 _sys.name(),
89 "', but no field variable with that number exists on the system.");
90
91 auto & container = _linear_fv_gradient_container_by_method[&method];
92 container.variable_numbers.insert(variable_number);
93
94 resizeGradientStateStorage(container, oldest_state);
95
96 const auto & current_solution = _sys.system().current_local_solution;
97 if (current_solution && current_solution->initialized())
98 {
99 if (container.current_values.empty())
100 initializeContainer(container.current_values);
101 if (container.next_values.empty())
102 initializeContainer(container.next_values);
103 setCurrentGradientState(container);
104 }
105
106 return LinearFVGradientReader(_sys, container.state_values, method, variable_number);
107}
void resizeGradientStateStorage(LinearFVGradientContainer &container, unsigned int oldest_state)
Ensure that a method container stores every requested time state.
Read-only view of one variable's cell-centered linear finite-volume gradient values.
sys_type & system()

◆ 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 LinearSystem::reinit ( )
overridevirtualinherited

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 181 of file LinearSystem.C.

182{
183 _current_solution = system().current_local_solution.get();
185}
void rebuildLinearFVGradientStorage()
Rebuild cached gradient values and reusable scratch storage after mesh/DOF changes.

◆ reinitElem()

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

Reinit an element assembly info.

Parameters
elemWhich element we are reinitializing for
tidID of the thread

Reimplemented in AuxiliarySystem.

Definition at line 339 of file SystemBase.C.

340{
342 {
343 const std::set<MooseVariableFieldBase *> & active_elemental_moose_variables =
345 for (const auto & var : active_elemental_moose_variables)
346 if (&(var->sys()) == this)
347 var->computeElemValues();
348 }
349 else
350 {
351 const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
352 for (const auto & var : vars)
353 var->computeElemValues();
354 }
355
356 if (system().has_static_condensation())
357 for (auto & [tag, matrix] : _active_tagged_matrices)
358 {
359 libmesh_ignore(tag);
360 cast_ptr<libMesh::StaticCondensation *>(matrix)->set_current_elem(*elem);
361 }
362}
void libmesh_ignore(const Args &...)

◆ reinitElemFace()

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

Reinit assembly info for a side of an element.

Parameters
elemThe element
sideSide of of the element
tidThread ID

Reimplemented in AuxiliarySystem.

Definition at line 365 of file SystemBase.C.

366{
367 const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
368 for (const auto & var : vars)
369 var->computeElemValuesFace();
370}

Referenced by SubProblem::reinitElemFaceRef().

◆ reinitLowerD()

void SystemBase::reinitLowerD ( THREAD_ID  tid)
virtualinherited

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

Definition at line 389 of file SystemBase.C.

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

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

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

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

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

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

398{
399 const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
400 for (const auto & var : vars)
401 {
402 var->reinitNode();
403 if (var->isNodalDefined())
404 var->computeNodalValues();
405 }
406}

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

410{
411 const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
412 for (const auto & var : vars)
413 {
414 var->reinitNode();
415 if (var->isNodalDefined())
416 var->computeNodalValues();
417 }
418}

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

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

Referenced by SubProblem::reinitNodes().

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

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

Referenced by SubProblem::reinitNodesNeighbor().

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

444{
445 const std::vector<MooseVariableScalar *> & vars = _vars[tid].scalars();
446 for (const auto & var : vars)
447 var->reinit(reinit_for_derivative_reordering);
448}
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 587 of file SystemBase.C.

588{
589 if (!_subproblem.matrixTagExists(tag_id))
590 mooseError("Cannot remove the matrix with TagID ",
591 tag_id,
592 "\nin system '",
593 name(),
594 "', because that tag does not exist in the problem");
595
596 if (hasMatrix(tag_id))
597 {
598 const auto matrix_name = _subproblem.matrixTagName(tag_id);
599 system().remove_matrix(matrix_name);
600 _tagged_matrices[tag_id] = nullptr;
601 }
602}
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 1353 of file SystemBase.C.

1354{
1356}
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}

◆ residualCopy()

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

Reimplemented in DisplacedSystem, and NonlinearSystemBase.

Definition at line 454 of file SystemBase.h.

455 {
456 mooseError("This system does not support getting a copy of the residual");
457 }

Referenced by DisplacedSystem::residualCopy().

◆ residualGhosted()

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

Reimplemented in DisplacedSystem, and NonlinearSystemBase.

Definition at line 458 of file SystemBase.h.

459 {
460 mooseError("This system does not support getting a ghosted copy of the residual");
461 }

Referenced by DisplacedSystem::residualGhosted().

◆ residualSetup()

virtual void LinearSystem::residualSetup ( )
inlineoverridevirtualinherited

Reimplemented from SystemBase.

Definition at line 91 of file LinearSystem.h.

91{}

◆ residualVectorTag()

virtual TagID SystemBase::residualVectorTag ( ) const
inlinevirtualinherited

Reimplemented in DisplacedSystem, and NonlinearSystemBase.

Definition at line 335 of file SystemBase.h.

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

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

◆ resizeGradientStateStorage()

void LinearFVGradientManager::resizeGradientStateStorage ( LinearFVGradientContainer &  container,
unsigned int  oldest_state 
)
protectedinherited

Ensure that a method container stores every requested time state.

Parameters
containerMethod container whose state storage should be grown.
oldest_stateOldest time state that must be stored.

Definition at line 183 of file LinearFVGradientManager.C.

185{
186 const auto required_states = static_cast<std::size_t>(oldest_state) + 1;
187 const auto old_size = container.state_values.size();
188 if (required_states > old_size && _sys.solutionStatesInitialized() && oldest_state > 0)
189 mooseError("Linear FV gradient state ",
190 oldest_state,
191 " was requested on system '",
192 _sys.name(),
193 "' after solution states were initialized. Old gradient states must be requested "
194 "during setup.");
195
196 if (required_states > old_size)
197 container.state_values.resize(required_states);
198}
bool solutionStatesInitialized() const
Whether or not the solution states have been initialized via initSolutionState()
Definition SystemBase.h:931

Referenced by AuxiliarySystem::updateFVGradient().

◆ resolveFVGradientMethod()

const FVGradientMethod & LinearFVGradientManager::resolveFVGradientMethod ( const GradientMethodName &  method_name)
inherited

Resolve a named gradient method, constructing a built-in method when needed.

Parameters
method_nameName of the gradient method to retrieve.
Returns
Gradient method associated with the supplied name.

Definition at line 52 of file LinearFVGradientManager.C.

53{
54 auto & fe_problem = _sys.feProblem();
55
56 if (!fe_problem.hasFVGradientMethod(method_name))
57 {
58 if (method_name == "green-gauss")
59 {
60 auto params = fe_problem.getMooseApp().getFactory().getValidParams("FVGreenGaussGradient");
61 fe_problem.addFVGradientMethod("FVGreenGaussGradient", method_name, params);
62 }
63 else if (method_name == "green-gauss-venkatakrishnan")
64 {
65 auto params = fe_problem.getMooseApp().getFactory().getValidParams("FVGreenGaussGradient");
66 params.set<MooseEnum>("limiter") = "venkatakrishnan";
67 fe_problem.addFVGradientMethod("FVGreenGaussGradient", method_name, params);
68 }
69 }
70
71 if (!fe_problem.hasFVGradientMethod(method_name))
72 mooseError("Unable to find FVGradientMethod with name '", method_name, "'");
73
74 return fe_problem.getFVGradientMethod(method_name);
75}
Factory & getFactory()
Retrieve a writable reference to the Factory associated with this App.
Definition MooseApp.h:407
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55

◆ restoreAdditionalStates()

void LinearSystem::restoreAdditionalStates ( )
overrideprotectedvirtualinherited

Restore system-owned state not represented by solution vectors.

Default implementation does nothing.

Reimplemented from SystemBase.

Definition at line 196 of file LinearSystem.C.

197{
199}
void restoreGradientStates()
Restore current gradients from state one after a failed timestep.

◆ restoreGradientStates()

void LinearFVGradientManager::restoreGradientStates ( )
protectedinherited

Restore current gradients from state one after a failed timestep.

Definition at line 392 of file LinearFVGradientManager.C.

393{
394 mooseAssert(!Threads::in_threads, "Linear FV gradient state copying is not thread-safe.");
395 for (auto & [_, container] : _linear_fv_gradient_container_by_method)
396 {
397 if (container.state_values.size() <= 1)
398 continue;
399
400 mooseAssert(container.has_computed_gradient,
401 "Current gradient state must be initialized before restoration.");
402 copyGradient(container.state_values[1], container.state_values[0]);
403 copyGradient(container.state_values[0], container.next_values);
404 }
405}

Referenced by AuxiliarySystem::restoreAdditionalStates(), and LinearSystem::restoreAdditionalStates().

◆ restoreOldSolutions()

void SystemBase::restoreOldSolutions ( )
virtualinherited

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

Definition at line 540 of file SystemBase.C.

541{
543 if (num_states > 1)
544 for (unsigned int i = 1; i <= num_states - 1; ++i)
546 {
548 removeVector("save_solution_state_" + std::to_string(i));
549 _saved_solution_states[i] = nullptr;
550 }
551
553 {
555 removeVector("save_solution_dot_old");
556 _saved_dot_old = nullptr;
557 }
559 {
561 removeVector("save_solution_dotdot_old");
562 _saved_dotdot_old = nullptr;
563 }
564}
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 SolverSystem::restoreSolutions ( )
finaloverridevirtualinherited

Restore current solutions (call after your solve failed)

Reimplemented from SystemBase.

Definition at line 41 of file SolverSystem.C.

42{
43 // call parent
45 // and update _current_solution
47}
virtual void restoreSolutions()
Restore current solutions (call after your solve failed)

◆ restoreStateHistory()

void SystemBase::restoreStateHistory ( )
inherited

Restore solution vectors and additional system-owned state together.

Definition at line 1346 of file SystemBase.C.

1347{
1350}
virtual void restoreAdditionalStates()
Restore system-owned state not represented by solution vectors.

◆ rightHandSideNonTimeVectorTag()

TagID LinearSystem::rightHandSideNonTimeVectorTag ( ) const
inlineinherited

Definition at line 150 of file LinearSystem.h.

150{ return _rhs_non_time_tag; }
TagID _rhs_non_time_tag
Tag for non-time contribution rhs.

◆ rightHandSideTimeVectorTag()

TagID LinearSystem::rightHandSideTimeVectorTag ( ) const
inlineinherited

Accessors of important tag IDs

Definition at line 149 of file LinearSystem.h.

149{ return _rhs_time_tag; }
TagID _rhs_time_tag
Tag for time contribution rhs.

◆ rightHandSideVectorTag()

TagID LinearSystem::rightHandSideVectorTag ( ) const
inlineinherited

Definition at line 151 of file LinearSystem.h.

151{ return _rhs_tag; }
TagID _rhs_tag
Used for the right hand side vector from PETSc.

Referenced by FEProblemBase::computeLinearSystemSys().

◆ saveOldSolutions()

void SystemBase::saveOldSolutions ( )
virtualinherited

Save the old and older solutions.

Definition at line 509 of file SystemBase.C.

510{
512 if (num_states > 1)
513 {
514 _saved_solution_states.resize(num_states);
515 for (unsigned int i = 1; i <= num_states - 1; ++i)
518 &addVector("save_solution_state_" + std::to_string(i), false, PARALLEL);
519
520 for (unsigned int i = 1; i <= num_states - 1; ++i)
522 }
523
525 _saved_dot_old = &addVector("save_solution_dot_old", false, PARALLEL);
527 _saved_dotdot_old = &addVector("save_solution_dotdot_old", false, PARALLEL);
528
529 if (solutionUDotOld())
531
532 if (solutionUDotDotOld())
534}

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

1668{
1669 if (!_serialized_solution.get())
1670 {
1671 _serialized_solution = NumericVector<Number>::build(_communicator);
1672 _serialized_solution->init(system().n_dofs(), false, SERIAL);
1673 }
1674
1675 return *_serialized_solution;
1676}
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

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

◆ serializeSolution()

void SolverSystem::serializeSolution ( )
inherited

Definition at line 50 of file SolverSystem.C.

51{
52 if (_serialized_solution.get())
53 {
54 if (!_serialized_solution->initialized() || _serialized_solution->size() != system().n_dofs())
55 {
56 _serialized_solution->clear();
57 _serialized_solution->init(system().n_dofs(), false, SERIAL);
58 }
59
61 }
62}
virtual void localize(std::vector< T > &v_local) const=0

Referenced by SolverSystem::setSolution().

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

1649{
1650 _vars[tid].setActiveScalarVariableCoupleableVectorTags(vtags);
1651}

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

1642{
1643 _vars[tid].setActiveVariableCoupleableVectorTags(vtags);
1644}

Referenced by SubProblem::setActiveFEVariableCoupleableVectorTags().

◆ setCurrentGradientState()

void LinearFVGradientManager::setCurrentGradientState ( LinearFVGradientContainer &  container) const
protectedinherited

Set solution state zero to the current gradient.

Definition at line 216 of file LinearFVGradientManager.C.

217{
218 mooseAssert(!container.state_values.empty(),
219 "Gradient state storage must contain a current state.");
220 auto & current_view = container.state_values[0];
221 current_view.clear();
222 current_view.reserve(container.current_values.size());
223 for (auto & component : container.current_values)
224 current_view.push_back(component.get());
225}

Referenced by LinearFVGradientManager::finalizeLinearFVGradientContainer(), LinearFVGradientManager::initializeLinearFVGradientStorage(), and AuxiliarySystem::updateFVGradient().

◆ setMooseKSPNormType()

void SolverSystem::setMooseKSPNormType ( MooseEnum  kspnorm)
inherited

Set the norm in which the linear convergence will be measured.

Parameters
kspnormThe required norm

Definition at line 115 of file SolverSystem.C.

116{
117 if (kspnorm == "none")
119 else if (kspnorm == "preconditioned")
121 else if (kspnorm == "unpreconditioned")
123 else if (kspnorm == "natural")
125 else if (kspnorm == "default")
127 else
128 mooseError("Unknown ksp norm type specified.");
129}
@ KSPN_NONE
Definition MooseTypes.h:886
@ KSPN_PRECONDITIONED
Definition MooseTypes.h:887
@ KSPN_UNPRECONDITIONED
Definition MooseTypes.h:888
@ KSPN_DEFAULT
Use whatever we have in PETSc.
Definition MooseTypes.h:890
@ KSPN_NATURAL
Definition MooseTypes.h:889

Referenced by MoosePreconditioner::MoosePreconditioner().

◆ setPCSide()

void SolverSystem::setPCSide ( MooseEnum  pcs)
inherited

Set the side on which the preconditioner is applied to.

Parameters
pcsThe required preconditioning side

Definition at line 100 of file SolverSystem.C.

101{
102 if (pcs == "left")
104 else if (pcs == "right")
106 else if (pcs == "symmetric")
108 else if (pcs == "default")
110 else
111 mooseError("Unknown PC side specified.");
112}
@ PCS_LEFT
Definition MooseTypes.h:875
@ PCS_DEFAULT
Use whatever we have in PETSc.
Definition MooseTypes.h:878
@ PCS_SYMMETRIC
Definition MooseTypes.h:877
@ PCS_RIGHT
Definition MooseTypes.h:876

Referenced by MoosePreconditioner::MoosePreconditioner().

◆ setSolution()

void SolverSystem::setSolution ( const NumericVector< Number > &  soln)
inherited

Set the solution to a given vector.

Parameters
solnThe vector which should be treated as the solution.

Definition at line 65 of file SolverSystem.C.

66{
67 _current_solution = &soln;
68
70 associateVectorToTag(const_cast<NumericVector<Number> &>(soln), tag);
71
72 if (_serialized_solution.get())
74}
void serializeSolution()
virtual TagID getVectorTagID(const TagName &tag_name) const
Get a TagID from a TagName.
Definition SubProblem.C:192
const TagName SOLUTION_TAG
Definition MooseTypes.C:25

Referenced by FEProblemBase::computeDamping(), FEProblemBase::computeJacobianInternal(), FEProblemBase::computeJacobianTag(), FEProblemBase::computeLinearSystemTags(), FEProblemBase::computeResidualAndJacobian(), FEProblemBase::computeResidualInternal(), FEProblemBase::computeResidualTag(), FEProblemBase::computeResidualType(), ActuallyExplicitEuler::solve(), and ExplicitSSPRungeKutta::solveStage().

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

186{
187 AllLocalDofIndicesThread aldit(_subproblem, {var_name});
188 const ConstElemRange & elem_range = *_mesh.getActiveLocalElementRange();
189 Threads::parallel_reduce(elem_range, aldit);
190
191 // Gather the dof indices across procs to get all the dof indices for var_name
192 aldit.dofIndicesSetUnion();
193
194 const auto & all_dof_indices = aldit.getDofIndices();
195 _var_all_dof_indices.assign(all_dof_indices.begin(), all_dof_indices.end());
196}
Grab all the (possibly semi)local dof indices for the variables passed in, in the system passed in.
const libMesh::ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems,...
Definition MooseMesh.C:1247
StoredRange< MeshBase::const_element_iterator, const Elem * > ConstElemRange

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

1741{
1742 for (const auto & warehouse : _vars)
1743 for (const auto & [var_num, var_ptr] : warehouse.numberToVariableMap())
1744 var_ptr->sizeMatrixTagData();
1745}

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

◆ solution() [1/2]

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

Definition at line 212 of file SystemBase.h.

212{ return solutionState(0); }

Referenced by Adaptivity::adaptMesh(), SolverSystem::applyFixedPointRelaxation(), TransientMultiApp::appTransferVector(), MooseEigenSystem::combineSystemSolution(), AuxiliarySystem::compute(), NonlinearSystemBase::computeDamping(), AuxiliarySystem::computeElementalVarsHelper(), NonlinearSystemBase::computeJacobianInternal(), AuxiliarySystem::computeMortarNodalVars(), NonlinearSystemBase::computeNodalBCsJacobian(), NonlinearSystemBase::computeNodalBCsResidual(), AuxiliarySystem::computeNodalVarsHelper(), NonlinearSystemBase::computeResidualTags(), AuxiliarySystem::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(), AuxiliarySystem::serializeSolution(), NonlinearSystemBase::setConstraintSecondaryValues(), NonlinearSystemBase::setInitialSolution(), DisplacedSystem::solutionInternal(), NonlinearEigenSystem::solve(), MultiAppDofCopyTransfer::transfer(), PicardSolve::transformVariables(), SecantSolve::transformVariables(), SteffensenSolve::transformVariables(), AuxiliarySystem::variableWiseRelativeSolutionDifferenceNorm(), MoveNodesByParsedExpressionModifier::writeOutputs(), and SystemBase::zeroVariables().

◆ solution() [2/2]

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

Definition at line 215 of file SystemBase.h.

215{ return solutionState(0); }

◆ solutionInternal()

NumericVector< Number > & SolverSystem::solutionInternal ( ) const
inlinefinaloverrideprotectedvirtualinherited

Internal getter for solution owned by libMesh.

Implements SystemBase.

Definition at line 135 of file SolverSystem.h.

136{
137 return *system().solution;
138}
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 216 of file SystemBase.h.

216{ return solutionState(1); }

◆ solutionOlder() [1/2]

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

◆ solutionOlder() [2/2]

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

Definition at line 217 of file SystemBase.h.

217{ return solutionState(2); }

◆ solutionPreviousNewton() [1/2]

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

Reimplemented in DisplacedSystem.

Definition at line 1365 of file SystemBase.C.

1366{
1369 else
1370 return nullptr;
1371}

◆ solutionPreviousNewton() [2/2]

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

Reimplemented in DisplacedSystem.

Definition at line 1374 of file SystemBase.C.

1375{
1378 else
1379 return nullptr;
1380}

Referenced by AuxiliarySystem::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 1466 of file SystemBase.C.

1468{
1469 if (!hasSolutionState(state, iteration_type))
1470 needSolutionState(state, iteration_type);
1471 return *getSolutionStates(iteration_type)[state];
1472}
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.

Referenced by SolverSystem::applyFixedPointRelaxation(), SystemBase::copyPreviousSolutions(), FunctorNodalCorrector::execute(), 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 1436 of file SystemBase.C.

1438{
1439 if (!hasSolutionState(state, iteration_type))
1440 {
1441 const auto num_states = getNumSolutionStates(iteration_type);
1442 mooseError("For iteration type '",
1443 Moose::stringify(iteration_type),
1444 "': solution state ",
1445 state,
1446 " was requested in ",
1447 name(),
1448 " but only up to state ",
1449 (num_states == 0) ? 0 : num_states - 1,
1450 " is available.");
1451 }
1452
1453 const auto & solution_states = getSolutionStates(iteration_type);
1454
1455 if (state == 0)
1456 mooseAssert(solution_states[0] == &solutionInternal(), "Inconsistent current solution");
1457 else
1458 mooseAssert(solution_states[state] ==
1459 &getVector(oldSolutionStateVectorName(state, iteration_type)),
1460 "Inconsistent solution state");
1461
1462 return *solution_states[state];
1463}

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

1477{
1478 if (!hasSolutionState(state, iteration_type))
1479 mooseError("solutionStateParallelType() may only be called if the solution state exists.");
1480 return getSolutionStates(iteration_type)[state]->type();
1481}

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

bool _solution_states_initialized
Whether or not the solution states have been initialized.

Referenced by LinearFVGradientManager::computeGradients(), LinearFVGradientManager::resizeGradientStateStorage(), 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 293 of file SystemBase.h.

293{ 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 294 of file SystemBase.h.

294{ 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 296 of file SystemBase.h.

296{ 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 295 of file SystemBase.h.

295{ return _u_dot_old; }

◆ solve()

virtual void DumpObjectsLinearSystem::solve ( )
inlineoverridevirtual

Solve the system (using libMesh magic)

Reimplemented from LinearSystem.

Definition at line 30 of file DumpObjectsLinearSystem.h.

30{}

◆ stopSolve()

virtual void DumpObjectsLinearSystem::stopSolve ( const ExecFlagType &  exec_flag,
const std::set< TagID > &  vector_tags_to_close 
)
inlineoverridevirtual

Quit the current solve as soon as possible.

Reimplemented from LinearSystem.

Definition at line 31 of file DumpObjectsLinearSystem.h.

31{}

◆ subdomainSetup()

void SystemBase::subdomainSetup ( )
virtualinherited

Reimplemented in NonlinearSystemBase, and AuxiliarySystem.

Definition at line 1613 of file SystemBase.C.

1614{
1615 for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
1616 _vars[tid].subdomainSetup();
1617}
virtual void subdomainSetup()

Referenced by SystemBase::subdomainSetup(), AuxiliarySystem::subdomainSetup(), and NonlinearSystemBase::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; }

◆ system() [1/2]

virtual const System & LinearSystem::system ( ) const
inlineoverridevirtualinherited

Implements SystemBase.

Definition at line 145 of file LinearSystem.h.

145{ return _sys; }

◆ system() [2/2]

virtual System & LinearSystem::system ( )
inlineoverridevirtualinherited

Get the reference to the libMesh system.

Implements SystemBase.

Definition at line 144 of file LinearSystem.h.

144{ return _sys; }

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

◆ systemMatrixTag()

virtual TagID LinearSystem::systemMatrixTag ( ) const
inlineoverridevirtualinherited

Return the Matrix Tag ID for System.

Reimplemented from SystemBase.

Definition at line 152 of file LinearSystem.h.

152{ return _system_matrix_tag; }
TagID _system_matrix_tag
Tag for every contribution to system matrix.

Referenced by FEProblemBase::computeLinearSystemSys().

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

◆ timeKernelVariableNames()

virtual std::vector< std::string > LinearSystem::timeKernelVariableNames ( )
inlineoverridevirtualinherited

Returns the names of the variables that have time derivative kernels in the system.

Implements SolverSystem.

Definition at line 106 of file LinearSystem.h.

106{ return {}; }

◆ timestepSetup()

void SystemBase::timestepSetup ( )
virtualinherited

Reimplemented in AuxiliarySystem, and NonlinearSystemBase.

Definition at line 1599 of file SystemBase.C.

1600{
1601 for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
1602 _vars[tid].timestepSetup();
1603}
virtual void timestepSetup()

Referenced by SystemBase::timestepSetup(), AuxiliarySystem::timestepSetup(), and NonlinearSystemBase::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 320 of file SystemBase.h.

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

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

◆ update()

void SystemBase::update ( )
inherited

◆ updateFVGradient()

void LinearFVGradientManager::updateFVGradient ( const LinearFVGradientReader &  reader)
inherited

Update a registered gradient reader explicitly.

Parameters
readerGradient reader to update.

Definition at line 81 of file LinearFVGradientManager.C.

136{
137 if (&reader.system() != &_sys)
138 mooseError("Requested update for a linear FV gradient field from a different system than '",
139 _sys.name(),
140 "'.");
141
142 const auto method_container_pair = _linear_fv_gradient_container_by_method.find(&reader.method());
143 if (method_container_pair != _linear_fv_gradient_container_by_method.end())
144 {
145 auto * const perf_graph_interface = dynamic_cast<PerfGraphInterface *>(&_sys);
146 mooseAssert(perf_graph_interface,
147 "LinearFVGradientManager requires its owning system to implement "
148 "PerfGraphInterface.");
149 const auto perf_id =
150 perf_graph_interface->registerTimedSection("LinearVariableFV_Gradients", 3);
151 mooseAssert(!Threads::in_threads, "PerfGraph timing cannot be used within threaded sections");
152 PerfGuard time_guard(perf_graph_interface->perfGraph(), perf_id);
153
154 auto & container = computeLinearFVGradientContainer(reader.method());
156 return;
157 }
158
159 mooseError("Requested update for an unregistered linear FV gradient field on system '",
160 _sys.name(),
161 "'.");
162}
const FVGradientMethod & method() const
Method object that produces the stored values.
const SystemBase & system() const
System whose DOF map indexes the stored values.

◆ 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

Definition at line 784 of file SystemBase.h.

784{ return _vars[tid]; }

Referenced by AuxiliarySystem::updateFVGradient().

◆ varKind()

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

Definition at line 959 of file SystemBase.h.

959{ 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:144

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

200{
201 if (vars_to_be_zeroed.size() > 0)
202 {
203 NumericVector<Number> & solution = this->solution();
204
205 auto problem = dynamic_cast<FEProblemBase *>(&_subproblem);
206 if (!problem)
207 mooseError("System needs to be registered in FEProblemBase for using zeroVariables.");
208
209 AllLocalDofIndicesThread aldit(*problem, vars_to_be_zeroed, true);
210 const ConstElemRange & elem_range = *_mesh.getActiveLocalElementRange();
211 Threads::parallel_reduce(elem_range, aldit);
212
213 const auto & dof_indices_to_zero = aldit.getDofIndices();
214
215 solution.close();
216
217 for (const auto & dof : dof_indices_to_zero)
218 solution.set(dof, 0);
219
220 solution.close();
221
222 // Call update to update the current_local_solution for this system
223 system().update();
224 }
225}
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 234 of file SystemBase.C.

235{
237}
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:199

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

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 1072 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 1102 of file SystemBase.h.

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

◆ _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::checkNonConformingFaces(), MeshDiagnosticsGenerator::checkNonMatchingEdges(), MeshDiagnosticsGenerator::checkNonPlanarSides(), MeshDiagnosticsGenerator::checkPolygons(), FEProblemBase::checkProblemIntegrity(), ReferenceResidualConvergence::checkResidualConvergence(), MeshDiagnosticsGenerator::checkSidesetsOrientation(), MeshDiagnosticsGenerator::checkWatertightNodesets(), MeshDiagnosticsGenerator::checkWatertightSidesets(), CoarsenSurfaceMeshAlongSidesetGenerator::coarsenAlongSidesets(), 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(), CoarsenSurfaceMeshAlongSidesetGenerator::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().

◆ _converged

bool LinearSystem::_converged
protectedinherited

If the solve on the linear system converged.

Definition at line 246 of file LinearSystem.h.

Referenced by LinearSystem::converged(), and LinearSystem::solve().

◆ _current_l_its

unsigned int LinearSystem::_current_l_its
protectedinherited

The linear iterations needed for convergence.

Definition at line 207 of file LinearSystem.h.

Referenced by LinearSystem::solve().

◆ _current_solution

const NumericVector<Number>* SolverSystem::_current_solution
protectedinherited

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

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

◆ _du_dotdot_du

Real SystemBase::_du_dotdot_du
protectedinherited

Definition at line 1065 of file SystemBase.h.

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

◆ _dummy

NumericVector<Number>* DumpObjectsLinearSystem::_dummy
protected

Definition at line 35 of file DumpObjectsLinearSystem.h.

◆ _factory

Factory& SystemBase::_factory
protectedinherited

◆ _fe_problem

FEProblemBase& SystemBase::_fe_problem
protectedinherited

the governing finite element/volume problem

Definition at line 1033 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(), AuxiliarySystem::clearScalarVariableCoupleableTags(), AuxiliarySystem::compute(), LinearSystem::compute(), SolverSystem::compute(), NonlinearSystemBase::computeDamping(), NonlinearSystemBase::computeDiracContributions(), AuxiliarySystem::computeElementalVarsHelper(), NonlinearSystemBase::computeJacobian(), NonlinearSystemBase::computeJacobianBlocks(), NonlinearSystemBase::computeJacobianBlocks(), NonlinearSystemBase::computeJacobianInternal(), LinearSystem::computeLinearSystemInternal(), LinearSystem::computeLinearSystemTags(), AuxiliarySystem::computeMortarNodalVars(), NonlinearSystemBase::computeNodalBCsJacobian(), NonlinearSystemBase::computeNodalBCsResidual(), NonlinearSystemBase::computeNodalBCsResidual(), NonlinearSystemBase::computeNodalBCsResidualAndJacobian(), AuxiliarySystem::computeNodalVarsHelper(), NonlinearSystemBase::computeResidualAndJacobianInternal(), NonlinearSystemBase::computeResidualInternal(), NonlinearSystemBase::computeResidualTags(), NonlinearSystemBase::computeScalarKernelsJacobians(), AuxiliarySystem::computeScalarVars(), NonlinearSystemBase::computeScaling(), NonlinearSystem::computeScalingJacobian(), NonlinearSystem::computeScalingResidual(), NonlinearSystemBase::constraintJacobians(), NonlinearSystemBase::constraintResiduals(), LinearSystem::containsTimeKernel(), NonlinearSystem::converged(), NonlinearSystemBase::convergence(), 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(), AuxiliarySystem::setScalarVariableCoupleableTags(), NonlinearSystemBase::shouldEvaluatePreSMOResidual(), NonlinearSystem::solve(), and NonlinearSystemBase::timestepSetup().

◆ _final_linear_residual

Real LinearSystem::_final_linear_residual
protectedinherited

The final linear residual.

Definition at line 243 of file LinearSystem.h.

Referenced by LinearSystem::solve().

◆ _initial_linear_residual

Real LinearSystem::_initial_linear_residual
protectedinherited

The initial linear residual.

Definition at line 240 of file LinearSystem.h.

Referenced by LinearSystem::solve().

◆ _ksp_norm

Moose::MooseKSPNormType SolverSystem::_ksp_norm
protectedinherited

KSP norm type.

Definition at line 122 of file SolverSystem.h.

Referenced by SolverSystem::getMooseKSPNormType(), and SolverSystem::setMooseKSPNormType().

◆ _linear_fv_gradient_container_by_method

std::unordered_map<const FVGradientMethod *, LinearFVGradientContainer> LinearFVGradientManager::_linear_fv_gradient_container_by_method
protectedinherited

◆ _linear_implicit_system

libMesh::LinearImplicitSystem& LinearSystem::_linear_implicit_system
protectedinherited

◆ _matrix_tag_active_flags

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

Active flags for tagged matrices.

Definition at line 1074 of file SystemBase.h.

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

◆ _matrix_tags

std::set<TagID> LinearSystem::_matrix_tags
protectedinherited

Matrix tags to temporarily store all tags associated with the current system.

Definition at line 213 of file LinearSystem.h.

◆ _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 1090 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 1093 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 1047 of file SystemBase.h.

Referenced by SystemBase::getMaxVariableNumber().

◆ _mesh

MooseMesh& SystemBase::_mesh
protectedinherited

◆ _n_linear_iters

unsigned int LinearSystem::_n_linear_iters
protectedinherited

Number of linear iterations.

Definition at line 237 of file LinearSystem.h.

Referenced by LinearSystem::nLinearIterations(), and LinearSystem::solve().

◆ _name

std::string SystemBase::_name
protectedinherited

The name of this system.

Definition at line 1040 of file SystemBase.h.

◆ _numbered_vars

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

Map variable number to its pointer.

Definition at line 1099 of file SystemBase.h.

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

◆ _pc_side

Moose::PCSideType SolverSystem::_pc_side
protectedinherited

Preconditioning side.

Definition at line 120 of file SolverSystem.h.

Referenced by SolverSystem::getPCSide(), and SolverSystem::setPCSide().

◆ _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().

◆ _rhs_non_time

NumericVector<Number>* LinearSystem::_rhs_non_time
protectedinherited

right hand side vector for non-time contributions

Definition at line 225 of file LinearSystem.h.

Referenced by LinearSystem::getRightHandSideNonTimeVector().

◆ _rhs_non_time_tag

TagID LinearSystem::_rhs_non_time_tag
protectedinherited

Tag for non-time contribution rhs.

Definition at line 222 of file LinearSystem.h.

Referenced by LinearSystem::rightHandSideNonTimeVectorTag().

◆ _rhs_tag

TagID LinearSystem::_rhs_tag
protectedinherited

Used for the right hand side vector from PETSc.

Definition at line 228 of file LinearSystem.h.

Referenced by LinearSystem::LinearSystem(), and LinearSystem::rightHandSideVectorTag().

◆ _rhs_time

NumericVector<Number>* LinearSystem::_rhs_time
protectedinherited

right hand side vector for time contributions

Definition at line 219 of file LinearSystem.h.

Referenced by LinearSystem::getRightHandSideTimeVector().

◆ _rhs_time_tag

TagID LinearSystem::_rhs_time_tag
protectedinherited

Tag for time contribution rhs.

Definition at line 216 of file LinearSystem.h.

Referenced by LinearSystem::rightHandSideTimeVectorTag().

◆ _saved_dot_old

NumericVector<Real>* SystemBase::_saved_dot_old
protectedinherited

Definition at line 1081 of file SystemBase.h.

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

◆ _saved_dotdot_old

NumericVector<Real>* SystemBase::_saved_dotdot_old
protectedinherited

Definition at line 1082 of file SystemBase.h.

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

◆ _saved_old

NumericVector<Real>* SystemBase::_saved_old
protectedinherited

Definition at line 1077 of file SystemBase.h.

◆ _saved_older

NumericVector<Real>* SystemBase::_saved_older
protectedinherited

Definition at line 1078 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 1147 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 1115 of file SystemBase.h.

Referenced by AuxiliarySystem::compute(), SolverSystem::preInit(), SystemBase::serializedSolution(), AuxiliarySystem::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 1149 of file SystemBase.h.

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

◆ _solution_is_invalid

bool SolverSystem::_solution_is_invalid
protectedinherited

Boolean to see if solution is invalid.

Definition at line 125 of file SolverSystem.h.

◆ _solution_state

std::vector<NumericVector<Number> *> LinearSystem::_solution_state
privateinherited

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

Definition at line 253 of file LinearSystem.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 1145 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 1108 of file SystemBase.h.

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

◆ _subproblem

SubProblem& SystemBase::_subproblem
protectedinherited

◆ _sys

System& LinearSystem::_sys
protectedinherited

Base class reference to the libmesh system.

Definition at line 204 of file LinearSystem.h.

Referenced by LinearSystem::preInit(), LinearSystem::system(), and LinearSystem::system().

◆ _system_matrix_non_time_tag

TagID LinearSystem::_system_matrix_non_time_tag
protectedinherited

Tag for non-time contribution to the system matrix.

Definition at line 231 of file LinearSystem.h.

◆ _system_matrix_tag

TagID LinearSystem::_system_matrix_tag
protectedinherited

Tag for every contribution to system matrix.

Definition at line 234 of file LinearSystem.h.

Referenced by LinearSystem::LinearSystem(), and LinearSystem::systemMatrixTag().

◆ _tagged_matrices

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

◆ _tagged_vectors

std::vector<NumericVector<Number> *> SystemBase::_tagged_vectors
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 1111 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 1085 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 1045 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 1043 of file SystemBase.h.

Referenced by NonlinearSystemBase::addBoundaryCondition(), NonlinearSystemBase::addInterfaceKernel(), AuxiliarySystem::addVariable(), SystemBase::applyScalingFactors(), NonlinearSystemBase::assembleScalingVector(), SystemBase::clearAllDofIndices(), AuxiliarySystem::compute(), SystemBase::customSetup(), SystemBase::getActualFieldVariable(), SystemBase::getActualFieldVariable(), SystemBase::getFieldVariable(), SystemBase::getFieldVariable(), SystemBase::getFVVariable(), SystemBase::getMinQuadratureOrder(), AuxiliarySystem::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

◆ _vector_tags

std::set<TagID> LinearSystem::_vector_tags
protectedinherited

Vector tags to temporarily store all tags associated with the current system.

Definition at line 210 of file LinearSystem.h.

◆ _verbose

bool SystemBase::_verbose
protectedinherited

True if printing out additional information.

Definition at line 1105 of file SystemBase.h.

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


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