cyclicACMIFvsPatchField.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) 2013-2015 OpenFOAM Foundation
9  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
33 template<class Type>
35 (
36  const fvPatch& p,
38 )
39 :
40  coupledFvsPatchField<Type>(p, iF),
41  cyclicACMIPatch_(refCast<const cyclicACMIFvPatch>(p))
42 {}
43 
44 
45 template<class Type>
47 (
49  const fvPatch& p,
51  const fvPatchFieldMapper& mapper
52 )
53 :
54  coupledFvsPatchField<Type>(ptf, p, iF, mapper),
55  cyclicACMIPatch_(refCast<const cyclicACMIFvPatch>(p))
56 {
57  if (!isA<cyclicACMIFvPatch>(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()
65  }
66 }
67 
68 
69 template<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  cyclicACMIPatch_(refCast<const cyclicACMIFvPatch>(p, dict))
79 {
80  if (!isA<cyclicACMIFvPatch>(p))
81  {
83  << "patch " << this->patch().index() << " not cyclicACMI type. "
84  << "Patch type = " << p.type()
86  }
87 }
88 
89 
90 template<class Type>
92 (
93  const cyclicACMIFvsPatchField<Type>& ptf
94 )
95 :
97  cyclicACMIPatch_(ptf.cyclicACMIPatch_)
98 {}
99 
100 
101 template<class Type>
103 (
106 )
107 :
108  coupledFvsPatchField<Type>(ptf, iF),
109  cyclicACMIPatch_(ptf.cyclicACMIPatch_)
110 {}
111 
112 
113 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
114 
115 template<class Type>
117 {
118  if
119  (
121  || (
122  this->cyclicACMIPatch_.size()
123  && this->cyclicACMIPatch_.cyclicACMIPatch().neighbPatch().size()
124  )
125  )
126  {
127  return true;
128  }
129 
130  return false;
131 }
132 
133 
134 // ************************************************************************* //
dictionary dict
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:125
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:598
Type & refCast(U &obj)
A dynamic_cast (for references). Generates a FatalError on failed casts and uses the virtual type() m...
Definition: typeInfo.H:159
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
Foam::cyclicACMIFvsPatchField.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:70
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:1049
const fvPatch & patch() const noexcept
Return the patch.
virtual bool coupled() const
Return true if running parallel.
static const char *const typeName
Typename for Field.
Definition: Field.H:86
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
A FieldMapper for finite-volume patch fields.
Foam::coupledFvsPatchField.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:627
cyclicACMIFvsPatchField(const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Construct from patch and internal field.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
volScalarField & p
label index() const noexcept
The index of this patch in the boundary mesh.
Definition: fvPatch.H:218
IOerror FatalIOError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL IO ERROR&#39; header text and ...