fvMeshToFvMesh.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) 2022-2023 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::fvMeshToFvMesh
26 
27 Description
28 
29 SourceFiles
30  fvMeshToFvMeshTemplates.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef fvMeshToFvMesh_H
35 #define fvMeshToFvMesh_H
36 
37 #include "meshToMesh.H"
38 #include "volFields.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class fvMeshToFvMesh Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class fvMeshToFvMesh
50 :
51  public meshToMesh
52 {
53 private:
54 
55  // Private Member Functions
56 
57  //- Evaluate constraint types for the given vol field
58  template<class Type>
59  static void evaluateConstraintTypes(VolField<Type>& fld);
60 
61 
62 public:
63 
64  //- Run-time type information
65  TypeName("fvMeshToFvMesh");
66 
67 
68  // Constructors
69 
70  //- Inherit base class' constructors
72 
73 
74  //- Destructor
75  virtual ~fvMeshToFvMesh();
76 
77 
78  // Member Functions
79 
80  // Interpolation
81 
82  //- Interpolate a source vol field to the target with no left
83  // over values specified. If the interpolation weight sum is less
84  // than one for a face then they will be normalised. If the
85  // interpolation weight sum is zero for a face then that face's
86  // value will be NaN.
87  template<class Type>
89  (
90  const VolField<Type>& srcFld
91  ) const;
92 
93  //- Interpolate a source vol field to the target with left over
94  // values specified. If the interpolation weight sum is less than
95  // one for a face then the average will include the left over
96  // value multiplied by one minus the weight sum.
97  template<class Type>
99  (
100  const VolField<Type>& srcFld,
101  const VolField<Type>& leftOverTgtFld,
102  const UList<wordRe>& tgtCuttingPatches
103  ) const;
104 
105  //- Interpolate a source vol internal field to the target with no
106  // left over values specified. As the corresponding srcToTgt.
107  template<class Type>
109  (
110  const VolInternalField<Type>& srcFld
111  ) const;
112 
113  //- Interpolate a source vol internal field to the target with left
114  // over values specified. As the corresponding srcToTgt.
115  template<class Type>
117  (
118  const VolInternalField<Type>& srcFld,
119  const VolInternalField<Type>& leftOverTgtFld
120  ) const;
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace Foam
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #ifdef NoRepository
131  #include "fvMeshToFvMeshTemplates.C"
132 #endif
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #endif
137 
138 // ************************************************************************* //
Generic GeometricField class.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: UList.H:74
virtual ~fvMeshToFvMesh()
Destructor.
TypeName("fvMeshToFvMesh")
Run-time type information.
tmp< VolField< Type > > srcToTgt(const VolField< Type > &srcFld) const
Interpolate a source vol field to the target with no left.
Class to calculate interpolative addressing and weights between the cells and patches of two overlapp...
Definition: meshToMesh.H:54
meshToMesh(const polyMesh &srcMesh, const polyMesh &tgtMesh, const word &engineType, const HashTable< word > &patchMap=NullObjectRef< HashTable< word >>())
Construct from source and target meshes. If a patchMap is supplied,.
Definition: meshToMesh.C:43
A class for managing temporary objects.
Definition: tmp.H:55
gmvFile<< "tracers "<< particles.size()<< nl;{ pointField positions(particles.size());label particlei=0;forAllConstIter(Cloud< passiveParticle >, particles, iter) { positions[particlei++]=iter().position(mesh);} for(i=0;i< pTraits< point >::nComponents;i++) { forAll(positions, particlei) { gmvFile<< component(positions[particlei], i)<< ' ';} gmvFile<< nl;}}forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.name(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Namespace for OpenFOAM.
typename VolField< Type >::Internal VolInternalField
Definition: volFieldsFwd.H:58