FreeFOAM The Cross-Platform CFD Toolkit
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) 1991-2010 OpenCFD Ltd.
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"
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  if (debug)
142  {
143  if
144  (
145  this->dimensionedInternalField().mesh().nCells() > 0
146  && (
147  this->patch().patch().size()
148  % this->dimensionedInternalField().mesh().nCells()
149  )
150  )
151  {
152  WarningIn("emptyFvPatchField<Type>::updateCoeffs()")
153  << "This mesh contains patches of type empty but is not 1D or 2D\n"
154  " by virtue of the fact that the number of faces of this\n"
155  " empty patch is not divisible by the number of cells."
156  << endl;
157  }
158  }
159 }
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace Foam
165 
166 // ************************ vim: set sw=4 sts=4 et: ************************ //