DATimeOp.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v4
5 
6  Description:
7  Time operation for functions
8 
9 \*---------------------------------------------------------------------------*/
10 
11 #ifndef DATimeOp_H
12 #define DATimeOp_H
13 
14 #include "runTimeSelectionTables.H"
15 #include "fvOptions.H"
16 #include "DAOption.H"
17 
18 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
19 
20 namespace Foam
21 {
22 
23 /*---------------------------------------------------------------------------*\
24  Class DATimeOp Declaration
25 \*---------------------------------------------------------------------------*/
26 
27 class DATimeOp
28 {
29 
30 private:
32  DATimeOp(const DATimeOp&);
33 
35  void operator=(const DATimeOp&);
36 
37 protected:
39  const word timeOpType_;
40 
42  const dictionary options_;
43 
44 public:
46  TypeName("DATimeOp");
47 
48  // Declare run-time constructor selection table
50  autoPtr,
51  DATimeOp,
52  dictionary,
53  (
54  const word timeOpType,
55  const dictionary options),
56  (
57  timeOpType,
58  options));
59 
60  // Constructors
61 
62  //- Construct from components
63  DATimeOp(
64  const word timeOpType,
65  const dictionary options);
66 
67  // Selectors
68 
69  //- Return a reference to the selected model
70  static autoPtr<DATimeOp> New(
71  const word timeOpType,
72  const dictionary options);
73 
74  //- Destructor
75  virtual ~DATimeOp()
76  {
77  }
78 
80  virtual scalar compute(
81  const scalarList& valList,
82  const label iStart,
83  const label iEnd) = 0;
84 
86  virtual scalar dFScaling(
87  const scalarList& valList,
88  const label iStart,
89  const label iEnd,
90  const label timeIdx) = 0;
91 };
92 
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94 
95 } // End namespace Foam
96 
97 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
98 
99 #endif
100 
101 // ************************************************************************* //
DAOption.H
Foam::DATimeOp::options_
const dictionary options_
a dictionary option from DAFunction
Definition: DATimeOp.H:42
Foam::DATimeOp::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, DATimeOp, dictionary,(const word timeOpType, const dictionary options),(timeOpType, options))
Foam::DATimeOp::~DATimeOp
virtual ~DATimeOp()
Definition: DATimeOp.H:75
Foam::DATimeOp::TypeName
TypeName("DATimeOp")
Runtime type information.
Foam::DATimeOp
Definition: DATimeOp.H:27
Foam::DATimeOp::compute
virtual scalar compute(const scalarList &valList, const label iStart, const label iEnd)=0
compute the timeOp value based on valList
Foam::DATimeOp::dFScaling
virtual scalar dFScaling(const scalarList &valList, const label iStart, const label iEnd, const label timeIdx)=0
compute the scaling factor for dF/d? calculation.
Foam
Definition: checkGeometry.C:32
Foam::DATimeOp::New
static autoPtr< DATimeOp > New(const word timeOpType, const dictionary options)
Definition: DATimeOp.C:32
Foam::DATimeOp::timeOpType_
const word timeOpType_
type of the timeOp
Definition: DATimeOp.H:39