nonConformalMappedFvPatchBase.C
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 \*---------------------------------------------------------------------------*/
25 
27 #include "surfaceFields.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
34 }
35 
36 
37 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
38 
39 template<class Type>
40 Foam::tmp<Foam::Field<Type>> Foam::nonConformalMappedFvPatchBase::fromNeighbour
41 (
42  const Field<Type>& nbrFld
43 ) const
44 {
45  const fvMesh& mesh = patch().boundaryMesh().mesh();
46 
47  return
48  map
49  (
50  nbrMesh().polyFacesBf()[nbrFvPatch().index()],
51  nbrFld,
52  mesh.polyFacesBf()[patch().index()]
53  );
54 }
55 
56 
57 template<class Type>
58 Foam::tmp<Foam::Field<Type>> Foam::nonConformalMappedFvPatchBase::toNeighbour
59 (
60  const Field<Type>& fld
61 ) const
62 {
63  const fvMesh& mesh = patch().boundaryMesh().mesh();
64 
65  return
66  map
67  (
68  mesh.polyFacesBf()[patch().index()],
69  fld,
70  nbrMesh().polyFacesBf()[nbrFvPatch().index()]
71  );
72 }
73 
74 
75 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
76 
78 (
79  const fvPatch& patch
80 )
81 :
82  mappedFvPatchBaseBase(patch),
83  mapper_(refCast<const nonConformalMappedPatchBase>(patch.patch()))
84 {}
85 
86 
87 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
88 
90 {}
91 
92 
93 // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
94 
96 (
97  label,
98  nonConformalMappedFvPatchBase
99 );
100 
101 
103 (
105  nonConformalMappedFvPatchBase
106 );
107 
108 
109 // ************************************************************************* //
Pre-declare SubField and related Field type.
Definition: Field.H:83
const fvMesh & mesh() const
Return the mesh reference.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
const GeometricBoundaryField< label, fvsPatchField, surfaceMesh > & polyFacesBf() const
Return face-poly-face addressing.
Definition: fvMesh.C:880
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
const fvBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: fvPatch.H:162
Base class for fv patches that provide mapping between two fv patches.
const fvPatch & patch() const
Reference to the fvPatch.
const fvPatch & nbrFvPatch() const
Get the patch to map from.
const fvMesh & nbrMesh() const
Get the mesh for the region to map from.
Base class for fv patches which provides non-conformal mapping between two potentially non-globally c...
nonConformalMappedFvPatchBase(const fvPatch &patch)
Construct from a patch.
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...
const polyMesh & mesh() const
Return the mesh reference.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:404
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
To & refCast(From &r)
Reference type cast template function.
Definition: typeInfo.H:129
defineTypeNameAndDebug(combustionModel, 0)
FOR_ALL_FIELD_TYPES(makeFieldSourceTypedef)
IMPLEMENT_MAPPED_FV_PATCH_BASE_FROM_AND_TO_NEIGHBOUR(label, nonConformalMappedFvPatchBase)
Foam::surfaceFields.