cyclicAMIFvsPatchField.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) 2011-2015 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
30
31// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32
33template<class Type>
35(
36 const fvPatch& p,
38)
39:
40 coupledFvsPatchField<Type>(p, iF),
41 cyclicAMIPatch_(refCast<const cyclicAMIFvPatch>(p))
42{}
43
44
45template<class Type>
47(
49 const fvPatch& p,
51 const fvPatchFieldMapper& mapper
52)
53:
54 coupledFvsPatchField<Type>(ptf, p, iF, mapper),
55 cyclicAMIPatch_(refCast<const cyclicAMIFvPatch>(p))
56{
57 if (!isA<cyclicAMIFvPatch>(this->patch()))
58 {
60 << "Field type does not correspond to patch type for patch "
61 << this->patch().index() << "." << endl
62 << "Field type: " << typeName << endl
63 << "Patch type: " << this->patch().type()
64 << exit(FatalError);
65 }
66}
67
68
69template<class Type>
71(
72 const fvPatch& p,
74 const dictionary& dict
75)
76:
77 coupledFvsPatchField<Type>(p, iF, dict),
78 cyclicAMIPatch_(refCast<const cyclicAMIFvPatch>(p, dict))
79{
80 if (!isA<cyclicAMIFvPatch>(p))
81 {
83 << "patch " << this->patch().index() << " not cyclicAMI type. "
84 << "Patch type = " << p.type()
86 }
87}
88
89
90template<class Type>
92(
94)
95:
96 coupledFvsPatchField<Type>(ptf),
97 cyclicAMIPatch_(ptf.cyclicAMIPatch_)
98{}
99
100
101template<class Type>
103(
106)
107:
108 coupledFvsPatchField<Type>(ptf, iF),
109 cyclicAMIPatch_(ptf.cyclicAMIPatch_)
110{}
111
112
113// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
114
115template<class Type>
117{
118 return cyclicAMIPatch_.coupled();
119}
120
121
122// ************************************************************************* //
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
Foam::coupledFvsPatchField.
Cyclic patch for Arbitrary Mesh Interface (AMI)
Foam::cyclicAMIFvsPatchField.
virtual bool coupled() const
Return true if running parallel.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:71
label index() const
Return the index of this patch in the fvBoundaryMesh.
Definition: fvPatch.H:203
const fvPatch & patch() const
Return patch.
volScalarField & p
#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
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:131
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
IOerror FatalIOError
error FatalError
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
dictionary dict