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

A system that holds auxiliary variables. More...

#include <AuxiliarySystem.h>

Inheritance diagram for AuxiliarySystem:
[legend]

Public Member Functions

 AuxiliarySystem (FEProblemBase &subproblem, const std::string &name)
 
virtual ~AuxiliarySystem ()
 
virtual void init () override
 Initialize the system. More...
 
virtual void addExtraVectors () override
 Method called during initialSetup to add extra system vector if they are required by the simulation. More...
 
virtual void initialSetup ()
 
virtual void timestepSetup ()
 
virtual void subdomainSetup ()
 
virtual void residualSetup ()
 
virtual void jacobianSetup ()
 
virtual void updateActive (THREAD_ID tid)
 
virtual void addVariable (const std::string &var_name, const FEType &type, Real scale_factor, const std::set< SubdomainID > *const active_subdomains=NULL) override
 Adds a variable to the system. More...
 
void addTimeIntegrator (const std::string &type, const std::string &name, InputParameters parameters) override
 Add a time integrator. More...
 
void addDotVectors ()
 Adds u_dot, u_dotdot, u_dot_old and u_dotdot_old vectors if requested by the time integrator. More...
 
void addKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 Adds an auxiliary kernel. More...
 
void addScalarKernel (const std::string &kernel_name, const std::string &name, InputParameters parameters)
 Adds a scalar kernel. More...
 
virtual void reinitElem (const Elem *elem, THREAD_ID tid) override
 Reinit an element assembly info. More...
 
virtual void reinitElemFace (const Elem *elem, unsigned int side, BoundaryID bnd_id, THREAD_ID tid) override
 Reinit assembly info for a side of an element. More...
 
virtual const NumericVector< Number > *& currentSolution () override
 The solution vector that is currently being operated on. More...
 
virtual NumericVector< Number > * solutionUDot () override
 
virtual NumericVector< Number > * solutionUDotDot () override
 
virtual void serializeSolution ()
 
virtual NumericVector< Number > & serializedSolution () override
 Returns a reference to a serialized version of the solution vector for this subproblem. More...
 
virtual void augmentSparsity (SparsityPattern::Graph &, std::vector< dof_id_type > &, std::vector< dof_id_type > &) override
 Will modify the sparsity pattern to add logical geometric connections. More...
 
virtual void compute (ExecFlagType type)
 Compute auxiliary variables. More...
 
std::set< std::string > getDependObjects (ExecFlagType type)
 Get a list of dependent UserObjects for this exec type. More...
 
std::set< std::string > getDependObjects ()
 
NumericVector< Number > & addVector (const std::string &vector_name, const bool project, const ParallelType type) override
 Adds a solution length vector to the system. More...
 
virtual Order getMinQuadratureOrder () override
 Get the minimum quadrature order for evaluating elemental auxiliary variables. More...
 
bool needMaterialOnSide (BoundaryID bnd_id)
 Indicated whether this system needs material properties on boundaries. More...
 
virtual NumericVector< Number > & solution () override
 
virtual NumericVector< Number > & solutionOld () override
 
virtual NumericVector< Number > & solutionOlder () override
 
virtual TransientExplicitSystem & sys ()
 
virtual System & system () override
 Get the reference to the libMesh system. More...
 
virtual const System & system () const override
 
virtual NumericVector< Number > * solutionUDotOld () override
 
virtual NumericVector< Number > * solutionUDotDotOld () override
 
virtual NumericVector< Number > * solutionPreviousNewton () override
 
virtual void setPreviousNewtonSolution ()
 
void setScalarVariableCoupleableTags (ExecFlagType type)
 
void clearScalarVariableCoupleableTags ()
 
void computeScalarVars (ExecFlagType type)
 
void computeNodalVars (ExecFlagType type)
 
void computeNodalVecVars (ExecFlagType type)
 
void computeElementalVars (ExecFlagType type)
 
void computeElementalVecVars (ExecFlagType type)
 
template<typename AuxKernelType >
void computeElementalVarsHelper (const MooseObjectWarehouse< AuxKernelType > &warehouse, const std::vector< std::vector< MooseVariableFEBase *>> &vars, const PerfID timer)
 
template<typename AuxKernelType >
void computeNodalVarsHelper (const MooseObjectWarehouse< AuxKernelType > &warehouse, const std::vector< std::vector< MooseVariableFEBase *>> &vars, const PerfID timer)
 
virtual void addTimeIntegrator (const std::string &, const std::string &, InputParameters)
 
virtual void addTimeIntegrator (std::shared_ptr< TimeIntegrator >)
 
virtual unsigned int number () const
 Gets the number of this system. More...
 
virtual MooseMeshmesh ()
 
virtual SubProblemsubproblem ()
 
virtual DofMap & dofMap ()
 Gets the dof map. More...
 
virtual void initializeObjects ()
 Called only once, just before the solve begins so objects can do some precalculations. More...
 
virtual void update ()
 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...
 
virtual Number & duDotDu ()
 
virtual Number & duDotDotDu ()
 
virtual void saveOldSolutions ()
 Save the old and older solutions. More...
 
virtual void restoreOldSolutions ()
 Restore the old and older solutions when the saved solutions present. More...
 
bool hasVector (const std::string &tag_name) const
 Check if the named vector exists in the system. More...
 
virtual bool hasVector (TagID tag_id)
 Check if the tagged vector exists in the system. More...
 
virtual TagID timeVectorTag ()
 Ideally, we should not need this API. More...
 
virtual TagID timeMatrixTag ()
 Return the Matrix Tag ID for Time. More...
 
virtual TagID systemMatrixTag ()
 Return the Matrix Tag ID for System. More...
 
virtual TagID nonTimeVectorTag ()
 
virtual TagID residualVectorTag ()
 
virtual NumericVector< Number > & getVector (const std::string &name)
 Get a raw NumericVector. More...
 
virtual NumericVector< Number > & getVector (TagID tag)
 Get a raw NumericVector. More...
 
virtual void associateVectorToTag (NumericVector< Number > &vec, TagID tag)
 Associate a vector for a given tag. More...
 
virtual void disassociateVectorFromTag (NumericVector< Number > &vec, TagID tag)
 Associate a vector for a given tag. More...
 
virtual void disassociateAllTaggedVectors ()
 Disassociate all vectors, and then hasVector() will return false. More...
 
virtual bool hasMatrix (TagID tag)
 Check if the tagged matrix exists in the system. More...
 
virtual SparseMatrix< Number > & getMatrix (TagID tag)
 Get a raw SparseMatrix. More...
 
virtual void activeAllMatrixTags ()
 Make all exsiting matrices ative. More...
 
virtual void activeMatrixTag (TagID tag)
 Active a matrix for tag. More...
 
virtual bool matrixTagActive (TagID tag)
 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...
 
virtual void associateMatrixToTag (SparseMatrix< Number > &matrix, TagID tag)
 associate a matirx to a tag More...
 
virtual void disassociateMatrixFromTag (SparseMatrix< Number > &matrix, TagID tag)
 disassociate a matirx from a tag More...
 
virtual void disassociateAllTaggedMatrices ()
 Clear all tagged matrices. More...
 
virtual NumericVector< Number > & residualCopy ()
 
virtual NumericVector< Number > & residualGhosted ()
 
virtual void augmentSendList (std::vector< dof_id_type > &send_list)
 Will modify the send_list to add all of the extra ghosted dofs for this system. More...
 
virtual bool isScalarVariable (unsigned int var_name) const
 
MooseVariableFEBasegetVariable (THREAD_ID tid, const std::string &var_name)
 Gets a reference to a variable of with specified name. More...
 
MooseVariableFEBasegetVariable (THREAD_ID tid, unsigned int var_number)
 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...
 
virtual MooseVariableScalargetScalarVariable (THREAD_ID tid, const std::string &var_name)
 Gets a reference to a scalar variable with specified number. More...
 
virtual MooseVariableScalargetScalarVariable (THREAD_ID tid, unsigned int var_number)
 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...
 
size_t getMaxVarNDofsPerElem ()
 Gets the maximum number of dofs used by any one variable on any one element. More...
 
size_t getMaxVarNDofsPerNode ()
 Gets the maximum number of dofs used by any one variable on any one node. More...
 
void assignMaxVarNDofsPerElem (const size_t &max_dofs)
 assign the maximum element dofs More...
 
void assignMaxVarNDofsPerNode (const size_t &max_dofs)
 assign the maximum node dofs More...
 
virtual void addVariableToZeroOnResidual (std::string var_name)
 Adds this variable to the list of variables to be zeroed during each residual evaluation. More...
 
virtual void addVariableToZeroOnJacobian (std::string var_name)
 Adds this variable to the list of variables to be zeroed during each Jacobian evaluation. More...
 
virtual void zeroVariables (std::vector< std::string > &vars_to_be_zeroed)
 Zero out the solution for the list of variables passed in. More...
 
virtual void zeroVariablesForResidual ()
 Zero out the solution for the variables that were registered as needing to have their solutions zeroed on out on residual evaluation by a call to addVariableToZeroOnResidual() More...
 
virtual void zeroVariablesForJacobian ()
 Zero out the solution for the variables that were registered as needing to have their solutions zeroed on out on Jacobian evaluation by a call to addVariableToZeroOnResidual() More...
 
virtual void prepare (THREAD_ID tid)
 Prepare the system for use. More...
 
virtual void prepareFace (THREAD_ID tid, bool resize_data)
 Prepare the system for use on sides. More...
 
virtual void prepareNeighbor (THREAD_ID tid)
 Prepare the system for use. More...
 
virtual void 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 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)
 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< MooseVariableFEBase * > & getVariables (THREAD_ID tid)
 
const std::vector< MooseVariableScalar * > & getScalarVariables (THREAD_ID tid)
 
const std::set< SubdomainID > & getSubdomainsForVar (unsigned int var_number) const
 
virtual void removeVector (const std::string &name)
 Remove a vector from the system with the given name. More...
 
virtual void removeVector (TagID tag_id)
 Remove a solution length vector from the system with the specified TagID. 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...
 
virtual void closeTaggedVectors (const std::set< TagID > &tags)
 Close all vectors for given tags. More...
 
virtual void zeroTaggedVectors (const std::set< TagID > &tags)
 Zero all vectors for given tags. More...
 
virtual SparseMatrix< Number > & addMatrix (TagID)
 Adds a jacobian sized vector. More...
 
virtual void removeMatrix (TagID)
 Removes a jacobian sized vector. More...
 
virtual const std::string & name () const
 
virtual void addScalarVariable (const std::string &var_name, Order order, Real scale_factor, const std::set< SubdomainID > *const active_subdomains=NULL)
 Adds a scalar variable. More...
 
const std::vector< VariableName > & getVariableNames () const
 
virtual void computeVariables (const NumericVector< Number > &)
 
void copyVars (ExodusII_IO &io)
 
virtual void copySolutionsBackwards ()
 Copy current solution into old and older. More...
 
virtual void addTimeIntegrator (std::shared_ptr< TimeIntegrator >)
 
TimeIntegratorgetTimeIntegrator ()
 
std::shared_ptr< TimeIntegratorgetSharedTimeIntegrator ()
 
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

FEProblemBase_fe_problem
 
TransientExplicitSystem & _sys
 
const NumericVector< Number > * _current_solution
 solution vector from nonlinear solver More...
 
NumericVector< Number > & _serialized_solution
 Serialized version of the solution vector. More...
 
NumericVector< Number > * _solution_previous_nl
 Solution vector of the previous nonlinear iterate. More...
 
std::shared_ptr< TimeIntegrator_time_integrator
 Time integrator. More...
 
NumericVector< Number > * _u_dot
 solution vector for u^dot More...
 
NumericVector< Number > * _u_dotdot
 solution vector for u^dotdot More...
 
NumericVector< Number > * _u_dot_old
 Old solution vector for u^dot. More...
 
NumericVector< Number > * _u_dotdot_old
 Old solution vector for u^dotdot. More...
 
bool _need_serialized_solution
 Whether or not a copy of the residual needs to be made. More...
 
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vars
 
std::vector< std::vector< MooseVariableFEBase * > > _nodal_std_vars
 
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vec_vars
 
std::vector< std::vector< MooseVariableFEBase * > > _elem_vars
 
std::vector< std::vector< MooseVariableFEBase * > > _elem_std_vars
 
std::vector< std::vector< MooseVariableFEBase * > > _elem_vec_vars
 
ExecuteMooseObjectWarehouse< AuxScalarKernel_aux_scalar_storage
 
ExecuteMooseObjectWarehouse< AuxKernel_nodal_aux_storage
 
ExecuteMooseObjectWarehouse< AuxKernel_elemental_aux_storage
 
ExecuteMooseObjectWarehouse< VectorAuxKernel_nodal_vec_aux_storage
 
ExecuteMooseObjectWarehouse< VectorAuxKernel_elemental_vec_aux_storage
 
const PerfID _compute_scalar_vars_timer
 Timers. More...
 
const PerfID _compute_nodal_vars_timer
 
const PerfID _compute_nodal_vec_vars_timer
 
const PerfID _compute_elemental_vars_timer
 
const PerfID _compute_elemental_vec_vars_timer
 

Protected Member Functions

PerfID registerTimedSection (const std::string &section_name, const unsigned int level)
 Call to register a named section for timing. More...
 

Protected Attributes

SubProblem_subproblem
 
MooseApp_app
 
Factory_factory
 
MooseMesh_mesh
 
std::string _name
 The name of this system. More...
 
std::vector< VariableWarehouse_vars
 Variable warehouses (one for each thread) More...
 
std::map< unsigned int, std::set< SubdomainID > > _var_map
 Map of variables (variable id -> array of subdomains where it lives) More...
 
std::vector< std::string > _vars_to_be_zeroed_on_residual
 
std::vector< std::string > _vars_to_be_zeroed_on_jacobian
 
Real _du_dot_du
 
Real _du_dotdot_du
 
std::vector< NumericVector< Number > * > _tagged_vectors
 Tagged vectors (pointer) More...
 
std::vector< SparseMatrix< Number > * > _tagged_matrices
 Tagged matrices (pointer) More...
 
std::vector< bool > _matrix_tag_active_flags
 Active flags for tagged matrices. More...
 
NumericVector< Real > * _saved_old
 
NumericVector< Real > * _saved_older
 
NumericVector< Real > * _saved_dot_old
 
NumericVector< Real > * _saved_dotdot_old
 
Moose::VarKindType _var_kind
 default kind of variables in this system More...
 
std::vector< VarCopyInfo_var_to_copy
 
size_t _max_var_n_dofs_per_elem
 Maximum number of dofs for any one variable on any one element. More...
 
size_t _max_var_n_dofs_per_node
 Maximum number of dofs for any one variable on any one node. More...
 
const InputParameters_pg_params
 Params. More...
 
PerfGraph_perf_graph
 The performance graph to add to. More...
 
std::string _prefix
 A prefix to use for all sections. More...
 

Friends

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

Detailed Description

A system that holds auxiliary variables.

Definition at line 41 of file AuxiliarySystem.h.

Constructor & Destructor Documentation

◆ AuxiliarySystem()

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

Definition at line 32 of file AuxiliarySystem.C.

34  PerfGraphInterface(subproblem.getMooseApp().perfGraph(), "AuxiliarySystem"),
37  _current_solution(NULL),
38  _serialized_solution(*NumericVector<Number>::build(_fe_problem.comm()).release()),
40  _u_dot(NULL),
41  _u_dotdot(NULL),
42  _u_dot_old(NULL),
43  _u_dotdot_old(NULL),
50  _compute_scalar_vars_timer(registerTimedSection("computeScalarVars", 1)),
51  _compute_nodal_vars_timer(registerTimedSection("computeNodalVars", 1)),
52  _compute_nodal_vec_vars_timer(registerTimedSection("computeNodalVecVars", 1)),
53  _compute_elemental_vars_timer(registerTimedSection("computeElementalVars", 1)),
54  _compute_elemental_vec_vars_timer(registerTimedSection("computeElementalVecVars", 1))
55 {
56  _nodal_vars.resize(libMesh::n_threads());
57  _nodal_std_vars.resize(libMesh::n_threads());
58  _nodal_vec_vars.resize(libMesh::n_threads());
59  _elem_vars.resize(libMesh::n_threads());
60  _elem_std_vars.resize(libMesh::n_threads());
61  _elem_vec_vars.resize(libMesh::n_threads());
62 }
PerfID registerTimedSection(const std::string &section_name, const unsigned int level)
Call to register a named section for timing.
std::vector< std::vector< MooseVariableFEBase * > > _elem_std_vars
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
NumericVector< Number > & _serialized_solution
Serialized version of the solution vector.
std::vector< std::vector< MooseVariableFEBase * > > _elem_vec_vars
NumericVector< Number > * _u_dotdot
solution vector for u^dotdot
NumericVector< Number > * _u_dot
solution vector for u^dot
const ExecFlagEnum & getExecuteOnEnum() const
Return the app level ExecFlagEnum, this contains all the available flags for the app.
Definition: MooseApp.h:661
const PerfID _compute_elemental_vec_vars_timer
const NumericVector< Number > * _current_solution
solution vector from nonlinear solver
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
virtual EquationSystems & es()=0
const PerfID _compute_nodal_vars_timer
virtual const std::string & name() const
Definition: SystemBase.C:1049
const PerfID _compute_nodal_vec_vars_timer
std::vector< std::vector< MooseVariableFEBase * > > _nodal_std_vars
FEProblemBase & _fe_problem
TransientSystem< ExplicitSystem > TransientExplicitSystem
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vec_vars
virtual SubProblem & subproblem()
Definition: SystemBase.h:105
const PerfID _compute_elemental_vars_timer
TransientExplicitSystem & _sys
const PerfID _compute_scalar_vars_timer
Timers.
bool _need_serialized_solution
Whether or not a copy of the residual needs to be made.
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vars
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
MooseApp & _app
Definition: SystemBase.h:696
NumericVector< Number > * _u_dot_old
Old solution vector for u^dot.
SystemBase(SubProblem &subproblem, const std::string &name, Moose::VarKindType var_kind)
Definition: SystemBase.C:82
std::vector< std::vector< MooseVariableFEBase * > > _elem_vars
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
MooseApp & getMooseApp() const
Get the MooseApp this object is associated with.
Definition: MooseObject.h:91
PerfGraphInterface(const MooseObject *moose_object)
For objects that are MooseObjects with a default prefix of type()
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage
NumericVector< Number > * _u_dotdot_old
Old solution vector for u^dotdot.
NumericVector< Number > * _solution_previous_nl
Solution vector of the previous nonlinear iterate.
PerfGraph & perfGraph()
Get the PerfGraph for this app.
Definition: MooseApp.h:98

◆ ~AuxiliarySystem()

AuxiliarySystem::~AuxiliarySystem ( )
virtual

Definition at line 64 of file AuxiliarySystem.C.

64 { delete &_serialized_solution; }
NumericVector< Number > & _serialized_solution
Serialized version of the solution vector.

Member Function Documentation

◆ activeAllMatrixTags()

void SystemBase::activeAllMatrixTags ( )
virtualinherited

Make all exsiting matrices ative.

Definition at line 865 of file SystemBase.C.

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

866 {
867  auto num_matrix_tags = _subproblem.numMatrixTags();
868 
869  _matrix_tag_active_flags.resize(num_matrix_tags);
870 
871  for (decltype(num_matrix_tags) tag = 0; tag < num_matrix_tags; tag++)
872  if (hasMatrix(tag))
873  _matrix_tag_active_flags[tag] = true;
874  else
875  _matrix_tag_active_flags[tag] = false;
876 }
virtual bool hasMatrix(TagID tag)
Check if the tagged matrix exists in the system.
Definition: SystemBase.C:781
std::vector< bool > _matrix_tag_active_flags
Active flags for tagged matrices.
Definition: SystemBase.h:719
SubProblem & _subproblem
Definition: SystemBase.h:694
virtual unsigned int numMatrixTags()
The total number of tags.
Definition: SubProblem.h:157

◆ activeMatrixTag()

void SystemBase::activeMatrixTag ( TagID  tag)
virtualinherited

Active a matrix for tag.

Definition at line 830 of file SystemBase.C.

831 {
832  mooseAssert(_subproblem.matrixTagExists(tag),
833  "Cannot active Matrix with matrix_tag : " << tag << "that does not exist");
834 
835  if (_matrix_tag_active_flags.size() < tag + 1)
836  _matrix_tag_active_flags.resize(tag + 1);
837 
838  _matrix_tag_active_flags[tag] = true;
839 }
virtual bool matrixTagExists(const TagName &tag_name)
Check to see if a particular Tag exists.
Definition: SubProblem.C:128
std::vector< bool > _matrix_tag_active_flags
Active flags for tagged matrices.
Definition: SystemBase.h:719
SubProblem & _subproblem
Definition: SystemBase.h:694

◆ addDotVectors()

void AuxiliarySystem::addDotVectors ( )

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

Definition at line 72 of file AuxiliarySystem.C.

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

◆ addExtraVectors()

void AuxiliarySystem::addExtraVectors ( )
overridevirtual

Method called during initialSetup to add extra system vector if they are required by the simulation.

Reimplemented from SystemBase.

Definition at line 85 of file AuxiliarySystem.C.

86 {
88  _solution_previous_nl = &addVector("u_previous_newton", true, GHOSTED);
89 }
NumericVector< Number > & addVector(const std::string &vector_name, const bool project, const ParallelType type) override
Adds a solution length vector to the system.
FEProblemBase & _fe_problem
void needsPreviousNewtonIteration(bool state)
Set a flag that indicated that user required values for the previous Newton iterate.
NumericVector< Number > * _solution_previous_nl
Solution vector of the previous nonlinear iterate.

◆ addKernel()

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

Adds an auxiliary kernel.

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

Definition at line 225 of file AuxiliarySystem.C.

228 {
229  parameters.set<AuxiliarySystem *>("_aux_sys") = this;
230 
231  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
232  {
233  if (parameters.get<std::string>("_moose_base") == "AuxKernel")
234  {
235  std::shared_ptr<AuxKernel> kernel =
236  _factory.create<AuxKernel>(kernel_name, name, parameters, tid);
237  if (kernel->isNodal())
238  _nodal_aux_storage.addObject(kernel, tid);
239  else
240  _elemental_aux_storage.addObject(kernel, tid);
241  }
242 
243  else if (parameters.get<std::string>("_moose_base") == "VectorAuxKernel")
244  {
245  std::shared_ptr<VectorAuxKernel> kernel =
246  _factory.create<VectorAuxKernel>(kernel_name, name, parameters, tid);
247  if (kernel->isNodal())
248  _nodal_vec_aux_storage.addObject(kernel, tid);
249  else
250  _elemental_vec_aux_storage.addObject(kernel, tid);
251  }
252  }
253 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Factory & _factory
Definition: SystemBase.h:697
virtual const std::string & name() const
Definition: SystemBase.C:1049
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
Definition: AuxKernel.h:34
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage
A system that holds auxiliary variables.
unsigned int THREAD_ID
Definition: MooseTypes.h:162

◆ addMatrix()

virtual SparseMatrix<Number>& SystemBase::addMatrix ( TagID  )
inlinevirtualinherited

Adds a jacobian sized vector.

Parameters
tag_nameThe name of the tag

Reimplemented in NonlinearSystem.

Definition at line 642 of file SystemBase.h.

643  {
644  mooseError("Adding a matrix is not supported for this type of system!");
645  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ addScalarKernel()

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

Adds a scalar kernel.

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

Definition at line 256 of file AuxiliarySystem.C.

259 {
260  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
261  {
262  std::shared_ptr<AuxScalarKernel> kernel =
263  _factory.create<AuxScalarKernel>(kernel_name, name, parameters, tid);
264  _aux_scalar_storage.addObject(kernel, tid);
265  }
266 }
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
Factory & _factory
Definition: SystemBase.h:697
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
virtual const std::string & name() const
Definition: SystemBase.C:1049
Base class for making kernels that work on auxiliary scalar variables.
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.
unsigned int THREAD_ID
Definition: MooseTypes.h:162

◆ addScalarVariable()

void SystemBase::addScalarVariable ( const std::string &  var_name,
Order  order,
Real  scale_factor,
const std::set< SubdomainID > *const  active_subdomains = NULL 
)
virtualinherited

Adds a scalar variable.

Parameters
var_nameThe name of the variable
orderThe order of the variable
scale_factorThe scaling factor to be used with this scalar variable

Definition at line 628 of file SystemBase.C.

Referenced by DisplacedProblem::addAuxScalarVariable(), and DisplacedProblem::addScalarVariable().

632 {
633  FEType type(order, SCALAR);
634  unsigned int var_num = system().add_variable(var_name, type, active_subdomains);
635  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
636  {
637  // FIXME: we cannot refer fetype in libMesh at this point, so we will just make a copy in
638  // MooseVariableBase.
639  MooseVariableScalar * var =
640  new MooseVariableScalar(var_num, type, *this, _subproblem.assembly(tid), _var_kind, tid);
641  var->scalingFactor(scale_factor);
642  _vars[tid].add(var_name, var);
643  }
644  if (active_subdomains == nullptr)
645  _var_map[var_num] = std::set<SubdomainID>();
646  else
647  for (const auto subdomain_id : *active_subdomains)
648  _var_map[var_num].insert(subdomain_id);
649 }
virtual Assembly & assembly(THREAD_ID tid)=0
SubProblem & _subproblem
Definition: SystemBase.h:694
Moose::VarKindType _var_kind
default kind of variables in this system
Definition: SystemBase.h:730
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:706
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704
MatType type
Class for scalar variables (they are different).
unsigned int THREAD_ID
Definition: MooseTypes.h:162
void scalingFactor(Real factor)
Set the scaling factor for this variable.

◆ addTimeIntegrator() [1/4]

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

Add a time integrator.

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

Reimplemented from SystemBase.

Definition at line 216 of file AuxiliarySystem.C.

219 {
220  parameters.set<SystemBase *>("_sys") = this;
222 }
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, InputParameters parameters, THREAD_ID tid=0, bool print_deprecated=true)
Build an object (must be registered) - THIS METHOD IS DEPRECATED (Use create<T>()) ...
Definition: Factory.C:87
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
Factory & _factory
Definition: SystemBase.h:697
Base class for a system (of equations)
Definition: SystemBase.h:93
virtual const std::string & name() const
Definition: SystemBase.C:1049
MatType type
Base class for time integrators.
std::shared_ptr< TimeIntegrator > _time_integrator
Time integrator.

◆ addTimeIntegrator() [2/4]

virtual void SystemBase::addTimeIntegrator
inline

Definition at line 681 of file SystemBase.h.

684  {
685  }

◆ addTimeIntegrator() [3/4]

virtual void SystemBase::addTimeIntegrator
inline

Definition at line 687 of file SystemBase.h.

687 {}

◆ addTimeIntegrator() [4/4]

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

Reimplemented in DisplacedSystem.

Definition at line 687 of file SystemBase.h.

687 {}

◆ addVariable()

void AuxiliarySystem::addVariable ( const std::string &  var_name,
const FEType &  type,
Real  scale_factor,
const std::set< SubdomainID > *const  active_subdomains = NULL 
)
overridevirtual

Adds a variable to the system.

Parameters
var_namename of the variable
typeFE type of the variable
scale_factorthe scaling factor for the variable
active_subdomainsa list of subdomain ids this variable is active on

Reimplemented from SystemBase.

Definition at line 176 of file AuxiliarySystem.C.

180 {
181  SystemBase::addVariable(var_name, type, scale_factor, active_subdomains);
182  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
183  {
184  if (type.family == LAGRANGE_VEC)
185  {
186  VectorMooseVariable * var = _vars[tid].getFieldVariable<RealVectorValue>(var_name);
187  if (var)
188  {
189  _nodal_vars[tid].push_back(var);
190  _nodal_vec_vars[tid].push_back(var);
191  }
192  }
193 
194  else
195  {
196  MooseVariable * var = _vars[tid].getFieldVariable<Real>(var_name);
197 
198  if (var)
199  {
200  if (var->feType().family == LAGRANGE)
201  {
202  _nodal_vars[tid].push_back(var);
203  _nodal_std_vars[tid].push_back(var);
204  }
205  else
206  {
207  _elem_vars[tid].push_back(var);
208  _elem_std_vars[tid].push_back(var);
209  }
210  }
211  }
212  }
213 }
std::vector< std::vector< MooseVariableFEBase * > > _elem_std_vars
Class for stuff related to variables.
Definition: Adaptivity.h:30
VectorValue< Real > RealVectorValue
Definition: Assembly.h:32
virtual void addVariable(const std::string &var_name, const FEType &type, Real scale_factor, const std::set< SubdomainID > *const active_subdomains=NULL)
Adds a variable to the system.
Definition: SystemBase.C:597
const FEType & feType() const
Get the type of finite element object.
std::vector< std::vector< MooseVariableFEBase * > > _nodal_std_vars
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vec_vars
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vars
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704
MatType type
std::vector< std::vector< MooseVariableFEBase * > > _elem_vars
unsigned int THREAD_ID
Definition: MooseTypes.h:162

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

909 {
910  _var_to_copy.push_back(VarCopyInfo(dest_name, source_name, timestep));
911 }
std::vector< VarCopyInfo > _var_to_copy
Definition: SystemBase.h:732
Information about variables that will be copied.
Definition: SystemBase.h:75

◆ addVariableToZeroOnJacobian()

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

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

Parameters
var_nameThe name of the variable to be zeroed.

Reimplemented in DisplacedSystem.

Definition at line 184 of file SystemBase.C.

Referenced by DisplacedSystem::addVariableToZeroOnJacobian(), ADIntegratedBCTempl< T, compute_stage >::ADIntegratedBCTempl(), ADKernelTempl< T, compute_stage >::ADKernelTempl(), DGKernelBase::DGKernelBase(), IntegratedBC::IntegratedBC(), InterfaceKernel::InterfaceKernel(), Kernel::Kernel(), NodalBC::NodalBC(), and NodalKernel::NodalKernel().

185 {
186  _vars_to_be_zeroed_on_jacobian.push_back(var_name);
187 }
std::vector< std::string > _vars_to_be_zeroed_on_jacobian
Definition: SystemBase.h:709

◆ addVariableToZeroOnResidual()

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

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

Parameters
var_nameThe name of the variable to be zeroed.

Reimplemented in DisplacedSystem.

Definition at line 178 of file SystemBase.C.

Referenced by DisplacedSystem::addVariableToZeroOnResidual(), ADIntegratedBCTempl< T, compute_stage >::ADIntegratedBCTempl(), ADKernelTempl< T, compute_stage >::ADKernelTempl(), DGKernelBase::DGKernelBase(), IntegratedBC::IntegratedBC(), InterfaceKernel::InterfaceKernel(), Kernel::Kernel(), NodalBC::NodalBC(), and NodalKernel::NodalKernel().

179 {
180  _vars_to_be_zeroed_on_residual.push_back(var_name);
181 }
std::vector< std::string > _vars_to_be_zeroed_on_residual
Definition: SystemBase.h:708

◆ addVector() [1/2]

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

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.

Reimplemented from SystemBase.

Definition at line 464 of file AuxiliarySystem.C.

Referenced by addDotVectors(), and addExtraVectors().

467 {
468  if (hasVector(vector_name))
469  return getVector(vector_name);
470 
471  NumericVector<Number> * vec = &_sys.add_vector(vector_name, project, type);
472 
473  return *vec;
474 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:685
TransientExplicitSystem & _sys
MatType type
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector.
Definition: SystemBase.C:735

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

537 {
538  if (!_subproblem.vectorTagExists(tag))
539  mooseError("Cannot add a tagged vector with vector_tag, ",
540  tag,
541  ", that tag does not exist in System ",
542  name());
543 
544  if (hasVector(tag))
545  return getVector(tag);
546 
547  auto vector_name = _subproblem.vectorTagName(tag);
548 
549  NumericVector<Number> & vec = system().add_vector(vector_name, project, type);
550 
551  if (_tagged_vectors.size() < tag + 1)
552  _tagged_vectors.resize(tag + 1);
553 
554  _tagged_vectors[tag] = &vec;
555 
556  return vec;
557 }
virtual TagName vectorTagName(TagID tag)
Retrieve the name associated with a TagID.
Definition: SubProblem.C:105
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:685
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
virtual const std::string & name() const
Definition: SystemBase.C:1049
SubProblem & _subproblem
Definition: SystemBase.h:694
virtual bool vectorTagExists(TagID tag)
Check to see if a particular Tag exists.
Definition: SubProblem.h:112
virtual System & system()=0
Get the reference to the libMesh system.
MatType type
std::vector< NumericVector< Number > * > _tagged_vectors
Tagged vectors (pointer)
Definition: SystemBase.h:715
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector.
Definition: SystemBase.C:735

◆ assignMaxVarNDofsPerElem()

void SystemBase::assignMaxVarNDofsPerElem ( const size_t &  max_dofs)
inlineinherited

assign the maximum element dofs

Definition at line 425 of file SystemBase.h.

425 { _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:735

◆ assignMaxVarNDofsPerNode()

void SystemBase::assignMaxVarNDofsPerNode ( const size_t &  max_dofs)
inlineinherited

assign the maximum node dofs

Definition at line 430 of file SystemBase.h.

430 { _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:738

◆ associateMatrixToTag()

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

associate a matirx to a tag

Reimplemented in DisplacedSystem.

Definition at line 803 of file SystemBase.C.

Referenced by DisplacedSystem::associateMatrixToTag(), and NonlinearSystemBase::computeJacobian().

804 {
805  mooseAssert(_subproblem.matrixTagExists(tag),
806  "Cannot associate Matrix with matrix_tag : " << tag << "that does not exist");
807 
808  if (_tagged_matrices.size() < tag + 1)
809  _tagged_matrices.resize(tag + 1);
810 
811  _tagged_matrices[tag] = &matrix;
812 }
std::vector< SparseMatrix< Number > * > _tagged_matrices
Tagged matrices (pointer)
Definition: SystemBase.h:717
virtual bool matrixTagExists(const TagName &tag_name)
Check to see if a particular Tag exists.
Definition: SubProblem.C:128
SubProblem & _subproblem
Definition: SystemBase.h:694

◆ associateVectorToTag()

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

Associate a vector for a given tag.

Reimplemented in DisplacedSystem.

Definition at line 749 of file SystemBase.C.

Referenced by DisplacedSystem::associateVectorToTag(), NonlinearSystemBase::computeNodalBCs(), and NonlinearSystemBase::computeResidualTag().

750 {
751  mooseAssert(_subproblem.vectorTagExists(tag),
752  "You can't associate a tag that does not exist " << tag);
753  if (_tagged_vectors.size() < tag + 1)
754  _tagged_vectors.resize(tag + 1);
755 
756  _tagged_vectors[tag] = &vec;
757 }
SubProblem & _subproblem
Definition: SystemBase.h:694
virtual bool vectorTagExists(TagID tag)
Check to see if a particular Tag exists.
Definition: SubProblem.h:112
std::vector< NumericVector< Number > * > _tagged_vectors
Tagged vectors (pointer)
Definition: SystemBase.h:715

◆ augmentSendList()

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

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

Reimplemented in DisplacedSystem.

Definition at line 414 of file SystemBase.C.

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

415 {
416  std::set<dof_id_type> & ghosted_elems = _subproblem.ghostedElems();
417 
418  DofMap & dof_map = dofMap();
419 
420  std::vector<dof_id_type> dof_indices;
421 
422  System & sys = system();
423 
424  unsigned int sys_num = sys.number();
425 
426  unsigned int n_vars = sys.n_vars();
427 
428  for (const auto & elem_id : ghosted_elems)
429  {
430  Elem * elem = _mesh.elemPtr(elem_id);
431 
432  if (elem->active())
433  {
434  dof_map.dof_indices(elem, dof_indices);
435 
436  // Only need to ghost it if it's actually not on this processor
437  for (const auto & dof : dof_indices)
438  if (dof < dof_map.first_dof() || dof >= dof_map.end_dof())
439  send_list.push_back(dof);
440 
441  // Now add the DoFs from all of the nodes. This is necessary because of block
442  // restricted variables. A variable might not live _on_ this element but it
443  // might live on nodes connected to this element.
444  for (unsigned int n = 0; n < elem->n_nodes(); n++)
445  {
446  Node * node = elem->node_ptr(n);
447 
448  // Have to get each variable's dofs
449  for (unsigned int v = 0; v < n_vars; v++)
450  {
451  const Variable & var = sys.variable(v);
452  unsigned int var_num = var.number();
453  unsigned int n_comp = var.n_components();
454 
455  // See if this variable has any dofs at this node
456  if (node->n_dofs(sys_num, var_num) > 0)
457  {
458  // Loop over components of the variable
459  for (unsigned int c = 0; c < n_comp; c++)
460  send_list.push_back(node->dof_number(sys_num, var_num, c));
461  }
462  }
463  }
464  }
465  }
466 }
virtual Elem * elemPtr(const dof_id_type i)
Definition: MooseMesh.C:2269
virtual DofMap & dofMap()
Gets the dof map.
Definition: SystemBase.C:900
DofMap & dof_map
SubProblem & _subproblem
Definition: SystemBase.h:694
virtual std::set< dof_id_type > & ghostedElems()
Return the list of elements that should have their DoFs ghosted to this processor.
Definition: SubProblem.h:505
virtual System & system()=0
Get the reference to the libMesh system.
MooseMesh & _mesh
Definition: SystemBase.h:699
PetscInt n

◆ augmentSparsity()

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

Will modify the sparsity pattern to add logical geometric connections.

Implements SystemBase.

Definition at line 575 of file AuxiliarySystem.C.

578 {
579 }

◆ clearScalarVariableCoupleableTags()

void AuxiliarySystem::clearScalarVariableCoupleableTags ( )

Definition at line 498 of file AuxiliarySystem.C.

Referenced by computeScalarVars().

499 {
502 }
virtual void clearActiveScalarVariableCoupleableMatrixTags(THREAD_ID tid) override
virtual void clearActiveScalarVariableCoupleableVectorTags(THREAD_ID tid) override
FEProblemBase & _fe_problem

◆ closeTaggedMatrices()

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

Close all matrices associated the tags.

Definition at line 795 of file SystemBase.C.

Referenced by NonlinearSystemBase::computeJacobianInternal().

796 {
797  for (auto tag : tags)
798  if (hasMatrix(tag))
799  getMatrix(tag).close();
800 }
virtual bool hasMatrix(TagID tag)
Check if the tagged matrix exists in the system.
Definition: SystemBase.C:781
virtual SparseMatrix< Number > & getMatrix(TagID tag)
Get a raw SparseMatrix.
Definition: SystemBase.C:787

◆ closeTaggedVectors()

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

Close all vectors for given tags.

Definition at line 560 of file SystemBase.C.

Referenced by NonlinearSystemBase::computeResidualTags().

561 {
562  for (auto & tag : tags)
563  {
564  mooseAssert(_subproblem.vectorTagExists(tag), "Tag: " << tag << " does not exsit");
565  getVector(tag).close();
566  }
567 }
SubProblem & _subproblem
Definition: SystemBase.h:694
virtual bool vectorTagExists(TagID tag)
Check to see if a particular Tag exists.
Definition: SubProblem.h:112
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector.
Definition: SystemBase.C:735

◆ compute()

void AuxiliarySystem::compute ( ExecFlagType  type)
virtual

Compute auxiliary variables.

Parameters
typeTime flag of which variables should be computed

Definition at line 322 of file AuxiliarySystem.C.

Referenced by setPreviousNewtonSolution().

323 {
324  // avoid division by dt which might be zero.
325  if (_fe_problem.dt() > 0. && _time_integrator)
326  _time_integrator->preStep();
327 
328  // We need to compute time derivatives every time each kind of the variables is finished, because:
329  //
330  // a) the user might want to use the aux variable value somewhere, thus we need to provide the
331  // up-to-date value
332  // b) time integration system works with the whole vectors of solutions, thus we cannot update
333  // only a part of the vector
334  //
335 
336  if (_vars[0].scalars().size() > 0)
337  {
339  // compute time derivatives of scalar aux variables _after_ the values were updated
340  if (_fe_problem.dt() > 0. && _time_integrator)
341  _time_integrator->computeTimeDerivatives();
342  }
343 
344  if (_vars[0].fieldVariables().size() > 0)
345  {
350 
351  // compute time derivatives of nodal aux variables _after_ the values were updated
352  if (_fe_problem.dt() > 0. && _time_integrator)
353  _time_integrator->computeTimeDerivatives();
354  }
355 
358 }
void computeScalarVars(ExecFlagType type)
void computeElementalVars(ExecFlagType type)
FEProblemBase & _fe_problem
bool _need_serialized_solution
Whether or not a copy of the residual needs to be made.
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704
MatType type
void computeNodalVars(ExecFlagType type)
virtual void serializeSolution()
void computeNodalVecVars(ExecFlagType type)
virtual Real & dt() const
std::shared_ptr< TimeIntegrator > _time_integrator
Time integrator.
void computeElementalVecVars(ExecFlagType type)

◆ computeElementalVars()

void AuxiliarySystem::computeElementalVars ( ExecFlagType  type)

Definition at line 560 of file AuxiliarySystem.C.

Referenced by compute().

561 {
563  computeElementalVarsHelper<AuxKernel>(elemental, _elem_std_vars, _compute_elemental_vars_timer);
564 }
std::vector< std::vector< MooseVariableFEBase * > > _elem_std_vars
A storage container for MooseObjects that inherit from SetupInterface.
const PerfID _compute_elemental_vars_timer
MatType type
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage

◆ computeElementalVarsHelper()

template<typename AuxKernelType >
template void AuxiliarySystem::computeElementalVarsHelper< VectorAuxKernel > ( const MooseObjectWarehouse< AuxKernelType > &  warehouse,
const std::vector< std::vector< MooseVariableFEBase *>> &  vars,
const PerfID  timer 
)

Definition at line 615 of file AuxiliarySystem.C.

619 {
620  if (warehouse.hasActiveBlockObjects())
621  {
622  TIME_SECTION(timer);
623 
624  // Block Elemental AuxKernels
625  PARALLEL_TRY
626  {
627  ConstElemRange & range = *_mesh.getActiveLocalElementRange();
628  ComputeElemAuxVarsThread<AuxKernelType> eavt(_fe_problem, warehouse, vars, true);
629  Threads::parallel_reduce(range, eavt);
630 
631  solution().close();
632  _sys.update();
633  }
634  PARALLEL_CATCH;
635  }
636 
637  // Boundary Elemental AuxKernels
638  if (warehouse.hasActiveBoundaryObjects())
639  {
640  TIME_SECTION(_compute_elemental_vec_vars_timer);
641 
642  PARALLEL_TRY
643  {
645  ComputeElemAuxBcsThread<AuxKernelType> eabt(_fe_problem, warehouse, vars, true);
646  Threads::parallel_reduce(bnd_elems, eabt);
647 
648  solution().close();
649  _sys.update();
650  }
651  PARALLEL_CATCH;
652  }
653 }
ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:739
bool hasActiveBlockObjects(THREAD_ID tid=0) const
StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > ConstBndElemRange
Definition: MooseMesh.h:1293
const PerfID _compute_elemental_vec_vars_timer
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
FEProblemBase & _fe_problem
TransientExplicitSystem & _sys
virtual NumericVector< Number > & solution() override
MooseMesh & _mesh
Definition: SystemBase.h:699
StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > * getBoundaryElementRange()
Definition: MooseMesh.C:803

◆ computeElementalVecVars()

void AuxiliarySystem::computeElementalVecVars ( ExecFlagType  type)

Definition at line 567 of file AuxiliarySystem.C.

Referenced by compute().

568 {
570  computeElementalVarsHelper<VectorAuxKernel>(
572 }
std::vector< std::vector< MooseVariableFEBase * > > _elem_vec_vars
A storage container for MooseObjects that inherit from SetupInterface.
const PerfID _compute_elemental_vec_vars_timer
MatType type
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ computeNodalVars()

void AuxiliarySystem::computeNodalVars ( ExecFlagType  type)

Definition at line 546 of file AuxiliarySystem.C.

Referenced by compute().

547 {
549  computeNodalVarsHelper<AuxKernel>(nodal, _nodal_std_vars, _compute_nodal_vars_timer);
550 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
A storage container for MooseObjects that inherit from SetupInterface.
const PerfID _compute_nodal_vars_timer
std::vector< std::vector< MooseVariableFEBase * > > _nodal_std_vars
MatType type

◆ computeNodalVarsHelper()

template<typename AuxKernelType >
template void AuxiliarySystem::computeNodalVarsHelper< VectorAuxKernel > ( const MooseObjectWarehouse< AuxKernelType > &  warehouse,
const std::vector< std::vector< MooseVariableFEBase *>> &  vars,
const PerfID  timer 
)

Definition at line 657 of file AuxiliarySystem.C.

661 {
662  if (warehouse.hasActiveBlockObjects())
663  {
664  TIME_SECTION(timer);
665 
666  // Block Nodal AuxKernels
667  PARALLEL_TRY
668  {
669  ConstNodeRange & range = *_mesh.getLocalNodeRange();
671  Threads::parallel_reduce(range, navt);
672 
673  solution().close();
674  _sys.update();
675  }
676  PARALLEL_CATCH;
677  }
678 
679  if (warehouse.hasActiveBoundaryObjects())
680  {
681  TIME_SECTION(timer);
682 
683  // Boundary Nodal AuxKernels
684  PARALLEL_TRY
685  {
688  Threads::parallel_reduce(bnd_nodes, nabt);
689 
690  solution().close();
691  _sys.update();
692  }
693  PARALLEL_CATCH;
694  }
695 }
bool hasActiveBlockObjects(THREAD_ID tid=0) const
ConstNodeRange * getLocalNodeRange()
Definition: MooseMesh.C:776
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
FEProblemBase & _fe_problem
TransientExplicitSystem & _sys
virtual NumericVector< Number > & solution() override
MooseMesh & _mesh
Definition: SystemBase.h:699
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > ConstBndNodeRange
Some useful StoredRange typedefs.
Definition: MooseMesh.h:1292
StoredRange< MooseMesh::const_bnd_node_iterator, const BndNode * > * getBoundaryNodeRange()
Definition: MooseMesh.C:790

◆ computeNodalVecVars()

void AuxiliarySystem::computeNodalVecVars ( ExecFlagType  type)

Definition at line 553 of file AuxiliarySystem.C.

Referenced by compute().

554 {
556  computeNodalVarsHelper<VectorAuxKernel>(nodal, _nodal_vec_vars, _compute_nodal_vec_vars_timer);
557 }
A storage container for MooseObjects that inherit from SetupInterface.
const PerfID _compute_nodal_vec_vars_timer
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vec_vars
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
MatType type

◆ computeScalarVars()

void AuxiliarySystem::computeScalarVars ( ExecFlagType  type)

Definition at line 505 of file AuxiliarySystem.C.

Referenced by compute().

506 {
508 
509  // Reference to the current storage container
511 
512  if (storage.hasActiveObjects())
513  {
514  TIME_SECTION(_compute_scalar_vars_timer);
515 
516  PARALLEL_TRY
517  {
518  // FIXME: run multi-threaded
519  THREAD_ID tid = 0;
520  if (storage.hasActiveObjects())
521  {
523 
524  const std::vector<std::shared_ptr<AuxScalarKernel>> & objects =
525  storage.getActiveObjects(tid);
526 
527  // Call compute() method on all active AuxScalarKernel objects
528  for (const auto & obj : objects)
529  obj->compute();
530 
531  const std::vector<MooseVariableScalar *> & scalar_vars = getScalarVariables(tid);
532  for (const auto & var : scalar_vars)
533  var->insert(solution());
534  }
535  }
536  PARALLEL_CATCH;
537 
538  solution().close();
539  _sys.update();
540  }
541 
543 }
const std::vector< MooseVariableScalar * > & getScalarVariables(THREAD_ID tid)
Definition: SystemBase.h:574
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
void setScalarVariableCoupleableTags(ExecFlagType type)
void clearScalarVariableCoupleableTags()
const std::vector< std::shared_ptr< T > > & getActiveObjects(THREAD_ID tid=0) const
Retrieve complete vector to the active all/block/boundary restricted objects for a given thread...
FEProblemBase & _fe_problem
TransientExplicitSystem & _sys
const PerfID _compute_scalar_vars_timer
Timers.
virtual NumericVector< Number > & solution() override
MatType type
virtual void reinitScalars(THREAD_ID tid) override
bool hasActiveObjects(THREAD_ID tid=0) const
unsigned int THREAD_ID
Definition: MooseTypes.h:162

◆ computeVariables()

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

Definition at line 672 of file SystemBase.h.

672 {}

◆ copyOldSolutions()

void SystemBase::copyOldSolutions ( )
virtualinherited

Shifts the solutions backwards in time.

Definition at line 1013 of file SystemBase.C.

Referenced by EigenExecutionerBase::inversePowerIteration().

1014 {
1015  solutionOlder() = solutionOld();
1017  if (solutionUDotOld())
1018  *solutionUDotOld() = *solutionUDot();
1019  if (solutionUDotDotOld())
1021  if (solutionPreviousNewton())
1023 }
virtual NumericVector< Number > * solutionUDot()=0
virtual NumericVector< Number > & solutionOld()=0
virtual NumericVector< Number > * solutionUDotDotOld()=0
virtual NumericVector< Number > * solutionPreviousNewton()=0
virtual NumericVector< Number > & solutionOlder()=0
virtual NumericVector< Number > * solutionUDotOld()=0
virtual NumericVector< Number > * solutionUDotDot()=0
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.

◆ copySolutionsBackwards()

void SystemBase::copySolutionsBackwards ( )
virtualinherited

Copy current solution into old and older.

Definition at line 996 of file SystemBase.C.

997 {
998  system().update();
1001  if (solutionUDotOld())
1002  *solutionUDotOld() = *solutionUDot();
1003  if (solutionUDotDotOld())
1005  if (solutionPreviousNewton())
1007 }
virtual NumericVector< Number > * solutionUDot()=0
virtual NumericVector< Number > & solutionOld()=0
virtual NumericVector< Number > * solutionUDotDotOld()=0
virtual NumericVector< Number > * solutionPreviousNewton()=0
virtual System & system()=0
Get the reference to the libMesh system.
virtual NumericVector< Number > & solutionOlder()=0
virtual NumericVector< Number > * solutionUDotOld()=0
virtual NumericVector< Number > * solutionUDotDot()=0
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.

◆ copyVars()

void SystemBase::copyVars ( ExodusII_IO &  io)
inherited

Definition at line 914 of file SystemBase.C.

915 {
916  int n_steps = io.get_num_time_steps();
917 
918  bool did_copy = false;
919  for (const auto & vci : _var_to_copy)
920  {
921  int timestep = -1;
922 
923  if (vci._timestep == "LATEST")
924  // Use the last time step in the file from which to retrieve the solution
925  timestep = n_steps;
926  else
927  {
928  timestep = MooseUtils::convert<int>(vci._timestep);
929  if (timestep > n_steps)
930  mooseError("Invalid value passed as \"initial_from_file_timestep\". Expected \"LATEST\" or "
931  "a valid integer between 1 and ",
932  n_steps,
933  " inclusive, received ",
934  vci._timestep);
935  }
936 
937  did_copy = true;
938 
939  if (hasVariable(vci._dest_name))
940  {
941  if (getVariable(0, vci._dest_name).isNodal())
942  io.copy_nodal_solution(system(), vci._dest_name, vci._source_name, timestep);
943 
944  else
945  io.copy_elemental_solution(system(), vci._dest_name, vci._source_name, timestep);
946  }
947  else if (hasScalarVariable(vci._dest_name))
948  {
949  auto rank = comm().rank();
950  auto size = comm().size();
951 
952  // Read solution on rank 0 only and send data to rank "size - 1" where scalar DOFs are stored
953  std::vector<Real> global_values;
954  if (rank == 0)
955  {
956  // Read the scalar value then set that value in the current solution
957  io.read_global_variable({vci._source_name}, timestep, global_values);
958  if (size > 1)
959  comm().send(size - 1, global_values);
960  }
961  if (rank == size - 1)
962  {
963  if (size > 1)
964  comm().receive(0, global_values);
965  const unsigned int var_num = system().variable_number(vci._dest_name);
966  system().solution->set(var_num, global_values[0]);
967  }
968  }
969  }
970 
971  if (did_copy)
972  solution().close();
973 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
MooseVariableFEBase & getVariable(THREAD_ID tid, const std::string &var_name)
Gets a reference to a variable of with specified name.
Definition: SystemBase.C:105
virtual bool isNodal() const =0
Is this variable nodal.
std::vector< VarCopyInfo > _var_to_copy
Definition: SystemBase.h:732
int convert< int >(const std::string &str, bool throw_on_failure)
Definition: MooseUtils.C:658
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:652
MPI_Comm comm
virtual NumericVector< Number > & solution()=0
virtual bool hasScalarVariable(const std::string &var_name) const
Definition: SystemBase.C:661

◆ currentSolution()

virtual const NumericVector<Number>*& AuxiliarySystem::currentSolution ( )
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 102 of file AuxiliarySystem.h.

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

103  {
104  _current_solution = _sys.current_local_solution.get();
105  return _current_solution;
106  }
const NumericVector< Number > * _current_solution
solution vector from nonlinear solver
TransientExplicitSystem & _sys

◆ deactiveAllMatrixTags()

void SystemBase::deactiveAllMatrixTags ( )
virtualinherited

Make matrices inactive.

Definition at line 854 of file SystemBase.C.

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

855 {
856  auto num_matrix_tags = _subproblem.numMatrixTags();
857 
858  _matrix_tag_active_flags.resize(num_matrix_tags);
859 
860  for (decltype(num_matrix_tags) tag = 0; tag < num_matrix_tags; tag++)
861  _matrix_tag_active_flags[tag] = false;
862 }
std::vector< bool > _matrix_tag_active_flags
Active flags for tagged matrices.
Definition: SystemBase.h:719
SubProblem & _subproblem
Definition: SystemBase.h:694
virtual unsigned int numMatrixTags()
The total number of tags.
Definition: SubProblem.h:157

◆ deactiveMatrixTag()

void SystemBase::deactiveMatrixTag ( TagID  tag)
virtualinherited

deactive a matrix for tag

Definition at line 842 of file SystemBase.C.

843 {
844  mooseAssert(_subproblem.matrixTagExists(tag),
845  "Cannot deactivate Matrix with matrix_tag : " << tag << "that does not exist");
846 
847  if (_matrix_tag_active_flags.size() < tag + 1)
848  _matrix_tag_active_flags.resize(tag + 1);
849 
850  _matrix_tag_active_flags[tag] = false;
851 }
virtual bool matrixTagExists(const TagName &tag_name)
Check to see if a particular Tag exists.
Definition: SubProblem.C:128
std::vector< bool > _matrix_tag_active_flags
Active flags for tagged matrices.
Definition: SystemBase.h:719
SubProblem & _subproblem
Definition: SystemBase.h:694

◆ disassociateAllTaggedMatrices()

void SystemBase::disassociateAllTaggedMatrices ( )
virtualinherited

Clear all tagged matrices.

Reimplemented in DisplacedSystem.

Definition at line 887 of file SystemBase.C.

Referenced by DisplacedSystem::disassociateAllTaggedMatrices().

888 {
889  for (auto & matrix : _tagged_matrices)
890  matrix = nullptr;
891 }
std::vector< SparseMatrix< Number > * > _tagged_matrices
Tagged matrices (pointer)
Definition: SystemBase.h:717

◆ disassociateAllTaggedVectors()

void SystemBase::disassociateAllTaggedVectors ( )
virtualinherited

Disassociate all vectors, and then hasVector() will return false.

Reimplemented in DisplacedSystem.

Definition at line 774 of file SystemBase.C.

Referenced by DisplacedSystem::disassociateAllTaggedVectors().

775 {
776  for (auto & tagged_vector : _tagged_vectors)
777  tagged_vector = nullptr;
778 }
std::vector< NumericVector< Number > * > _tagged_vectors
Tagged vectors (pointer)
Definition: SystemBase.h:715

◆ disassociateMatrixFromTag()

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

disassociate a matirx from a tag

Reimplemented in DisplacedSystem.

Definition at line 815 of file SystemBase.C.

Referenced by NonlinearSystemBase::computeJacobian(), and DisplacedSystem::disassociateMatrixFromTag().

816 {
817  mooseAssert(_subproblem.matrixTagExists(tag),
818  "Cannot disassociate Matrix with matrix_tag : " << tag << "that does not exist");
819 
820  if (_tagged_matrices.size() < tag + 1)
821  _tagged_matrices.resize(tag + 1);
822 
823  if (_tagged_matrices[tag] != &matrix)
824  mooseError("You can not disassociate a matrix from a tag which it was not associated to");
825 
826  _tagged_matrices[tag] = nullptr;
827 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::vector< SparseMatrix< Number > * > _tagged_matrices
Tagged matrices (pointer)
Definition: SystemBase.h:717
virtual bool matrixTagExists(const TagName &tag_name)
Check to see if a particular Tag exists.
Definition: SubProblem.C:128
SubProblem & _subproblem
Definition: SystemBase.h:694

◆ disassociateVectorFromTag()

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

Associate a vector for a given tag.

Reimplemented in DisplacedSystem.

Definition at line 760 of file SystemBase.C.

Referenced by NonlinearSystemBase::computeNodalBCs(), NonlinearSystemBase::computeResidualTag(), and DisplacedSystem::disassociateVectorFromTag().

761 {
762  mooseAssert(_subproblem.vectorTagExists(tag),
763  "You can't associate a tag that does not exist " << tag);
764  if (_tagged_vectors.size() < tag + 1)
765  _tagged_vectors.resize(tag + 1);
766 
767  if (_tagged_vectors[tag] != &vec)
768  mooseError("You can not disassociate a vector from a tag which it was not associated to");
769 
770  _tagged_vectors[tag] = nullptr;
771 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
SubProblem & _subproblem
Definition: SystemBase.h:694
virtual bool vectorTagExists(TagID tag)
Check to see if a particular Tag exists.
Definition: SubProblem.h:112
std::vector< NumericVector< Number > * > _tagged_vectors
Tagged vectors (pointer)
Definition: SystemBase.h:715

◆ dofMap()

DofMap & SystemBase::dofMap ( )
virtualinherited

◆ duDotDotDu()

virtual Number& SystemBase::duDotDotDu ( )
inlinevirtualinherited

◆ duDotDu()

virtual Number& SystemBase::duDotDu ( )
inlinevirtualinherited

◆ getDependObjects() [1/2]

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

Get a list of dependent UserObjects for this exec type.

Parameters
typeExecution flag type
Returns
a set of dependent user objects

Definition at line 361 of file AuxiliarySystem.C.

362 {
363  std::set<std::string> depend_objects;
364 
365  // Elemental AuxKernels
366  {
367  const std::vector<std::shared_ptr<AuxKernel>> & auxs =
368  _elemental_aux_storage[type].getActiveObjects();
369  for (const auto & aux : auxs)
370  {
371  const std::set<std::string> & uo = aux->getDependObjects();
372  depend_objects.insert(uo.begin(), uo.end());
373  }
374  }
375 
376  // Elemental VectorAuxKernels
377  {
378  const std::vector<std::shared_ptr<VectorAuxKernel>> & auxs =
379  _elemental_vec_aux_storage[type].getActiveObjects();
380  for (const auto & aux : auxs)
381  {
382  const std::set<std::string> & uo = aux->getDependObjects();
383  depend_objects.insert(uo.begin(), uo.end());
384  }
385  }
386 
387  // Nodal AuxKernels
388  {
389  const std::vector<std::shared_ptr<AuxKernel>> & auxs =
390  _nodal_aux_storage[type].getActiveObjects();
391  for (const auto & aux : auxs)
392  {
393  const std::set<std::string> & uo = aux->getDependObjects();
394  depend_objects.insert(uo.begin(), uo.end());
395  }
396  }
397 
398  // Nodal VectorAuxKernels
399  {
400  const std::vector<std::shared_ptr<VectorAuxKernel>> & auxs =
401  _nodal_vec_aux_storage[type].getActiveObjects();
402  for (const auto & aux : auxs)
403  {
404  const std::set<std::string> & uo = aux->getDependObjects();
405  depend_objects.insert(uo.begin(), uo.end());
406  }
407  }
408 
409  return depend_objects;
410 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
MatType type
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ getDependObjects() [2/2]

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

Definition at line 413 of file AuxiliarySystem.C.

414 {
415  std::set<std::string> depend_objects;
416 
417  // Elemental AuxKernels
418  {
419  const std::vector<std::shared_ptr<AuxKernel>> & auxs =
420  _elemental_aux_storage.getActiveObjects();
421  for (const auto & aux : auxs)
422  {
423  const std::set<std::string> & uo = aux->getDependObjects();
424  depend_objects.insert(uo.begin(), uo.end());
425  }
426  }
427 
428  // Elemental VectorAuxKernels
429  {
430  const std::vector<std::shared_ptr<VectorAuxKernel>> & auxs =
431  _elemental_vec_aux_storage.getActiveObjects();
432  for (const auto & aux : auxs)
433  {
434  const std::set<std::string> & uo = aux->getDependObjects();
435  depend_objects.insert(uo.begin(), uo.end());
436  }
437  }
438 
439  // Nodal AuxKernels
440  {
441  const std::vector<std::shared_ptr<AuxKernel>> & auxs = _nodal_aux_storage.getActiveObjects();
442  for (const auto & aux : auxs)
443  {
444  const std::set<std::string> & uo = aux->getDependObjects();
445  depend_objects.insert(uo.begin(), uo.end());
446  }
447  }
448 
449  // Nodal VectorAuxKernels
450  {
451  const std::vector<std::shared_ptr<VectorAuxKernel>> & auxs =
452  _nodal_vec_aux_storage.getActiveObjects();
453  for (const auto & aux : auxs)
454  {
455  const std::set<std::string> & uo = aux->getDependObjects();
456  depend_objects.insert(uo.begin(), uo.end());
457  }
458  }
459 
460  return depend_objects;
461 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ getFieldVariable() [1/2]

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

Gets a reference to a variable of with specified name.

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

Definition at line 136 of file SystemBase.C.

Referenced by Assembly::copyFaceShapes(), Assembly::copyNeighborShapes(), Assembly::copyShapes(), DisplacedProblem::getStandardVariable(), and DisplacedProblem::getVectorVariable().

137 {
138  return *_vars[tid].getFieldVariable<T>(var_name);
139 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704

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

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

Definition at line 143 of file SystemBase.C.

144 {
145  return *_vars[tid].getFieldVariable<T>(var_number);
146 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704

◆ getMatrix()

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

◆ getMaxVarNDofsPerElem()

size_t SystemBase::getMaxVarNDofsPerElem ( )
inlineinherited

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

Returns
The max

Definition at line 413 of file SystemBase.h.

Referenced by Assembly::computeAffineMapAD(), Assembly::computeFaceMap(), and Assembly::computeSinglePointMapAD().

413 { 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:735

◆ getMaxVarNDofsPerNode()

size_t SystemBase::getMaxVarNDofsPerNode ( )
inlineinherited

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

Returns
The max

Definition at line 420 of file SystemBase.h.

420 { 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:738

◆ getMinQuadratureOrder()

Order AuxiliarySystem::getMinQuadratureOrder ( )
overridevirtual

Get the minimum quadrature order for evaluating elemental auxiliary variables.

Reimplemented from SystemBase.

Definition at line 582 of file AuxiliarySystem.C.

583 {
584  Order order = CONSTANT;
585  std::vector<MooseVariableFEBase *> vars = _vars[0].fieldVariables();
586  for (const auto & var : vars)
587  {
588  if (!var->isNodal()) // nodal aux variables do not need quadrature
589  {
590  FEType fe_type = var->feType();
591  if (fe_type.default_quadrature_order() > order)
592  order = fe_type.default_quadrature_order();
593  }
594  }
595 
596  return order;
597 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704

◆ getScalarVariable() [1/2]

MooseVariableScalar & SystemBase::getScalarVariable ( THREAD_ID  tid,
const std::string &  var_name 
)
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 149 of file SystemBase.C.

Referenced by Assembly::addJacobianOffDiagScalar(), IntegratedBC::computeJacobianBlockScalar(), VectorIntegratedBC::computeJacobianBlockScalar(), ODEKernel::computeOffDiagJacobian(), VectorKernel::computeOffDiagJacobianScalar(), Kernel::computeOffDiagJacobianScalar(), DisplacedProblem::getScalarVariable(), and Assembly::init().

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

◆ getScalarVariable() [2/2]

MooseVariableScalar & SystemBase::getScalarVariable ( THREAD_ID  tid,
unsigned int  var_number 
)
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 158 of file SystemBase.C.

159 {
160  MooseVariableScalar * var =
161  dynamic_cast<MooseVariableScalar *>(_vars[tid].getVariable(var_number));
162  if (!var)
163  mooseError("variable #" + Moose::stringify(var_number) + " does not exist in this system");
164  return *var;
165 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:61
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704
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 691 of file SystemBase.h.

Referenced by DisplacedProblem::DisplacedProblem().

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

◆ getSubdomainsForVar()

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

Definition at line 579 of file SystemBase.h.

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

◆ getTimeIntegrator()

TimeIntegrator* SystemBase::getTimeIntegrator ( )
inlineinherited

Definition at line 689 of file SystemBase.h.

Referenced by DT2::computeDT(), Transient::endStep(), AB2PredictorCorrector::estimateTimeError(), MooseVariableFE< Real >::MooseVariableFE(), and Transient::preExecute().

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

◆ getVariable() [1/2]

MooseVariableFEBase & SystemBase::getVariable ( THREAD_ID  tid,
const std::string &  var_name 
)
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 105 of file SystemBase.C.

Referenced by Assembly::addJacobianBlock(), Assembly::addJacobianBlockNonlocal(), Assembly::addJacobianNeighbor(), NonlocalIntegratedBC::computeJacobianBlock(), NonlocalIntegratedBC::computeNonlocalOffDiagJacobian(), NonlocalKernel::computeNonlocalOffDiagJacobian(), SystemBase::copyVars(), FieldSplitPreconditioner::FieldSplitPreconditioner(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), EqualValueEmbeddedConstraint::getConnectedDofIndices(), NodeElemConstraint::getConnectedDofIndices(), NodeFaceConstraint::getConnectedDofIndices(), Marker::getMarkerValue(), SubProblem::getVariableHelper(), Assembly::init(), NodalNormalsPreprocessor::initialize(), Assembly::initNonlocalCoupling(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), AddPeriodicBCAction::setPeriodicVars(), SingleMatrixPreconditioner::SingleMatrixPreconditioner(), and UpdateErrorVectorsThread::UpdateErrorVectorsThread().

106 {
107  MooseVariableFEBase * var = dynamic_cast<MooseVariableFEBase *>(_vars[tid].getVariable(var_name));
108  if (!var)
109  {
110  std::stringstream errMsg;
111  errMsg << "Variable '" << var_name << "' does not exist in this system" << std::endl;
112  throw std::runtime_error(errMsg.str().c_str());
113  // mooseError("Variable '" + var_name + "' does not exist in this system");
114  }
115  return *var;
116 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704

◆ getVariable() [2/2]

MooseVariableFEBase & SystemBase::getVariable ( THREAD_ID  tid,
unsigned int  var_number 
)
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 119 of file SystemBase.C.

120 {
121  MooseVariableFEBase * var =
122  dynamic_cast<MooseVariableFEBase *>(_vars[tid].getVariable(var_number));
123  if (!var)
124  {
125  std::stringstream errMsg;
126  errMsg << "Variable '" << Moose::stringify(var_number) << "' does not exist in this system"
127  << std::endl;
128  throw std::runtime_error(errMsg.str().c_str());
129  // mooseError("variable #" + Moose::stringify(var_number) + " does not exist in this system");
130  }
131  return *var;
132 }
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:61
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704

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

Referenced by PhysicsBasedPreconditioner::addSystem().

169 {
170  mooseAssert(_var_map.find(var_number) != _var_map.end(), "Variable does not exist.");
171  if (_var_map[var_number].empty())
172  return nullptr;
173  else
174  return &_var_map[var_number];
175 }
std::map< unsigned int, std::set< SubdomainID > > _var_map
Map of variables (variable id -> array of subdomains where it lives)
Definition: SystemBase.h:706

◆ getVariableNames()

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

Definition at line 670 of file SystemBase.h.

Referenced by MooseEigenSystem::buildSystemDoFIndices(), NonlinearSystemBase::checkKernelCoverage(), and AddPeriodicBCAction::setPeriodicVars().

670 { return _vars[0].names(); }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704

◆ getVariables()

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

◆ getVector() [1/2]

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

◆ getVector() [2/2]

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

Get a raw NumericVector.

Reimplemented in DisplacedSystem.

Definition at line 741 of file SystemBase.C.

742 {
743  mooseAssert(hasVector(tag), "Cannot retrieve vector with residual_tag: " << tag);
744 
745  return *_tagged_vectors[tag];
746 }
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:685
std::vector< NumericVector< Number > * > _tagged_vectors
Tagged vectors (pointer)
Definition: SystemBase.h:715

◆ hasMatrix()

bool SystemBase::hasMatrix ( TagID  tag)
virtualinherited

◆ hasScalarVariable()

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

Definition at line 661 of file SystemBase.C.

Referenced by ComputeFullJacobianThread::computeFaceJacobian(), ComputeFullJacobianThread::computeJacobian(), SystemBase::copyVars(), DisplacedProblem::getScalarVariable(), DisplacedProblem::hasScalarVariable(), and AddPeriodicBCAction::setPeriodicVars().

662 {
663  if (system().has_variable(var_name))
664  return system().variable_type(var_name).family == SCALAR;
665  else
666  return false;
667 }
virtual System & system()=0
Get the reference to the libMesh system.

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

Referenced by ADKernelTempl< T, compute_stage >::ADKernelTempl(), SystemBase::copyVars(), DGKernelBase::DGKernelBase(), FEProblemBase::duplicateVariableCheck(), DisplacedProblem::getStandardVariable(), DisplacedProblem::getSystem(), SubProblem::getVariableHelper(), DisplacedProblem::getVectorVariable(), DisplacedProblem::hasVariable(), InterfaceKernel::InterfaceKernel(), and Kernel::Kernel().

653 {
654  if (system().has_variable(var_name))
655  return system().variable_type(var_name).family != SCALAR;
656  else
657  return false;
658 }
virtual System & system()=0
Get the reference to the libMesh system.

◆ hasVector() [1/2]

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

◆ hasVector() [2/2]

bool SystemBase::hasVector ( TagID  tag_id)
virtualinherited

Check if the tagged vector exists in the system.

Reimplemented in DisplacedSystem.

Definition at line 726 of file SystemBase.C.

727 {
728  return tag < _tagged_vectors.size() && _tagged_vectors[tag];
729 }
std::vector< NumericVector< Number > * > _tagged_vectors
Tagged vectors (pointer)
Definition: SystemBase.h:715

◆ init()

void AuxiliarySystem::init ( )
overridevirtual

Initialize the system.

Reimplemented from SystemBase.

Definition at line 67 of file AuxiliarySystem.C.

68 {
69 }

◆ initializeObjects()

virtual void SystemBase::initializeObjects ( )
inlinevirtualinherited

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

Definition at line 126 of file SystemBase.h.

126 {};

◆ initialSetup()

void AuxiliarySystem::initialSetup ( )
virtual

Definition at line 92 of file AuxiliarySystem.C.

93 {
94  for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
95  {
98 
99  _nodal_aux_storage.sort(tid);
100  _nodal_aux_storage.initialSetup(tid);
101 
102  _nodal_vec_aux_storage.sort(tid);
103  _nodal_vec_aux_storage.initialSetup(tid);
104 
105  _elemental_aux_storage.sort(tid);
106  _elemental_aux_storage.initialSetup(tid);
107 
108  _elemental_vec_aux_storage.sort(tid);
109  _elemental_vec_aux_storage.initialSetup(tid);
110  }
111 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
void sort(THREAD_ID tid=0)
Performs a sort using the DependencyResolver.
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
virtual void initialSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods.
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ isScalarVariable()

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

Definition at line 670 of file SystemBase.C.

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

671 {
672  return (system().variable(var_num).type().family == SCALAR);
673 }
virtual System & system()=0
Get the reference to the libMesh system.
MatType type

◆ jacobianSetup()

void AuxiliarySystem::jacobianSetup ( )
virtual

Definition at line 140 of file AuxiliarySystem.C.

141 {
142  for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
143  {
145  _nodal_aux_storage.jacobianSetup(tid);
146  _nodal_vec_aux_storage.jacobianSetup(tid);
147  _elemental_aux_storage.jacobianSetup(tid);
148  _elemental_vec_aux_storage.jacobianSetup(tid);
149  }
150 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
void jacobianSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods.
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ matrixTagActive()

bool SystemBase::matrixTagActive ( TagID  tag)
virtualinherited

If or not a matrix tag is active.

Definition at line 879 of file SystemBase.C.

880 {
881  mooseAssert(_subproblem.matrixTagExists(tag), "Matrix tag " << tag << " does not exist");
882 
883  return tag < _matrix_tag_active_flags.size() && _matrix_tag_active_flags[tag];
884 }
virtual bool matrixTagExists(const TagName &tag_name)
Check to see if a particular Tag exists.
Definition: SubProblem.C:128
std::vector< bool > _matrix_tag_active_flags
Active flags for tagged matrices.
Definition: SystemBase.h:719
SubProblem & _subproblem
Definition: SystemBase.h:694

◆ mesh()

virtual MooseMesh& SystemBase::mesh ( )
inlinevirtualinherited

◆ name()

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

◆ needMaterialOnSide()

bool AuxiliarySystem::needMaterialOnSide ( BoundaryID  bnd_id)

Indicated whether this system needs material properties on boundaries.

Returns
Boolean if IntegratedBCs are active

Definition at line 600 of file AuxiliarySystem.C.

601 {
602  return _elemental_aux_storage.hasActiveBoundaryObjects(bnd_id) ||
603  _elemental_vec_aux_storage.hasActiveBoundaryObjects(bnd_id);
604 }
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ nonTimeVectorTag()

TagID SystemBase::nonTimeVectorTag ( )
virtualinherited

Reimplemented in NonlinearSystemBase, and DisplacedSystem.

Definition at line 712 of file SystemBase.C.

Referenced by DisplacedSystem::nonTimeVectorTag().

713 {
714  mooseError("Not implemented yet");
715  return 0;
716 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ number()

unsigned int SystemBase::number ( ) const
virtualinherited

◆ nVariables()

unsigned int SystemBase::nVariables ( ) const
virtualinherited

Get the number of variables in this system.

Returns
the number of variables

Definition at line 676 of file SystemBase.C.

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

677 {
678  return _vars[0].names().size();
679 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704

◆ prepare()

void SystemBase::prepare ( THREAD_ID  tid)
virtualinherited

Prepare the system for use.

Parameters
tidID of the thread

Definition at line 242 of file SystemBase.C.

Referenced by DisplacedProblem::prepare(), DisplacedProblem::reinitDirac(), and DisplacedProblem::reinitElemPhys().

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

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

Referenced by DisplacedProblem::prepareFace().

266 {
267  // We only need to do something if the element prepare was restricted
269  {
270  const std::set<MooseVariableFEBase *> & active_elemental_moose_variables =
272 
273  std::vector<MooseVariableFEBase *> newly_prepared_vars;
274 
275  const std::vector<MooseVariableFEBase *> & vars = _vars[tid].fieldVariables();
276  for (const auto & var : vars)
277  {
278  // If it wasn't in the active list, we need to prepare it
279  if (&(var->sys()) == this && !active_elemental_moose_variables.count(var))
280  {
281  var->prepare();
282  newly_prepared_vars.push_back(var);
283  }
284  }
285 
286  // Make sure to resize the residual and jacobian datastructures for all the new variables
287  if (resize_data)
288  for (const auto var_ptr : newly_prepared_vars)
289  {
290  _subproblem.assembly(tid).prepareVariable(var_ptr);
293  }
294  }
295 }
virtual bool hasActiveElementalMooseVariables(THREAD_ID tid) const
Whether or not a list of active elemental moose variables has been set.
Definition: SubProblem.C:252
virtual Assembly & assembly(THREAD_ID tid)=0
virtual const std::set< MooseVariableFEBase * > & getActiveElementalMooseVariables(THREAD_ID tid) const
Get the MOOSE variables to be reinited on each element.
Definition: SubProblem.C:246
void prepareVariableNonlocal(MooseVariableFEBase *var)
Definition: Assembly.C:2004
SubProblem & _subproblem
Definition: SystemBase.h:694
virtual bool checkNonlocalCouplingRequirement()
Definition: SubProblem.h:69
void prepareVariable(MooseVariableFEBase *var)
Used for preparing the dense residual and jacobian blocks for one particular variable.
Definition: Assembly.C:1975
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704

◆ prepareNeighbor()

void SystemBase::prepareNeighbor ( THREAD_ID  tid)
virtualinherited

Prepare the system for use.

Parameters
tidID of the thread

Definition at line 298 of file SystemBase.C.

Referenced by DisplacedProblem::reinitNeighbor(), and DisplacedProblem::reinitNeighborPhys().

299 {
300  const std::vector<MooseVariableFEBase *> & vars = _vars[tid].fieldVariables();
301  for (const auto & var : vars)
302  var->prepareNeighbor();
303 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704

◆ registerTimedSection()

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

Call to register a named section for timing.

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

Definition at line 50 of file PerfGraphInterface.C.

51 {
52  if (_prefix != "")
53  return _perf_graph.registerSection(_prefix + "::" + section_name, level);
54  else
55  return _perf_graph.registerSection(section_name, level);
56 }
PerfGraph & _perf_graph
The performance graph to add to.
std::string _prefix
A prefix to use for all sections.
PerfID registerSection(const std::string &section_name, unsigned int level)
Registers a named section of code.
Definition: PerfGraph.C:42

◆ reinitElem()

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

Reinit an element assembly info.

Parameters
elemWhich element we are reinitializing for
tidID of the thread

Reimplemented from SystemBase.

Definition at line 269 of file AuxiliarySystem.C.

270 {
271  for (auto * var : _nodal_vars[tid])
272  var->computeElemValues();
273 
274  for (auto * var : _elem_vars[tid])
275  {
276  var->reinitAux();
277  var->computeElemValues();
278  }
279 }
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vars
std::vector< std::vector< MooseVariableFEBase * > > _elem_vars

◆ reinitElemFace()

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

Reinit assembly info for a side of an element.

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

Reimplemented from SystemBase.

Definition at line 282 of file AuxiliarySystem.C.

286 {
287  for (auto * var : _nodal_vars[tid])
288  var->computeElemValuesFace();
289 
290  for (auto * var : _elem_vars[tid])
291  {
292  var->reinitAux();
293  var->reinitAuxNeighbor();
294  var->computeElemValuesFace();
295  }
296 }
std::vector< std::vector< MooseVariableFEBase * > > _nodal_vars
std::vector< std::vector< MooseVariableFEBase * > > _elem_vars

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

Referenced by DisplacedProblem::reinitNeighborPhys().

349 {
350  const std::vector<MooseVariableFEBase *> & vars = _vars[tid].fieldVariables();
351  for (const auto & var : vars)
352  var->computeNeighborValues();
353 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704

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

Referenced by DisplacedProblem::reinitNeighbor(), and DisplacedProblem::reinitNeighborPhys().

341 {
342  const std::vector<MooseVariableFEBase *> & vars = _vars[tid].fieldVariables();
343  for (const auto & var : vars)
344  var->computeNeighborValuesFace();
345 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704

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

Referenced by DisplacedProblem::reinitNode().

357 {
358  const std::vector<MooseVariableFEBase *> & vars = _vars[tid].fieldVariables();
359  for (const auto & var : vars)
360  {
361  if (var->isNodal())
362  {
363  var->reinitNode();
364  var->computeNodalValues();
365  }
366  }
367 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704

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

Referenced by DisplacedProblem::reinitNodeFace().

371 {
372  const std::vector<MooseVariableFEBase *> & vars = _vars[tid].fieldVariables();
373  for (const auto & var : vars)
374  {
375  if (var->isNodal())
376  {
377  var->reinitNode();
378  var->computeNodalValues();
379  }
380  }
381 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704

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

Referenced by DisplacedProblem::reinitNodes().

385 {
386  const std::vector<MooseVariableFEBase *> & vars = _vars[tid].fieldVariables();
387  for (const auto & var : vars)
388  {
389  var->reinitNodes(nodes);
390  var->computeNodalValues();
391  }
392 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704

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

Referenced by DisplacedProblem::reinitNodesNeighbor().

396 {
397  const std::vector<MooseVariableFEBase *> & vars = _vars[tid].fieldVariables();
398  for (const auto & var : vars)
399  {
400  var->reinitNodesNeighbor(nodes);
401  var->computeNodalNeighborValues();
402  }
403 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704

◆ reinitScalars()

void SystemBase::reinitScalars ( THREAD_ID  tid)
virtualinherited

Reinit scalar varaibles.

Parameters
tidThread ID

Definition at line 406 of file SystemBase.C.

Referenced by DisplacedProblem::reinitScalars().

407 {
408  const std::vector<MooseVariableScalar *> & vars = _vars[tid].scalars();
409  for (const auto & var : vars)
410  var->reinit();
411 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:704

◆ removeMatrix()

virtual void SystemBase::removeMatrix ( TagID  )
inlinevirtualinherited

Removes a jacobian sized vector.

Parameters
tag_nameThe name of the tag

Definition at line 652 of file SystemBase.h.

653  {
654  mooseError("Removing a matrix is not supported for this type of system!");
655  }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ removeVector() [1/2]

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

Remove a vector from the system with the given name.

Definition at line 1043 of file SystemBase.C.

Referenced by SystemBase::restoreOldSolutions().

1044 {
1045  system().remove_vector(name);
1046 }
virtual const std::string & name() const
Definition: SystemBase.C:1049
virtual System & system()=0
Get the reference to the libMesh system.

◆ removeVector() [2/2]

void SystemBase::removeVector ( TagID  tag_id)
virtualinherited

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

Parameters
tag_idTag ID

Definition at line 580 of file SystemBase.C.

581 {
582  if (!_subproblem.vectorTagExists(tag_id))
583  mooseError("Cannot remove an unexisting tag or its associated vector, ",
584  tag_id,
585  ", that tag does not exist in System ",
586  name());
587 
588  if (hasVector(tag_id))
589  {
590  auto vector_name = _subproblem.vectorTagName(tag_id);
591  system().remove_vector(vector_name);
592  _tagged_vectors[tag_id] = nullptr;
593  }
594 }
virtual TagName vectorTagName(TagID tag)
Retrieve the name associated with a TagID.
Definition: SubProblem.C:105
bool hasVector(const std::string &tag_name) const
Check if the named vector exists in the system.
Definition: SystemBase.C:685
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
virtual const std::string & name() const
Definition: SystemBase.C:1049
SubProblem & _subproblem
Definition: SystemBase.h:694
virtual bool vectorTagExists(TagID tag)
Check to see if a particular Tag exists.
Definition: SubProblem.h:112
virtual System & system()=0
Get the reference to the libMesh system.
std::vector< NumericVector< Number > * > _tagged_vectors
Tagged vectors (pointer)
Definition: SystemBase.h:715

◆ residualCopy()

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

Reimplemented in NonlinearSystemBase, and DisplacedSystem.

Definition at line 291 of file SystemBase.h.

Referenced by DisplacedSystem::residualCopy().

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

◆ residualGhosted()

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

Reimplemented in NonlinearSystemBase, and DisplacedSystem.

Definition at line 295 of file SystemBase.h.

Referenced by DisplacedSystem::residualGhosted().

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

◆ residualSetup()

void AuxiliarySystem::residualSetup ( )
virtual

Definition at line 153 of file AuxiliarySystem.C.

154 {
155  for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
156  {
158  _nodal_aux_storage.residualSetup(tid);
159  _nodal_vec_aux_storage.residualSetup(tid);
160  _elemental_aux_storage.residualSetup(tid);
161  _elemental_vec_aux_storage.residualSetup(tid);
162  }
163 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
void residualSetup(THREAD_ID tid=0) const
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ residualVectorTag()

TagID SystemBase::residualVectorTag ( )
virtualinherited

Reimplemented in NonlinearSystemBase.

Definition at line 719 of file SystemBase.C.

720 {
721  mooseError("Not implemented yet");
722  return 0;
723 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ restoreOldSolutions()

void SystemBase::restoreOldSolutions ( )
virtualinherited

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

Definition at line 497 of file SystemBase.C.

Referenced by DisplacedProblem::restoreOldSolutions().

498 {
499  if (_saved_old)
500  {
501  solutionOld() = *_saved_old;
502  removeVector("save_solution_old");
503  _saved_old = nullptr;
504  }
505  if (_saved_older)
506  {
508  removeVector("save_solution_older");
509  _saved_older = nullptr;
510  }
512  {
514  removeVector("save_solution_dot_old");
515  _saved_dot_old = NULL;
516  }
518  {
520  removeVector("save_solution_dotdot_old");
521  _saved_dotdot_old = NULL;
522  }
523 }
virtual NumericVector< Number > & solutionOld()=0
virtual NumericVector< Number > * solutionUDotDotOld()=0
NumericVector< Real > * _saved_older
Definition: SystemBase.h:723
NumericVector< Real > * _saved_dot_old
Definition: SystemBase.h:726
virtual void removeVector(const std::string &name)
Remove a vector from the system with the given name.
Definition: SystemBase.C:1043
NumericVector< Real > * _saved_old
Definition: SystemBase.h:722
virtual NumericVector< Number > & solutionOlder()=0
NumericVector< Real > * _saved_dotdot_old
Definition: SystemBase.h:727
virtual NumericVector< Number > * solutionUDotOld()=0

◆ restoreSolutions()

void SystemBase::restoreSolutions ( )
virtualinherited

Restore current solutions (call after your solve failed)

Reimplemented in NonlinearSystemBase.

Definition at line 1029 of file SystemBase.C.

Referenced by NonlinearSystemBase::restoreSolutions().

1030 {
1031  *(const_cast<NumericVector<Number> *&>(currentSolution())) = solutionOld();
1032  solution() = solutionOld();
1033  if (solutionUDotOld())
1034  *solutionUDot() = *solutionUDotOld();
1035  if (solutionUDotDotOld())
1037  if (solutionPreviousNewton())
1039  system().update();
1040 }
virtual NumericVector< Number > * solutionUDot()=0
virtual NumericVector< Number > & solutionOld()=0
virtual NumericVector< Number > * solutionUDotDotOld()=0
virtual NumericVector< Number > * solutionPreviousNewton()=0
virtual System & system()=0
Get the reference to the libMesh system.
virtual NumericVector< Number > & solution()=0
virtual NumericVector< Number > * solutionUDotOld()=0
virtual NumericVector< Number > * solutionUDotDot()=0
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.

◆ saveOldSolutions()

void SystemBase::saveOldSolutions ( )
virtualinherited

Save the old and older solutions.

Definition at line 472 of file SystemBase.C.

Referenced by DisplacedProblem::saveOldSolutions().

473 {
474  if (!_saved_old)
475  _saved_old = &addVector("save_solution_old", false, PARALLEL);
476  if (!_saved_older)
477  _saved_older = &addVector("save_solution_older", false, PARALLEL);
479  _saved_dot_old = &addVector("save_solution_dot_old", false, PARALLEL);
481  _saved_dotdot_old = &addVector("save_solution_dotdot_old", false, PARALLEL);
482 
483  *_saved_old = solutionOld();
485 
486  if (solutionUDotOld())
488 
489  if (solutionUDotDotOld())
491 }
virtual 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:526
virtual NumericVector< Number > & solutionOld()=0
virtual NumericVector< Number > * solutionUDotDotOld()=0
NumericVector< Real > * _saved_older
Definition: SystemBase.h:723
NumericVector< Real > * _saved_dot_old
Definition: SystemBase.h:726
NumericVector< Real > * _saved_old
Definition: SystemBase.h:722
virtual NumericVector< Number > & solutionOlder()=0
NumericVector< Real > * _saved_dotdot_old
Definition: SystemBase.h:727
virtual NumericVector< Number > * solutionUDotOld()=0

◆ serializedSolution()

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

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

Implements SystemBase.

Definition at line 299 of file AuxiliarySystem.C.

300 {
302  return _serialized_solution;
303 }
NumericVector< Number > & _serialized_solution
Serialized version of the solution vector.
bool _need_serialized_solution
Whether or not a copy of the residual needs to be made.

◆ serializeSolution()

void AuxiliarySystem::serializeSolution ( )
virtual

Definition at line 306 of file AuxiliarySystem.C.

Referenced by compute().

307 {
309  _sys.n_dofs() > 0) // libMesh does not like serializing of empty vectors
310  {
311  if (!_serialized_solution.initialized() || _serialized_solution.size() != _sys.n_dofs())
312  {
313  _serialized_solution.clear();
314  _serialized_solution.init(_sys.n_dofs(), false, SERIAL);
315  }
316 
317  solution().localize(_serialized_solution);
318  }
319 }
NumericVector< Number > & _serialized_solution
Serialized version of the solution vector.
TransientExplicitSystem & _sys
bool _need_serialized_solution
Whether or not a copy of the residual needs to be made.
virtual NumericVector< Number > & solution() override

◆ setPreviousNewtonSolution()

void AuxiliarySystem::setPreviousNewtonSolution ( )
virtual

Definition at line 607 of file AuxiliarySystem.C.

608 {
609  // Evaluate aux variables to get the solution vector
611 }
const ExecFlagType EXEC_LINEAR
virtual void compute(ExecFlagType type)
Compute auxiliary variables.

◆ setScalarVariableCoupleableTags()

void AuxiliarySystem::setScalarVariableCoupleableTags ( ExecFlagType  type)

Definition at line 477 of file AuxiliarySystem.C.

Referenced by computeScalarVars().

478 {
480  const std::vector<std::shared_ptr<AuxScalarKernel>> & objects = storage.getActiveObjects(0);
481 
482  std::set<TagID> needed_sc_var_matrix_tags;
483  std::set<TagID> needed_sc_var_vector_tags;
484  for (const auto & obj : objects)
485  {
486  auto & sc_var_coup_vtags = obj->getScalarVariableCoupleableVectorTags();
487  needed_sc_var_vector_tags.insert(sc_var_coup_vtags.begin(), sc_var_coup_vtags.end());
488 
489  auto & sc_var_coup_mtags = obj->getScalarVariableCoupleableMatrixTags();
490  needed_sc_var_matrix_tags.insert(sc_var_coup_mtags.begin(), sc_var_coup_mtags.end());
491  }
492 
493  _fe_problem.setActiveScalarVariableCoupleableMatrixTags(needed_sc_var_matrix_tags, 0);
494  _fe_problem.setActiveScalarVariableCoupleableVectorTags(needed_sc_var_vector_tags, 0);
495 }
virtual void setActiveScalarVariableCoupleableMatrixTags(std::set< TagID > &mtags, THREAD_ID tid) override
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
const std::vector< std::shared_ptr< T > > & getActiveObjects(THREAD_ID tid=0) const
Retrieve complete vector to the active all/block/boundary restricted objects for a given thread...
FEProblemBase & _fe_problem
MatType type
virtual void setActiveScalarVariableCoupleableVectorTags(std::set< TagID > &vtags, THREAD_ID tid) override

◆ solution()

virtual NumericVector<Number>& AuxiliarySystem::solution ( )
inlineoverridevirtual

◆ solutionOld()

virtual NumericVector<Number>& AuxiliarySystem::solutionOld ( )
inlineoverridevirtual

Implements SystemBase.

Definition at line 160 of file AuxiliarySystem.h.

160 { return *_sys.old_local_solution; }
TransientExplicitSystem & _sys

◆ solutionOlder()

virtual NumericVector<Number>& AuxiliarySystem::solutionOlder ( )
inlineoverridevirtual

Implements SystemBase.

Definition at line 162 of file AuxiliarySystem.h.

162 { return *_sys.older_local_solution; }
TransientExplicitSystem & _sys

◆ solutionPreviousNewton()

virtual NumericVector<Number>* AuxiliarySystem::solutionPreviousNewton ( )
inlineoverridevirtual

Implements SystemBase.

Definition at line 171 of file AuxiliarySystem.h.

172  {
173  return _solution_previous_nl;
174  }
NumericVector< Number > * _solution_previous_nl
Solution vector of the previous nonlinear iterate.

◆ solutionUDot()

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

Implements SystemBase.

Definition at line 108 of file AuxiliarySystem.h.

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

◆ solutionUDotDot()

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

Implements SystemBase.

Definition at line 110 of file AuxiliarySystem.h.

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

◆ solutionUDotDotOld()

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

Implements SystemBase.

Definition at line 170 of file AuxiliarySystem.h.

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

◆ solutionUDotOld()

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

Implements SystemBase.

Definition at line 169 of file AuxiliarySystem.h.

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

◆ solve()

void SystemBase::solve ( )
virtualinherited

Solve the system (using libMesh magic)

Reimplemented in NonlinearSystemBase, NonlinearEigenSystem, DumpObjectsNonlinearSystem, and NonlinearSystem.

Definition at line 987 of file SystemBase.C.

988 {
989  system().solve();
990 }
virtual System & system()=0
Get the reference to the libMesh system.

◆ subdomainSetup()

void AuxiliarySystem::subdomainSetup ( )
virtual

Definition at line 127 of file AuxiliarySystem.C.

128 {
129  for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
130  {
132  _nodal_aux_storage.subdomainSetup(tid);
133  _nodal_vec_aux_storage.subdomainSetup(tid);
134  _elemental_aux_storage.subdomainSetup(tid);
135  _elemental_vec_aux_storage.subdomainSetup(tid);
136  }
137 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage
virtual void subdomainSetup(THREAD_ID tid=0) const

◆ subproblem()

virtual SubProblem& SystemBase::subproblem ( )
inlinevirtualinherited

◆ sys()

virtual TransientExplicitSystem& AuxiliarySystem::sys ( )
inlinevirtual

Definition at line 164 of file AuxiliarySystem.h.

Referenced by DT2::preExecute(), DT2::preSolve(), DT2::rejectStep(), and DT2::step().

164 { return _sys; }
TransientExplicitSystem & _sys

◆ system() [1/2]

virtual System& AuxiliarySystem::system ( )
inlineoverridevirtual

◆ system() [2/2]

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

Implements SystemBase.

Definition at line 167 of file AuxiliarySystem.h.

167 { return _sys; }
TransientExplicitSystem & _sys

◆ systemMatrixTag()

TagID SystemBase::systemMatrixTag ( )
virtualinherited

Return the Matrix Tag ID for System.

Reimplemented in NonlinearSystemBase.

Definition at line 705 of file SystemBase.C.

706 {
707  mooseError("Not implemented yet");
708  return 0;
709 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ timeMatrixTag()

TagID SystemBase::timeMatrixTag ( )
virtualinherited

Return the Matrix Tag ID for Time.

Definition at line 698 of file SystemBase.C.

699 {
700  mooseError("Not implemented yet");
701  return 0;
702 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ timestepSetup()

void AuxiliarySystem::timestepSetup ( )
virtual

Definition at line 114 of file AuxiliarySystem.C.

115 {
116  for (unsigned int tid = 0; tid < libMesh::n_threads(); tid++)
117  {
119  _nodal_aux_storage.timestepSetup(tid);
120  _nodal_vec_aux_storage.timestepSetup(tid);
121  _elemental_aux_storage.timestepSetup(tid);
122  _elemental_vec_aux_storage.timestepSetup(tid);
123  }
124 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
virtual void timestepSetup(THREAD_ID tid=0) const
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ timeVectorTag()

TagID SystemBase::timeVectorTag ( )
virtualinherited

Ideally, we should not need this API.

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

Reimplemented in NonlinearSystemBase, and DisplacedSystem.

Definition at line 691 of file SystemBase.C.

Referenced by DisplacedSystem::timeVectorTag().

692 {
693  mooseError("Not implemented yet");
694  return 0;
695 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ update()

void SystemBase::update ( )
virtualinherited

◆ updateActive()

void AuxiliarySystem::updateActive ( THREAD_ID  tid)
virtual

Definition at line 166 of file AuxiliarySystem.C.

167 {
169  _nodal_aux_storage.updateActive(tid);
170  _nodal_vec_aux_storage.updateActive(tid);
171  _elemental_aux_storage.updateActive(tid);
172  _elemental_vec_aux_storage.updateActive(tid);
173 }
ExecuteMooseObjectWarehouse< AuxKernel > _nodal_aux_storage
ExecuteMooseObjectWarehouse< AuxScalarKernel > _aux_scalar_storage
ExecuteMooseObjectWarehouse< VectorAuxKernel > _nodal_vec_aux_storage
ExecuteMooseObjectWarehouse< AuxKernel > _elemental_aux_storage
virtual void updateActive(THREAD_ID tid=0)
Updates the active objects storage.
ExecuteMooseObjectWarehouse< VectorAuxKernel > _elemental_vec_aux_storage

◆ zeroTaggedVectors()

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

Zero all vectors for given tags.

Definition at line 570 of file SystemBase.C.

Referenced by NonlinearSystemBase::computeResidualTags().

571 {
572  for (auto & tag : tags)
573  {
574  mooseAssert(_subproblem.vectorTagExists(tag), "Tag: " << tag << " does not exsit");
575  getVector(tag).zero();
576  }
577 }
SubProblem & _subproblem
Definition: SystemBase.h:694
virtual bool vectorTagExists(TagID tag)
Check to see if a particular Tag exists.
Definition: SubProblem.h:112
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector.
Definition: SystemBase.C:735

◆ zeroVariables()

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

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

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

Reimplemented in DisplacedSystem.

Definition at line 190 of file SystemBase.C.

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

191 {
192  if (vars_to_be_zeroed.size() > 0)
193  {
194  NumericVector<Number> & solution = this->solution();
195 
196  AllLocalDofIndicesThread aldit(system(), vars_to_be_zeroed);
197  ConstElemRange & elem_range = *_mesh.getActiveLocalElementRange();
198  Threads::parallel_reduce(elem_range, aldit);
199 
200  const std::set<dof_id_type> & dof_indices_to_zero = aldit._all_dof_indices;
201 
202  solution.close();
203 
204  for (const auto & dof : dof_indices_to_zero)
205  solution.set(dof, 0);
206 
207  solution.close();
208 
209  // Call update to update the current_local_solution for this system
210  system().update();
211  }
212 }
ConstElemRange * getActiveLocalElementRange()
Return pointers to range objects for various types of ranges (local nodes, boundary elems...
Definition: MooseMesh.C:739
Grab all the local dof indices for the variables passed in, in the system passed in.
virtual System & system()=0
Get the reference to the libMesh system.
MooseMesh & _mesh
Definition: SystemBase.h:699
virtual NumericVector< Number > & solution()=0

◆ zeroVariablesForJacobian()

void SystemBase::zeroVariablesForJacobian ( )
virtualinherited

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

Definition at line 221 of file SystemBase.C.

222 {
224 }
std::vector< std::string > _vars_to_be_zeroed_on_jacobian
Definition: SystemBase.h:709
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:190

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

216 {
218 }
std::vector< std::string > _vars_to_be_zeroed_on_residual
Definition: SystemBase.h:708
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:190

Friends And Related Function Documentation

◆ ComputeIndicatorThread

friend class ComputeIndicatorThread
friend

Definition at line 251 of file AuxiliarySystem.h.

◆ ComputeMarkerThread

friend class ComputeMarkerThread
friend

Definition at line 252 of file AuxiliarySystem.h.

◆ ComputeNodalKernelBCJacobiansThread

Definition at line 257 of file AuxiliarySystem.h.

◆ ComputeNodalKernelBcsThread

friend class ComputeNodalKernelBcsThread
friend

Definition at line 255 of file AuxiliarySystem.h.

◆ ComputeNodalKernelJacobiansThread

friend class ComputeNodalKernelJacobiansThread
friend

Definition at line 256 of file AuxiliarySystem.h.

◆ ComputeNodalKernelsThread

friend class ComputeNodalKernelsThread
friend

Definition at line 254 of file AuxiliarySystem.h.

◆ FlagElementsThread

friend class FlagElementsThread
friend

Definition at line 253 of file AuxiliarySystem.h.

Member Data Documentation

◆ _app

MooseApp& SystemBase::_app
protectedinherited

◆ _aux_scalar_storage

ExecuteMooseObjectWarehouse<AuxScalarKernel> AuxiliarySystem::_aux_scalar_storage

◆ _compute_elemental_vars_timer

const PerfID AuxiliarySystem::_compute_elemental_vars_timer

Definition at line 248 of file AuxiliarySystem.h.

Referenced by computeElementalVars().

◆ _compute_elemental_vec_vars_timer

const PerfID AuxiliarySystem::_compute_elemental_vec_vars_timer

Definition at line 249 of file AuxiliarySystem.h.

Referenced by computeElementalVarsHelper(), and computeElementalVecVars().

◆ _compute_nodal_vars_timer

const PerfID AuxiliarySystem::_compute_nodal_vars_timer

Definition at line 246 of file AuxiliarySystem.h.

Referenced by computeNodalVars().

◆ _compute_nodal_vec_vars_timer

const PerfID AuxiliarySystem::_compute_nodal_vec_vars_timer

Definition at line 247 of file AuxiliarySystem.h.

Referenced by computeNodalVecVars().

◆ _compute_scalar_vars_timer

const PerfID AuxiliarySystem::_compute_scalar_vars_timer

Timers.

Definition at line 245 of file AuxiliarySystem.h.

Referenced by computeScalarVars().

◆ _current_solution

const NumericVector<Number>* AuxiliarySystem::_current_solution

solution vector from nonlinear solver

Definition at line 204 of file AuxiliarySystem.h.

Referenced by currentSolution().

◆ _du_dot_du

Real SystemBase::_du_dot_du
protectedinherited

Definition at line 711 of file SystemBase.h.

Referenced by SystemBase::duDotDu().

◆ _du_dotdot_du

Real SystemBase::_du_dotdot_du
protectedinherited

Definition at line 712 of file SystemBase.h.

Referenced by SystemBase::duDotDotDu().

◆ _elem_std_vars

std::vector<std::vector<MooseVariableFEBase *> > AuxiliarySystem::_elem_std_vars

Definition at line 230 of file AuxiliarySystem.h.

Referenced by addVariable(), AuxiliarySystem(), and computeElementalVars().

◆ _elem_vars

std::vector<std::vector<MooseVariableFEBase *> > AuxiliarySystem::_elem_vars

◆ _elem_vec_vars

std::vector<std::vector<MooseVariableFEBase *> > AuxiliarySystem::_elem_vec_vars

Definition at line 231 of file AuxiliarySystem.h.

Referenced by AuxiliarySystem(), and computeElementalVecVars().

◆ _elemental_aux_storage

ExecuteMooseObjectWarehouse<AuxKernel> AuxiliarySystem::_elemental_aux_storage

◆ _elemental_vec_aux_storage

ExecuteMooseObjectWarehouse<VectorAuxKernel> AuxiliarySystem::_elemental_vec_aux_storage

◆ _factory

Factory& SystemBase::_factory
protectedinherited

◆ _fe_problem

FEProblemBase& AuxiliarySystem::_fe_problem

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

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

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

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

◆ _mesh

MooseMesh& SystemBase::_mesh
protectedinherited

◆ _name

std::string SystemBase::_name
protectedinherited

The name of this system.

Definition at line 701 of file SystemBase.h.

◆ _need_serialized_solution

bool AuxiliarySystem::_need_serialized_solution

Whether or not a copy of the residual needs to be made.

Definition at line 222 of file AuxiliarySystem.h.

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

◆ _nodal_aux_storage

ExecuteMooseObjectWarehouse<AuxKernel> AuxiliarySystem::_nodal_aux_storage

◆ _nodal_std_vars

std::vector<std::vector<MooseVariableFEBase *> > AuxiliarySystem::_nodal_std_vars

Definition at line 226 of file AuxiliarySystem.h.

Referenced by addVariable(), AuxiliarySystem(), and computeNodalVars().

◆ _nodal_vars

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

◆ _nodal_vec_aux_storage

ExecuteMooseObjectWarehouse<VectorAuxKernel> AuxiliarySystem::_nodal_vec_aux_storage

◆ _nodal_vec_vars

std::vector<std::vector<MooseVariableFEBase *> > AuxiliarySystem::_nodal_vec_vars

Definition at line 227 of file AuxiliarySystem.h.

Referenced by addVariable(), AuxiliarySystem(), and computeNodalVecVars().

◆ _perf_graph

PerfGraph& PerfGraphInterface::_perf_graph
protectedinherited

The performance graph to add to.

Definition at line 66 of file PerfGraphInterface.h.

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

◆ _pg_params

const InputParameters* PerfGraphInterface::_pg_params
protectedinherited

Params.

Definition at line 63 of file PerfGraphInterface.h.

◆ _prefix

std::string PerfGraphInterface::_prefix
protectedinherited

A prefix to use for all sections.

Definition at line 69 of file PerfGraphInterface.h.

Referenced by PerfGraphInterface::registerTimedSection().

◆ _saved_dot_old

NumericVector<Real>* SystemBase::_saved_dot_old
protectedinherited

Definition at line 726 of file SystemBase.h.

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

◆ _saved_dotdot_old

NumericVector<Real>* SystemBase::_saved_dotdot_old
protectedinherited

Definition at line 727 of file SystemBase.h.

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

◆ _saved_old

NumericVector<Real>* SystemBase::_saved_old
protectedinherited

Definition at line 722 of file SystemBase.h.

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

◆ _saved_older

NumericVector<Real>* SystemBase::_saved_older
protectedinherited

Definition at line 723 of file SystemBase.h.

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

◆ _serialized_solution

NumericVector<Number>& AuxiliarySystem::_serialized_solution

Serialized version of the solution vector.

Definition at line 206 of file AuxiliarySystem.h.

Referenced by serializedSolution(), serializeSolution(), and ~AuxiliarySystem().

◆ _solution_previous_nl

NumericVector<Number>* AuxiliarySystem::_solution_previous_nl

Solution vector of the previous nonlinear iterate.

Definition at line 208 of file AuxiliarySystem.h.

Referenced by addExtraVectors(), and solutionPreviousNewton().

◆ _subproblem

SubProblem& SystemBase::_subproblem
protectedinherited

◆ _sys

TransientExplicitSystem& AuxiliarySystem::_sys

◆ _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> AuxiliarySystem::_time_integrator

Time integrator.

Definition at line 210 of file AuxiliarySystem.h.

Referenced by addTimeIntegrator(), and compute().

◆ _u_dot

NumericVector<Number>* AuxiliarySystem::_u_dot

solution vector for u^dot

Definition at line 212 of file AuxiliarySystem.h.

Referenced by addDotVectors(), and solutionUDot().

◆ _u_dot_old

NumericVector<Number>* AuxiliarySystem::_u_dot_old

Old solution vector for u^dot.

Definition at line 217 of file AuxiliarySystem.h.

Referenced by addDotVectors(), and solutionUDotOld().

◆ _u_dotdot

NumericVector<Number>* AuxiliarySystem::_u_dotdot

solution vector for u^dotdot

Definition at line 214 of file AuxiliarySystem.h.

Referenced by addDotVectors(), and solutionUDotDot().

◆ _u_dotdot_old

NumericVector<Number>* AuxiliarySystem::_u_dotdot_old

Old solution vector for u^dotdot.

Definition at line 219 of file AuxiliarySystem.h.

Referenced by addDotVectors(), and solutionUDotDotOld().

◆ _var_kind

Moose::VarKindType SystemBase::_var_kind
protectedinherited

default kind of variables in this system

Definition at line 730 of file SystemBase.h.

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

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

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

◆ _var_to_copy

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

Definition at line 732 of file SystemBase.h.

Referenced by SystemBase::addVariableToCopy(), and SystemBase::copyVars().

◆ _vars

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

◆ _vars_to_be_zeroed_on_jacobian

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

◆ _vars_to_be_zeroed_on_residual

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

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