blockDescriptor.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 | Copyright (C) 2011-2016 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::blockDescriptor
26 
27 Description
28  Takes the description of the block and the list of curved edges and
29  creates a list of points on edges together with the weighting factors
30 
31 SourceFiles
32  blockDescriptor.C
33  blockDescriptorEdges.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef blockDescriptor_H
38 #define blockDescriptor_H
39 
40 #include "cellShape.H"
41 #include "pointField.H"
42 #include "scalarList.H"
43 #include "curvedEdgeList.H"
44 #include "gradingDescriptors.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 class Istream;
52 class Ostream;
53 
54 // Forward declaration of friend functions and operators
55 class blockDescriptor;
56 Ostream& operator<<(Ostream&, const blockDescriptor&);
57 
58 /*---------------------------------------------------------------------------*\
59  Class blockDescriptor Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 class blockDescriptor
63 {
64  // Private data
65 
66  //- Reference to point field defining the block mesh
67  const pointField& blockPointField_;
68 
69  //- Reference to a list of curved edges
70  const curvedEdgeList& curvedEdges_;
71 
72  //- Block shape
73  cellShape blockShape_;
74 
75  //- The number of cells in the i,j,k directions
76  Vector<label> meshDensity_;
77 
78  //- Block edge points
79  List<List<point>> edgePoints_;
80 
81  //- Block edge weighting factors
82  scalarListList edgeWeights_;
83 
84  //- Expansion ratios in all directions
86 
87  //- Name of the zone (empty string if none)
88  word zoneName_;
89 
90 
91  // Private Member Functions
92 
93  //- Set the points/weights for all edges
94  void makeBlockEdges();
95 
96  //- Set the edge points/weights
97  void setEdge(label edgeI, label start, label end, label dim);
98 
99 
100  // Private Member Functions
101 
102  //- Disallow default bitwise assignment
103  void operator=(const blockDescriptor&);
104 
105 
106 public:
107 
108  // Constructors
109 
110  //- Construct from components. Optional cellSet/zone name.
112  (
113  const cellShape&,
115  const curvedEdgeList&,
116  const Vector<label>& meshDensity,
118  const word& zoneName = ""
119  );
120 
121  //- Construct from Istream
123  (
124  const pointField& blockPointField,
125  const curvedEdgeList&,
126  Istream&
127  );
128 
129  //- Clone
131  {
133  return autoPtr<blockDescriptor>(NULL);
134  }
135 
136 
137  //- Destructor
139 
140 
141  // Member Functions
142 
143  // Access
144 
145  //- Return the number of cells in the i,j,k directions
146  const Vector<label>& density() const
147  {
148  return meshDensity_;
149  }
150 
151  //- Reference to point field defining the block mesh
152  const pointField& blockPointField() const;
153 
154  //- Return the block shape
155  const cellShape& blockShape() const;
156 
157  //- Return the block points along each edge
158  const List<List<point>>& blockEdgePoints() const;
159 
160  //- Return the weightings along each edge
161  const scalarListList& blockEdgeWeights() const;
162 
163  //- Return the mesh density (number of cells) in the i,j,k directions
164  const Vector<label>& meshDensity() const;
165 
166  //- Return the (optional) zone name
167  const word& zoneName() const;
168 
169  //- Return the number of points
170  label nPoints() const;
171 
172  //- Return the number of cells
173  label nCells() const;
174 
175  //- Return block point at local label i
176  const point& blockPoint(const label i) const;
177 
178 
179  // IOstream Operators
180 
181  friend Ostream& operator<<(Ostream&, const blockDescriptor&);
182 };
183 
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 } // End namespace Foam
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 #endif
192 
193 // ************************************************************************* //
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
const Vector< label > & density() const
Return the number of cells in the i,j,k directions.
const scalarListList & blockEdgeWeights() const
Return the weightings along each edge.
friend Ostream & operator<<(Ostream &, const blockDescriptor &)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
An analytical geometric cellShape.
Definition: cellShape.H:69
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
Takes the description of the block and the list of curved edges and creates a list of points on edges...
const cellShape & blockShape() const
Return the block shape.
const Vector< label > & meshDensity() const
Return the mesh density (number of cells) in the i,j,k directions.
const point & blockPoint(const label i) const
Return block point at local label i.
label nPoints() const
Return the number of points.
blockDescriptor(const cellShape &, const pointField &blockPointField, const curvedEdgeList &, const Vector< label > &meshDensity, const UList< gradingDescriptors > &expand, const word &zoneName="")
Construct from components. Optional cellSet/zone name.
A class for handling words, derived from string.
Definition: word.H:59
string expand(const string &, const HashTable< string, word, string::hash > &mapping, const char sigil= '$')
Expand occurences of variables according to the mapping.
Definition: stringOps.C:75
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
autoPtr< blockDescriptor > clone() const
Clone.
~blockDescriptor()
Destructor.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
const word & zoneName() const
Return the (optional) zone name.
const pointField & blockPointField() const
Reference to point field defining the block mesh.
label nCells() const
Return the number of cells.
Ostream & operator<<(Ostream &, const ensightPart &)
const List< List< point > > & blockEdgePoints() const
Return the block points along each edge.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366
Namespace for OpenFOAM.