nonConformalPolyFacesFvsPatchLabelField.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2023-2024 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 
27 #include "fieldMapper.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
34 (
35  const fvPatch& p,
37 )
38 :
40 {
41  if (p.size())
42  {
44  << "Default construction of a " << typeName << " field should "
45  << "only occur on a patch with no faces"
46  << exit(FatalError);
47  }
48 }
49 
50 
53 (
54  const fvPatch& p,
56  const dictionary& dict
57 )
58 :
59  fvsPatchLabelField(p, iF, dict, false)
60 {
62  (
63  labelField("value", dict, dict.lookup<label>("size"))
64  );
65 }
66 
67 
70 (
72  const fvPatch& p,
74  const fieldMapper& mapper
75 )
76 :
77  fvsPatchLabelField(ptf, p, iF, mapper)
78 {
79  if (p.size())
80  {
82  << "Mapped construction of a " << typeName << " field should "
83  << "only occur on a patch with no faces"
84  << exit(FatalError);
85  }
86 }
87 
88 
91 (
94 )
95 :
96  fvsPatchLabelField(ptf, iF)
97 {}
98 
99 
100 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 
103 {
105  writeEntry(os, "size", this->size());
106  writeEntry(os, "value", *this);
107 }
108 
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 namespace Foam
113 {
115  (
118  );
119 }
120 
121 
122 // ************************************************************************* //
Macros for easy insertion into run-time selection tables.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
friend Ostream & operator(Ostream &, const Field< label > &)
static const char *const typeName
Definition: Field.H:106
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Abstract base class for field mapping.
Definition: fieldMapper.H:48
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Definition: fvsPatchField.H:83
virtual void write(Ostream &) const
Write.
nonConformalPolyFacesFvsPatchLabelField(const fvPatch &, const DimensionedField< label, surfaceMesh > &)
Construct from patch and internal field.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:334
Namespace for OpenFOAM.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
void writeEntry(Ostream &os, const HashTable< T, Key, Hash > &ht)
Definition: HashTableIO.C:96
Field< label > labelField
Specialisation of Field<T> for label.
Definition: labelField.H:49
error FatalError
makeFvsPatchTypeField(fvsPatchLabelField, nonConformalMappedPolyFacesFvsPatchLabelField)
dictionary dict
volScalarField & p