boundaryAdjointContribution.C
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-2019 PCOpt/NTUA
9 Copyright (C) 2013-2019 FOSS GP
10 Copyright (C) 2019-2021 OpenCFD Ltd.
11-------------------------------------------------------------------------------
12License
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\*---------------------------------------------------------------------------*/
29
31
32// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33
34namespace Foam
35{
36
37// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
38
41
42// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
43
45(
46 const word& managerName,
47 const word& adjointSolverName,
48 const word& simulationType,
49 const fvPatch& patch
50)
51:
52 patch_(patch)
53{}
54
55
56// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
57
59(
60 const word& managerName,
61 const word& adjointSolverName,
62 const word& simulationType,
63 const fvPatch& patch
64)
65{
66 auto* ctorPtr = dictionaryConstructorTable(simulationType);
67
68 if (!ctorPtr)
69 {
71 (
72 "boundaryAdjointContribution",
73 simulationType,
74 *dictionaryConstructorTablePtr_
75 ) << exit(FatalError);
76 }
77
78 return
80 (
81 ctorPtr
82 (
83 managerName,
85 simulationType,
86 patch
87 )
88 );
89}
90
91
92// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
93
95{
97}
98
99
101{
103}
104
105
107{
109}
110
111
113{
115}
116
117
119{
121}
122
123
125{
127}
128
129
131{
133}
134
135
137{
139}
140
141
142// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143
144} // End namespace Foam
145
146// ************************************************************************* //
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Definition: Time.C:717
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Abstract base class for computing contributions of the objective functions to the adjoint boundary co...
virtual tmp< scalarField > TMVariable2Diffusion()
virtual tmp< scalarField > adjointTMVariable1Source()
virtual tmp< scalarField > adjointTMVariable2Source()
virtual tmp< scalarField > TMVariable1Diffusion()
virtual const word adjointSolverName() const =0
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
virtual label size() const
Return size.
Definition: fvPatch.H:185
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
#define FatalErrorInLookup(lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalError.
Definition: error.H:457
Namespace for OpenFOAM.
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
error FatalError
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.