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-2015 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
68 
69  //- Reference to a list of curved edges
71 
72  //- Block shape
74 
75  //- The number of cells in the i,j,k directions
77 
78  //- Block edge points
80 
81  //- Block edge weighting factors
83 
84  //- Expansion ratios in all directions
86 
87  //- Name of the zone (empty string if none)
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  (
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 // ************************************************************************* //
curvedEdgeList.H
Foam::blockDescriptor::operator=
void operator=(const blockDescriptor &)
Disallow default bitwise assignment.
Foam::blockDescriptor::blockPoint
const point & blockPoint(const label i) const
Return block point at local label i.
Definition: blockDescriptor.C:236
Foam::blockDescriptor::blockShape_
cellShape blockShape_
Block shape.
Definition: blockDescriptor.H:72
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::blockDescriptor::makeBlockEdges
void makeBlockEdges()
Set the points/weights for all edges.
Definition: blockDescriptorEdges.C:32
Foam::blockDescriptor::setEdge
void setEdge(label edgeI, label start, label end, label dim)
Set the edge points/weights.
Definition: blockDescriptorEdges.C:61
Foam::blockDescriptor::density
const Vector< label > & density() const
Return the number of cells in the i,j,k directions.
Definition: blockDescriptor.H:145
Foam::blockDescriptor::blockShape
const cellShape & blockShape() const
Return the block shape.
Definition: blockDescriptor.C:183
Foam::blockDescriptor::blockEdgeWeights
const scalarListList & blockEdgeWeights() const
Return the weightings along each edge.
Definition: blockDescriptor.C:196
Foam::blockDescriptor::blockDescriptor
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.
Definition: blockDescriptor.C:32
Foam::blockDescriptor::zoneName
const word & zoneName() const
Return the (optional) zone name.
Definition: blockDescriptor.C:208
Foam::blockDescriptor::edgeWeights_
scalarListList edgeWeights_
Block edge weighting factors.
Definition: blockDescriptor.H:81
Foam::blockDescriptor::nPoints
label nPoints() const
Return the number of points.
Definition: blockDescriptor.C:214
scalarList.H
gradingDescriptors.H
Foam::blockDescriptor::operator<<
friend Ostream & operator<<(Ostream &, const blockDescriptor &)
Foam::blockDescriptor::clone
autoPtr< blockDescriptor > clone() const
Clone.
Definition: blockDescriptor.H:129
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:365
Foam::label
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
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::blockDescriptor::curvedEdges_
const curvedEdgeList & curvedEdges_
Reference to a list of curved edges.
Definition: blockDescriptor.H:69
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::operator<<
Ostream & operator<<(Ostream &, const edgeMesh &)
Definition: edgeMeshIO.C:130
Foam::blockDescriptor::nCells
label nCells() const
Return the number of cells.
Definition: blockDescriptor.C:225
Foam::blockDescriptor::expand_
List< gradingDescriptors > expand_
Expansion ratios in all directions.
Definition: blockDescriptor.H:84
Foam::cellShape
An analytical geometric cellShape.
Definition: cellShape.H:69
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::blockDescriptor::blockPointField
const pointField & blockPointField() const
Reference to point field defining the block mesh.
Definition: blockDescriptor.C:177
pointField.H
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::blockDescriptor::meshDensity_
Vector< label > meshDensity_
The number of cells in the i,j,k directions.
Definition: blockDescriptor.H:75
Foam::blockDescriptor::blockPointField_
const pointField & blockPointField_
Reference to point field defining the block mesh.
Definition: blockDescriptor.H:66
Foam::Vector< label >
Foam::List
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
Foam::UList
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
Foam::blockDescriptor::meshDensity
const Vector< label > & meshDensity() const
Return the mesh density (number of cells) in the i,j,k directions.
Definition: blockDescriptor.C:202
cellShape.H
Foam::blockDescriptor::zoneName_
word zoneName_
Name of the zone (empty string if none)
Definition: blockDescriptor.H:87
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::blockDescriptor::edgePoints_
List< List< point > > edgePoints_
Block edge points.
Definition: blockDescriptor.H:78
Foam::blockDescriptor::blockEdgePoints
const List< List< point > > & blockEdgePoints() const
Return the block points along each edge.
Definition: blockDescriptor.C:190
Foam::blockDescriptor
Takes the description of the block and the list of curved edges and creates a list of points on edges...
Definition: blockDescriptor.H:61
Foam::blockDescriptor::~blockDescriptor
~blockDescriptor()
Destructor.
Definition: blockDescriptor.C:171
Foam::stringOps::expand
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:74