nonConformalMappedFvPatchBase.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) 2023-2024 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::nonConformalMappedFvPatchBase
26 
27 Description
28  Base class for fv patches which provides non-conformal mapping between
29  two potentially non-globally conforming fv patches
30 
31 SourceFiles
32  nonConformalMappedFvPatchBase.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef nonConformalMappedFvPatchBase_H
37 #define nonConformalMappedFvPatchBase_H
38 
39 #include "mappedFvPatchBaseBase.H"
41 #include "nonConformalFvPatch.H"
42 #include "fvsPatchFields.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 class fvMesh;
50 
51 /*---------------------------------------------------------------------------*\
52  Class nonConformalMappedFvPatchBase Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 :
58 {
59  // Private Data
60 
61  //- Poly patch mapper base
62  const nonConformalMappedPatchBase& mapper_;
63 
64 
65  // Private Member Functions
66 
67  //- Map/interpolate a neighbour patch field to this patch
68  template<class Type>
69  tmp<Field<Type>> fromNeighbour(const Field<Type>& nbrFld) const;
70 
71  //- Map/interpolate a patch field to the neighbour patch
72  template<class Type>
73  tmp<Field<Type>> toNeighbour(const Field<Type>& fld) const;
74 
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("nonConformalMappedFvPatchBase");
80 
81 
82  // Constructors
83 
84  //- Construct from a patch
86 
87 
88  //- Destructor
90 
91 
92  // Member Functions
93 
94  //- Map/interpolate from one patch to another
95  template<class Type>
96  static tmp<Field<Type>> map
97  (
98  const fvsPatchLabelField& srcPolyFacesPf,
99  const Field<Type>& srcFld,
100  const fvsPatchLabelField& tgtPolyFacesPf
101  );
102 
103  //- Map/interpolate from one patch to another
104  template<class Type>
105  static tmp<Field<Type>> map
106  (
107  const fvsPatchLabelField& srcPolyFacesPf,
108  Field<Type>&& srcFld,
109  const fvsPatchLabelField& tgtPolyFacesPf
110  );
111 
112  //- Map/interpolate from one patch to another
113  template<class Type>
114  static tmp<Field<Type>> map
115  (
116  const fvsPatchLabelField& srcPolyFacesPf,
117  const tmp<Field<Type>>& srcFld,
118  const fvsPatchLabelField& tgtPolyFacesPf
119  );
120 
121  //- Map/interpolate
123 
124  //- Map/interpolate
126  (
128  );
129 };
130 
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 } // End namespace Foam
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #ifdef NoRepository
140 #endif
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #endif
145 
146 // ************************************************************************* //
Pre-declare SubField and related Field type.
Definition: Field.H:83
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
An abstract base class with a fat-interface to all derived classes covering all possible ways in whic...
Definition: fvsPatchField.H:83
Base class for fv patches that provide mapping between two fv patches.
const fvPatch & patch() const
Reference to the fvPatch.
Base class for fv patches which provides non-conformal mapping between two potentially non-globally c...
nonConformalMappedFvPatchBase(const fvPatch &patch)
Construct from a patch.
TypeName("nonConformalMappedFvPatchBase")
Runtime type information.
DEFINE_MAPPED_FV_PATCH_BASE_FROM_AND_TO_NEIGHBOUR(label,)
Map/interpolate.
FOR_ALL_FIELD_TYPES(DEFINE_MAPPED_FV_PATCH_BASE_FROM_AND_TO_NEIGHBOUR,)
Map/interpolate.
static tmp< Field< Type > > map(const fvsPatchLabelField &srcPolyFacesPf, const Field< Type > &srcFld, const fvsPatchLabelField &tgtPolyFacesPf)
Map/interpolate from one patch to another.
Base class for poly patches which provides non-conformal mapping between two potentially non-globally...
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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59