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

#include <DisplacedSystem.h>

Inheritance diagram for DisplacedSystem:
[legend]

Public Member Functions

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

Public Attributes

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

Protected Member Functions

NumericVector< Number > & solutionInternal () const override
 Internal getter for solution owned by libMesh. More...
 

Protected Attributes

SystemBase_undisplaced_system
 
TransientExplicitSystem_sys
 
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. More...
 
FEProblemBase_fe_problem
 the governing finite element/volume problem More...
 
MooseApp_app
 
Factory_factory
 
MooseMesh_mesh
 
std::string _name
 The name of this system. More...
 
std::vector< VariableWarehouse_vars
 Variable warehouses (one for each thread) More...
 
std::map< unsigned int, std::set< SubdomainID > > _var_map
 Map of variables (variable id -> array of subdomains where it lives) More...
 
unsigned int _max_var_number
 Maximum variable number. More...
 
std::vector< std::string > _vars_to_be_zeroed_on_residual
 
std::vector< std::string > _vars_to_be_zeroed_on_jacobian
 
NumericVector< Number > * _u_dot
 solution vector for u^dot More...
 
NumericVector< Number > * _u_dotdot
 solution vector for u^dotdot More...
 
NumericVector< Number > * _u_dot_old
 old solution vector for u^dot More...
 
NumericVector< Number > * _u_dotdot_old
 old solution vector for u^dotdot More...
 
Real _du_dot_du
 
Real _du_dotdot_du
 
std::vector< NumericVector< Number > * > _tagged_vectors
 Tagged vectors (pointer) More...
 
std::vector< SparseMatrix< Number > * > _tagged_matrices
 Tagged matrices (pointer) More...
 
std::vector< bool > _matrix_tag_active_flags
 Active flags for tagged matrices. More...
 
NumericVector< Real > * _saved_old
 
NumericVector< Real > * _saved_older
 
NumericVector< Real > * _saved_dot_old
 
NumericVector< Real > * _saved_dotdot_old
 
Moose::VarKindType _var_kind
 default kind of variables in this system More...
 
std::vector< VarCopyInfo_var_to_copy
 
size_t _max_var_n_dofs_per_elem
 Maximum number of dofs for any one variable on any one element. More...
 
size_t _max_var_n_dofs_per_node
 Maximum number of dofs for any one variable on any one node. More...
 
std::shared_ptr< TimeIntegrator_time_integrator
 Time integrator. More...
 
std::vector< std::vector< MooseVariableFieldBase * > > _numbered_vars
 Map variable number to its pointer. More...
 
bool _automatic_scaling
 Whether to automatically scale the variables. More...
 
bool _verbose
 True if printing out additional information. More...
 
bool _solution_states_initialized
 Whether or not the solution states have been initialized. More...
 
std::vector< dof_id_type_var_all_dof_indices
 Container for the dof indices of a given variable. More...
 
std::unique_ptr< NumericVector< Number > > _serialized_solution
 Serialized version of the solution vector, or nullptr if a serialized solution is not needed. More...
 
std::vector< std::unique_ptr< NumericVector< Number > > > _raw_grad_container
 A cache for storing gradients at dof locations. More...
 
const Parallel::Communicator & _communicator
 

Detailed Description

Definition at line 24 of file DisplacedSystem.h.

Constructor & Destructor Documentation

◆ DisplacedSystem() [1/2]

DisplacedSystem::DisplacedSystem ( DisplacedSystem &&  )
delete

◆ DisplacedSystem() [2/2]

DisplacedSystem::DisplacedSystem ( DisplacedProblem problem,
FEProblemBase fe_problem,
SystemBase undisplaced_system,
const std::string &  name,
Moose::VarKindType  var_kind 
)

Definition at line 18 of file DisplacedSystem.C.

23  : SystemBase(problem, fe_problem, name, var_kind),
24  _undisplaced_system(undisplaced_system),
25  _sys(problem.es().add_system<TransientExplicitSystem>(name))
26 {
27  if (!problem.defaultGhosting())
28  {
29  auto & dof_map = _sys.get_dof_map();
30  dof_map.remove_algebraic_ghosting_functor(dof_map.default_algebraic_ghosting());
31  dof_map.set_implicit_neighbor_dofs(false);
32  }
33 }
TransientExplicitSystem & _sys
virtual EquationSystems & es() override
virtual const std::string & name() const
Definition: SystemBase.C:1293
SystemBase & _undisplaced_system
TransientSystem< ExplicitSystem > TransientExplicitSystem
SystemBase(SubProblem &subproblem, FEProblemBase &fe_problem, const std::string &name, Moose::VarKindType var_kind)
Definition: SystemBase.C:52
bool defaultGhosting()
Whether or not the user has requested default ghosting ot be on.
Definition: SubProblem.h:132

◆ ~DisplacedSystem()

DisplacedSystem::~DisplacedSystem ( )
virtual

Definition at line 35 of file DisplacedSystem.C.

35 {}

Member Function Documentation

◆ activeAllMatrixTags()

void SystemBase::activeAllMatrixTags ( )
virtualinherited

Make all exsiting matrices ative.

Definition at line 1110 of file SystemBase.C.

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

1111 {
1112  auto num_matrix_tags = _subproblem.numMatrixTags();
1113 
1114  _matrix_tag_active_flags.resize(num_matrix_tags);
1115 
1116  for (decltype(num_matrix_tags) tag = 0; tag < num_matrix_tags; tag++)
1117  if (hasMatrix(tag))
1118  _matrix_tag_active_flags[tag] = true;
1119  else
1120  _matrix_tag_active_flags[tag] = false;
1121 }
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:338
std::vector< bool > _matrix_tag_active_flags
Active flags for tagged matrices.
Definition: SystemBase.h:991
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951
virtual unsigned int numMatrixTags() const
The total number of tags.
Definition: SubProblem.h:220

◆ activeMatrixTag()

void SystemBase::activeMatrixTag ( TagID  tag)
virtualinherited

Active a matrix for tag.

Definition at line 1075 of file SystemBase.C.

1076 {
1077  mooseAssert(_subproblem.matrixTagExists(tag),
1078  "Cannot active Matrix with matrix_tag : " << tag << "that does not exist");
1079 
1080  if (_matrix_tag_active_flags.size() < tag + 1)
1081  _matrix_tag_active_flags.resize(tag + 1);
1082 
1083  _matrix_tag_active_flags[tag] = true;
1084 }
std::vector< bool > _matrix_tag_active_flags
Active flags for tagged matrices.
Definition: SystemBase.h:991
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:306

◆ addDotVectors()

virtual void DisplacedSystem::addDotVectors ( )
inlineoverridevirtual

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

Reimplemented from SystemBase.

Definition at line 157 of file DisplacedSystem.h.

SystemBase & _undisplaced_system
virtual void addDotVectors()
Add u_dot, u_dotdot, u_dot_old and u_dotdot_old vectors if requested by the time integrator.
Definition: SystemBase.C:1558

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

567 {
568  if (!_subproblem.matrixTagExists(tag))
569  mooseError("Cannot add tagged matrix with TagID ",
570  tag,
571  " in system '",
572  name(),
573  "' because the tag does not exist in the problem");
574 
575  if (hasMatrix(tag))
576  return getMatrix(tag);
577 
578  const auto matrix_name = _subproblem.matrixTagName(tag);
579  SparseMatrix<Number> & mat = system().add_matrix(matrix_name);
580  associateMatrixToTag(mat, tag);
581 
582  return mat;
583 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:338
virtual const std::string & name() const
Definition: SystemBase.C:1293
virtual void associateMatrixToTag(SparseMatrix< Number > &matrix, TagID tag)
Associate a matrix to a tag.
Definition: SystemBase.C:1032
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951
virtual System & system()=0
Get the reference to the libMesh system.
virtual SparseMatrix< Number > & getMatrix(TagID tag)
Get a raw SparseMatrix.
Definition: SystemBase.C:980
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:306
virtual TagName matrixTagName(TagID tag)
Retrieve the name associated with a TagID.
Definition: SubProblem.C:335

◆ addScalingVector()

void SystemBase::addScalingVector ( )
inherited

Add the scaling factor vector to the system.

Definition at line 1470 of file SystemBase.C.

Referenced by MooseVariableBase::initialSetup().

1471 {
1472  addVector("scaling_factors", /*project=*/false, libMesh::ParallelType::GHOSTED);
1474 }
NumericVector< Number > & addVector(const std::string &vector_name, const bool project, const ParallelType type)
Adds a solution length vector to the system.
Definition: SystemBase.C:604
void hasScalingVector(const unsigned int nl_sys_num)
Tells this problem that the assembly associated with the given nonlinear system number involves a sca...
Definition: SubProblem.C:1127
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1132

◆ addTimeIntegrator() [1/4]

virtual void SystemBase::addTimeIntegrator
inline

Definition at line 871 of file SystemBase.h.

874  {
875  }

◆ addTimeIntegrator() [2/4]

virtual void SystemBase::addTimeIntegrator
inline

Definition at line 877 of file SystemBase.h.

877 {}

◆ addTimeIntegrator() [3/4]

void DisplacedSystem::addTimeIntegrator ( std::shared_ptr< TimeIntegrator ti)
overridevirtual

Reimplemented from SystemBase.

Definition at line 56 of file DisplacedSystem.C.

57 {
58  _time_integrator = ti;
59 }
std::shared_ptr< TimeIntegrator > _time_integrator
Time integrator.
Definition: SystemBase.h:1013

◆ addTimeIntegrator() [4/4]

virtual void SystemBase::addTimeIntegrator ( const std::string &  ,
const std::string &  ,
InputParameters  
)
inlinevirtualinherited

Reimplemented in NonlinearSystemBase, AuxiliarySystem, and LinearSystem.

Definition at line 871 of file SystemBase.h.

874  {
875  }

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

Referenced by AuxiliarySystem::addVariable().

718 {
720 
721  auto components = parameters.get<unsigned int>("components");
722 
723  // Convert the std::vector parameter provided by the user into a std::set for use by libMesh's
724  // System::add_variable method
725  std::set<SubdomainID> blocks;
726  const auto & block_param = parameters.get<std::vector<SubdomainName>>("block");
727  for (const auto & subdomain_name : block_param)
728  {
729  SubdomainID blk_id = _mesh.getSubdomainID(subdomain_name);
730  blocks.insert(blk_id);
731  }
732 
733  auto fe_type = FEType(Utility::string_to_enum<Order>(parameters.get<MooseEnum>("order")),
734  Utility::string_to_enum<FEFamily>(parameters.get<MooseEnum>("family")));
735 
736  unsigned int var_num;
737 
738  if (var_type == "ArrayMooseVariable")
739  {
740  if (fe_type.family == NEDELEC_ONE || fe_type.family == LAGRANGE_VEC ||
741  fe_type.family == MONOMIAL_VEC || fe_type.family == RAVIART_THOMAS)
742  mooseError("Vector family type cannot be used in an array variable");
743 
744  // Build up the variable names
745  std::vector<std::string> var_names;
746  for (unsigned int i = 0; i < components; i++)
747  var_names.push_back(SubProblem::arrayVariableComponent(name, i));
748 
749  // The number returned by libMesh is the _last_ variable number... we want to hold onto the
750  // _first_
751  var_num = system().add_variables(var_names, fe_type, &blocks) - (components - 1);
752 
753  // Set as array variable
754  if (parameters.isParamSetByUser("array") && !parameters.get<bool>("array"))
755  mooseError("Variable '",
756  name,
757  "' is an array variable ('components' > 1) but 'array' is set to false.");
758  parameters.set<bool>("array") = true;
759  }
760  else
761  var_num = system().add_variable(name, fe_type, &blocks);
762 
763  parameters.set<unsigned int>("_var_num") = var_num;
764  parameters.set<SystemBase *>("_system_base") = this;
765 
766  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
767  {
768  parameters.set<THREAD_ID>("tid") = tid;
769  std::shared_ptr<MooseVariableBase> var =
770  _factory.create<MooseVariableBase>(var_type, name, parameters, tid);
771 
772  _vars[tid].add(name, var);
773 
774  if (auto fe_var = dynamic_cast<MooseVariableFieldBase *>(var.get()))
775  {
776  auto required_size = var_num + components;
777  if (required_size > _numbered_vars[tid].size())
778  _numbered_vars[tid].resize(required_size);
779  for (MooseIndex(components) component = 0; component < components; ++component)
780  _numbered_vars[tid][var_num + component] = fe_var;
781 
782  if (auto * const functor = dynamic_cast<Moose::FunctorBase<ADReal> *>(fe_var))
783  _subproblem.addFunctor(name, *functor, tid);
784  else if (auto * const functor = dynamic_cast<Moose::FunctorBase<ADRealVectorValue> *>(fe_var))
785  _subproblem.addFunctor(name, *functor, tid);
786  else if (auto * const functor = dynamic_cast<Moose::FunctorBase<RealEigenVector> *>(fe_var))
787  _subproblem.addFunctor(name, *functor, tid);
788  else
789  mooseError("This should be a functor");
790  }
791 
792  if (var->blockRestricted())
793  for (const SubdomainID & id : var->blockIDs())
794  for (MooseIndex(components) component = 0; component < components; ++component)
795  _var_map[var_num + component].insert(id);
796  else
797  for (MooseIndex(components) component = 0; component < components; ++component)
798  _var_map[var_num + component] = std::set<SubdomainID>();
799  }
800 
801  // getMaxVariableNumber is an API method used in Rattlesnake
802  if (var_num > _max_var_number)
803  _max_var_number = var_num;
804 }
std::vector< std::vector< MooseVariableFieldBase * > > _numbered_vars
Map variable number to its pointer.
Definition: SystemBase.h:1016
unsigned int n_threads()
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters &parameters, THREAD_ID tid=0, bool print_deprecated=true)
Definition: Factory.C:110
void addFunctor(const std::string &name, const Moose::FunctorBase< T > &functor, const THREAD_ID tid)
add a functor to the problem functor container
Definition: SubProblem.h:1332
Factory & _factory
Definition: SystemBase.h:957
Base class for a system (of equations)
Definition: SystemBase.h:85
virtual const std::string & name() const
Definition: SystemBase.C:1293
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:31
subdomain_id_type SubdomainID
virtual System & system()=0
Get the reference to the libMesh system.
std::map< unsigned int, std::set< SubdomainID > > _var_map
Map of variables (variable id -> array of subdomains where it lives)
Definition: SystemBase.h:966
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was by the user.
static std::string arrayVariableComponent(const std::string &var_name, unsigned int i)
Returns the variable name of a component of an array variable.
Definition: SubProblem.h:271
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964
MooseMesh & _mesh
Definition: SystemBase.h:959
unsigned int _max_var_number
Maximum variable number.
Definition: SystemBase.h:968
unsigned int THREAD_ID
Definition: MooseTypes.h:198
SubdomainID getSubdomainID(const SubdomainName &subdomain_name) const
Get the associated subdomain ID for the subdomain name.
Definition: MooseMesh.C:1514

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

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

1153 {
1154  _var_to_copy.push_back(VarCopyInfo(dest_name, source_name, timestep));
1155 }
std::vector< VarCopyInfo > _var_to_copy
Definition: SystemBase.h:1004
Information about variables that will be copied.
Definition: SystemBase.h:67

◆ addVariableToZeroOnJacobian()

virtual void DisplacedSystem::addVariableToZeroOnJacobian ( std::string  var_name)
inlineoverridevirtual

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

Parameters
var_nameThe name of the variable to be zeroed.

Reimplemented from SystemBase.

Definition at line 200 of file DisplacedSystem.h.

201  {
203  }
SystemBase & _undisplaced_system
virtual void addVariableToZeroOnJacobian(std::string var_name)
Adds this variable to the list of variables to be zeroed during each Jacobian evaluation.
Definition: SystemBase.C:176

◆ addVariableToZeroOnResidual()

virtual void DisplacedSystem::addVariableToZeroOnResidual ( std::string  var_name)
inlineoverridevirtual

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

Parameters
var_nameThe name of the variable to be zeroed.

Reimplemented from SystemBase.

Definition at line 191 of file DisplacedSystem.h.

192  {
194  }
SystemBase & _undisplaced_system
virtual void addVariableToZeroOnResidual(std::string var_name)
Adds this variable to the list of variables to be zeroed during each residual evaluation.
Definition: SystemBase.C:170

◆ addVector() [1/2]

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

Adds a solution length vector to the system.

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

Definition at line 604 of file SystemBase.C.

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

605 {
606  if (hasVector(vector_name))
607  return getVector(vector_name);
608 
609  NumericVector<Number> & vec = system().add_vector(vector_name, project, type);
610  return vec;
611 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:880
virtual System & system()=0
Get the reference to the libMesh system.
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:889

◆ addVector() [2/2]

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

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

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

Definition at line 614 of file SystemBase.C.

615 {
616  if (!_subproblem.vectorTagExists(tag))
617  mooseError("Cannot add tagged vector with TagID ",
618  tag,
619  " in system '",
620  name(),
621  "' because the tag does not exist in the problem");
622 
623  if (hasVector(tag))
624  {
625  auto & vec = getVector(tag);
626 
627  if (type != ParallelType::AUTOMATIC && vec.type() != type)
628  mooseError("Cannot add tagged vector '",
630  "', in system '",
631  name(),
632  "' because a vector with the same name was found with a different parallel type");
633 
634  return vec;
635  }
636 
637  const auto vector_name = _subproblem.vectorTagName(tag);
638  NumericVector<Number> & vec = system().add_vector(vector_name, project, type);
639  associateVectorToTag(vec, tag);
640 
641  return vec;
642 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:880
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
virtual void associateVectorToTag(NumericVector< Number > &vec, TagID tag)
Associate a vector for a given tag.
Definition: SystemBase.C:937
virtual const std::string & name() const
Definition: SystemBase.C:1293
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:173
virtual System & system()=0
Get the reference to the libMesh system.
virtual TagName vectorTagName(const TagID tag) const
Retrieve the name associated with a TagID.
Definition: SubProblem.C:199
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:889

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

Referenced by NonlinearSystemBase::computeScaling().

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

◆ assignMaxVarNDofsPerElem()

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

assign the maximum element dofs

Definition at line 585 of file SystemBase.h.

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

◆ assignMaxVarNDofsPerNode()

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

assign the maximum node dofs

Definition at line 590 of file SystemBase.h.

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

◆ associateMatrixToTag()

virtual void DisplacedSystem::associateMatrixToTag ( SparseMatrix< Number > &  matrix,
TagID  tag 
)
inlineoverridevirtual

Associate a matrix to a tag.

Reimplemented from SystemBase.

Definition at line 86 of file DisplacedSystem.h.

87  {
89  }
SystemBase & _undisplaced_system
virtual void associateMatrixToTag(SparseMatrix< Number > &matrix, TagID tag)
Associate a matrix to a tag.
Definition: SystemBase.C:1032

◆ associateVectorToTag()

virtual void DisplacedSystem::associateVectorToTag ( NumericVector< Number > &  vec,
TagID  tag 
)
inlineoverridevirtual

Associate a vector for a given tag.

Reimplemented from SystemBase.

Definition at line 66 of file DisplacedSystem.h.

67  {
69  }
virtual void associateVectorToTag(NumericVector< Number > &vec, TagID tag)
Associate a vector for a given tag.
Definition: SystemBase.C:937
SystemBase & _undisplaced_system

◆ augmentSendList()

virtual void DisplacedSystem::augmentSendList ( std::vector< dof_id_type > &  send_list)
inlineoverridevirtual

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

Reimplemented from SystemBase.

Definition at line 172 of file DisplacedSystem.h.

173  {
175  }
SystemBase & _undisplaced_system
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.
Definition: SystemBase.C:448

◆ augmentSparsity()

virtual void DisplacedSystem::augmentSparsity ( SparsityPattern::Graph &  ,
std::vector< dof_id_type > &  ,
std::vector< dof_id_type > &   
)
inlineoverridevirtual

This is an empty function since the displaced system doesn't have a matrix! All sparsity pattern modification will be taken care of by the undisplaced system directly.

Implements SystemBase.

Definition at line 181 of file DisplacedSystem.h.

184  {
185  }

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

Referenced by SubProblem::automaticScaling().

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

◆ 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; }
bool _automatic_scaling
Whether to automatically scale the variables.
Definition: SystemBase.h:1019

◆ clearAllDofIndices()

void SystemBase::clearAllDofIndices ( )
inherited

Clear all dof indices from moose variables.

Definition at line 1538 of file SystemBase.C.

Referenced by SubProblem::clearAllDofIndices().

1539 {
1540  for (auto & var_warehouse : _vars)
1541  var_warehouse.clearAllDofIndices();
1542 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964

◆ closeTaggedMatrices()

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

Close all matrices associated the tags.

Definition at line 1016 of file SystemBase.C.

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

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

◆ closeTaggedVector()

void SystemBase::closeTaggedVector ( const TagID  tag)
inherited

Close vector with the given tag.

Definition at line 645 of file SystemBase.C.

Referenced by SystemBase::closeTaggedVectors().

646 {
647  if (!_subproblem.vectorTagExists(tag))
648  mooseError("Cannot close vector with TagID ",
649  tag,
650  " in system '",
651  name(),
652  "' because that tag does not exist in the problem");
653  else if (!hasVector(tag))
654  mooseError("Cannot close vector tag with name '",
656  "' in system '",
657  name(),
658  "' because there is no vector associated with that tag");
659 
660  getVector(tag).close();
661 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:880
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
virtual const std::string & name() const
Definition: SystemBase.C:1293
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:173
virtual void close()=0
virtual TagName vectorTagName(const TagID tag) const
Retrieve the name associated with a TagID.
Definition: SubProblem.C:199
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:889

◆ closeTaggedVectors()

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

Close all vectors for given tags.

Definition at line 664 of file SystemBase.C.

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

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

◆ compute()

virtual void DisplacedSystem::compute ( ExecFlagType  type)
inlineoverridevirtual

Compute time derivatives, auxiliary variables, etc.

Parameters
typeOur current execution stage

Implements SystemBase.

Definition at line 255 of file DisplacedSystem.h.

255 {}

◆ computeVariables()

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

Definition at line 862 of file SystemBase.h.

862 {}

◆ computingScalingJacobian()

bool SystemBase::computingScalingJacobian ( ) const
inherited

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

Definition at line 1477 of file SystemBase.C.

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

1478 {
1480 }
virtual bool computingScalingJacobian() const =0
Getter for whether we&#39;re computing the scaling jacobian.
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951

◆ copyOldSolutions()

void SystemBase::copyOldSolutions ( )
virtualinherited

Shifts the solutions backwards in time.

Definition at line 1245 of file SystemBase.C.

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

1246 {
1247  // Copying the solutions backward so the current solution will become the old, and the old will
1248  // become older. The same applies to the nonlinear iterates.
1249  for (const auto iteration_index : index_range(_solution_states))
1250  {
1251  const auto states = _solution_states[iteration_index].size();
1252  if (states > 1)
1253  for (unsigned int i = states - 1; i > 0; --i)
1254  solutionState(i, Moose::SolutionIterationType(iteration_index)) =
1255  solutionState(i - 1, Moose::SolutionIterationType(iteration_index));
1256  }
1257 
1258  if (solutionUDotOld())
1259  *solutionUDotOld() = *solutionUDot();
1260  if (solutionUDotDotOld())
1262  if (solutionPreviousNewton())
1264 }
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
virtual NumericVector< Number > & solutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Get a state of the solution (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.C:1380
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:242
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:239
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:241
std::array< std::vector< NumericVector< Number > * >, 2 > _solution_states
The solution states (0 = current, 1 = old, 2 = older, etc)
Definition: SystemBase.h:1047
virtual const NumericVector< Number > * solutionPreviousNewton() const
Definition: SystemBase.C:1308
virtual NumericVector< Number > * solutionUDotDot()
Definition: SystemBase.h:240
auto index_range(const T &sizable)
SolutionIterationType
Definition: MooseTypes.h:229

◆ copySolutionsBackwards()

void SystemBase::copySolutionsBackwards ( )
virtualinherited

Copy current solution into old and older.

Definition at line 1234 of file SystemBase.C.

1235 {
1236  system().update();
1237 
1238  copyOldSolutions();
1239 }
virtual void copyOldSolutions()
Shifts the solutions backwards in time.
Definition: SystemBase.C:1245
virtual System & system()=0
Get the reference to the libMesh system.

◆ copyVars()

void SystemBase::copyVars ( ExodusII_IO &  io)
inherited

Definition at line 1158 of file SystemBase.C.

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

◆ currentSolution()

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

The solution vector that is currently being operated on.

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

Implements SystemBase.

Definition at line 114 of file DisplacedSystem.h.

115  {
117  }
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
SystemBase & _undisplaced_system

◆ customSetup()

void SystemBase::customSetup ( const ExecFlagType exec_type)
virtualinherited

Reimplemented in NonlinearSystemBase, and AuxiliarySystem.

Definition at line 1510 of file SystemBase.C.

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

1511 {
1512  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
1513  _vars[tid].customSetup(exec_type);
1514 }
unsigned int n_threads()
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964
virtual void customSetup(const ExecFlagType &exec_type)
Definition: SystemBase.C:1510
unsigned int THREAD_ID
Definition: MooseTypes.h:198

◆ deactiveAllMatrixTags()

void SystemBase::deactiveAllMatrixTags ( )
virtualinherited

Make matrices inactive.

Definition at line 1099 of file SystemBase.C.

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

1100 {
1101  auto num_matrix_tags = _subproblem.numMatrixTags();
1102 
1103  _matrix_tag_active_flags.resize(num_matrix_tags);
1104 
1105  for (decltype(num_matrix_tags) tag = 0; tag < num_matrix_tags; tag++)
1106  _matrix_tag_active_flags[tag] = false;
1107 }
std::vector< bool > _matrix_tag_active_flags
Active flags for tagged matrices.
Definition: SystemBase.h:991
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951
virtual unsigned int numMatrixTags() const
The total number of tags.
Definition: SubProblem.h:220

◆ deactiveMatrixTag()

void SystemBase::deactiveMatrixTag ( TagID  tag)
virtualinherited

deactive a matrix for tag

Definition at line 1087 of file SystemBase.C.

1088 {
1089  mooseAssert(_subproblem.matrixTagExists(tag),
1090  "Cannot deactivate Matrix with matrix_tag : " << tag << "that does not exist");
1091 
1092  if (_matrix_tag_active_flags.size() < tag + 1)
1093  _matrix_tag_active_flags.resize(tag + 1);
1094 
1095  _matrix_tag_active_flags[tag] = false;
1096 }
std::vector< bool > _matrix_tag_active_flags
Active flags for tagged matrices.
Definition: SystemBase.h:991
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:306

◆ defaultMatrixTags()

virtual std::set<TagID> DisplacedSystem::defaultMatrixTags ( ) const
inlineoverridevirtual

Get the default matrix tags associted with this system.

Reimplemented from SystemBase.

Definition at line 61 of file DisplacedSystem.h.

62  {
64  }
SystemBase & _undisplaced_system
virtual std::set< TagID > defaultMatrixTags() const
Get the default matrix tags associted with this system.
Definition: SystemBase.h:297

◆ defaultVectorTags()

virtual std::set<TagID> DisplacedSystem::defaultVectorTags ( ) const
inlineoverridevirtual

Get the default vector tags associated with this system.

Reimplemented from SystemBase.

Definition at line 57 of file DisplacedSystem.h.

58  {
60  }
SystemBase & _undisplaced_system
virtual std::set< TagID > defaultVectorTags() const
Get the default vector tags associated with this system.
Definition: SystemBase.h:290

◆ disassociateDefaultMatrixTags()

virtual void DisplacedSystem::disassociateDefaultMatrixTags ( )
inlineoverridevirtual

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

Reimplemented from SystemBase.

Definition at line 101 of file DisplacedSystem.h.

102  {
104  }
SystemBase & _undisplaced_system
virtual void disassociateDefaultMatrixTags()
Disassociate the matrices associated with the default matrix tags of this system. ...
Definition: SystemBase.C:1066

◆ disassociateDefaultVectorTags()

virtual void DisplacedSystem::disassociateDefaultVectorTags ( )
inlineoverridevirtual

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

Reimplemented from SystemBase.

Definition at line 81 of file DisplacedSystem.h.

82  {
84  }
virtual void disassociateDefaultVectorTags()
Disassociate the vectors associated with the default vector tags of this system.
Definition: SystemBase.C:971
SystemBase & _undisplaced_system

◆ disassociateMatrixFromTag() [1/2]

virtual void DisplacedSystem::disassociateMatrixFromTag ( SparseMatrix< Number > &  matrix,
TagID  tag 
)
inlineoverridevirtual

Disassociate a matrix from a tag.

Reimplemented from SystemBase.

Definition at line 91 of file DisplacedSystem.h.

92  {
94  }
SystemBase & _undisplaced_system
virtual void disassociateMatrixFromTag(SparseMatrix< Number > &matrix, TagID tag)
Disassociate a matrix from a tag.
Definition: SystemBase.C:1044

◆ disassociateMatrixFromTag() [2/2]

virtual void DisplacedSystem::disassociateMatrixFromTag ( TagID  tag)
inlineoverridevirtual

Disassociate any matrix that is associated with a given tag.

Reimplemented from SystemBase.

Definition at line 96 of file DisplacedSystem.h.

97  {
99  }
SystemBase & _undisplaced_system
virtual void disassociateMatrixFromTag(SparseMatrix< Number > &matrix, TagID tag)
Disassociate a matrix from a tag.
Definition: SystemBase.C:1044

◆ disassociateVectorFromTag() [1/2]

virtual void DisplacedSystem::disassociateVectorFromTag ( NumericVector< Number > &  vec,
TagID  tag 
)
inlineoverridevirtual

Disassociate a given vector from a given tag.

Reimplemented from SystemBase.

Definition at line 71 of file DisplacedSystem.h.

72  {
74  }
virtual void disassociateVectorFromTag(NumericVector< Number > &vec, TagID tag)
Disassociate a given vector from a given tag.
Definition: SystemBase.C:949
SystemBase & _undisplaced_system

◆ disassociateVectorFromTag() [2/2]

virtual void DisplacedSystem::disassociateVectorFromTag ( TagID  tag)
inlineoverridevirtual

Disassociate any vector that is associated with a given tag.

Reimplemented from SystemBase.

Definition at line 76 of file DisplacedSystem.h.

77  {
79  }
virtual void disassociateVectorFromTag(NumericVector< Number > &vec, TagID tag)
Disassociate a given vector from a given tag.
Definition: SystemBase.C:949
SystemBase & _undisplaced_system

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

1145 {
1146  return system().get_dof_map();
1147 }
virtual System & system()=0
Get the reference to the libMesh system.

◆ duDotDotDu() [1/2]

virtual Number& DisplacedSystem::duDotDotDu ( )
inlineoverridevirtual

Reimplemented from SystemBase.

Definition at line 153 of file DisplacedSystem.h.

153 { return _undisplaced_system.duDotDotDu(); }
virtual Number & duDotDotDu()
Definition: SystemBase.h:235
SystemBase & _undisplaced_system

◆ duDotDotDu() [2/2]

virtual const Number& DisplacedSystem::duDotDotDu ( ) const
inlineoverridevirtual

Reimplemented from SystemBase.

Definition at line 155 of file DisplacedSystem.h.

155 { return _undisplaced_system.duDotDotDu(); }
virtual Number & duDotDotDu()
Definition: SystemBase.h:235
SystemBase & _undisplaced_system

◆ duDotDu() [1/2]

virtual Number& DisplacedSystem::duDotDu ( )
inlineoverridevirtual

Reimplemented from SystemBase.

Definition at line 152 of file DisplacedSystem.h.

152 { return _undisplaced_system.duDotDu(); }
virtual Number & duDotDu()
Definition: SystemBase.h:234
SystemBase & _undisplaced_system

◆ duDotDu() [2/2]

virtual const Number& DisplacedSystem::duDotDu ( ) const
inlineoverridevirtual

Reimplemented from SystemBase.

Definition at line 154 of file DisplacedSystem.h.

154 { return _undisplaced_system.duDotDu(); }
virtual Number & duDotDu()
Definition: SystemBase.h:234
SystemBase & _undisplaced_system

◆ feProblem() [1/2]

FEProblemBase& SystemBase::feProblem ( )
inlineinherited

Definition at line 104 of file SystemBase.h.

Referenced by DMMooseGetEmbedding_Private(), DMSetFromOptions_Moose(), and DMSetUp_Moose_Pre().

104 { return _fe_problem; }
FEProblemBase & _fe_problem
the governing finite element/volume problem
Definition: SystemBase.h:954

◆ feProblem() [2/2]

const FEProblemBase& SystemBase::feProblem ( ) const
inlineinherited

Definition at line 105 of file SystemBase.h.

105 { return _fe_problem; }
FEProblemBase & _fe_problem
the governing finite element/volume problem
Definition: SystemBase.h:954

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

1025 {
1026  for (auto tag : tags)
1027  if (hasMatrix(tag))
1028  getMatrix(tag).flush();
1029 }
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:338
virtual void flush()
virtual SparseMatrix< Number > & getMatrix(TagID tag)
Get a raw SparseMatrix.
Definition: SystemBase.C:980

◆ getActualFieldVariable() [1/2]

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

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

Definition at line 114 of file SystemBase.C.

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

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

◆ getActualFieldVariable() [2/2]

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

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

Definition at line 135 of file SystemBase.C.

136 {
137  return *_vars[tid].getActualFieldVariable<T>(var_number);
138 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964

◆ getFieldVariable() [1/2]

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

Gets a reference to a variable of with specified name.

This excludes and cannot return finite volume variables.

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

Definition at line 107 of file SystemBase.C.

Referenced by Marker::getMarkerValue().

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

◆ getFieldVariable() [2/2]

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

Gets a reference to a variable with specified number.

This excludes and cannot return finite volume variables.

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

Definition at line 128 of file SystemBase.C.

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

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

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

◆ getMatrix() [1/2]

virtual SparseMatrix<Number>& DisplacedSystem::getMatrix ( TagID  tag)
inlineoverridevirtual

Get a raw SparseMatrix.

Reimplemented from SystemBase.

Definition at line 238 of file DisplacedSystem.h.

239  {
240  return _undisplaced_system.getMatrix(tag);
241  }
SystemBase & _undisplaced_system
virtual SparseMatrix< Number > & getMatrix(TagID tag)
Get a raw SparseMatrix.
Definition: SystemBase.C:980

◆ getMatrix() [2/2]

virtual const SparseMatrix<Number>& DisplacedSystem::getMatrix ( TagID  tag) const
inlineoverridevirtual

Get a raw SparseMatrix.

Reimplemented from SystemBase.

Definition at line 242 of file DisplacedSystem.h.

243  {
244  return _undisplaced_system.getMatrix(tag);
245  }
SystemBase & _undisplaced_system
virtual SparseMatrix< Number > & getMatrix(TagID tag)
Get a raw SparseMatrix.
Definition: SystemBase.C:980

◆ getMaxVariableNumber()

unsigned int SystemBase::getMaxVariableNumber ( ) const
inlineinherited

Returns the maximum number of all variables on the system.

Definition at line 860 of file SystemBase.h.

860 { return _max_var_number; }
unsigned int _max_var_number
Maximum variable number.
Definition: SystemBase.h:968

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

Referenced by Moose::globalDofIndexToDerivative().

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

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

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

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

238 {
239  Order order = CONSTANT;
240  const std::vector<MooseVariableFieldBase *> & vars = _vars[0].fieldVariables();
241  for (const auto & var : vars)
242  {
243  FEType fe_type = var->feType();
244  if (fe_type.default_quadrature_order() > order)
245  order = fe_type.default_quadrature_order();
246  }
247 
248  return order;
249 }
Order
CONSTANT
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964

◆ getScalarVariable() [1/2]

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

Gets a reference to a scalar variable with specified number.

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

Definition at line 141 of file SystemBase.C.

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

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

◆ getScalarVariable() [2/2]

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

Gets a reference to a variable with specified number.

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

Definition at line 150 of file SystemBase.C.

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

◆ getScalarVariables()

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

◆ getSharedTimeIntegrator()

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

Definition at line 882 of file SystemBase.h.

Referenced by DisplacedProblem::DisplacedProblem().

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

◆ getStandardFieldVariableNames()

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

◆ getSubdomainsForVar() [1/2]

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

Definition at line 752 of file SystemBase.h.

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

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

◆ getSubdomainsForVar() [2/2]

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

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

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

Definition at line 763 of file SystemBase.h.

764  {
765  return getSubdomainsForVar(getVariable(0, var_name).number());
766  }
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1132
const std::set< SubdomainID > & getSubdomainsForVar(unsigned int var_number) const
Definition: SystemBase.h:752
MooseVariableFieldBase & getVariable(THREAD_ID tid, const std::string &var_name) const
Gets a reference to a variable of with specified name.
Definition: SystemBase.C:86

◆ getTimeIntegrator() [1/2]

TimeIntegrator* SystemBase::getTimeIntegrator ( )
inlineinherited

◆ getTimeIntegrator() [2/2]

const TimeIntegrator* SystemBase::getTimeIntegrator ( ) const
inlineinherited

Definition at line 880 of file SystemBase.h.

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

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

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

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

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

97 {
98  if (var_number < _numbered_vars[tid].size())
99  if (_numbered_vars[tid][var_number])
100  return *_numbered_vars[tid][var_number];
101 
102  mooseError("Variable #", Moose::stringify(var_number), " does not exist in this system");
103 }
std::vector< std::vector< MooseVariableFieldBase * > > _numbered_vars
Map variable number to its pointer.
Definition: SystemBase.h:1016
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:62

◆ getVariableBlocks()

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

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

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

Definition at line 160 of file SystemBase.C.

Referenced by PhysicsBasedPreconditioner::addSystem().

161 {
162  mooseAssert(_var_map.find(var_number) != _var_map.end(), "Variable does not exist.");
163  if (_var_map[var_number].empty())
164  return nullptr;
165  else
166  return &_var_map[var_number];
167 }
std::map< unsigned int, std::set< SubdomainID > > _var_map
Map of variables (variable id -> array of subdomains where it lives)
Definition: SystemBase.h:966

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

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

◆ getVariableNames()

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

◆ getVariables()

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

◆ getVector() [1/4]

virtual NumericVector<Number>& DisplacedSystem::getVector ( TagID  tag)
inlineoverridevirtual

Get a raw NumericVector by tag.

Reimplemented from SystemBase.

Definition at line 37 of file DisplacedSystem.h.

38  {
39  return _undisplaced_system.getVector(tag_id);
40  }
SystemBase & _undisplaced_system
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:889

◆ getVector() [2/4]

virtual const NumericVector<Number>& DisplacedSystem::getVector ( TagID  tag_id) const
inlineoverridevirtual

Reimplemented from SystemBase.

Definition at line 41 of file DisplacedSystem.h.

42  {
43  return _undisplaced_system.getVector(tag_id);
44  }
SystemBase & _undisplaced_system
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:889

◆ getVector() [3/4]

NumericVector< Number > & DisplacedSystem::getVector ( const std::string &  name)
overridevirtual

Get a raw NumericVector by name.

Get a raw NumericVector with the given name.

Reimplemented from SystemBase.

Definition at line 38 of file DisplacedSystem.C.

39 {
40  if (_sys.have_vector(name))
41  return _sys.get_vector(name);
42  else
44 }
TransientExplicitSystem & _sys
virtual const std::string & name() const
Definition: SystemBase.C:1293
SystemBase & _undisplaced_system
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:889

◆ getVector() [4/4]

const NumericVector< Number > & DisplacedSystem::getVector ( const std::string &  name) const
overridevirtual

Reimplemented from SystemBase.

Definition at line 47 of file DisplacedSystem.C.

48 {
49  if (_sys.have_vector(name))
50  return _sys.get_vector(name);
51  else
53 }
TransientExplicitSystem & _sys
virtual const std::string & name() const
Definition: SystemBase.C:1293
SystemBase & _undisplaced_system
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:889

◆ gradientContainer()

std::vector<std::unique_ptr<NumericVector<Number> > >& SystemBase::gradientContainer ( )
inlineinherited

Reference to the container vector which hold gradients at dofs (if it can be interpreted).

Mainly used for finite volume systems.

Definition at line 932 of file SystemBase.h.

933  {
934  return _raw_grad_container;
935  }
std::vector< std::unique_ptr< NumericVector< Number > > > _raw_grad_container
A cache for storing gradients at dof locations.
Definition: SystemBase.h:1037

◆ hasMatrix()

virtual bool DisplacedSystem::hasMatrix ( TagID  tag) const
inlineoverridevirtual

Check if the tagged matrix exists in the system.

Reimplemented from SystemBase.

Definition at line 218 of file DisplacedSystem.h.

219  {
220  return _undisplaced_system.hasMatrix(tag_id);
221  }
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:338
SystemBase & _undisplaced_system

◆ hasScalarVariable()

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

Definition at line 832 of file SystemBase.C.

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

833 {
834  if (system().has_variable(var_name))
835  return system().variable_type(var_name).family == SCALAR;
836  else
837  return false;
838 }
SCALAR
virtual System & system()=0
Get the reference to the libMesh system.

◆ hasSolutionState()

bool DisplacedSystem::hasSolutionState ( const unsigned int  state,
Moose::SolutionIterationType  iteration_type = Moose::SolutionIterationType::Time 
) const
inlineoverridevirtual

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

Reimplemented from SystemBase.

Definition at line 295 of file DisplacedSystem.h.

297 {
298  return _undisplaced_system.hasSolutionState(state, iteration_type);
299 }
SystemBase & _undisplaced_system
virtual bool hasSolutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time) const
Whether or not the system has the solution state (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.h:1053

◆ hasVarCopy()

bool SystemBase::hasVarCopy ( ) const
inlineinherited

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

Definition at line 885 of file SystemBase.h.

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

◆ hasVariable()

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

Query a system for a variable.

Parameters
var_namename of the variable
Returns
true if the variable exists

Definition at line 807 of file SystemBase.C.

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

808 {
809  auto & names = getVariableNames();
810  if (system().has_variable(var_name))
811  return system().variable_type(var_name).family != SCALAR;
812  if (std::find(names.begin(), names.end(), var_name) != names.end())
813  // array variable
814  return true;
815  else
816  return false;
817 }
SCALAR
virtual System & system()=0
Get the reference to the libMesh system.
const std::vector< VariableName > & getVariableNames() const
Definition: SystemBase.h:853

◆ hasVector() [1/2]

virtual bool DisplacedSystem::hasVector ( TagID  tag_id) const
inlineoverridevirtual

Check if the tagged vector exists in the system.

Reimplemented from SystemBase.

Definition at line 213 of file DisplacedSystem.h.

214  {
215  return _undisplaced_system.hasVector(tag_id);
216  }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:880
SystemBase & _undisplaced_system

◆ hasVector() [2/2]

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

◆ init()

virtual void SystemBase::init ( )
inlinevirtualinherited

Initialize the system.

Reimplemented in NonlinearSystemBase, NonlinearSystem, and SolverSystem.

Definition at line 156 of file SystemBase.h.

Referenced by SolverSystem::init().

156 {};

◆ initializeObjects()

virtual void SystemBase::initializeObjects ( )
inlinevirtualinherited

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

Definition at line 161 of file SystemBase.h.

161 {};

◆ initialSetup()

void SystemBase::initialSetup ( )
virtualinherited

Setup Functions.

Reimplemented in NonlinearSystemBase, LinearSystem, and AuxiliarySystem.

Definition at line 1483 of file SystemBase.C.

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

1484 {
1485  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
1486  _vars[tid].initialSetup();
1487 
1488  // If we need raw gradients, we initialize them here.
1489  bool gradient_storage_initialized = false;
1490  for (const auto & field_var : _vars[0].fieldVariables())
1491  if (!gradient_storage_initialized && field_var->needsGradientVectorStorage())
1492  {
1493  _raw_grad_container.clear();
1494  for (const auto i : make_range(this->_mesh.dimension()))
1495  {
1496  libmesh_ignore(i);
1497  _raw_grad_container.push_back(currentSolution()->zero_clone());
1498  }
1499  }
1500 }
virtual const NumericVector< Number > *const & currentSolution() const =0
The solution vector that is currently being operated on.
unsigned int n_threads()
std::vector< std::unique_ptr< NumericVector< Number > > > _raw_grad_container
A cache for storing gradients at dof locations.
Definition: SystemBase.h:1037
void libmesh_ignore(const Args &...)
virtual unsigned int dimension() const
Returns MeshBase::mesh_dimension(), (not MeshBase::spatial_dimension()!) of the underlying libMesh me...
Definition: MooseMesh.C:2679
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964
MooseMesh & _mesh
Definition: SystemBase.h:959
IntRange< T > make_range(T beg, T end)
virtual void initialSetup()
Setup Functions.
Definition: SystemBase.C:1483
unsigned int THREAD_ID
Definition: MooseTypes.h:198

◆ initSolutionState()

void DisplacedSystem::initSolutionState ( )
inlineoverridevirtual

Initializes the solution state.

Reimplemented from SystemBase.

Definition at line 268 of file DisplacedSystem.h.

269 {
271 }
virtual void initSolutionState()
Initializes the solution state.
Definition: SystemBase.C:1317
SystemBase & _undisplaced_system

◆ isArrayVariable()

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

If a variable is an array variable.

Definition at line 820 of file SystemBase.C.

821 {
822  auto & names = getVariableNames();
823  if (!system().has_variable(var_name) &&
824  std::find(names.begin(), names.end(), var_name) != names.end())
825  // array variable
826  return true;
827  else
828  return false;
829 }
virtual System & system()=0
Get the reference to the libMesh system.
const std::vector< VariableName > & getVariableNames() const
Definition: SystemBase.h:853

◆ isScalarVariable()

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

Definition at line 841 of file SystemBase.C.

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

842 {
843  return (system().variable(var_num).type().family == SCALAR);
844 }
virtual System & system()=0
Get the reference to the libMesh system.

◆ jacobianSetup()

void SystemBase::jacobianSetup ( )
virtualinherited

Reimplemented in NonlinearSystemBase, LinearSystem, and AuxiliarySystem.

Definition at line 1531 of file SystemBase.C.

Referenced by AuxiliarySystem::jacobianSetup(), and NonlinearSystemBase::jacobianSetup().

1532 {
1533  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
1534  _vars[tid].jacobianSetup();
1535 }
unsigned int n_threads()
virtual void jacobianSetup()
Definition: SystemBase.C:1531
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964
unsigned int THREAD_ID
Definition: MooseTypes.h:198

◆ matrixTagActive()

bool SystemBase::matrixTagActive ( TagID  tag) const
virtualinherited

If or not a matrix tag is active.

Definition at line 1124 of file SystemBase.C.

1125 {
1126  mooseAssert(_subproblem.matrixTagExists(tag), "Matrix tag " << tag << " does not exist");
1127 
1128  return tag < _matrix_tag_active_flags.size() && _matrix_tag_active_flags[tag];
1129 }
std::vector< bool > _matrix_tag_active_flags
Active flags for tagged matrices.
Definition: SystemBase.h:991
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:306

◆ 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; }
MooseMesh & _mesh
Definition: SystemBase.h:959

◆ name()

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

◆ needSolutionState()

void DisplacedSystem::needSolutionState ( const unsigned int  state,
Moose::SolutionIterationType  iteration_type = Moose::SolutionIterationType::Time 
)
inlineoverridevirtual

Registers that the solution state state is needed.

Reimplemented from SystemBase.

Definition at line 288 of file DisplacedSystem.h.

290 {
291  _undisplaced_system.needSolutionState(state, iteration_type);
292 }
virtual void needSolutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Registers that the solution state state is needed.
Definition: SystemBase.C:1389
SystemBase & _undisplaced_system

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

Referenced by SystemBase::nVariables().

857 {
858  unsigned int n = 0;
859  for (auto & var : _vars[0].fieldVariables())
860  n += var->count();
861 
862  return n;
863 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964

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

Referenced by MooseMesh::cacheFVElementalDoFs().

867 {
868  unsigned int n = 0;
869  for (auto & var : _vars[0].fieldVariables())
870  if (var->isFV())
871  n += var->count();
872 
873  return n;
874 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964

◆ nonTimeVectorTag()

virtual TagID DisplacedSystem::nonTimeVectorTag ( ) const
inlineoverridevirtual

Reimplemented from SystemBase.

Definition at line 55 of file DisplacedSystem.h.

SystemBase & _undisplaced_system
virtual TagID nonTimeVectorTag() const
Definition: SystemBase.h:280

◆ number()

unsigned int SystemBase::number ( ) const
inherited

Gets the number of this system.

Returns
The number of this system

Definition at line 1132 of file SystemBase.C.

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

1133 {
1134  return system().number();
1135 }
virtual System & system()=0
Get the reference to the libMesh system.

◆ nVariables()

unsigned int SystemBase::nVariables ( ) const
virtualinherited

Get the number of variables in this system.

Returns
the number of variables

Definition at line 847 of file SystemBase.C.

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

848 {
849  unsigned int n = nFieldVariables();
850  n += _vars[0].scalars().size();
851 
852  return n;
853 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964
unsigned int nFieldVariables() const
Get the number of field variables in this system.
Definition: SystemBase.C:856

◆ operator=()

DisplacedSystem& DisplacedSystem::operator= ( DisplacedSystem &&  )
delete

◆ prepare()

void SystemBase::prepare ( THREAD_ID  tid)
virtualinherited

Prepare the system for use.

Parameters
tidID of the thread

Definition at line 252 of file SystemBase.C.

Referenced by SubProblem::reinitElemFaceRef().

253 {
255  {
256  const std::set<MooseVariableFieldBase *> & active_elemental_moose_variables =
258  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
259  for (const auto & var : vars)
260  var->clearDofIndices();
261 
262  for (const auto & var : active_elemental_moose_variables)
263  if (&(var->sys()) == this)
264  var->prepare();
265  }
266  else
267  {
268  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
269  for (const auto & var : vars)
270  var->prepare();
271  }
272 }
virtual const std::set< MooseVariableFieldBase * > & getActiveElementalMooseVariables(const THREAD_ID tid) const
Get the MOOSE variables to be reinited on each element.
Definition: SubProblem.C:432
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964
virtual bool hasActiveElementalMooseVariables(const THREAD_ID tid) const
Whether or not a list of active elemental moose variables has been set.
Definition: SubProblem.C:438

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

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

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

Referenced by SubProblem::reinitLowerDElem().

329 {
330  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
331  for (const auto & var : vars)
332  var->prepareLowerD();
333 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964

◆ prepareNeighbor()

void SystemBase::prepareNeighbor ( THREAD_ID  tid)
virtualinherited

Prepare the system for use.

Parameters
tidID of the thread

Definition at line 320 of file SystemBase.C.

Referenced by SubProblem::reinitNeighborFaceRef().

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

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

337 {
338 
340  {
341  const std::set<MooseVariableFieldBase *> & active_elemental_moose_variables =
343  for (const auto & var : active_elemental_moose_variables)
344  if (&(var->sys()) == this)
345  var->computeElemValues();
346  }
347  else
348  {
349  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
350  for (const auto & var : vars)
351  var->computeElemValues();
352  }
353 }
virtual const std::set< MooseVariableFieldBase * > & getActiveElementalMooseVariables(const THREAD_ID tid) const
Get the MOOSE variables to be reinited on each element.
Definition: SubProblem.C:432
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964
virtual bool hasActiveElementalMooseVariables(const THREAD_ID tid) const
Whether or not a list of active elemental moose variables has been set.
Definition: SubProblem.C:438

◆ reinitElemFace()

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

Reinit assembly info for a side of an element.

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

Reimplemented in AuxiliarySystem.

Definition at line 356 of file SystemBase.C.

Referenced by SubProblem::reinitElemFaceRef().

360 {
361  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
362  for (const auto & var : vars)
363  var->computeElemValuesFace();
364 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964

◆ reinitLowerD()

void SystemBase::reinitLowerD ( THREAD_ID  tid)
virtualinherited

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

Definition at line 386 of file SystemBase.C.

Referenced by SubProblem::reinitLowerDElem().

387 {
388  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
389  for (const auto & var : vars)
390  var->computeLowerDValues();
391 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964

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

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

◆ reinitNeighborFace()

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

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

Definition at line 367 of file SystemBase.C.

Referenced by SubProblem::reinitNeighborFaceRef().

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

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

395 {
396  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
397  for (const auto & var : vars)
398  {
399  var->reinitNode();
400  if (var->isNodalDefined())
401  var->computeNodalValues();
402  }
403 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964

◆ reinitNodeFace()

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

Reinit nodal assembly info on a face.

Parameters
nodeNode to reinit
bnd_idBoundary ID
tidThread ID

Definition at line 406 of file SystemBase.C.

407 {
408  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
409  for (const auto & var : vars)
410  {
411  var->reinitNode();
412  if (var->isNodalDefined())
413  var->computeNodalValues();
414  }
415 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964

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

419 {
420  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
421  for (const auto & var : vars)
422  {
423  var->reinitNodes(nodes);
424  var->computeNodalValues();
425  }
426 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964

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

430 {
431  const std::vector<MooseVariableFieldBase *> & vars = _vars[tid].fieldVariables();
432  for (const auto & var : vars)
433  {
434  var->reinitNodesNeighbor(nodes);
435  var->computeNodalNeighborValues();
436  }
437 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964

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

441 {
442  const std::vector<MooseVariableScalar *> & vars = _vars[tid].scalars();
443  for (const auto & var : vars)
444  var->reinit(reinit_for_derivative_reordering);
445 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964

◆ removeMatrix()

void SystemBase::removeMatrix ( TagID  tag)
inherited

Removes a matrix with a given tag.

Parameters
tag_nameThe name of the tag

Definition at line 586 of file SystemBase.C.

587 {
588  if (!_subproblem.matrixTagExists(tag_id))
589  mooseError("Cannot remove the matrix with TagID ",
590  tag_id,
591  "\nin system '",
592  name(),
593  "', because that tag does not exist in the problem");
594 
595  if (hasMatrix(tag_id))
596  {
597  const auto matrix_name = _subproblem.matrixTagName(tag_id);
598  system().remove_matrix(matrix_name);
599  _tagged_matrices[tag_id] = nullptr;
600  }
601 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
std::vector< SparseMatrix< Number > * > _tagged_matrices
Tagged matrices (pointer)
Definition: SystemBase.h:989
virtual bool hasMatrix(TagID tag) const
Check if the tagged matrix exists in the system.
Definition: SystemBase.h:338
virtual const std::string & name() const
Definition: SystemBase.C:1293
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951
virtual System & system()=0
Get the reference to the libMesh system.
virtual bool matrixTagExists(const TagName &tag_name) const
Check to see if a particular Tag exists.
Definition: SubProblem.C:306
virtual TagName matrixTagName(TagID tag)
Retrieve the name associated with a TagID.
Definition: SubProblem.C:335

◆ removeVector() [1/2]

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

Remove a vector from the system with the given name.

Definition at line 1287 of file SystemBase.C.

Referenced by SystemBase::restoreOldSolutions().

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

◆ removeVector() [2/2]

void SystemBase::removeVector ( TagID  tag_id)
inherited

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

Parameters
tag_idTag ID

Definition at line 697 of file SystemBase.C.

698 {
699  if (!_subproblem.vectorTagExists(tag_id))
700  mooseError("Cannot remove the vector with TagID ",
701  tag_id,
702  "\nin system '",
703  name(),
704  "', because that tag does not exist in the problem");
705 
706  if (hasVector(tag_id))
707  {
708  auto vector_name = _subproblem.vectorTagName(tag_id);
709  system().remove_vector(vector_name);
710  _tagged_vectors[tag_id] = nullptr;
711  }
712 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:880
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
virtual const std::string & name() const
Definition: SystemBase.C:1293
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:173
virtual System & system()=0
Get the reference to the libMesh system.
virtual TagName vectorTagName(const TagID tag) const
Retrieve the name associated with a TagID.
Definition: SubProblem.C:199
std::vector< NumericVector< Number > * > _tagged_vectors
Tagged vectors (pointer)
Definition: SystemBase.h:987

◆ residualCopy()

virtual NumericVector<Number>& DisplacedSystem::residualCopy ( )
inlineoverridevirtual

Return the residual copy from the NonlinearSystem.

Returns
Residual copy

Reimplemented from SystemBase.

Definition at line 163 of file DisplacedSystem.h.

164  {
166  }
virtual NumericVector< Number > & residualCopy()
Definition: SystemBase.h:414
SystemBase & _undisplaced_system

◆ residualGhosted()

virtual NumericVector<Number>& DisplacedSystem::residualGhosted ( )
inlineoverridevirtual

Reimplemented from SystemBase.

Definition at line 167 of file DisplacedSystem.h.

168  {
170  }
SystemBase & _undisplaced_system
virtual NumericVector< Number > & residualGhosted()
Definition: SystemBase.h:418

◆ residualSetup()

void SystemBase::residualSetup ( )
virtualinherited

Reimplemented in NonlinearSystemBase, LinearSystem, and AuxiliarySystem.

Definition at line 1524 of file SystemBase.C.

Referenced by AuxiliarySystem::residualSetup(), and NonlinearSystemBase::residualSetup().

1525 {
1526  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
1527  _vars[tid].residualSetup();
1528 }
unsigned int n_threads()
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964
virtual void residualSetup()
Definition: SystemBase.C:1524
unsigned int THREAD_ID
Definition: MooseTypes.h:198

◆ residualVectorTag()

virtual TagID DisplacedSystem::residualVectorTag ( ) const
inlineoverridevirtual

Reimplemented from SystemBase.

Definition at line 46 of file DisplacedSystem.h.

47  {
49  }
SystemBase & _undisplaced_system
virtual TagID residualVectorTag() const
Definition: SystemBase.h:285

◆ restoreOldSolutions()

void SystemBase::restoreOldSolutions ( )
virtualinherited

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

Definition at line 538 of file SystemBase.C.

539 {
540  const auto states =
541  _solution_states[static_cast<unsigned short>(Moose::SolutionIterationType::Time)].size();
542  if (states > 1)
543  for (unsigned int i = 1; i <= states - 1; ++i)
544  if (_saved_solution_states[i])
545  {
547  removeVector("save_solution_state_" + std::to_string(i));
548  _saved_solution_states[i] = nullptr;
549  }
550 
552  {
554  removeVector("save_solution_dot_old");
555  _saved_dot_old = nullptr;
556  }
558  {
560  removeVector("save_solution_dotdot_old");
561  _saved_dotdot_old = nullptr;
562  }
563 }
virtual NumericVector< Number > & solutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Get a state of the solution (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.C:1380
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:242
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:241
NumericVector< Real > * _saved_dot_old
Definition: SystemBase.h:998
void removeVector(const std::string &name)
Remove a vector from the system with the given name.
Definition: SystemBase.C:1287
std::array< std::vector< NumericVector< Number > * >, 2 > _solution_states
The solution states (0 = current, 1 = old, 2 = older, etc)
Definition: SystemBase.h:1047
NumericVector< Real > * _saved_dotdot_old
Definition: SystemBase.h:999
std::vector< NumericVector< Number > * > _saved_solution_states
The saved solution states (0 = current, 1 = old, 2 = older, etc)
Definition: SystemBase.h:1049

◆ restoreSolutions()

void SystemBase::restoreSolutions ( )
virtualinherited

Restore current solutions (call after your solve failed)

Reimplemented in SolverSystem.

Definition at line 1270 of file SystemBase.C.

Referenced by SolverSystem::restoreSolutions().

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

◆ saveOldSolutions()

void SystemBase::saveOldSolutions ( )
virtualinherited

Save the old and older solutions.

Definition at line 506 of file SystemBase.C.

507 {
508  const auto states =
509  _solution_states[static_cast<unsigned short>(Moose::SolutionIterationType::Time)].size();
510  if (states > 1)
511  {
512  _saved_solution_states.resize(states);
513  for (unsigned int i = 1; i <= states - 1; ++i)
514  if (!_saved_solution_states[i])
516  &addVector("save_solution_state_" + std::to_string(i), false, PARALLEL);
517 
518  for (unsigned int i = 1; i <= states - 1; ++i)
520  }
521 
523  _saved_dot_old = &addVector("save_solution_dot_old", false, PARALLEL);
525  _saved_dotdot_old = &addVector("save_solution_dotdot_old", false, PARALLEL);
526 
527  if (solutionUDotOld())
529 
530  if (solutionUDotDotOld())
532 }
NumericVector< Number > & addVector(const std::string &vector_name, const bool project, const ParallelType type)
Adds a solution length vector to the system.
Definition: SystemBase.C:604
virtual NumericVector< Number > & solutionState(const unsigned int state, Moose::SolutionIterationType iteration_type=Moose::SolutionIterationType::Time)
Get a state of the solution (0 = current, 1 = old, 2 = older, etc).
Definition: SystemBase.C:1380
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:242
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:241
NumericVector< Real > * _saved_dot_old
Definition: SystemBase.h:998
std::array< std::vector< NumericVector< Number > * >, 2 > _solution_states
The solution states (0 = current, 1 = old, 2 = older, etc)
Definition: SystemBase.h:1047
NumericVector< Real > * _saved_dotdot_old
Definition: SystemBase.h:999
std::vector< NumericVector< Number > * > _saved_solution_states
The saved solution states (0 = current, 1 = old, 2 = older, etc)
Definition: SystemBase.h:1049

◆ serializedSolution()

virtual NumericVector<Number>& DisplacedSystem::serializedSolution ( )
inlineoverridevirtual

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

Reimplemented from SystemBase.

Definition at line 109 of file DisplacedSystem.h.

110  {
112  }
virtual NumericVector< Number > & serializedSolution()
Returns a reference to a serialized version of the solution vector for this subproblem.
Definition: SystemBase.C:1571
SystemBase & _undisplaced_system

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

Referenced by SubProblem::setActiveScalarVariableCoupleableVectorTags().

1553 {
1554  _vars[tid].setActiveScalarVariableCoupleableVectorTags(vtags);
1555 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964

◆ setActiveVariableCoupleableVectorTags()

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

Set the active vector tags for the variables.

Definition at line 1545 of file SystemBase.C.

Referenced by SubProblem::setActiveFEVariableCoupleableVectorTags().

1546 {
1547  _vars[tid].setActiveVariableCoupleableVectorTags(vtags);
1548 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964

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

183 {
184  AllLocalDofIndicesThread aldit(_subproblem, {var_name});
186  Threads::parallel_reduce(elem_range, aldit);
187 
188  // Gather the dof indices across procs to get all the dof indices for var_name
189  aldit.dofIndicesSetUnion();
190 
191  const auto & all_dof_indices = aldit.getDofIndices();
192  _var_all_dof_indices.assign(all_dof_indices.begin(), all_dof_indices.end());
193 }
ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:1041
std::vector< dof_id_type > _var_all_dof_indices
Container for the dof indices of a given variable.
Definition: SystemBase.h:1028
Grab all the (possibly semi)local dof indices for the variables passed in, in the system passed in...
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951
MooseMesh & _mesh
Definition: SystemBase.h:959

◆ setVerboseFlag()

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

Sets the verbose flag.

Parameters
[in]verboseVerbose flag

Definition at line 135 of file SystemBase.h.

Referenced by Executioner::Executioner().

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

◆ solution() [1/2]

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

Definition at line 182 of file SystemBase.h.

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

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

◆ solution() [2/2]

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

Definition at line 185 of file SystemBase.h.

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

◆ solutionInternal()

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

Internal getter for solution owned by libMesh.

Implements SystemBase.

Definition at line 258 of file DisplacedSystem.h.

259  {
260  return _undisplaced_system.solution();
261  }
NumericVector< Number > & solution()
Definition: SystemBase.h:182
SystemBase & _undisplaced_system

◆ solutionOld() [1/2]

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

◆ solutionOld() [2/2]

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

Definition at line 186 of file SystemBase.h.

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

◆ solutionOlder() [1/2]

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

Definition at line 184 of file SystemBase.h.

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

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

◆ solutionOlder() [2/2]

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

Definition at line 187 of file SystemBase.h.

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

◆ solutionPreviousNewton() [1/2]

NumericVector<Number>* DisplacedSystem::solutionPreviousNewton ( )
inlineoverridevirtual

Reimplemented from SystemBase.

Definition at line 119 of file DisplacedSystem.h.

119 { return nullptr; }

◆ solutionPreviousNewton() [2/2]

const NumericVector<Number>* DisplacedSystem::solutionPreviousNewton ( ) const
inlineoverridevirtual

Reimplemented from SystemBase.

Definition at line 120 of file DisplacedSystem.h.

120 { return nullptr; }

◆ solutionState() [1/2]

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

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

Definition at line 274 of file DisplacedSystem.h.

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

◆ solutionState() [2/2]

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

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

Reimplemented from SystemBase.

Definition at line 281 of file DisplacedSystem.h.

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

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

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

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

◆ solutionUDot() [1/2]

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

Reimplemented from SystemBase.

Definition at line 122 of file DisplacedSystem.h.

122 { return _undisplaced_system.solutionUDot(); }
SystemBase & _undisplaced_system
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:239

◆ solutionUDot() [2/2]

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

Reimplemented from SystemBase.

Definition at line 135 of file DisplacedSystem.h.

136  {
138  }
SystemBase & _undisplaced_system
virtual NumericVector< Number > * solutionUDot()
Definition: SystemBase.h:239

◆ solutionUDotDot() [1/2]

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

Reimplemented from SystemBase.

Definition at line 123 of file DisplacedSystem.h.

124  {
126  }
SystemBase & _undisplaced_system
virtual NumericVector< Number > * solutionUDotDot()
Definition: SystemBase.h:240

◆ solutionUDotDot() [2/2]

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

Reimplemented from SystemBase.

Definition at line 139 of file DisplacedSystem.h.

140  {
142  }
SystemBase & _undisplaced_system
virtual NumericVector< Number > * solutionUDotDot()
Definition: SystemBase.h:240

◆ solutionUDotDotOld() [1/2]

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

Reimplemented from SystemBase.

Definition at line 131 of file DisplacedSystem.h.

132  {
134  }
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:242
SystemBase & _undisplaced_system

◆ solutionUDotDotOld() [2/2]

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

Reimplemented from SystemBase.

Definition at line 147 of file DisplacedSystem.h.

148  {
150  }
virtual NumericVector< Number > * solutionUDotDotOld()
Definition: SystemBase.h:242
SystemBase & _undisplaced_system

◆ solutionUDotOld() [1/2]

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

Reimplemented from SystemBase.

Definition at line 127 of file DisplacedSystem.h.

128  {
130  }
SystemBase & _undisplaced_system
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:241

◆ solutionUDotOld() [2/2]

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

Reimplemented from SystemBase.

Definition at line 143 of file DisplacedSystem.h.

144  {
146  }
SystemBase & _undisplaced_system
virtual NumericVector< Number > * solutionUDotOld()
Definition: SystemBase.h:241

◆ solve()

void SystemBase::solve ( )
virtualinherited

Solve the system (using libMesh magic)

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

Definition at line 1225 of file SystemBase.C.

1226 {
1227  system().solve();
1228 }
virtual System & system()=0
Get the reference to the libMesh system.

◆ subdomainSetup()

void SystemBase::subdomainSetup ( )
virtualinherited

Reimplemented in AuxiliarySystem.

Definition at line 1517 of file SystemBase.C.

Referenced by AuxiliarySystem::subdomainSetup(), and NonlinearSystemBase::subdomainSetup().

1518 {
1519  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
1520  _vars[tid].subdomainSetup();
1521 }
unsigned int n_threads()
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964
virtual void subdomainSetup()
Definition: SystemBase.C:1517
unsigned int THREAD_ID
Definition: MooseTypes.h:198

◆ 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; }
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951

◆ sys()

virtual TransientExplicitSystem& DisplacedSystem::sys ( )
inlinevirtual

Definition at line 247 of file DisplacedSystem.h.

247 { return _sys; }
TransientExplicitSystem & _sys

◆ system() [1/2]

System & DisplacedSystem::system ( )
overridevirtual

Get the reference to the libMesh system.

Implements SystemBase.

Definition at line 62 of file DisplacedSystem.C.

63 {
64  return _sys;
65 }
TransientExplicitSystem & _sys

◆ system() [2/2]

const System & DisplacedSystem::system ( ) const
overridevirtual

Implements SystemBase.

Definition at line 68 of file DisplacedSystem.C.

69 {
70  return _sys;
71 }
TransientExplicitSystem & _sys

◆ systemMatrixTag()

virtual TagID DisplacedSystem::systemMatrixTag ( ) const
inlineoverridevirtual

Return the Matrix Tag ID for System.

Reimplemented from SystemBase.

Definition at line 51 of file DisplacedSystem.h.

SystemBase & _undisplaced_system
virtual TagID systemMatrixTag() const
Return the Matrix Tag ID for System.
Definition: SystemBase.h:275

◆ timestepSetup()

void SystemBase::timestepSetup ( )
virtualinherited

Reimplemented in NonlinearSystemBase, and AuxiliarySystem.

Definition at line 1503 of file SystemBase.C.

Referenced by AuxiliarySystem::timestepSetup(), and NonlinearSystemBase::timestepSetup().

1504 {
1505  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
1506  _vars[tid].timestepSetup();
1507 }
unsigned int n_threads()
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:964
unsigned int THREAD_ID
Definition: MooseTypes.h:198
virtual void timestepSetup()
Definition: SystemBase.C:1503

◆ timeVectorTag()

virtual TagID DisplacedSystem::timeVectorTag ( ) const
inlineoverridevirtual

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

Definition at line 53 of file DisplacedSystem.h.

SystemBase & _undisplaced_system
virtual TagID timeVectorTag() const
Ideally, we should not need this API.
Definition: SystemBase.h:270

◆ update()

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

◆ varKind()

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

Definition at line 926 of file SystemBase.h.

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

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

◆ zeroTaggedVector()

void SystemBase::zeroTaggedVector ( const TagID  tag)
inherited

Zero vector with the given tag.

Definition at line 671 of file SystemBase.C.

Referenced by SystemBase::zeroTaggedVectors().

672 {
673  if (!_subproblem.vectorTagExists(tag))
674  mooseError("Cannot zero vector with TagID ",
675  tag,
676  " in system '",
677  name(),
678  "' because that tag does not exist in the problem");
679  else if (!hasVector(tag))
680  mooseError("Cannot zero vector tag with name '",
682  "' in system '",
683  name(),
684  "' because there is no vector associated with that tag");
685 
686  getVector(tag).zero();
687 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:880
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
virtual void zero()=0
virtual const std::string & name() const
Definition: SystemBase.C:1293
SubProblem & _subproblem
The subproblem for whom this class holds variable data, etc; this can either be the governing finite ...
Definition: SystemBase.h:951
virtual bool vectorTagExists(const TagID tag_id) const
Check to see if a particular Tag exists.
Definition: SubProblem.h:173
virtual TagName vectorTagName(const TagID tag) const
Retrieve the name associated with a TagID.
Definition: SubProblem.C:199
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector by name.
Definition: SystemBase.C:889

◆ zeroTaggedVectors()

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

Zero all vectors for given tags.

Definition at line 690 of file SystemBase.C.

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

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

◆ zeroVariables()

virtual void DisplacedSystem::zeroVariables ( std::vector< std::string > &  vars_to_be_zeroed)
inlineoverridevirtual

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

Reimplemented from SystemBase.

Definition at line 208 of file DisplacedSystem.h.

209  {
210  _undisplaced_system.zeroVariables(vars_to_be_zeroed);
211  }
SystemBase & _undisplaced_system
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:196

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

232 {
234 }
std::vector< std::string > _vars_to_be_zeroed_on_jacobian
Definition: SystemBase.h:971
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:196

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

226 {
228 }
std::vector< std::string > _vars_to_be_zeroed_on_residual
Definition: SystemBase.h:970
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:196

Member Data Documentation

◆ _app

MooseApp& SystemBase::_app
protectedinherited

◆ _automatic_scaling

bool SystemBase::_automatic_scaling
protectedinherited

Whether to automatically scale the variables.

Definition at line 1019 of file SystemBase.h.

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

◆ _du_dot_du

Real SystemBase::_du_dot_du
protectedinherited

Definition at line 983 of file SystemBase.h.

Referenced by SystemBase::duDotDu().

◆ _du_dotdot_du

Real SystemBase::_du_dotdot_du
protectedinherited

Definition at line 984 of file SystemBase.h.

Referenced by SystemBase::duDotDotDu().

◆ _factory

Factory& SystemBase::_factory
protectedinherited

◆ _fe_problem

FEProblemBase& SystemBase::_fe_problem
protectedinherited

the governing finite element/volume problem

Definition at line 954 of file SystemBase.h.

Referenced by SystemBase::addDotVectors(), NonlinearSystemBase::assembleScalingVector(), NonlinearSystemBase::augmentSparsity(), AuxiliarySystem::AuxiliarySystem(), SolverSystem::checkInvalidSolution(), NonlinearSystemBase::checkKernelCoverage(), AuxiliarySystem::clearScalarVariableCoupleableTags(), SolverSystem::compute(), AuxiliarySystem::compute(), NonlinearSystemBase::computeDamping(), NonlinearSystemBase::computeDiracContributions(), AuxiliarySystem::computeElementalVarsHelper(), LinearSystem::computeGradients(), NonlinearSystemBase::computeJacobian(), NonlinearSystemBase::computeJacobianBlocks(), NonlinearSystemBase::computeJacobianInternal(), LinearSystem::computeLinearSystemInternal(), LinearSystem::computeLinearSystemTags(), AuxiliarySystem::computeMortarNodalVars(), NonlinearSystemBase::computeNodalBCs(), NonlinearSystemBase::computeNodalBCsResidualAndJacobian(), AuxiliarySystem::computeNodalVarsHelper(), NonlinearSystemBase::computeResidualAndJacobianInternal(), NonlinearSystemBase::computeResidualInternal(), NonlinearSystemBase::computeResidualTags(), NonlinearSystemBase::computeScalarKernelsJacobians(), AuxiliarySystem::computeScalarVars(), NonlinearSystemBase::computeScaling(), NonlinearSystem::computeScalingJacobian(), NonlinearSystem::computeScalingResidual(), NonlinearSystemBase::constraintJacobians(), NonlinearSystemBase::constraintResiduals(), NonlinearSystem::converged(), NonlinearSystemBase::customSetup(), MooseEigenSystem::eigenKernelOnCurrent(), MooseEigenSystem::eigenKernelOnOld(), NonlinearSystemBase::enforceNodalConstraintsJacobian(), NonlinearSystemBase::enforceNodalConstraintsResidual(), SystemBase::feProblem(), NonlinearSystemBase::getResidualNonTimeVector(), NonlinearSystemBase::getResidualTimeVector(), NonlinearSystemBase::init(), NonlinearSystemBase::initialSetup(), NonlinearSystemBase::jacobianSetup(), LinearSystem::LinearSystem(), NonlinearSystemBase::NonlinearSystemBase(), NonlinearSystemBase::overwriteNodeFace(), NonlinearSystemBase::reinitNodeFace(), NonlinearSystem::residualAndJacobianTogether(), NonlinearSystemBase::residualSetup(), NonlinearSystemBase::setConstraintSecondaryValues(), NonlinearSystemBase::setInitialSolution(), AuxiliarySystem::setScalarVariableCoupleableTags(), NonlinearSystemBase::shouldEvaluatePreSMOResidual(), NonlinearSystem::solve(), and NonlinearSystemBase::timestepSetup().

◆ _matrix_tag_active_flags

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

◆ _max_var_n_dofs_per_elem

size_t SystemBase::_max_var_n_dofs_per_elem
protectedinherited

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

Definition at line 1007 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 1010 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 968 of file SystemBase.h.

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

◆ _mesh

MooseMesh& SystemBase::_mesh
protectedinherited

◆ _name

std::string SystemBase::_name
protectedinherited

The name of this system.

Definition at line 961 of file SystemBase.h.

◆ _numbered_vars

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

Map variable number to its pointer.

Definition at line 1016 of file SystemBase.h.

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

◆ _raw_grad_container

std::vector<std::unique_ptr<NumericVector<Number> > > SystemBase::_raw_grad_container
protectedinherited

A cache for storing gradients at dof locations.

We store it on the system because we create copies of variables on each thread and that would lead to increased data duplication when using threading-based parallelism.

Definition at line 1037 of file SystemBase.h.

Referenced by LinearSystem::computeGradients(), SystemBase::gradientContainer(), and SystemBase::initialSetup().

◆ _saved_dot_old

NumericVector<Real>* SystemBase::_saved_dot_old
protectedinherited

Definition at line 998 of file SystemBase.h.

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

◆ _saved_dotdot_old

NumericVector<Real>* SystemBase::_saved_dotdot_old
protectedinherited

Definition at line 999 of file SystemBase.h.

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

◆ _saved_old

NumericVector<Real>* SystemBase::_saved_old
protectedinherited

Definition at line 994 of file SystemBase.h.

◆ _saved_older

NumericVector<Real>* SystemBase::_saved_older
protectedinherited

Definition at line 995 of file SystemBase.h.

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

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

◆ _solution_states_initialized

bool SystemBase::_solution_states_initialized
protectedinherited

Whether or not the solution states have been initialized.

Definition at line 1025 of file SystemBase.h.

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

◆ _subproblem

SubProblem& SystemBase::_subproblem
protectedinherited

◆ _sys

TransientExplicitSystem& DisplacedSystem::_sys
protected

Definition at line 264 of file DisplacedSystem.h.

Referenced by DisplacedSystem(), getVector(), sys(), and system().

◆ _tagged_matrices

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

◆ _tagged_vectors

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

◆ _time_integrator

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

◆ _u_dot

NumericVector<Number>* SystemBase::_u_dot
protectedinherited

solution vector for u^dot

Definition at line 974 of file SystemBase.h.

Referenced by SystemBase::addDotVectors(), NonlinearSystemBase::setSolutionUDot(), and SystemBase::solutionUDot().

◆ _u_dot_old

NumericVector<Number>* SystemBase::_u_dot_old
protectedinherited

old solution vector for u^dot

Definition at line 979 of file SystemBase.h.

Referenced by SystemBase::addDotVectors(), NonlinearSystemBase::setSolutionUDotOld(), and SystemBase::solutionUDotOld().

◆ _u_dotdot

NumericVector<Number>* SystemBase::_u_dotdot
protectedinherited

solution vector for u^dotdot

Definition at line 976 of file SystemBase.h.

Referenced by SystemBase::addDotVectors(), NonlinearSystemBase::setSolutionUDotDot(), and SystemBase::solutionUDotDot().

◆ _u_dotdot_old

NumericVector<Number>* SystemBase::_u_dotdot_old
protectedinherited

old solution vector for u^dotdot

Definition at line 981 of file SystemBase.h.

Referenced by SystemBase::addDotVectors(), NonlinearSystemBase::setSolutionUDotDotOld(), and SystemBase::solutionUDotDotOld().

◆ _undisplaced_system

SystemBase& DisplacedSystem::_undisplaced_system
protected

◆ _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 1028 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 1002 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 966 of file SystemBase.h.

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

◆ _var_to_copy

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

◆ _vars

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

Variable warehouses (one for each thread)

Definition at line 964 of file SystemBase.h.

Referenced by NonlinearSystemBase::addBoundaryCondition(), NonlinearSystemBase::addInterfaceKernel(), AuxiliarySystem::addVariable(), SystemBase::addVariable(), SystemBase::applyScalingFactors(), NonlinearSystemBase::assembleScalingVector(), SystemBase::clearAllDofIndices(), AuxiliarySystem::compute(), SystemBase::customSetup(), SystemBase::getActualFieldVariable(), SystemBase::getFieldVariable(), SystemBase::getFVVariable(), AuxiliarySystem::getMinQuadratureOrder(), SystemBase::getMinQuadratureOrder(), SystemBase::getScalarVariable(), SystemBase::getScalarVariables(), SystemBase::getVariable(), SystemBase::getVariableNames(), SystemBase::getVariables(), LinearSystem::initialSetup(), SystemBase::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::subdomainSetup(), and SystemBase::timestepSetup().

◆ _vars_to_be_zeroed_on_jacobian

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

◆ _vars_to_be_zeroed_on_residual

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

◆ _verbose

bool SystemBase::_verbose
protectedinherited

True if printing out additional information.

Definition at line 1022 of file SystemBase.h.

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


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