DAResidual.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v3
5 
6  Description:
7  Compute the residual for a given solver
8 
9 \*---------------------------------------------------------------------------*/
10 
11 #ifndef DAResidual_H
12 #define DAResidual_H
13 
14 #include "runTimeSelectionTables.H"
15 #include "fvOptions.H"
16 #include "surfaceFields.H"
17 #include "DAOption.H"
18 #include "DAModel.H"
19 #include "DAMacroFunctions.H"
20 #include "DAUtility.H"
21 #include "DAIndex.H"
22 #include "DAField.H"
23 #include "DAFvSource.H"
24 #include "IOMRFZoneListDF.H"
25 
26 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
27 
28 namespace Foam
29 {
30 
31 /*---------------------------------------------------------------------------*\
32  Class DAResidual Declaration
33 \*---------------------------------------------------------------------------*/
34 
36 {
37 
38 private:
40  DAResidual(const DAResidual&);
41 
43  void operator=(const DAResidual&);
44 
45 protected:
47  const fvMesh& mesh_;
48 
51 
53  const DAModel& daModel_;
54 
56  const DAIndex& daIndex_;
57 
60 
61 public:
63  TypeName("DAResidual");
64 
65  // Declare run-time constructor selection table
67  autoPtr,
68  DAResidual,
69  dictionary,
70  (const word modelType,
71  const fvMesh& mesh,
72  const DAOption& daOption,
73  const DAModel& daModel,
74  const DAIndex& daIndex),
75  (modelType, mesh, daOption, daModel, daIndex));
76 
77  // Constructors
78 
79  //- Construct from components
80  DAResidual(
81  const word modelType,
82  const fvMesh& mesh,
83  const DAOption& daOption,
84  const DAModel& daModel,
85  const DAIndex& daIndex);
86 
87  // Selectors
88 
89  //- Return a reference to the selected model
90  static autoPtr<DAResidual> New(
91  const word modelType,
92  const fvMesh& mesh,
93  const DAOption& daOption,
94  const DAModel& daModel,
95  const DAIndex& daIndex);
96 
97  //- Destructor
98  virtual ~DAResidual()
99  {
100  }
101 
102  // Members
103 
105  virtual void clear() = 0;
106 
108  virtual void calcResiduals(const dictionary& options) = 0;
109 
111  virtual void updateIntermediateVariables() = 0;
112 
114  virtual void correctBoundaryConditions() = 0;
115 
117  void masterFunction(
118  const dictionary& options,
119  const Vec xvVec,
120  const Vec wVec,
121  Vec resVec);
122 };
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace Foam
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #endif
131 
132 // ************************************************************************* //
Foam::DAResidual::correctBoundaryConditions
virtual void correctBoundaryConditions()=0
update the boundary condition for all the states in the selected solver
DAOption.H
Foam::DAResidual::mesh_
const fvMesh & mesh_
fvMesh
Definition: DAResidual.H:47
DAIndex.H
IOMRFZoneListDF.H
Foam::DAOption
Definition: DAOption.H:29
DAUtility.H
Foam::DAResidual::updateIntermediateVariables
virtual void updateIntermediateVariables()=0
update any intermdiate variables that are dependent on state variables and are used in calcResiduals
daOption
DAOption daOption(mesh, pyOptions_)
DAFvSource.H
DAMacroFunctions.H
Foam::DAResidual::daIndex_
const DAIndex & daIndex_
DAIndex.
Definition: DAResidual.H:56
Foam::DAResidual::daField_
DAField daField_
DAField object.
Definition: DAResidual.H:59
Foam::DAResidual::clear
virtual void clear()=0
clear the members
Foam::DAResidual::daOption_
const DAOption & daOption_
DAOption object.
Definition: DAResidual.H:50
DAModel.H
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
Foam::DAIndex
Definition: DAIndex.H:32
Foam::DAResidual::New
static autoPtr< DAResidual > New(const word modelType, const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex)
Definition: DAResidual.C:38
Foam::DAField
Definition: DAField.H:36
Foam::DAModel
Definition: DAModel.H:59
Foam::DAResidual::~DAResidual
virtual ~DAResidual()
Definition: DAResidual.H:98
Foam
Definition: multiFreqScalarFvPatchField.C:144
Foam::DAResidual::TypeName
TypeName("DAResidual")
Runtime type information.
Foam::DAResidual
Definition: DAResidual.H:35
Foam::DAResidual::daModel_
const DAModel & daModel_
DAModel object.
Definition: DAResidual.H:53
Foam::DAResidual::masterFunction
void masterFunction(const dictionary &options, const Vec xvVec, const Vec wVec, Vec resVec)
the master function that compute the residual vector given the state and point vectors
Definition: DAResidual.C:81
Foam::DAResidual::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, DAResidual, dictionary,(const word modelType, const fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex),(modelType, mesh, daOption, daModel, daIndex))
daModel
DAModel daModel(mesh, daOption)
daIndex
DAIndex daIndex(mesh, daOption, daModel)
DAField.H
Foam::DAResidual::calcResiduals
virtual void calcResiduals(const dictionary &options)=0
compute residuals