columnFvMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2018-2019 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::simplifiedMeshes::columnFvMesh
28 
29 Description
30  Generates a 1D column representation of a mesh based on an existing mesh
31  and/or fields
32 
33 SourceFiles
34  columnFvMesh.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef simplifiedMeshes_columnFvMesh_H
39 #define simplifiedMeshes_columnFvMesh_H
40 
41 #include "simplifiedFvMesh.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 namespace simplifiedMeshes
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class columnFvMesh Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class columnFvMeshInfo
55 {
56  // Private Member Functions
57 
58  //- Set the patch dictionary entries using the mesh or field files
59  bool setPatchEntries(const Time& runTime);
60 
61  //- Initialise
62  void initialise(const Time& runTime);
63 
64  //- Helper function to initialise empty zones
65  template<class ZoneMeshType>
66  void initialiseZone
67  (
68  const word& zoneTypeName,
69  const fileName& instance,
70  ZoneMeshType& zoneType
71  );
72 
73 
74 protected:
75 
76  // Protected Data
77 
78  //- Region of existing mesh
79  const word regionName_;
80 
81  //- Location of existing mesh (if present)
83 
84  //- Created from existing mesh (false = from field)
85  bool createFromMesh_;
86 
87  // Temporary mesh data used during construction of columnFvMesh
88  // Note: transferred to columnFvMesh
89 
90  //- Points
92 
93  //- Faces
95 
96  //- Owner addressing
98 
99  //- Neighbour addressing
101 
102 
103  // Patch data
104 
105  //- Dictionary of patch information
107 
108  //- Number of patches with at least 1 local face
109  label nPatchWithFace_;
111 
112  // Protected Member Functions
113 
114  //- Add the patches to the mesh
116 
117  //- Initialise zones if constructed from mesh
118  void initialiseZones(fvMesh& mesh);
119 
120 
121 public:
122 
123  //- Runtime type information
124  ClassName("columnFvMeshInfo");
125 
126  // Constructor
128  (
129  const Time& runTime,
130  const word& regionName
131  );
132 };
133 
134 
135 class columnFvMesh
136 :
137  public columnFvMeshInfo,
138  public simplifiedFvMesh
139 {
140 
141 public:
142 
143  //- Runtime type information
144  TypeName("columnFvMesh");
145 
146  //- Constructor
148  (
149  const Time& runTime,
151  );
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace simplifiedMeshes
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #ifdef NoRepository
163  #include "columnFvMeshTemplates.C"
164 #endif
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #endif
169 
170 // ************************************************************************* //
Generates a 1D column representation of a mesh based on an existing mesh and/or fields.
Definition: columnFvMesh.H:160
A class for handling file names.
Definition: fileName.H:72
labelList owner1D_
Owner addressing.
Definition: columnFvMesh.H:110
const word localInstance_
Location of existing mesh (if present)
Definition: columnFvMesh.H:87
columnFvMesh(const Time &runTime, const word &regionName=polyMesh::defaultRegion)
Constructor.
Definition: columnFvMesh.C:432
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
ClassName("columnFvMeshInfo")
Runtime type information.
const word & regionName() const
The mesh region name or word::null if polyMesh::defaultRegion.
Definition: polyMesh.C:847
engineTime & runTime
TypeName("columnFvMesh")
Runtime type information.
Functions to generate simplified finite volume meshes.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
labelList neighbour1D_
Neighbour addressing.
Definition: columnFvMesh.H:115
dynamicFvMesh & mesh
A class for handling words, derived from Foam::string.
Definition: word.H:63
static word defaultRegion
Return the default region name.
Definition: polyMesh.H:405
bool createFromMesh_
Created from existing mesh (false = from field)
Definition: columnFvMesh.H:92
void addLocalPatches(fvMesh &mesh) const
Add the patches to the mesh.
Definition: columnFvMesh.C:318
const word regionName_
Region of existing mesh.
Definition: columnFvMesh.H:82
columnFvMeshInfo(const Time &runTime, const word &regionName)
Definition: columnFvMesh.C:399
label nPatchWithFace_
Number of patches with at least 1 local face.
Definition: columnFvMesh.H:128
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
dictionary patchEntries_
Dictionary of patch information.
Definition: columnFvMesh.H:123
void initialiseZones(fvMesh &mesh)
Initialise zones if constructed from mesh.
Definition: columnFvMesh.C:379
Namespace for OpenFOAM.