cyclicPointPatchField.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) 2011-2023 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 "cyclicPointPatchField.H"
27 #include "Swap.H"
28 #include "transformField.H"
29 #include "pointFields.H"
30 
31 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32 
33 template<class Type>
35 (
36  const pointPatch& p,
38 )
39 :
40  coupledPointPatchField<Type>(p, iF),
41  cyclicPatch_(refCast<const cyclicPointPatch>(p))
42 {}
43 
44 
45 template<class Type>
47 (
48  const pointPatch& p,
50  const dictionary& dict
51 )
52 :
53  coupledPointPatchField<Type>(p, iF, dict),
54  cyclicPatch_(refCast<const cyclicPointPatch>(p))
55 {
56  if (!isType<cyclicPointPatch>(p))
57  {
59  (
60  dict
61  ) << "patch " << this->patch().index() << " not cyclic type. "
62  << "Patch type = " << p.type()
63  << exit(FatalIOError);
64  }
65 }
66 
67 
68 template<class Type>
70 (
71  const cyclicPointPatchField<Type>& ptf,
72  const pointPatch& p,
74  const fieldMapper& mapper
75 )
76 :
77  coupledPointPatchField<Type>(ptf, p, iF, mapper),
78  cyclicPatch_(refCast<const cyclicPointPatch>(p))
79 {
80  if (!isType<cyclicPointPatch>(this->patch()))
81  {
83  << "Field type does not correspond to patch type for patch "
84  << this->patch().index() << "." << endl
85  << "Field type: " << typeName << endl
86  << "Patch type: " << this->patch().type()
87  << exit(FatalError);
88  }
89 }
90 
91 
92 template<class Type>
94 (
95  const cyclicPointPatchField<Type>& ptf,
97 )
98 :
99  coupledPointPatchField<Type>(ptf, iF),
100  cyclicPatch_(ptf.cyclicPatch_)
101 {}
102 
103 
104 // ************************************************************************* //
Swap its arguments.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A Coupled boundary condition for pointField.
Cyclic front and back plane patch field.
cyclicPointPatchField(const pointPatch &, const DimensionedField< Type, pointMesh > &)
Construct from patch and internal field.
Cyclic patch for post-processing.
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
const pointPatch & patch() const
Return patch.
Basic pointPatch represents a set of points from the mesh.
Definition: pointPatch.H:57
virtual label index() const =0
Return the index of this patch in the pointBoundaryMesh.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:346
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:334
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:129
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:257
IOerror FatalIOError
error FatalError
dictionary dict
volScalarField & p
Spatial transformation functions for primitive fields.