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

#include <DisplacedSystem.h>

Inheritance diagram for DisplacedSystem:
[legend]

Public Member Functions

 DisplacedSystem (DisplacedProblem &problem, SystemBase &undisplaced_system, const std::string &name, Moose::VarKindType var_kind)
 
virtual ~DisplacedSystem ()
 
virtual void init () override
 Initialize the system. More...
 
virtual bool hasResidualVector (Moose::KernelType type) const override
 
virtual NumericVector< Number > & residualVector (Moose::KernelType type) override
 
virtual NumericVector< Number > & getVector (const std::string &name) override
 Get a raw NumericVector. More...
 
virtual NumericVector< Number > & serializedSolution () override
 Returns a reference to a serialized version of the solution vector for this subproblem. More...
 
virtual const NumericVector< Number > *& currentSolution () override
 The solution vector that is currently being operated on. More...
 
virtual NumericVector< Number > & solution () override
 
virtual NumericVector< Number > & solutionUDot () override
 
virtual Number & duDotDu () override
 
virtual NumericVector< Number > & residualCopy () override
 Return the residual copy from the NonlinearSystem. More...
 
virtual NumericVector< Number > & residualGhosted () override
 
virtual void augmentSendList (std::vector< dof_id_type > &send_list) override
 Will modify the send_list to add all of the extra ghosted dofs for this system. More...
 
virtual void augmentSparsity (SparsityPattern::Graph &, std::vector< dof_id_type > &, std::vector< dof_id_type > &) override
 This is an empty function since the displaced system doesn't have a matrix! All sparsity pattern modification will be taken care of by the undisplaced system directly. More...
 
virtual void addVariableToZeroOnResidual (std::string var_name) override
 Adds this variable to the list of variables to be zeroed during each residual evaluation. More...
 
virtual void addVariableToZeroOnJacobian (std::string var_name) override
 Adds this variable to the list of variables to be zeroed during each jacobian evaluation. More...
 
virtual void zeroVariables (std::vector< std::string > &vars_to_be_zeroed) override
 Zero out the solution for the list of variables passed in. More...
 
virtual NumericVector< Number > & solutionOld () override
 
virtual NumericVector< Number > & solutionOlder () override
 
virtual NumericVector< Number > * solutionPreviousNewton () override
 
virtual TransientExplicitSystem & sys ()
 
virtual System & system () override
 Get the reference to the libMesh system. More...
 
virtual const System & system () const override
 
virtual unsigned int number ()
 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 addExtraVectors ()
 Method called during initialSetup to add extra system vector if they are required by the simulation. 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 void saveOldSolutions ()
 Save the old and older solutions. More...
 
virtual void restoreOldSolutions ()
 Restore the old and older solutions when the saved solutions present. More...
 
virtual bool hasVector (const std::string &name)
 Check if the named vector exists in the system. More...
 
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. More...
 
virtual bool hasVariable (const std::string &var_name)
 Query a system for a variable. More...
 
virtual bool hasScalarVariable (const std::string &var_name)
 
virtual bool isScalarVariable (unsigned int var_name)
 
virtual MooseVariablegetVariable (THREAD_ID tid, const std::string &var_name)
 Gets a reference to a variable of with specified name. More...
 
virtual MooseVariablegetVariable (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 ()
 Get the number of variables in this system. More...
 
virtual void zeroVariablesForResidual ()
 Zero out the solution for the variables that were registered as needing to have their solutions zeroed on out on residual evaluation by a call to addVariableToZeroOnResidual() More...
 
virtual void zeroVariablesForJacobian ()
 Zero out the solution for the variables that were registered as needing to have their solutions zeroed on out on Jacobian evaluation by a call to addVariableToZeroOnResidual() More...
 
virtual Order getMinQuadratureOrder ()
 Get minimal quadrature order needed for integrating variables in this system. More...
 
virtual void prepare (THREAD_ID tid)
 Prepare the system for use. More...
 
virtual void prepareFace (THREAD_ID tid, bool resize_data)
 Prepare the system for use on sides. More...
 
virtual void prepareNeighbor (THREAD_ID tid)
 Prepare the system for use. More...
 
virtual void reinitElem (const Elem *elem, THREAD_ID tid)
 Reinit an element assembly info. More...
 
virtual void reinitElemFace (const Elem *elem, unsigned int side, BoundaryID bnd_id, THREAD_ID tid)
 Reinit assembly info for a side of an element. More...
 
virtual void reinitNeighborFace (const Elem *elem, unsigned int side, BoundaryID bnd_id, THREAD_ID tid)
 Compute the values of the variables at all the current points. More...
 
virtual void reinitNeighbor (const Elem *elem, THREAD_ID tid)
 Compute the values of the variables at all the current points. More...
 
virtual void 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 reinitNodeNeighbor (const Node *node, THREAD_ID tid)
 Reinit nodal assembly info for neighbor node. 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< MooseVariable * > & 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 NumericVector< Number > & addVector (const std::string &vector_name, const bool project, const ParallelType type)
 Adds a solution length vector to the system. More...
 
virtual const std::string & name ()
 
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...
 

Protected Attributes

SystemBase_undisplaced_system
 
TransientExplicitSystem & _sys
 
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
 
NumericVector< Number > * _dummy_vec
 
NumericVector< Real > * _saved_old
 
NumericVector< Real > * _saved_older
 
Moose::VarKindType _var_kind
 default kind of variables in this system More...
 
std::vector< VarCopyInfo_var_to_copy
 

Detailed Description

Definition at line 26 of file DisplacedSystem.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file DisplacedSystem.C.

22  : SystemBase(problem, name, var_kind),
23  _undisplaced_system(undisplaced_system),
24  _sys(problem.es().add_system<TransientExplicitSystem>(name))
25 {
26 }
TransientExplicitSystem & _sys
virtual const std::string & name()
Definition: SystemBase.h:453
virtual EquationSystems & es() override
SystemBase & _undisplaced_system
SystemBase(SubProblem &subproblem, const std::string &name, Moose::VarKindType var_kind)
Definition: SystemBase.C:84
DisplacedSystem::~DisplacedSystem ( )
virtual

Definition at line 28 of file DisplacedSystem.C.

28 {}

Member Function Documentation

void SystemBase::addExtraVectors ( )
virtualinherited

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

Reimplemented in NonlinearSystemBase, and AuxiliarySystem.

Definition at line 660 of file SystemBase.C.

661 {
662 }
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 530 of file SystemBase.C.

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

534 {
535  FEType type(order, SCALAR);
536  unsigned int var_num = system().add_variable(var_name, type, active_subdomains);
537  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
538  {
539  // FIXME: we cannot refer fetype in libMesh at this point, so we will just make a copy in
540  // MooseVariableBase.
541  MooseVariableScalar * var =
542  new MooseVariableScalar(var_num, type, *this, _subproblem.assembly(tid), _var_kind);
543  var->scalingFactor(scale_factor);
544  _vars[tid].add(var_name, var);
545  }
546  if (active_subdomains == NULL)
547  _var_map[var_num] = std::set<SubdomainID>();
548  else
549  for (std::set<SubdomainID>::iterator it = active_subdomains->begin();
550  it != active_subdomains->end();
551  ++it)
552  _var_map[var_num].insert(*it);
553 }
virtual Assembly & assembly(THREAD_ID tid)=0
SubProblem & _subproblem
Definition: SystemBase.h:478
Moose::VarKindType _var_kind
default kind of variables in this system
Definition: SystemBase.h:504
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:490
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
MatType type
Class for scalar variables (they are different).
unsigned int THREAD_ID
Definition: MooseTypes.h:79
void scalingFactor(Real factor)
Set the scaling factor for this variable.
void SystemBase::addVariable ( const std::string &  var_name,
const FEType &  type,
Real  scale_factor,
const std::set< SubdomainID > *const  active_subdomains = NULL 
)
virtualinherited

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

Definition at line 500 of file SystemBase.C.

Referenced by DisplacedProblem::addAuxVariable(), AuxiliarySystem::addVariable(), and DisplacedProblem::addVariable().

504 {
505  unsigned int var_num = system().add_variable(var_name, type, active_subdomains);
506  for (THREAD_ID tid = 0; tid < libMesh::n_threads(); tid++)
507  {
508  // FIXME: we cannot refer fetype in libMesh at this point, so we will just make a copy in
509  // MooseVariableBase.
510  MooseVariableBase * var;
511  if (type == FEType(0, MONOMIAL))
512  var = new MooseVariableConstMonomial(
513  var_num, type, *this, _subproblem.assembly(tid), _var_kind);
514  else
515  var = new MooseVariable(var_num, type, *this, _subproblem.assembly(tid), _var_kind);
516 
517  var->scalingFactor(scale_factor);
518  _vars[tid].add(var_name, var);
519  }
520  if (active_subdomains == NULL)
521  _var_map[var_num] = std::set<SubdomainID>();
522  else
523  for (std::set<SubdomainID>::iterator it = active_subdomains->begin();
524  it != active_subdomains->end();
525  ++it)
526  _var_map[var_num].insert(*it);
527 }
Class for stuff related to variables.
Definition: MooseVariable.h:43
virtual Assembly & assembly(THREAD_ID tid)=0
SubProblem & _subproblem
Definition: SystemBase.h:478
Moose::VarKindType _var_kind
default kind of variables in this system
Definition: SystemBase.h:504
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:490
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
MatType type
unsigned int THREAD_ID
Definition: MooseTypes.h:79
void scalingFactor(Real factor)
Set the scaling factor for this variable.
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 616 of file SystemBase.C.

Referenced by CopyNodalVarsAction::act().

619 {
620  _var_to_copy.push_back(VarCopyInfo(dest_name, source_name, timestep));
621 }
std::vector< VarCopyInfo > _var_to_copy
Definition: SystemBase.h:506
Information about variables that will be copied.
Definition: SystemBase.h:73
virtual void DisplacedSystem::addVariableToZeroOnJacobian ( std::string  var_name)
inlineoverridevirtual

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

Parameters
var_nameThe name of the variable to be zeroed.

Reimplemented from SystemBase.

Definition at line 108 of file DisplacedSystem.h.

109  {
111  }
SystemBase & _undisplaced_system
virtual void addVariableToZeroOnJacobian(std::string var_name)
Adds this variable to the list of variables to be zeroed during each Jacobian evaluation.
Definition: SystemBase.C:156
virtual void DisplacedSystem::addVariableToZeroOnResidual ( std::string  var_name)
inlineoverridevirtual

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

Parameters
var_nameThe name of the variable to be zeroed.

Reimplemented from SystemBase.

Definition at line 99 of file DisplacedSystem.h.

100  {
102  }
SystemBase & _undisplaced_system
virtual void addVariableToZeroOnResidual(std::string var_name)
Adds this variable to the list of variables to be zeroed during each residual evaluation.
Definition: SystemBase.C:150
NumericVector< Number > & SystemBase::addVector ( const std::string &  vector_name,
const bool  project,
const ParallelType  type 
)
virtualinherited

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

Definition at line 490 of file SystemBase.C.

Referenced by NonlinearSystemBase::addExtraVectors(), AStableDirk4::AStableDirk4(), FEProblemBase::initNullSpaceVectors(), LStableDirk3::LStableDirk3(), LStableDirk4::LStableDirk4(), NonlinearSystemBase::residualGhosted(), NonlinearSystemBase::residualVector(), SystemBase::saveOldSolutions(), and Transient::Transient().

491 {
492  if (hasVector(vector_name))
493  return getVector(vector_name);
494 
495  NumericVector<Number> * vec = &system().add_vector(vector_name, project, type);
496  return *vec;
497 }
virtual bool hasVector(const std::string &name)
Check if the named vector exists in the system.
Definition: SystemBase.C:589
virtual System & system()=0
Get the reference to the libMesh system.
MatType type
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector.
Definition: SystemBase.C:598
virtual void DisplacedSystem::augmentSendList ( std::vector< dof_id_type > &  send_list)
inlineoverridevirtual

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

Reimplemented from SystemBase.

Definition at line 80 of file DisplacedSystem.h.

81  {
83  }
SystemBase & _undisplaced_system
virtual void augmentSendList(std::vector< dof_id_type > &send_list)
Will modify the send_list to add all of the extra ghosted dofs for this system.
Definition: SystemBase.C:401
virtual void DisplacedSystem::augmentSparsity ( SparsityPattern::Graph &  ,
std::vector< dof_id_type > &  ,
std::vector< dof_id_type > &   
)
inlineoverridevirtual

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

Implements SystemBase.

Definition at line 89 of file DisplacedSystem.h.

92  {
93  }
virtual void SystemBase::computeVariables ( const NumericVector< Number > &  )
inlinevirtualinherited

Definition at line 468 of file SystemBase.h.

468 {};
void SystemBase::copyOldSolutions ( )
virtualinherited

Shifts the solutions backwards in time.

Definition at line 693 of file SystemBase.C.

Referenced by EigenExecutionerBase::inversePowerIteration().

694 {
699 }
virtual NumericVector< Number > & solutionOld()=0
virtual NumericVector< Number > * solutionPreviousNewton()=0
virtual NumericVector< Number > & solutionOlder()=0
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
void SystemBase::copySolutionsBackwards ( )
virtualinherited

Copy current solution into old and older.

Definition at line 680 of file SystemBase.C.

681 {
682  system().update();
687 }
virtual NumericVector< Number > & solutionOld()=0
virtual NumericVector< Number > * solutionPreviousNewton()=0
virtual System & system()=0
Get the reference to the libMesh system.
virtual NumericVector< Number > & solutionOlder()=0
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
void SystemBase::copyVars ( ExodusII_IO &  io)
inherited

Definition at line 624 of file SystemBase.C.

625 {
626  int n_steps = io.get_num_time_steps();
627 
628  bool did_copy = false;
629  for (std::vector<VarCopyInfo>::iterator it = _var_to_copy.begin(); it != _var_to_copy.end(); ++it)
630  {
631  VarCopyInfo & vci = *it;
632  int timestep = -1;
633 
634  if (vci._timestep == "LATEST")
635  // Use the last time step in the file from which to retrieve the solution
636  timestep = n_steps;
637  else
638  {
639  std::istringstream ss(vci._timestep);
640  if (!((ss >> timestep) && ss.eof()) || timestep > n_steps)
641  mooseError("Invalid value passed as \"initial_from_file_timestep\". Expected \"LATEST\" or "
642  "a valid integer between 1 and ",
643  n_steps,
644  " inclusive, received ",
645  vci._timestep);
646  }
647 
648  did_copy = true;
649  if (getVariable(0, vci._dest_name).isNodal())
650  io.copy_nodal_solution(system(), vci._dest_name, vci._source_name, timestep);
651  else
652  io.copy_elemental_solution(system(), vci._dest_name, vci._source_name, timestep);
653  }
654 
655  if (did_copy)
656  solution().close();
657 }
std::string _source_name
Definition: SystemBase.h:83
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
virtual bool isNodal() const override
Is this variable nodal.
std::vector< VarCopyInfo > _var_to_copy
Definition: SystemBase.h:506
virtual MooseVariable & getVariable(THREAD_ID tid, const std::string &var_name)
Gets a reference to a variable of with specified name.
Definition: SystemBase.C:103
Information about variables that will be copied.
Definition: SystemBase.h:73
std::string _dest_name
Definition: SystemBase.h:82
virtual System & system()=0
Get the reference to the libMesh system.
std::string _timestep
Definition: SystemBase.h:84
virtual NumericVector< Number > & solution()=0
virtual const NumericVector<Number>*& DisplacedSystem::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 54 of file DisplacedSystem.h.

55  {
57  }
SystemBase & _undisplaced_system
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
DofMap & SystemBase::dofMap ( )
virtualinherited
virtual Number& DisplacedSystem::duDotDu ( )
inlineoverridevirtual

Reimplemented from SystemBase.

Definition at line 65 of file DisplacedSystem.h.

65 { return _undisplaced_system.duDotDu(); }
virtual Number & duDotDu()
Definition: SystemBase.h:156
SystemBase & _undisplaced_system
Order SystemBase::getMinQuadratureOrder ( )
virtualinherited

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

Returns
The minimal order of quadrature

Reimplemented in AuxiliarySystem.

Definition at line 199 of file SystemBase.C.

200 {
201  Order order = CONSTANT;
202  std::vector<MooseVariable *> vars = _vars[0].variables();
203  for (const auto & var : vars)
204  {
205  FEType fe_type = var->feType();
206  if (fe_type.default_quadrature_order() > order)
207  order = fe_type.default_quadrature_order();
208  }
209 
210  return order;
211 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
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 121 of file SystemBase.C.

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

122 {
123  MooseVariableScalar * var = dynamic_cast<MooseVariableScalar *>(_vars[tid].getVariable(var_name));
124  if (var == NULL)
125  mooseError("Scalar variable '" + var_name + "' does not exist in this system");
126  return *var;
127 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
Class for scalar variables (they are different).
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 130 of file SystemBase.C.

131 {
132  MooseVariableScalar * var =
133  dynamic_cast<MooseVariableScalar *>(_vars[tid].getVariable(var_number));
134  if (var == NULL)
135  mooseError("variable #" + Moose::stringify(var_number) + " does not exist in this system");
136  return *var;
137 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:66
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
Class for scalar variables (they are different).
const std::vector<MooseVariableScalar *>& SystemBase::getScalarVariables ( THREAD_ID  tid)
inlineinherited
const std::set<SubdomainID>& SystemBase::getSubdomainsForVar ( unsigned int  var_number) const
inlineinherited

Definition at line 427 of file SystemBase.h.

428  {
429  return _var_map.at(var_number);
430  }
std::map< unsigned int, std::set< SubdomainID > > _var_map
Map of variables (variable id -> array of subdomains where it lives)
Definition: SystemBase.h:490
MooseVariable & SystemBase::getVariable ( THREAD_ID  tid,
const std::string &  var_name 
)
virtualinherited

Gets a reference to a variable of with specified name.

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

Definition at line 103 of file SystemBase.C.

Referenced by AdaptivityAction::act(), Assembly::addJacobianBlock(), Assembly::addJacobianBlockNonlocal(), Assembly::addJacobianNeighbor(), NonlocalIntegratedBC::computeJacobianBlock(), NonlocalKernel::computeNonlocalOffDiagJacobian(), NonlocalIntegratedBC::computeNonlocalOffDiagJacobian(), NonlocalKernel::computeOffDiagJacobian(), Assembly::copyFaceShapes(), Assembly::copyNeighborShapes(), Assembly::copyShapes(), SystemBase::copyVars(), FieldSplitPreconditioner::FieldSplitPreconditioner(), FiniteDifferencePreconditioner::FiniteDifferencePreconditioner(), NodeFaceConstraint::getConnectedDofIndices(), Marker::getMarkerValue(), DisplacedProblem::getVariable(), NodalNormalsPreprocessor::initialize(), FDKernel::perturbedResidual(), PhysicsBasedPreconditioner::PhysicsBasedPreconditioner(), AddPeriodicBCAction::setPeriodicVars(), SingleMatrixPreconditioner::SingleMatrixPreconditioner(), and UpdateErrorVectorsThread::UpdateErrorVectorsThread().

104 {
105  MooseVariable * var = dynamic_cast<MooseVariable *>(_vars[tid].getVariable(var_name));
106  if (var == NULL)
107  mooseError("Variable '" + var_name + "' does not exist in this system");
108  return *var;
109 }
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
MooseVariable & SystemBase::getVariable ( 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 112 of file SystemBase.C.

113 {
114  MooseVariable * var = dynamic_cast<MooseVariable *>(_vars[tid].getVariable(var_number));
115  if (var == NULL)
116  mooseError("variable #" + Moose::stringify(var_number) + " does not exist in this system");
117  return *var;
118 }
Class for stuff related to variables.
Definition: MooseVariable.h:43
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::string stringify(const T &t)
conversion to string
Definition: Conversion.h:66
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
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 140 of file SystemBase.C.

Referenced by PhysicsBasedPreconditioner::addSystem().

141 {
142  mooseAssert(_var_map.find(var_number) != _var_map.end(), "Variable does not exist.");
143  if (_var_map[var_number].empty())
144  return NULL;
145  else
146  return &_var_map[var_number];
147 }
std::map< unsigned int, std::set< SubdomainID > > _var_map
Map of variables (variable id -> array of subdomains where it lives)
Definition: SystemBase.h:490
const std::vector<VariableName>& SystemBase::getVariableNames ( ) const
inlineinherited

Definition at line 466 of file SystemBase.h.

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

466 { return _vars[0].names(); };
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
const std::vector<MooseVariable *>& SystemBase::getVariables ( THREAD_ID  tid)
inlineinherited
NumericVector< Number > & DisplacedSystem::getVector ( const std::string &  name)
overridevirtual

Get a raw NumericVector.

Get a raw NumericVector with the given name.

Reimplemented from SystemBase.

Definition at line 36 of file DisplacedSystem.C.

Referenced by residualVector().

37 {
38  if (_sys.have_vector(name))
39  return _sys.get_vector(name);
40  else
42 }
TransientExplicitSystem & _sys
virtual const std::string & name()
Definition: SystemBase.h:453
SystemBase & _undisplaced_system
virtual NumericVector< Number > & getVector(const std::string &name)
Get a raw NumericVector.
Definition: SystemBase.C:598
virtual bool DisplacedSystem::hasResidualVector ( Moose::KernelType  type) const
inlineoverridevirtual

Reimplemented from SystemBase.

Definition at line 37 of file DisplacedSystem.h.

38  {
40  }
SystemBase & _undisplaced_system
MatType type
virtual bool hasResidualVector(Moose::KernelType) const
Definition: SystemBase.h:159
bool SystemBase::hasScalarVariable ( const std::string &  var_name)
virtualinherited

Definition at line 565 of file SystemBase.C.

Referenced by ComputeFullJacobianThread::computeFaceJacobian(), ComputeFullJacobianThread::computeJacobian(), DisplacedProblem::getScalarVariable(), and DisplacedProblem::hasScalarVariable().

566 {
567  if (system().has_variable(var_name))
568  return system().variable_type(var_name).family == SCALAR;
569  else
570  return false;
571 }
virtual System & system()=0
Get the reference to the libMesh system.
bool SystemBase::hasVariable ( const std::string &  var_name)
virtualinherited

Query a system for a variable.

Parameters
var_namename of the variable
Returns
true if the variable exists

Definition at line 556 of file SystemBase.C.

Referenced by DGKernel::DGKernel(), FEProblemBase::duplicateVariableCheck(), DisplacedProblem::getSystem(), DisplacedProblem::getVariable(), DisplacedProblem::hasVariable(), InterfaceKernel::InterfaceKernel(), and KernelBase::KernelBase().

557 {
558  if (system().has_variable(var_name))
559  return system().variable_type(var_name).family != SCALAR;
560  else
561  return false;
562 }
virtual System & system()=0
Get the reference to the libMesh system.
bool SystemBase::hasVector ( const std::string &  name)
virtualinherited

Check if the named vector exists in the system.

Definition at line 589 of file SystemBase.C.

Referenced by AuxiliarySystem::addVector(), SystemBase::addVector(), and NonlinearSystemBase::computeResidual().

590 {
591  return system().have_vector(name);
592 }
virtual const std::string & name()
Definition: SystemBase.h:453
virtual System & system()=0
Get the reference to the libMesh system.
void DisplacedSystem::init ( )
overridevirtual

Initialize the system.

Reimplemented from SystemBase.

Definition at line 31 of file DisplacedSystem.C.

Referenced by DisplacedProblem::init().

32 {
33 }
virtual void SystemBase::initializeObjects ( )
inlinevirtualinherited

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

Definition at line 124 of file SystemBase.h.

124 {};
bool SystemBase::isScalarVariable ( unsigned int  var_name)
virtualinherited

Definition at line 574 of file SystemBase.C.

Referenced by ODEKernel::computeOffDiagJacobian().

575 {
576  return (system().variable(var_num).type().family == SCALAR);
577 }
virtual System & system()=0
Get the reference to the libMesh system.
MatType type
virtual MooseMesh& SystemBase::mesh ( )
inlinevirtualinherited
virtual const std::string& SystemBase::name ( )
inlinevirtualinherited
unsigned int SystemBase::number ( )
virtualinherited
unsigned int SystemBase::nVariables ( )
virtualinherited

Get the number of variables in this system.

Returns
the number of variables

Definition at line 580 of file SystemBase.C.

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

581 {
582  return _vars[0].names().size();
583 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
void SystemBase::prepare ( THREAD_ID  tid)
virtualinherited

Prepare the system for use.

Parameters
tidID of the thread

Definition at line 214 of file SystemBase.C.

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

215 {
217  {
218  const std::set<MooseVariable *> & active_elemental_moose_variables =
220  const std::vector<MooseVariable *> & vars = _vars[tid].variables();
221  for (const auto & var : vars)
222  var->clearDofIndices();
223 
224  for (const auto & var : active_elemental_moose_variables)
225  if (&(var->sys()) == this)
226  var->prepare();
227  }
228  else
229  {
230  const std::vector<MooseVariable *> & vars = _vars[tid].variables();
231  for (const auto & var : vars)
232  var->prepare();
233  }
234 }
virtual bool hasActiveElementalMooseVariables(THREAD_ID tid)
Whether or not a list of active elemental moose variables has been set.
Definition: SubProblem.C:76
SubProblem & _subproblem
Definition: SystemBase.h:478
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
virtual const std::set< MooseVariable * > & getActiveElementalMooseVariables(THREAD_ID tid)
Get the MOOSE variables to be reinited on each element.
Definition: SubProblem.C:70
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 237 of file SystemBase.C.

Referenced by DisplacedProblem::prepareFace().

238 {
240  tid)) // We only need to do something if the element prepare was restricted
241  {
242  const std::set<MooseVariable *> & active_elemental_moose_variables =
244 
245  std::vector<MooseVariable *> newly_prepared_vars;
246 
247  const std::vector<MooseVariable *> & vars = _vars[tid].variables();
248  for (const auto & var : vars)
249  {
250  if (&(var->sys()) == this &&
251  !active_elemental_moose_variables.count(
252  var)) // If it wasnt in the active list we need to prepare it
253  {
254  var->prepare();
255  newly_prepared_vars.push_back(var);
256  }
257  }
258 
259  // Make sure to resize the residual and jacobian datastructures for all the new variables
260  if (resize_data)
261  for (unsigned int i = 0; i < newly_prepared_vars.size(); i++)
262  {
263  _subproblem.assembly(tid).prepareVariable(newly_prepared_vars[i]);
265  _subproblem.assembly(tid).prepareVariableNonlocal(newly_prepared_vars[i]);
266  }
267  }
268 }
virtual Assembly & assembly(THREAD_ID tid)=0
virtual bool hasActiveElementalMooseVariables(THREAD_ID tid)
Whether or not a list of active elemental moose variables has been set.
Definition: SubProblem.C:76
void prepareVariable(MooseVariable *var)
Used for preparing the dense residual and jacobian blocks for one particular variable.
Definition: Assembly.C:1076
SubProblem & _subproblem
Definition: SystemBase.h:478
virtual bool checkNonlocalCouplingRequirement()
Definition: SubProblem.h:62
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
void prepareVariableNonlocal(MooseVariable *var)
Definition: Assembly.C:1098
virtual const std::set< MooseVariable * > & getActiveElementalMooseVariables(THREAD_ID tid)
Get the MOOSE variables to be reinited on each element.
Definition: SubProblem.C:70
void SystemBase::prepareNeighbor ( THREAD_ID  tid)
virtualinherited

Prepare the system for use.

Parameters
tidID of the thread

Definition at line 271 of file SystemBase.C.

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

272 {
273  const std::vector<MooseVariable *> & vars = _vars[tid].variables();
274  for (const auto & var : vars)
275  var->prepareNeighbor();
276 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
void SystemBase::reinitElem ( const Elem *  elem,
THREAD_ID  tid 
)
virtualinherited

Reinit an element assembly info.

Parameters
elemWhich element we are reinitializing for
tidID of the thread

Reimplemented in AuxiliarySystem.

Definition at line 279 of file SystemBase.C.

Referenced by DisplacedProblem::reinitElem().

280 {
281 
283  {
284  const std::set<MooseVariable *> & active_elemental_moose_variables =
286  for (const auto & var : active_elemental_moose_variables)
287  if (&(var->sys()) == this)
288  var->computeElemValues();
289  }
290  else
291  {
292  const std::vector<MooseVariable *> & vars = _vars[tid].variables();
293  for (const auto & var : vars)
294  var->computeElemValues();
295  }
296 }
virtual bool hasActiveElementalMooseVariables(THREAD_ID tid)
Whether or not a list of active elemental moose variables has been set.
Definition: SubProblem.C:76
SubProblem & _subproblem
Definition: SystemBase.h:478
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
virtual const std::set< MooseVariable * > & getActiveElementalMooseVariables(THREAD_ID tid)
Get the MOOSE variables to be reinited on each element.
Definition: SubProblem.C:70
void SystemBase::reinitElemFace ( const Elem *  elem,
unsigned int  side,
BoundaryID  bnd_id,
THREAD_ID  tid 
)
virtualinherited

Reinit assembly info for a side of an element.

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

Reimplemented in AuxiliarySystem.

Definition at line 299 of file SystemBase.C.

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

303 {
304  const std::vector<MooseVariable *> & vars = _vars[tid].variables();
305  for (const auto & var : vars)
306  var->computeElemValuesFace();
307 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
void SystemBase::reinitNeighbor ( const Elem *  elem,
THREAD_ID  tid 
)
virtualinherited

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

Definition at line 321 of file SystemBase.C.

Referenced by DisplacedProblem::reinitNeighborPhys().

322 {
323  const std::vector<MooseVariable *> & vars = _vars[tid].variables();
324  for (const auto & var : vars)
325  var->computeNeighborValues();
326 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
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 310 of file SystemBase.C.

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

314 {
315  const std::vector<MooseVariable *> & vars = _vars[tid].variables();
316  for (const auto & var : vars)
317  var->computeNeighborValuesFace();
318 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
void SystemBase::reinitNode ( const Node *  node,
THREAD_ID  tid 
)
virtualinherited

Reinit nodal assembly info.

Parameters
nodeNode to reinit for
tidThread ID

Definition at line 329 of file SystemBase.C.

Referenced by DisplacedProblem::reinitNode().

330 {
331  const std::vector<MooseVariable *> & vars = _vars[tid].variables();
332  for (const auto & var : vars)
333  {
334  if (var->isNodal())
335  {
336  var->reinitNode();
337  var->computeNodalValues();
338  }
339  }
340 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
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 343 of file SystemBase.C.

Referenced by DisplacedProblem::reinitNodeFace().

344 {
345  const std::vector<MooseVariable *> & vars = _vars[tid].variables();
346  for (const auto & var : vars)
347  {
348  if (var->isNodal())
349  {
350  var->reinitNode();
351  var->computeNodalValues();
352  }
353  }
354 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
void SystemBase::reinitNodeNeighbor ( const Node *  node,
THREAD_ID  tid 
)
virtualinherited

Reinit nodal assembly info for neighbor node.

Parameters
nodeNode to reinit for
tidThread ID

Definition at line 357 of file SystemBase.C.

Referenced by DisplacedProblem::reinitNodeNeighbor().

358 {
359  const std::vector<MooseVariable *> & vars = _vars[tid].variables();
360  for (const auto & var : vars)
361  {
362  if (var->isNodal())
363  {
364  var->reinitNodeNeighbor();
365  var->computeNodalNeighborValues();
366  }
367  }
368 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
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 371 of file SystemBase.C.

Referenced by DisplacedProblem::reinitNodes().

372 {
373  const std::vector<MooseVariable *> & vars = _vars[tid].variables();
374  for (const auto & var : vars)
375  {
376  var->reinitNodes(nodes);
377  var->computeNodalValues();
378  }
379 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
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 382 of file SystemBase.C.

Referenced by DisplacedProblem::reinitNodesNeighbor().

383 {
384  const std::vector<MooseVariable *> & vars = _vars[tid].variables();
385  for (const auto & var : vars)
386  {
387  var->reinitNodesNeighbor(nodes);
388  var->computeNodalNeighborValues();
389  }
390 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
void SystemBase::reinitScalars ( THREAD_ID  tid)
virtualinherited

Reinit scalar varaibles.

Parameters
tidThread ID

Definition at line 393 of file SystemBase.C.

Referenced by DisplacedProblem::reinitScalars().

394 {
395  const std::vector<MooseVariableScalar *> & vars = _vars[tid].scalars();
396  for (const auto & var : vars)
397  var->reinit();
398 }
std::vector< VariableWarehouse > _vars
Variable warehouses (one for each thread)
Definition: SystemBase.h:488
virtual void SystemBase::removeVector ( const std::string &  name)
inlinevirtualinherited

Remove a vector from the system with the given name.

Definition at line 435 of file SystemBase.h.

Referenced by SystemBase::restoreOldSolutions().

435 { system().remove_vector(name); }
virtual const std::string & name()
Definition: SystemBase.h:453
virtual System & system()=0
Get the reference to the libMesh system.
virtual NumericVector<Number>& DisplacedSystem::residualCopy ( )
inlineoverridevirtual

Return the residual copy from the NonlinearSystem.

Returns
Residual copy

Reimplemented from SystemBase.

Definition at line 71 of file DisplacedSystem.h.

72  {
74  }
virtual NumericVector< Number > & residualCopy()
Definition: SystemBase.h:179
SystemBase & _undisplaced_system
virtual NumericVector<Number>& DisplacedSystem::residualGhosted ( )
inlineoverridevirtual

Reimplemented from SystemBase.

Definition at line 75 of file DisplacedSystem.h.

76  {
78  }
SystemBase & _undisplaced_system
virtual NumericVector< Number > & residualGhosted()
Definition: SystemBase.h:183
virtual NumericVector<Number>& DisplacedSystem::residualVector ( Moose::KernelType  type)
inlineoverridevirtual

Reimplemented from SystemBase.

Definition at line 42 of file DisplacedSystem.h.

43  {
45  }
SystemBase & _undisplaced_system
MatType type
virtual NumericVector< Number > & residualVector(Moose::KernelType)
Definition: SystemBase.h:158
void SystemBase::restoreOldSolutions ( )
virtualinherited

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

Definition at line 473 of file SystemBase.C.

Referenced by DisplacedProblem::restoreOldSolutions().

474 {
475  if (_saved_old)
476  {
477  solutionOld() = *_saved_old;
478  removeVector("save_solution_old");
479  _saved_old = NULL;
480  }
481  if (_saved_older)
482  {
484  removeVector("save_solution_older");
485  _saved_older = NULL;
486  }
487 }
virtual NumericVector< Number > & solutionOld()=0
virtual void removeVector(const std::string &name)
Remove a vector from the system with the given name.
Definition: SystemBase.h:435
NumericVector< Real > * _saved_older
Definition: SystemBase.h:501
NumericVector< Real > * _saved_old
Definition: SystemBase.h:500
virtual NumericVector< Number > & solutionOlder()=0
void SystemBase::restoreSolutions ( )
virtualinherited

Restore current solutions (call after your solve failed)

Reimplemented in NonlinearSystemBase.

Definition at line 705 of file SystemBase.C.

Referenced by NonlinearSystemBase::restoreSolutions().

706 {
707  *(const_cast<NumericVector<Number> *&>(currentSolution())) = solutionOld();
708  solution() = solutionOld();
711  system().update();
712 }
virtual NumericVector< Number > & solutionOld()=0
virtual NumericVector< Number > * solutionPreviousNewton()=0
virtual System & system()=0
Get the reference to the libMesh system.
virtual NumericVector< Number > & solution()=0
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.
void SystemBase::saveOldSolutions ( )
virtualinherited

Save the old and older solutions.

Definition at line 459 of file SystemBase.C.

Referenced by DisplacedProblem::saveOldSolutions().

460 {
461  if (!_saved_old)
462  _saved_old = &addVector("save_solution_old", false, PARALLEL);
463  if (!_saved_older)
464  _saved_older = &addVector("save_solution_older", false, PARALLEL);
465  *_saved_old = solutionOld();
467 }
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:490
virtual NumericVector< Number > & solutionOld()=0
NumericVector< Real > * _saved_older
Definition: SystemBase.h:501
NumericVector< Real > * _saved_old
Definition: SystemBase.h:500
virtual NumericVector< Number > & solutionOlder()=0
virtual NumericVector<Number>& DisplacedSystem::serializedSolution ( )
inlineoverridevirtual

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

Implements SystemBase.

Definition at line 49 of file DisplacedSystem.h.

50  {
52  }
SystemBase & _undisplaced_system
virtual NumericVector< Number > & serializedSolution()=0
Returns a reference to a serialized version of the solution vector for this subproblem.
virtual NumericVector<Number>& DisplacedSystem::solution ( )
inlineoverridevirtual

Implements SystemBase.

Definition at line 59 of file DisplacedSystem.h.

59 { return _undisplaced_system.solution(); }
SystemBase & _undisplaced_system
virtual NumericVector< Number > & solution()=0
virtual NumericVector<Number>& DisplacedSystem::solutionOld ( )
inlineoverridevirtual

Implements SystemBase.

Definition at line 121 of file DisplacedSystem.h.

121 { return *_sys.old_local_solution; }
TransientExplicitSystem & _sys
virtual NumericVector<Number>& DisplacedSystem::solutionOlder ( )
inlineoverridevirtual

Implements SystemBase.

Definition at line 123 of file DisplacedSystem.h.

123 { return *_sys.older_local_solution; }
TransientExplicitSystem & _sys
virtual NumericVector<Number>* DisplacedSystem::solutionPreviousNewton ( )
inlineoverridevirtual

Implements SystemBase.

Definition at line 125 of file DisplacedSystem.h.

125 { return NULL; }
virtual NumericVector<Number>& DisplacedSystem::solutionUDot ( )
inlineoverridevirtual

Reimplemented from SystemBase.

Definition at line 61 of file DisplacedSystem.h.

62  {
64  }
virtual NumericVector< Number > & solutionUDot()
Definition: SystemBase.h:157
SystemBase & _undisplaced_system
void SystemBase::solve ( )
virtualinherited

Solve the system (using libMesh magic)

Reimplemented in NonlinearSystemBase, NonlinearEigenSystem, and NonlinearSystem.

Definition at line 671 of file SystemBase.C.

672 {
673  system().solve();
674 }
virtual System & system()=0
Get the reference to the libMesh system.
virtual SubProblem& SystemBase::subproblem ( )
inlinevirtualinherited
virtual TransientExplicitSystem& DisplacedSystem::sys ( )
inlinevirtual

Definition at line 127 of file DisplacedSystem.h.

Referenced by UpdateDisplacedMeshThread::init(), and DisplacedProblem::syncSolutions().

127 { return _sys; }
TransientExplicitSystem & _sys
virtual System& DisplacedSystem::system ( )
inlineoverridevirtual

Get the reference to the libMesh system.

Implements SystemBase.

Definition at line 129 of file DisplacedSystem.h.

Referenced by DisplacedProblem::getSystem().

129 { return _sys; }
TransientExplicitSystem & _sys
virtual const System& DisplacedSystem::system ( ) const
inlineoverridevirtual

Implements SystemBase.

Definition at line 130 of file DisplacedSystem.h.

130 { return _sys; }
TransientExplicitSystem & _sys
void SystemBase::update ( )
virtualinherited
virtual void DisplacedSystem::zeroVariables ( std::vector< std::string > &  vars_to_be_zeroed)
inlineoverridevirtual

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

Reimplemented from SystemBase.

Definition at line 116 of file DisplacedSystem.h.

117  {
118  _undisplaced_system.zeroVariables(vars_to_be_zeroed);
119  }
SystemBase & _undisplaced_system
virtual void zeroVariables(std::vector< std::string > &vars_to_be_zeroed)
Zero out the solution for the list of variables passed in.
Definition: SystemBase.C:162
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 193 of file SystemBase.C.

194 {
196 }
std::vector< std::string > _vars_to_be_zeroed_on_jacobian
Definition: SystemBase.h:493
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:162
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 187 of file SystemBase.C.

188 {
190 }
std::vector< std::string > _vars_to_be_zeroed_on_residual
Definition: SystemBase.h:492
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:162

Member Data Documentation

MooseApp& SystemBase::_app
protectedinherited

Definition at line 480 of file SystemBase.h.

Real SystemBase::_du_dot_du
protectedinherited

Definition at line 495 of file SystemBase.h.

NumericVector<Number>* SystemBase::_dummy_vec
protectedinherited

Definition at line 497 of file SystemBase.h.

Factory& SystemBase::_factory
protectedinherited
MooseMesh& SystemBase::_mesh
protectedinherited
std::string SystemBase::_name
protectedinherited

The name of this system.

Definition at line 485 of file SystemBase.h.

NumericVector<Real>* SystemBase::_saved_old
protectedinherited

Definition at line 500 of file SystemBase.h.

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

NumericVector<Real>* SystemBase::_saved_older
protectedinherited

Definition at line 501 of file SystemBase.h.

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

SubProblem& SystemBase::_subproblem
protectedinherited
TransientExplicitSystem& DisplacedSystem::_sys
protected

Definition at line 134 of file DisplacedSystem.h.

Referenced by getVector(), solutionOld(), solutionOlder(), sys(), and system().

SystemBase& DisplacedSystem::_undisplaced_system
protected
Moose::VarKindType SystemBase::_var_kind
protectedinherited

default kind of variables in this system

Definition at line 504 of file SystemBase.h.

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

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

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

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

Definition at line 506 of file SystemBase.h.

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

std::vector<VariableWarehouse> SystemBase::_vars
protectedinherited
std::vector<std::string> SystemBase::_vars_to_be_zeroed_on_jacobian
protectedinherited
std::vector<std::string> SystemBase::_vars_to_be_zeroed_on_residual
protectedinherited

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