cyclicACMIFvPatchField.H
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) 2013-2020 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 Class
25  Foam::cyclicACMIFvPatchField
26 
27 Description
28  This boundary condition enforces a cyclic condition between a pair of
29  boundaries, whereby communication between the patches is performed using
30  an arbitrarily coupled mesh interface (ACMI) interpolation.
31 
32 Usage
33  Example of the boundary condition specification:
34  \verbatim
35  <patchName>
36  {
37  type cyclicACMI;
38  }
39  \endverbatim
40 
41 See also
42  Foam::AMIInterpolation
43 
44 SourceFiles
45  cyclicACMIFvPatchField.C
46 
47 \*---------------------------------------------------------------------------*/
48 
49 #ifndef cyclicACMIFvPatchField_H
50 #define cyclicACMIFvPatchField_H
51 
52 #include "cyclicAMIFvPatchField.H"
53 #include "cyclicACMIFvPatch.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace Foam
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class cyclicACMIFvPatchField Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 template<class Type>
66 :
67  public cyclicAMIFvPatchField<Type>
68 {
69 public:
70 
71  //- Runtime type information
72  TypeName(cyclicACMIFvPatch::typeName_());
73 
74 
75  // Constructors
76 
77  //- Inherit parent constructors
79 
80  //- Construct and return a clone setting internal field reference
82  (
84  ) const
85  {
87  (
88  new cyclicACMIFvPatchField<Type>(*this, iF)
89  );
90  }
91 
92 
93  // Member Functions
94 
95  // Access
96 
97  //- Return the fv patch
98  const cyclicACMIFvPatch& cyclicACMIPatch() const
99  {
100  return refCast<const cyclicACMIFvPatch>(this->patch());
101  }
102 
103 
104  // Evaluation functions
105 
106  //- Return true if this patch field fixes a value
107  // Needed to check if a level has to be specified while solving
108  // Poissons equations
109  virtual bool fixesValue() const
110  {
111  const scalarField& mask =
113 
114  if (gMax(mask) > 1e-5)
115  {
116  // regions connected
117  return false;
118  }
119  else
120  {
121  // fully separated
122  return nonOverlapPatchField().fixesValue();
123  }
124  }
125 
126  //- Return reference to non-overlapping patchField
128 
129  //- Manipulate matrix
130  virtual void manipulateMatrix(fvMatrix<Type>& matrix);
131 
132  //- Update the coefficients associated with the patch field
133  virtual void updateCoeffs();
134 };
135 
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 } // End namespace Foam
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 #ifdef NoRepository
144  #include "cyclicACMIFvPatchField.C"
145 #endif
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************************************************************* //
TypeName(cyclicACMIFvPatch::typeName_())
Runtime type information.
const fvPatchField< Type > & nonOverlapPatchField() const
Return reference to non-overlapping patchField.
const cyclicACMIFvPatch & cyclicACMIPatch() const
Return the fv patch.
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:66
This boundary condition enforces a cyclic condition between a pair of boundaries, whereby communicati...
virtual bool fixesValue() const
Return true if this patch field fixes a value.
Cyclic patch for Arbitrarily Coupled Mesh Interface (ACMI)
A special matrix type and solver, designed for finite volume solutions of scalar equations. Face addressing is used to make all matrix assembly and solution loops vectorise.
Definition: fvPatchField.H:72
const fvPatch & patch() const
Return patch.
Definition: fvPatchField.H:337
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Type gMax(const FieldField< Field, Type > &f)
const scalarField & mask() const
Mask field where 1 = overlap, 0 = no-overlap.
const cyclicACMIPolyPatch & cyclicACMIPatch() const
Return the poly patch.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
virtual void manipulateMatrix(fvMatrix< Type > &matrix)
Manipulate matrix.
const doubleScalar e
Elementary charge.
Definition: doubleScalar.H:105
A class for managing temporary objects.
Definition: PtrList.H:53
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:199
This boundary condition enforces a cyclic condition between a pair of boundaries, whereby communicati...
Namespace for OpenFOAM.