fvMeshStitcherTools.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 Namespace
25  Foam::fvMeshStitcherTools
26 
27 Description
28  Collection of free functions utilised by the stitching process
29 
30 SourceFiles
31  fvMeshStitcherTools.C
32  fvMeshStitcherToolsTemplates.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef fvMeshStitcherTools_H
37 #define fvMeshStitcherTools_H
38 
39 #include "fvMesh.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 namespace fvMeshStitcherTools
46 {
47 
48 //- Map a field with an (optional) addressing offset
49 template<class Type>
51 (
52  const Field<Type>& f,
53  const labelUList& addr,
54  const label addr0 = 0
55 );
56 
57 //- Tmp variant of above
58 template<class Type>
60 (
61  const tmp<Field<Type>>& f,
62  const labelUList& addr,
63  const label addr0 = 0
64 );
65 
66 //- Reverse map a field with an (optional) addressing offset, initialising the
67 // value to zero and summing repeated indices
68 template<class Type>
70 (
71  const Field<Type>& f,
72  const label size,
73  const labelUList& addr,
74  const label addr0 = 0
75 );
76 
77 //- Tmp variant of above
78 template<class Type>
80 (
81  const tmp<Field<Type>>& f,
82  const label size,
83  const labelUList& addr,
84  const label addr0 = 0
85 );
86 
87 //- Alias for surface boundary fields to reduce verbosity of method
88 // definitions below
89 template<class Type>
91 
92 //- Return the total non-conformal area associated with each original face
94 
95 //- Extract the non-conformal parts of the boundary field and store it on the
96 // conformal faces
97 template<class Type>
99 (
100  const SurfaceFieldBoundary<Type>& fieldb
101 );
102 
103 //- Extract the original parts of the boundary field and store it
104 // on the conformal faces
105 template<class Type>
107 (
108  const SurfaceFieldBoundary<Type>& fieldb
109 );
110 
111 //- Combine non-conformal and original parts of the boundary field from the
112 // conformal faces to construct the complete non-conformal boundary field
113 template<class Type>
115 (
116  const SurfaceFieldBoundary<Type>& ncFieldb,
117  const SurfaceFieldBoundary<Type>& origFieldb
118 );
119 
120 //- Synchronise the boundary field by combining corresponding
121 // values across couplings with the given weightings
122 template<class Type>
124 (
125  const SurfaceFieldBoundary<Type>& fieldb,
126  const bool flip,
127  const scalar ownerWeight,
128  const scalar neighbourWeight
129 );
130 
131 //- Synchronise the boundary field by combining corresponding
132 // values across couplings with equal weightings
133 template<class Type>
135 (
136  const SurfaceFieldBoundary<Type>& fieldb
137 );
138 
139 } // End namespace patchToPatchTools
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #ifdef NoRepository
146 #endif
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
Pre-declare SubField and related Field type.
Definition: Field.H:83
Generic GeometricBoundaryField class.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:96
A class for managing temporary objects.
Definition: tmp.H:55
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
tmp< SurfaceFieldBoundary< scalar > > origNcMagSfb(const fvMesh &mesh)
Return the total non-conformal area associated with each original face.
tmp< SurfaceFieldBoundary< Type > > conformedNcBoundaryField(const SurfaceFieldBoundary< Type > &fieldb)
Extract the non-conformal parts of the boundary field and store it on the.
tmp< Field< Type > > fieldMap(const Field< Type > &f, const labelUList &addr, const label addr0=0)
Map a field with an (optional) addressing offset.
tmp< Field< Type > > fieldRMapSum(const Field< Type > &f, const label size, const labelUList &addr, const label addr0=0)
Reverse map a field with an (optional) addressing offset, initialising the.
tmp< SurfaceFieldBoundary< Type > > synchronisedBoundaryField(const SurfaceFieldBoundary< Type > &fieldb, const bool flip, const scalar ownerWeight, const scalar neighbourWeight)
Synchronise the boundary field by combining corresponding.
tmp< SurfaceFieldBoundary< Type > > unconformedBoundaryField(const SurfaceFieldBoundary< Type > &ncFieldb, const SurfaceFieldBoundary< Type > &origFieldb)
Combine non-conformal and original parts of the boundary field from the.
tmp< SurfaceFieldBoundary< Type > > conformedOrigBoundaryField(const SurfaceFieldBoundary< Type > &fieldb)
Extract the original parts of the boundary field and store it.
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
labelList f(nPoints)