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-------------------------------------------------------------------------------
10License
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
34template<class Type>
36(
37 const faPatch& p,
39)
40:
41 faPatchField<Type>(p, iF, Field<Type>(0))
42{}
43
44
45template<class Type>
47(
49 const faPatch& p,
52)
53:
54 faPatchField<Type>(p, iF, Field<Type>(0))
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
69template<class Type>
71(
72 const faPatch& p,
74 const dictionary& dict
75)
76:
77 faPatchField<Type>(p, iF, Field<Type>(0))
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()
88 }
89}
90
91
92template<class Type>
94(
96)
97:
98 faPatchField<Type>
99 (
100 ptf.patch(),
101 ptf.internalField(),
102 Field<Type>(0)
103 )
104{}
105
106
107template<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
120template<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// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
static const char *const typeName
Typename for Field.
Definition: FieldBase.H:59
Generic templated field type.
Definition: Field.H:82
const word & name() const noexcept
Return the object name.
Definition: IOobjectI.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Author Zeljko Tukovic, FMENA Hrvoje Jasak, Wikki Ltd.
void updateCoeffs()
Update the coefficients associated with the patch field.
A FieldMapper for finite-area patch fields.
faPatchField<Type> abstract base class. This class gives a fat-interface to all derived classes cover...
Definition: faPatchField.H:82
const DimensionedField< Type, areaMesh > & internalField() const
Return dimensioned internal field reference.
Definition: faPatchField.H:292
Finite area patch class. Used for 2-D non-Euclidian finite area method.
Definition: faPatch.H:78
virtual label size() const
Patch size is the number of edge labels.
Definition: faPatch.H:311
volScalarField & p
dynamicFvMesh & mesh
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:473
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
IOerror FatalIOError
error FatalError
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
dictionary dict