FreeFOAM The Cross-Platform CFD Toolkit
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) 1991-2010 OpenCFD Ltd.
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  block descriptor. Takes the description of the block and the list
29  of curved edges and creates a list of points on edges together
30  with the weighting factors
31 
32 SourceFiles
33  blockDescriptor.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef blockDescriptor_H
38 #define blockDescriptor_H
39 
40 #include <OpenFOAM/scalar.H>
41 #include <OpenFOAM/label.H>
42 #include <OpenFOAM/point.H>
43 #include <OpenFOAM/cellShape.H>
44 #include <OpenFOAM/scalarList.H>
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 class Istream;
53 class Ostream;
54 
55 /*---------------------------------------------------------------------------*\
56  Class blockDescriptor Declaration
57 \*---------------------------------------------------------------------------*/
58 
60 {
61  // Private data
62 
63  //- Block mesh points
64  const pointField& blockMeshPoints_;
65 
66  //- block shape
67  cellShape blockShape_;
68 
69  // reference to a list of curved edges
70  const curvedEdgeList& curvedEdges_;
71 
72  // block edge points
73  List<List<point> > edgePoints_;
74 
75  //- block edge weighting factors
76  scalarListList edgeWeights_;
77 
78  //- number of point in each direction
79  Vector<label> n_;
80 
81  //- expansion ratios in all directions
82  scalarList expand_;
83 
84  //- name of the zone (empty string if none)
85  word zoneName_;
86 
87  // Private member functions
88 
89  void makeBlockEdges();
90 
91  void setEdge(label edge, label start, label end, label dim);
92 
93 
94 public:
95 
96  // Constructors
97 
98  //- Construct from components. Optional cellSet/zone name.
100  (
101  const cellShape&,
102  const pointField& blockMeshPoints,
103  const curvedEdgeList& edges,
104  const Vector<label>& n,
105  const scalarList& expand,
106  const word& zoneName = ""
107  );
108 
109  //- Construct from Istream
111  (
112  const pointField& blockMeshPoints,
113  const curvedEdgeList& edges,
114  Istream& is
115  );
116 
117  //- Clone
119  {
120  notImplemented("blockDescriptor::clone()");
121  return autoPtr<blockDescriptor>(NULL);
122  }
123 
124 
125  // Member Functions
126 
127  // Access
128 
129  const pointField& points() const;
130 
131  const cellShape& blockShape() const;
132 
133  const List<List<point> >& blockEdgePoints() const;
134 
135  const scalarListList& blockEdgeWeights() const;
136 
137  const Vector<label>& n() const;
138 
139  const word& zoneName() const;
140 
141  // Member Operators
142 
143  void operator=(const blockDescriptor&);
144 
145 
146  // IOstream Operators
147 
148  friend Ostream& operator<<(Ostream&, const blockDescriptor&);
149 };
150 
151 
153 {
154  notImplemented("Istream& operator>>(Istream& is, blockDescriptor*)");
155  return is;
156 }
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************ vim: set sw=4 sts=4 et: ************************ //