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 -------------------------------------------------------------------------------
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 \*---------------------------------------------------------------------------*/
29 
31 #include "fvPatchFieldsFwd.H"
32 
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
34 
35 namespace Foam
36 {
37 
38 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
39 
42 
43 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
44 
45 boundaryAdjointContribution::boundaryAdjointContribution
46 (
47  const word& managerName,
48  const word& adjointSolverName,
49  const word& simulationType,
50  const fvPatch& patch
51 )
52 :
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 * * * * * * * * * * * * * //
94 
96 {
98 }
99 
102 {
104 }
105 
108 {
110 }
111 
114 {
116 }
117 
120 {
122 }
123 
126 {
128 }
129 
132 {
134 }
135 
136 
138 {
140 }
141 
142 
145 {
147  return tmp<fvPatchScalarField>(nullptr);
148 }
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // ************************************************************************* //
virtual const word adjointSolverName() const =0
virtual tmp< fvPatchScalarField > turbulentDiffusivity() const
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
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 finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
#define FatalErrorInLookup(lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalError.
Definition: error.H:605
A class for handling words, derived from Foam::string.
Definition: word.H:63
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
Definition: tmp.H:206
virtual tmp< scalarField > adjointTMVariable2Source()
virtual tmp< scalarField > adjointTMVariable1Source()
Abstract base class for computing contributions of the objective functions to the adjoint boundary co...
virtual label size() const
Patch size is the number of faces, but can be overloaded.
Definition: fvPatch.H:234
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
defineTypeNameAndDebug(combustionModel, 0)
virtual tmp< scalarField > TMVariable2Diffusion()
const std::string patch
OpenFOAM patch number as a std::string.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
A class for managing temporary objects.
Definition: HashPtrTable.H:50
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:686
virtual tmp< scalarField > TMVariable1Diffusion()
Namespace for OpenFOAM.
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:127