DAInputPatchVar.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2 
3  DAFoam : Discrete Adjoint with OpenFOAM
4  Version : v4
5 
6  Description:
7  Child class for a selected variable at a select patch
8 
9 \*---------------------------------------------------------------------------*/
10 
11 #ifndef DAInputPatchVar_H
12 #define DAInputPatchVar_H
13 
14 #include "DAInput.H"
15 #include "addToRunTimeSelectionTable.H"
16 #include "mixedFvPatchFields.H"
17 
18 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
19 
20 namespace Foam
21 {
22 
23 /*---------------------------------------------------------------------------*\
24  Class DAInputPatchVar Declaration
25 \*---------------------------------------------------------------------------*/
26 
28  : public DAInput
29 {
30 
31 protected:
33  word varName_;
34 
36  word varType_;
37 
38 public:
39  TypeName("patchVar");
40  // Constructors
41 
42  //- Construct from components
44  const word inputName,
45  const word inputType,
46  fvMesh& mesh,
47  const DAOption& daOption,
48  const DAModel& daModel,
49  const DAIndex& daIndex);
50 
51  //- Destructor
52  virtual ~DAInputPatchVar()
53  {
54  }
55 
56  virtual void run(const scalarList& input);
57 
58  virtual label size()
59  {
60  if (varType_ == "scalar")
61  {
62  return 1;
63  }
64  else if (varType_ == "vector")
65  {
66  return 3;
67  }
68  else
69  {
70  FatalErrorIn("DAInputPatchVar::size") << "varType not valid" << exit(FatalError);
71  }
72  }
73 
74  virtual label distributed()
75  {
76  return 0;
77  }
78 };
79 
80 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
81 
82 } // End namespace Foam
83 
84 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85 
86 #endif
87 
88 // ************************************************************************* //
Foam::DAInputPatchVar::distributed
virtual label distributed()
Definition: DAInputPatchVar.H:74
Foam::DAInputPatchVar::DAInputPatchVar
DAInputPatchVar(const word inputName, const word inputType, fvMesh &mesh, const DAOption &daOption, const DAModel &daModel, const DAIndex &daIndex)
Definition: DAInputPatchVar.C:19
Foam::DAInputPatchVar::varType_
word varType_
the type of the variable can be either scalar or vector
Definition: DAInputPatchVar.H:36
Foam::DAOption
Definition: DAOption.H:29
mesh
fvMesh & mesh
Definition: createRefsHeatTransfer.H:4
Foam::DAInputPatchVar::TypeName
TypeName("patchVar")
Foam::DAInputPatchVar::size
virtual label size()
Definition: DAInputPatchVar.H:58
Foam::DAIndex
Definition: DAIndex.H:32
DAInput.H
Foam::DAInputPatchVar
Definition: DAInputPatchVar.H:27
Foam::DAModel
Definition: DAModel.H:57
Foam::DAInputPatchVar::varName_
word varName_
the name of the variable
Definition: DAInputPatchVar.H:33
Foam
Definition: checkGeometry.C:32
Foam::DAInput
Definition: DAInput.H:30
Foam::DAInputPatchVar::run
virtual void run(const scalarList &input)
Definition: DAInputPatchVar.C:44
Foam::DAInputPatchVar::~DAInputPatchVar
virtual ~DAInputPatchVar()
Definition: DAInputPatchVar.H:52