emptyFaPatchField.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) 2016-2017 Wikki Ltd
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "emptyFaPatchField.H"
29 #include "faPatchFieldMapper.H"
30 #include "areaFaMesh.H"
31 
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
33 
34 template<class Type>
36 (
37  const faPatch& p,
39 )
40 :
42 {}
43 
44 
45 template<class Type>
47 (
49  const faPatch& p,
51  const faPatchFieldMapper&
52 )
53 :
55 {
56  if (!isType<emptyFaPatch>(p))
57  {
59  << "\n patch type '" << p.type()
60  << "' not constraint type '" << typeName << "'"
61  << "\n for patch " << p.name()
62  << " of field " << this->internalField().name()
63  << " in file " << this->internalField().objectPath()
64  << exit(FatalError);
65  }
66 }
67 
68 
69 template<class Type>
71 (
72  const faPatch& p,
74  const dictionary& dict
75 )
76 :
78 {
79  if (!isA<emptyFaPatch>(p))
80  {
82  << "\n patch type '" << p.type()
83  << "' not constraint type '" << typeName << "'"
84  << "\n for patch " << p.name()
85  << " of field " << this->internalField().name()
86  << " in file " << this->internalField().objectPath()
87  << exit(FatalIOError);
88  }
89 }
90 
91 
92 template<class Type>
94 (
95  const emptyFaPatchField<Type>& ptf
96 )
97 :
99  (
100  ptf.patch(),
101  ptf.internalField(),
102  Field<Type>(0)
103  )
104 {}
105 
106 
107 template<class Type>
109 (
110  const emptyFaPatchField<Type>& ptf,
112 )
113 :
114  faPatchField<Type>(ptf.patch(), iF, Field<Type>(0))
115 {}
116 
117 
118 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
119 
120 template<class Type>
122 {
123  if (this->internalField().mesh().nFaces())
124  {
125  if
126  (
127  this->patch().faPatch::size()
128  % this->internalField().mesh().nFaces()
129  )
130  {
132  << "This mesh contains patches of type empty but is "
133  << "not 1D or 2D by virtue of the fact that the number of "
134  << "faces of this empty patch is not divisible by the number "
135  << "of cells."
136  << exit(FatalError);
137  }
138  }
139 }
140 
141 
142 // ************************************************************************* //
Foam::faPatchField::internalField
const DimensionedField< Type, areaMesh > & internalField() const
Return dimensioned internal field reference.
Definition: faPatchField.H:285
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::faPatchField
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
Definition: areaFieldsFwd.H:50
Foam::emptyFaPatchField::updateCoeffs
void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: emptyFaPatchField.C:121
Foam::emptyFaPatchField
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
Definition: emptyFaPatchField.H:56
Foam::FatalIOError
IOerror FatalIOError
Foam::faPatchFieldMapper
Definition: faPatchFieldMapper.H:44
faPatchFieldMapper.H
emptyFaPatchField.H
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::emptyFaPatchField::emptyFaPatchField
emptyFaPatchField(const faPatch &, const DimensionedField< Type, areaMesh > &)
Construct from patch and internal field.
Definition: emptyFaPatchField.C:36
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
areaFaMesh.H
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
FatalIOErrorInFunction
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:473
Foam::faPatch
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition: faPatch.H:69
Foam::faPatchField::patch
const faPatch & patch() const
Return patch.
Definition: faPatchField.H:279
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54