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 :
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()
64  << exit(FatalError);
65  }
66 }
67 
68 
69 template<class Type>
71 (
72  const fvPatch& p,
74  const dictionary& dict
75 )
76 :
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()
85  << exit(FatalIOError);
86  }
87 }
88 
89 
90 template<class Type>
92 (
94 )
95 :
97  cyclicACMIPatch_(ptf.cyclicACMIPatch_)
98 {}
99 
100 
101 template<class Type>
103 (
106 )
107 :
109  cyclicACMIPatch_(ptf.cyclicACMIPatch_)
110 {}
111 
112 
113 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
114 
115 template<class Type>
117 {
118  if
119  (
120  Pstream::parRun()
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 // ************************************************************************* //
p
volScalarField & p
Definition: createFieldRefs.H:8
cyclicACMIFvsPatchField.H
Foam::FatalIOError
IOerror FatalIOError
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::cyclicACMIFvsPatchField
Foam::cyclicACMIFvsPatchField.
Definition: cyclicACMIFvsPatchField.H:52
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::cyclicACMIFvsPatchField::coupled
virtual bool coupled() const
Return true if running parallel.
Definition: cyclicACMIFvsPatchField.C:116
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Foam::foamVersion::patch
const std::string patch
OpenFOAM patch number as a std::string.
Foam::coupledFvsPatchField
Foam::coupledFvsPatchField.
Definition: coupledFvsPatchField.H:52
FatalIOErrorInFunction
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:473
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::cyclicACMIFvsPatchField::cyclicACMIFvsPatchField
cyclicACMIFvsPatchField(const fvPatch &, const DimensionedField< Type, surfaceMesh > &)
Construct from patch and internal field.
Definition: cyclicACMIFvsPatchField.C:35
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54