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-2019 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
81  virtual tmp<fvPatchField<Type>> clone() const
82  {
84  (
86  );
87  }
88 
89  //- Construct and return a clone setting internal field reference
91  (
93  ) const
94  {
96  (
97  new cyclicACMIFvPatchField<Type>(*this, iF)
98  );
99  }
100 
101 
102  // Member Functions
103 
104  // Access
105 
106  //- Return the fv patch
107  const cyclicACMIFvPatch& cyclicACMIPatch() const
108  {
109  return refCast<const cyclicACMIFvPatch>(this->patch());
110  }
111 
112 
113  // Evaluation functions
114 
115  //- Return true if this patch field fixes a value
116  // Needed to check if a level has to be specified while solving
117  // Poissons equations
118  virtual bool fixesValue() const
119  {
120  const scalarField& mask =
122 
123  if (gMax(mask) > 1e-5)
124  {
125  // regions connected
126  return false;
127  }
128  else
129  {
130  // fully separated
131  return nonOverlapPatchField().fixesValue();
132  }
133  }
134 
135  //- Return reference to non-overlapping patchField
137 
138  //- Manipulate matrix
139  virtual void manipulateMatrix(fvMatrix<Type>& matrix);
140 
141  //- Update the coefficients associated with the patch field
142  virtual void updateCoeffs();
143 };
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace Foam
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #ifdef NoRepository
153  #include "cyclicACMIFvPatchField.C"
154 #endif
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
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
virtual tmp< fvPatchField< Type > > clone() const
Construct and return a clone.
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:325
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:98
A class for managing temporary objects.
Definition: PtrList.H:53
This boundary condition enforces a cyclic condition between a pair of boundaries, whereby communicati...
Namespace for OpenFOAM.