Loading...
Searching...
No Matches
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)
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,
73 const DimensionedField<Type, surfaceMesh>& iF,
74 const dictionary& dict
75)
76:
77 coupledFvsPatchField<Type>(p, iF, dict),
78 cyclicAMIPatch_(refCast<const cyclicAMIFvPatch>(p, dict))
79{
81 {
83 << "patch " << this->patch().index() << " not cyclicAMI type. "
84 << "Patch type = " << p.type()
86 }
87}
88
89
90template<class Type>
92(
93 const cyclicAMIFvsPatchField<Type>& ptf
94)
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...
Abstract base class for coupled patches.
coupledFvsPatchField(const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Construct from patch and internal field.
Cyclic patch for Arbitrary Mesh Interface (AMI).
This boundary condition enforces a cyclic condition between a pair of boundaries, whereby communicati...
cyclicAMIFvsPatchField(const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Construct from patch and internal field.
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:133
A FieldMapper for finite-volume patch fields.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition fvPatch.H:71
label index() const noexcept
The index of this patch in the boundary mesh.
Definition fvPatch.H:218
const fvPatch & patch() const noexcept
Return the patch.
volScalarField & p
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition error.H:629
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition error.H:600
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
Definition typeInfo.H:172
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
Definition typeInfo.H:87
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition errorManip.H:125
dictionary dict