Loading...
Searching...
No Matches
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-2023 PCOpt/NTUA
9 Copyright (C) 2013-2023 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#include "fvPatchFieldsFwd.H"
32
33// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35namespace Foam
36{
37
38// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
39
40defineTypeNameAndDebug(boundaryAdjointContribution, 0);
41defineRunTimeSelectionTable(boundaryAdjointContribution, dictionary);
42
43// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44
45boundaryAdjointContribution::boundaryAdjointContribution
46(
47 const word& managerName,
49 const word& simulationType,
50 const fvPatch& patch
51)
53 patch_(patch)
54{}
55
56
57// * * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * //
58
60(
61 const word& managerName,
62 const word& adjointSolverName,
63 const word& simulationType,
64 const fvPatch& patch
65)
66{
67 auto* ctorPtr = dictionaryConstructorTable(simulationType);
68
69 if (!ctorPtr)
70 {
72 (
73 "boundaryAdjointContribution",
74 simulationType,
75 *dictionaryConstructorTablePtr_
76 ) << exit(FatalError);
77 }
78
79 return
80 autoPtr<boundaryAdjointContribution>
81 (
82 ctorPtr
83 (
84 managerName,
86 simulationType,
87 patch
88 )
89 );
90}
91
92
93// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
98}
99
104}
105
110}
111
116}
117
122}
123
128}
129
134}
135
136
142
145{
147 return nullptr;
148}
149
150// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151
152} // End namespace Foam
153
154// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
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
virtual tmp< fvPatchScalarField > turbulentDiffusivity() const
static autoPtr< boundaryAdjointContribution > New(const word &managerName, const word &adjointSolverName, const word &simulationType, const fvPatch &patch)
Return a reference to the selected turbulence model.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
A class for managing temporary objects.
Definition tmp.H:75
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Definition tmp.H:215
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
#define FatalErrorInLookup(lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalError.
Definition error.H:607
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition error.H:688
Namespace for OpenFOAM.
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition errorManip.H:125
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.