ENH: settings.(c)sh: added checking on SGIMPI MPI_ROOT
[OpenFOAM-2.0.x.git] / etc / codeTemplates / dynamicCode / fixedValueFvPatchFieldTemplate.C
bloba8b6a6da67beb930f1f330757cdedb10dcdf9d6a
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by
13     the Free Software Foundation, either version 3 of the License, or
14     (at your option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "fixedValueFvPatchFieldTemplate.H"
27 #include "addToRunTimeSelectionTable.H"
28 #include "fvPatchFieldMapper.H"
29 #include "volFields.H"
30 #include "surfaceFields.H"
31 //{{{ begin codeInclude
32 ${codeInclude}
33 //}}} end codeInclude
36 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
38 namespace Foam
41 // * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
43 //{{{ begin localCode
44 ${localCode}
45 //}}} end localCode
48 // * * * * * * * * * * * * * * * Global Functions  * * * * * * * * * * * * * //
50 extern "C"
52     // dynamicCode:
53     // SHA1 = ${SHA1sum}
54     //
55     // unique function name that can be checked if the correct library version
56     // has been loaded
57     void ${typeName}_${SHA1sum}(bool load)
58     {
59         if (load)
60         {
61             // code that can be explicitly executed after loading
62         }
63         else
64         {
65             // code that can be explicitly executed before unloading
66         }
67     }
70 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
72 makeRemovablePatchTypeField
74     fvPatch${FieldType},
75     ${typeName}FixedValueFvPatch${FieldType}
79 const char* const ${typeName}FixedValueFvPatch${FieldType}::SHA1sum =
80     "${SHA1sum}";
83 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
85 ${typeName}FixedValueFvPatch${FieldType}::
86 ${typeName}FixedValueFvPatch${FieldType}
88     const fvPatch& p,
89     const DimensionedField<${TemplateType}, volMesh>& iF
92     fixedValueFvPatchField<${TemplateType}>(p, iF)
94     if (${verbose:-false})
95     {
96         Info<<"construct ${typeName} sha1: ${SHA1sum}"
97             " from patch/DimensionedField\n";
98     }
102 ${typeName}FixedValueFvPatch${FieldType}::
103 ${typeName}FixedValueFvPatch${FieldType}
105     const ${typeName}FixedValueFvPatch${FieldType}& ptf,
106     const fvPatch& p,
107     const DimensionedField<${TemplateType}, volMesh>& iF,
108     const fvPatchFieldMapper& mapper
111     fixedValueFvPatchField<${TemplateType}>(ptf, p, iF, mapper)
113     if (${verbose:-false})
114     {
115         Info<<"construct ${typeName} sha1: ${SHA1sum}"
116             " from patch/DimensionedField/mapper\n";
117     }
121 ${typeName}FixedValueFvPatch${FieldType}::
122 ${typeName}FixedValueFvPatch${FieldType}
124     const fvPatch& p,
125     const DimensionedField<${TemplateType}, volMesh>& iF,
126     const dictionary& dict
129     fixedValueFvPatchField<${TemplateType}>(p, iF, dict)
131     if (${verbose:-false})
132     {
133         Info<<"construct ${typeName} sha1: ${SHA1sum}"
134             " from patch/dictionary\n";
135     }
139 ${typeName}FixedValueFvPatch${FieldType}::
140 ${typeName}FixedValueFvPatch${FieldType}
142     const ${typeName}FixedValueFvPatch${FieldType}& ptf
145     fixedValueFvPatchField<${TemplateType}>(ptf)
147     if (${verbose:-false})
148     {
149         Info<<"construct ${typeName} sha1: ${SHA1sum}"
150             " as copy\n";
151     }
155 ${typeName}FixedValueFvPatch${FieldType}::
156 ${typeName}FixedValueFvPatch${FieldType}
158     const ${typeName}FixedValueFvPatch${FieldType}& ptf,
159     const DimensionedField<${TemplateType}, volMesh>& iF
162     fixedValueFvPatchField<${TemplateType}>(ptf, iF)
164     if (${verbose:-false})
165     {
166         Info<<"construct ${typeName} sha1: ${SHA1sum} "
167             "as copy/DimensionedField\n";
168     }
172 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
174 ${typeName}FixedValueFvPatch${FieldType}::
175 ~${typeName}FixedValueFvPatch${FieldType}()
177     if (${verbose:-false})
178     {
179         Info<<"destroy ${typeName} sha1: ${SHA1sum}\n";
180     }
184 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
186 void ${typeName}FixedValueFvPatch${FieldType}::updateCoeffs()
188     if (this->updated())
189     {
190         return;
191     }
193     if (${verbose:-false})
194     {
195         Info<<"updateCoeffs ${typeName} sha1: ${SHA1sum}\n";
196     }
198 //{{{ begin code
199     ${code}
200 //}}} end code
202     this->fixedValueFvPatchField<${TemplateType}>::updateCoeffs();
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 } // End namespace Foam
210 // ************************************************************************* //