FreeFOAM The Cross-Platform CFD Toolkit
block.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::block
26 
27 Description
28  Creates a single block of cells from point coordinates,
29  numbers of cells in each direction and expansion ratio
30 
31 
32 SourceFiles
33  block.C
34  blockIO.C
35 
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef block_H
40 #define block_H
41 
42 #include <OpenFOAM/pointField.H>
43 #include <OpenFOAM/labelList.H>
44 
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 class Istream;
53 class Ostream;
54 
55 /*---------------------------------------------------------------------------*\
56  Class block Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class block
60 {
61  // Private data
62 
63  //- block definition
64  blockDescriptor BlockDef;
65 
66  //- list of vertices
67  pointField Vertices;
68 
69  //- list of cells
70  labelListList Cells;
71 
72  //- boundary patches
73  labelListListList BoundaryPatches;
74 
75 
76  // private member functions
77 
78  label vtxLabel(label i, label j, label k);
79 
80  void blockPoints();
81 
82  void blockCells();
83 
84  void blockBoundary();
85 
86 public:
87 
88  // Constructors
89 
90  //- from the block definition
91  block(const blockDescriptor&);
92 
93  //- as copy
94  block(const block&);
95 
96  //- clone function
98  {
99  notImplemented("block::clone()");
100  return autoPtr<block>(NULL);
101  }
102 
103  // Destructor
104 
105  ~block();
106 
107 
108  // Member Functions
109 
110  // Access
111 
112  const blockDescriptor& blockDef() const;
113  const pointField& points() const;
114  const labelListList& cells() const;
115  const labelListListList& boundaryPatches() const;
116 
117 
118  // IOstream Operators
119 
120  friend Ostream& operator<<(Ostream&, const block&);
121 };
122 
123 
125 {
126  notImplemented("Istream& operator>>(Istream& is, block*)");
127  return is;
128 }
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************ vim: set sw=4 sts=4 et: ************************ //