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  //- Additional prefix for region. Empty if default region
82  const fileName regionPrefix_;
83 
84  //- Location of existing mesh (if present)
85  const word localInstance_;
86 
87  //- Created from existing mesh (false = from field)
88  bool createFromMesh_;
89 
90  // Temporary mesh data used during construction of columnFvMesh
91  // Note: transferred to columnFvMesh
92 
93  //- Points
95 
96  //- Faces
98 
99  //- Owner addressing
101 
102  //- Neighbour addressing
104 
105 
106  // Patch data
107 
108  //- Dictionary of patch information
110 
111  //- Number of patches with at least 1 local face
112  label nPatchWithFace_;
113 
114  // Protected Member Functions
115 
116  //- Add the patches to the mesh
117  void addLocalPatches(fvMesh& mesh) const;
118 
119  //- Initialise zones if constructed from mesh
120  void initialiseZones(fvMesh& mesh);
121 
122 
123 public:
124 
125  //- Runtime type information
126  ClassName("columnFvMeshInfo");
127 
128  // Constructor
130  (
131  const Time& runTime,
132  const word& regionName
133  );
134 };
135 
136 
137 class columnFvMesh
138 :
139  public columnFvMeshInfo,
140  public simplifiedFvMesh
141 {
142 
143 public:
144 
145  //- Runtime type information
146  TypeName("columnFvMesh");
147 
148  //- Constructor
150  (
151  const Time& runTime,
153  );
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace simplifiedMeshes
160 } // End namespace Foam
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #ifdef NoRepository
165  #include "columnFvMeshTemplates.C"
166 #endif
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::simplifiedMeshes::columnFvMeshInfo::createFromMesh_
bool createFromMesh_
Created from existing mesh (false = from field)
Definition: columnFvMesh.H:87
Foam::simplifiedMeshes::columnFvMeshInfo::addLocalPatches
void addLocalPatches(fvMesh &mesh) const
Add the patches to the mesh.
Definition: columnFvMesh.C:325
Foam::polyMesh::defaultRegion
static word defaultRegion
Return the default region name.
Definition: polyMesh.H:318
Foam::simplifiedMeshes::columnFvMeshInfo::owner1D_
labelList owner1D_
Owner addressing.
Definition: columnFvMesh.H:99
Foam::simplifiedMeshes::columnFvMeshInfo::points1D_
pointField points1D_
Points.
Definition: columnFvMesh.H:93
Foam::simplifiedMeshes::columnFvMeshInfo::initialiseZones
void initialiseZones(fvMesh &mesh)
Initialise zones if constructed from mesh.
Definition: columnFvMesh.C:386
Foam::simplifiedMeshes::columnFvMeshInfo::faces1D_
faceList faces1D_
Faces.
Definition: columnFvMesh.H:96
Foam::simplifiedMeshes::columnFvMeshInfo::patchEntries_
dictionary patchEntries_
Dictionary of patch information.
Definition: columnFvMesh.H:108
Foam::simplifiedMeshes::columnFvMesh::TypeName
TypeName("columnFvMesh")
Runtime type information.
regionName
Foam::word regionName
Definition: createNamedDynamicFvMesh.H:1
simplifiedFvMesh.H
Foam::simplifiedMeshes::columnFvMeshInfo::regionName_
const word regionName_
Region of existing mesh.
Definition: columnFvMesh.H:78
Foam::Field< vector >
Foam::simplifiedMeshes::columnFvMeshInfo::columnFvMeshInfo
columnFvMeshInfo(const Time &runTime, const word &regionName)
Definition: columnFvMesh.C:406
columnFvMeshTemplates.C
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::simplifiedMeshes::columnFvMeshInfo::localInstance_
const word localInstance_
Location of existing mesh (if present)
Definition: columnFvMesh.H:84
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::simplifiedFvMesh
Functions to generate simplified finite volume meshes.
Definition: simplifiedFvMesh.H:52
Foam::List< face >
Foam::simplifiedMeshes::columnFvMesh
Generates a 1D column representation of a mesh based on an existing mesh and/or fields.
Definition: columnFvMesh.H:136
Foam::simplifiedMeshes::columnFvMeshInfo
Definition: columnFvMesh.H:53
Foam::simplifiedMeshes::columnFvMeshInfo::regionPrefix_
const fileName regionPrefix_
Additional prefix for region. Empty if default region.
Definition: columnFvMesh.H:81
Foam::simplifiedMeshes::columnFvMeshInfo::ClassName
ClassName("columnFvMeshInfo")
Runtime type information.
Foam::simplifiedMeshes::columnFvMeshInfo::neighbour1D_
labelList neighbour1D_
Neighbour addressing.
Definition: columnFvMesh.H:102
Foam::simplifiedMeshes::columnFvMesh::columnFvMesh
columnFvMesh(const Time &runTime, const word &regionName=polyMesh::defaultRegion)
Constructor.
Definition: columnFvMesh.C:445
Foam::simplifiedMeshes::columnFvMeshInfo::nPatchWithFace_
label nPatchWithFace_
Number of patches with at least 1 local face.
Definition: columnFvMesh.H:111