midPoint.H
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-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::midPoint
28 
29 Group
30  grpFvSurfaceInterpolationSchemes
31 
32 Description
33  Mid-point interpolation (weighting factors = 0.5) scheme class.
34 
35 SourceFiles
36  midPoint.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef midPoint_H
41 #define midPoint_H
42 
44 #include "volFields.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class midPoint Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 template<class Type>
56 class midPoint
57 :
58  public surfaceInterpolationScheme<Type>
59 {
60  // Private Member Functions
61 
62  //- No copy assignment
63  void operator=(const midPoint&) = delete;
64 
65 
66 public:
67 
68  //- Runtime type information
69  TypeName("midPoint");
70 
71 
72  // Constructors
73 
74  //- Construct from mesh
75  midPoint(const fvMesh& mesh)
76  :
78  {}
79 
80  //- Construct from Istream
81  midPoint(const fvMesh& mesh, Istream&)
82  :
84  {}
85 
86  //- Construct from faceFlux and Istream
88  (
89  const fvMesh& mesh,
90  const surfaceScalarField&,
91  Istream&
92  )
93  :
95  {}
96 
97 
98  // Member Functions
99 
100  //- Return the interpolation weighting factors
102  (
104  ) const
105  {
107  (
109  (
110  IOobject
111  (
112  "midPointWeights",
113  this->mesh().time().timeName(),
114  this->mesh(),
117  false
118  ),
119  this->mesh(),
120  dimensionedScalar("0.5", dimless, 0.5)
121  )
122  );
123 
124  surfaceScalarField::Boundary& awBf =
125  taw.ref().boundaryFieldRef();
126 
127  forAll(awBf, patchi)
128  {
129  if (!awBf[patchi].coupled())
130  {
131  awBf[patchi] = 1.0;
132  }
133  }
134 
135  return taw;
136  }
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
volFields.H
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::midPoint::midPoint
midPoint(const fvMesh &mesh)
Construct from mesh.
Definition: midPoint.H:74
Foam::midPoint
Mid-point interpolation (weighting factors = 0.5) scheme class.
Definition: midPoint.H:55
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::midPoint::weights
tmp< surfaceScalarField > weights(const GeometricField< Type, fvPatchField, volMesh > &) const
Return the interpolation weighting factors.
Definition: midPoint.H:101
Foam::tmp::ref
T & ref() const
Definition: tmpI.H:227
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::midPoint::midPoint
midPoint(const fvMesh &mesh, Istream &)
Construct from Istream.
Definition: midPoint.H:80
Foam::dimensionedScalar
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Definition: dimensionedScalarFwd.H:42
timeName
word timeName
Definition: getTimeIndex.H:3
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::midPoint::TypeName
TypeName("midPoint")
Runtime type information.
Foam::surfaceInterpolationScheme
Abstract base class for surface interpolation schemes.
Definition: surfaceInterpolationScheme.H:57
Foam::surfaceInterpolationScheme::mesh
const fvMesh & mesh() const
Return mesh reference.
Definition: surfaceInterpolationScheme.H:144
coupled
bool coupled(solutionDict.getOrDefault("coupledEnergyField", false))
Foam::GeometricField< scalar, fvsPatchField, surfaceMesh >
Foam::IOobject::NO_READ
Definition: IOobject.H:188
surfaceInterpolationScheme.H
Foam::dimless
const dimensionSet dimless
Dimensionless.
Definition: dimensionSets.C:189