www.mooseframework.org
DisplacedSystem.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef DISPLACEDSYSTEM_H
16 #define DISPLACEDSYSTEM_H
17 
18 #include "SystemBase.h"
19 
20 #include "libmesh/transient_system.h"
21 #include "libmesh/explicit_system.h"
22 
23 // Forward declarations
24 class DisplacedProblem;
25 
27 {
28 public:
30  SystemBase & undisplaced_system,
31  const std::string & name,
32  Moose::VarKindType var_kind);
33  virtual ~DisplacedSystem();
34 
35  virtual void init() override;
36 
37  virtual bool hasResidualVector(Moose::KernelType type) const override
38  {
40  }
41 
42  virtual NumericVector<Number> & residualVector(Moose::KernelType type) override
43  {
45  }
46 
47  virtual NumericVector<Number> & getVector(const std::string & name) override;
48 
49  virtual NumericVector<Number> & serializedSolution() override
50  {
52  }
53 
54  virtual const NumericVector<Number> *& currentSolution() override
55  {
57  }
58 
59  virtual NumericVector<Number> & solution() override { return _undisplaced_system.solution(); }
60 
61  virtual NumericVector<Number> & solutionUDot() override
62  {
64  }
65  virtual Number & duDotDu() override { return _undisplaced_system.duDotDu(); }
66 
71  virtual NumericVector<Number> & residualCopy() override
72  {
74  }
75  virtual NumericVector<Number> & residualGhosted() override
76  {
78  }
79 
80  virtual void augmentSendList(std::vector<dof_id_type> & send_list) override
81  {
83  }
84 
89  virtual void augmentSparsity(SparsityPattern::Graph & /*sparsity*/,
90  std::vector<dof_id_type> & /*n_nz*/,
91  std::vector<dof_id_type> & /*n_oz*/) override
92  {
93  }
94 
99  virtual void addVariableToZeroOnResidual(std::string var_name) override
100  {
102  }
103 
108  virtual void addVariableToZeroOnJacobian(std::string var_name) override
109  {
111  }
112 
116  virtual void zeroVariables(std::vector<std::string> & vars_to_be_zeroed) override
117  {
118  _undisplaced_system.zeroVariables(vars_to_be_zeroed);
119  }
120 
121  virtual NumericVector<Number> & solutionOld() override { return *_sys.old_local_solution; }
122 
123  virtual NumericVector<Number> & solutionOlder() override { return *_sys.older_local_solution; }
124 
125  virtual NumericVector<Number> * solutionPreviousNewton() override { return NULL; }
126 
127  virtual TransientExplicitSystem & sys() { return _sys; }
128 
129  virtual System & system() override { return _sys; }
130  virtual const System & system() const override { return _sys; }
131 
132 protected:
134  TransientExplicitSystem & _sys;
135 };
136 
137 #endif /* DISPLACEDSYSTEM_H */
DisplacedSystem(DisplacedProblem &problem, SystemBase &undisplaced_system, const std::string &name, Moose::VarKindType var_kind)
virtual NumericVector< Number > & solutionOlder() override
TransientExplicitSystem & _sys
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&#39;t have a matrix! All sparsity pattern modi...
virtual NumericVector< Number > & residualCopy() override
Return the residual copy from the NonlinearSystem.
virtual const System & system() const override
virtual NumericVector< Number > & residualCopy()
Definition: SystemBase.h:179
virtual TransientExplicitSystem & sys()
virtual void zeroVariables(std::vector< std::string > &vars_to_be_zeroed) override
Zero out the solution for the list of variables passed in.
virtual NumericVector< Number > & solution() override
virtual Number & duDotDu() override
virtual const std::string & name()
Definition: SystemBase.h:453
Base class for a system (of equations)
Definition: SystemBase.h:91
virtual const NumericVector< Number > *& currentSolution() override
The solution vector that is currently being operated on.
virtual NumericVector< Number > & solutionUDot() override
virtual Number & duDotDu()
Definition: SystemBase.h:156
virtual NumericVector< Number > & residualVector(Moose::KernelType type) override
virtual NumericVector< Number > & solutionUDot()
Definition: SystemBase.h:157
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.
virtual NumericVector< Number > * solutionPreviousNewton() override
SystemBase & _undisplaced_system
VarKindType
Framework-wide stuff.
Definition: MooseTypes.h:156
virtual void addVariableToZeroOnResidual(std::string var_name) override
Adds this variable to the list of variables to be zeroed during each residual evaluation.
KernelType
Definition: MooseTypes.h:162
virtual NumericVector< Number > & serializedSolution()=0
Returns a reference to a serialized version of the solution vector for this subproblem.
virtual bool hasResidualVector(Moose::KernelType type) const override
MatType type
virtual NumericVector< Number > & residualVector(Moose::KernelType)
Definition: SystemBase.h:158
virtual void addVariableToZeroOnJacobian(std::string var_name) override
Adds this variable to the list of variables to be zeroed during each jacobian evaluation.
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
virtual NumericVector< Number > & residualGhosted() override
virtual System & system() override
Get the reference to the libMesh system.
virtual ~DisplacedSystem()
virtual NumericVector< Number > & solution()=0
virtual NumericVector< Number > & getVector(const std::string &name) override
Get a raw NumericVector.
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 bool hasResidualVector(Moose::KernelType) const
Definition: SystemBase.h:159
virtual void init() override
Initialize the 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 NumericVector< Number > & residualGhosted()
Definition: SystemBase.h:183
virtual NumericVector< Number > & serializedSolution() override
Returns a reference to a serialized version of the solution vector for this subproblem.
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
virtual NumericVector< Number > & solutionOld() override
virtual const NumericVector< Number > *& currentSolution()=0
The solution vector that is currently being operated on.