fvMeshTools.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) 2012-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::fvMeshTools
26 
27 Description
28  A collection of tools for operating on an fvMesh.
29 
30 SourceFiles
31  fvMeshTools.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef fvMeshTools_H
36 #define fvMeshTools_H
37 
38 #include "fvMesh.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class fvMeshTools Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class fvMeshTools
50 {
51  // Private Static Member Functions
52 
53  //- Set patchFields according to dictionary
54  template<class GeoField>
55  static void setPatchFields
56  (
57  typename GeoField::Mesh& mesh,
58  const label patchi,
59  const dictionary& patchFieldDict
60  );
61 
62 
63 public:
64 
65  // Static Member Functions
66 
67  //- Add patch. Inserts patch before all processor patches. Returns the
68  // index of the added patch.
69  static label addPatch(fvMesh& mesh, const polyPatch& patch);
70 
71  //- Complete adding patches
72  static void addedPatches(fvMesh& mesh);
73 
74  //- Change patchField on registered fields according to dictionary
75  static void setPatchFields
76  (
77  fvMesh& mesh,
78  const label patchi,
79  const dictionary& patchFieldDict
80  );
81 
82  //- Reorder and remove trailing patches. If validBoundary call is
83  // parallel synced and all add the same patch with same settings
84  static void reorderPatches
85  (
86  fvMesh&,
87  const labelList& oldToNew,
88  const label nPatches,
89  const bool validBoundary
90  );
91 };
92 
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 } // End namespace Foam
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 #ifdef NoRepository
101  #include "fvMeshToolsTemplates.C"
102 #endif
103 
104 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
105 
106 #endif
107 
108 // ************************************************************************* //
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
A collection of tools for operating on an fvMesh.
Definition: fvMeshTools.H:49
static void reorderPatches(fvMesh &, const labelList &oldToNew, const label nPatches, const bool validBoundary)
Reorder and remove trailing patches. If validBoundary call is.
Definition: fvMeshTools.C:104
static label addPatch(fvMesh &mesh, const polyPatch &patch)
Add patch. Inserts patch before all processor patches. Returns the.
Definition: fvMeshTools.C:33
static void addedPatches(fvMesh &mesh)
Complete adding patches.
Definition: fvMeshTools.C:73
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:96
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:70
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
label patchi
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
label nPatches
Definition: readKivaGrid.H:396