FIBaseIncompressible.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2007-2020 PCOpt/NTUA
9  Copyright (C) 2013-2020 FOSS GP
10  Copyright (C) 2019 OpenCFD Ltd.
11 -------------------------------------------------------------------------------
12 License
13  This file is part of OpenFOAM.
14 
15  OpenFOAM is free software: you can redistribute it and/or modify it
16  under the terms of the GNU General Public License as published by
17  the Free Software Foundation, either version 3 of the License, or
18  (at your option) any later version.
19 
20  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23  for more details.
24 
25  You should have received a copy of the GNU General Public License
26  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27 
28 Class
29  Foam::incompressible::FIBase
30 
31 Description
32  Base class for Field Integral-based sensitivity derivatives
33 
34 SourceFiles
35  FIBase.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef FIBaseIncompressible_H
40 #define FIBaseIncompressible_H
41 
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 namespace incompressible
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class FIBase Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class FIBase
59 :
60  public shapeSensitivities
61 {
62 protected:
63 
64  // Protected data
65 
66  //- grad(dx/db) multiplier
68 
69  //- div(dx/db) multiplier
71 
72  //- dx/db multiplier coming from fvOptions
74 
75  //- Include distance variation in sens computation
76  bool includeDistance_;
77 
78  //- Adjoint eikonal equation solver
80 
81 
82  // Protected Member Functions
83 
84  //- Read options and update solver pointers if necessary
85  void read();
86 
87 
88 private:
89 
90  // Private Member Functions
91 
92  //- No copy construct
93  FIBase(const FIBase&) = delete;
94 
95  //- No copy assignment
96  void operator=(const FIBase&) = delete;
97 
98 
99 public:
100 
101  //- Runtime type information
102  TypeName("volumetricBSplinesFI");
103 
104 
105  // Constructors
106 
107  //- Construct from components
108  FIBase
109  (
110  const fvMesh& mesh,
111  const dictionary& dict,
112  incompressibleVars& primalVars,
113  incompressibleAdjointVars& adjointVars,
116  );
117 
118 
119  //- Destructor
120  virtual ~FIBase() = default;
121 
122 
123  // Member Functions
124 
125  //- Read dict if changed
126  virtual bool readDict(const dictionary& dict);
127 
128  //- Accumulate sensitivity integrands
129  virtual void accumulateIntegrand(const scalar dt);
130 
131  //- Assemble sensitivities
132  virtual void assembleSensitivities() = 0;
133 
134  //- Zero sensitivity fields and their constituents
135  virtual void clearSensitivities();
136 };
137 
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 } // End namespace incompressible
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
Foam::sensitivity::dict
const dictionary & dict() const
Return the construction dictionary.
Definition: sensitivity.C:57
Foam::incompressible::FIBase::optionsDxDbMult_
vectorField optionsDxDbMult_
dx/db multiplier coming from fvOptions
Definition: FIBaseIncompressible.H:72
Foam::objectiveManager
class for managing incompressible objective functions.
Definition: objectiveManager.H:54
Foam::incompressible::FIBase::clearSensitivities
virtual void clearSensitivities()
Zero sensitivity fields and their constituents.
Definition: FIBaseIncompressible.C:172
Foam::incompressible::FIBase::gradDxDbMult_
volTensorField gradDxDbMult_
grad(dx/db) multiplier
Definition: FIBaseIncompressible.H:66
Foam::incompressible::FIBase::read
void read()
Read options and update solver pointers if necessary.
Definition: FIBaseIncompressible.C:48
Foam::incompressible::FIBase::divDxDbMult_
scalarField divDxDbMult_
div(dx/db) multiplier
Definition: FIBaseIncompressible.H:69
Foam::incompressibleAdjointVars
Class including all adjoint fields for incompressible flows.
Definition: incompressibleAdjointVars.H:52
Foam::fv::optionAdjointList
Definition: fvOptionAdjointList.H:59
Foam::incompressible::FIBase::eikonalSolver_
autoPtr< adjointEikonalSolver > eikonalSolver_
Adjoint eikonal equation solver.
Definition: FIBaseIncompressible.H:78
Foam::incompressible::FIBase::assembleSensitivities
virtual void assembleSensitivities()=0
Assemble sensitivities.
Foam::incompressible::shapeSensitivities
Definition: shapeSensitivitiesIncompressible.H:55
Foam::Field< scalar >
Foam::incompressible::FIBase::readDict
virtual bool readDict(const dictionary &dict)
Read dict if changed.
Definition: FIBaseIncompressible.C:121
Foam::incompressible::FIBase::TypeName
TypeName("volumetricBSplinesFI")
Runtime type information.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::incompressible::FIBase::~FIBase
virtual ~FIBase()=default
Destructor.
shapeSensitivitiesIncompressible.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::incompressible::FIBase
Base class for Field Integral-based sensitivity derivatives.
Definition: FIBaseIncompressible.H:57
adjointSensitivityIncompressible.H
Foam::incompressible::FIBase::includeDistance_
bool includeDistance_
Include distance variation in sens computation.
Definition: FIBaseIncompressible.H:75
adjointEikonalSolverIncompressible.H
Foam::incompressible::FIBase::accumulateIntegrand
virtual void accumulateIntegrand(const scalar dt)
Accumulate sensitivity integrands.
Definition: FIBaseIncompressible.C:137
Foam::GeometricField< tensor, fvPatchField, volMesh >
fvOptionsAdjoint
fv::IOoptionListAdjoint fvOptionsAdjoint(mesh)
Foam::incompressibleVars
Base class for solution control classes.
Definition: incompressibleVars.H:54