emptyFvPatchField.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 | Copyright (C) 2011 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "emptyFvPatchField.H"
27 #include "fvPatchFieldMapper.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 
34 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35 
36 template<class Type>
38 (
39  const fvPatch& p,
41 )
42 :
44 {}
45 
46 
47 template<class Type>
49 (
51  const fvPatch& p,
53  const fvPatchFieldMapper&
54 )
55 :
57 {
58  if (!isType<emptyFvPatch>(p))
59  {
61  (
62  "emptyFvPatchField<Type>::emptyFvPatchField\n"
63  "(\n"
64  " const emptyFvPatchField<Type>&,\n"
65  " const fvPatch& p,\n"
66  " const DimensionedField<Type, volMesh>& iF,\n"
67  " const fvPatchFieldMapper& mapper\n"
68  ")\n"
69  ) << "\n patch type '" << p.type()
70  << "' not constraint type '" << typeName << "'"
71  << "\n for patch " << p.name()
72  << " of field " << this->dimensionedInternalField().name()
73  << " in file " << this->dimensionedInternalField().objectPath()
74  << exit(FatalIOError);
75  }
76 }
77 
78 
79 template<class Type>
81 (
82  const fvPatch& p,
84  const dictionary& dict
85 )
86 :
88 {
89  if (!isType<emptyFvPatch>(p))
90  {
92  (
93  "emptyFvPatchField<Type>::emptyFvPatchField\n"
94  "(\n"
95  " const fvPatch& p,\n"
96  " const Field<Type>& field,\n"
97  " const dictionary& dict\n"
98  ")\n",
99  dict
100  ) << "\n patch type '" << p.type()
101  << "' not constraint type '" << typeName << "'"
102  << "\n for patch " << p.name()
103  << " of field " << this->dimensionedInternalField().name()
104  << " in file " << this->dimensionedInternalField().objectPath()
105  << exit(FatalIOError);
106  }
107 }
108 
109 
110 template<class Type>
112 (
113  const emptyFvPatchField<Type>& ptf
114 )
115 :
117  (
118  ptf.patch(),
120  Field<Type>(0)
121  )
122 {}
123 
124 
125 template<class Type>
127 (
128  const emptyFvPatchField<Type>& ptf,
130 )
131 :
132  fvPatchField<Type>(ptf.patch(), iF, Field<Type>(0))
133 {}
134 
135 
136 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
137 
138 template<class Type>
140 {
141  //- Check moved to checkMesh. Test here breaks down if multiple empty
142  // patches.
143  //if
144  //(
145  // this->patch().patch().size()
146  // % this->dimensionedInternalField().mesh().nCells()
147  //)
148  //{
149  // FatalErrorIn("emptyFvPatchField<Type>::updateCoeffs()")
150  // << "This mesh contains patches of type empty but is not"
151  // << "1D or 2D\n"
152  // " by virtue of the fact that the number of faces of this\n"
153  // " empty patch is not divisible by the number of cells."
154  // << exit(FatalError);
155  //}
156 }
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Foam
162 
163 // ************************************************************************* //
This boundary condition provides an &#39;empty&#39; condition for reduced dimensions cases, i.e. 1- and 2-D geometries. Apply this condition to patches whose normal is aligned to geometric directions that do not constitue solution directions.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
emptyFvPatchField(const fvPatch &, const DimensionedField< Type, volMesh > &)
Construct from patch and internal field.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
Foam::fvPatchFieldMapper.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
dictionary dict
void updateCoeffs()
Update the coefficients associated with the patch field.
IOerror FatalIOError
volScalarField & p
Definition: createFields.H:51
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:65
Pre-declare SubField and related Field type.
Definition: Field.H:57
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
Definition: error.H:314
rDeltaT dimensionedInternalField()
const DimensionedField< Type, volMesh > & dimensionedInternalField() const
Return dimensioned internal field reference.
Definition: fvPatchField.H:307
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
const fvPatch & patch() const
Return patch.
Definition: fvPatchField.H:300
#define FatalIOErrorIn(functionName, ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:325