3
|
1 // FEGrid.h -*- C++ -*- |
|
2 /* |
|
3 |
1011
|
4 Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton |
3
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
1315
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
3
|
21 |
|
22 */ |
|
23 |
382
|
24 #if !defined (octave_FEGrid_h) |
|
25 #define octave_FEGrid_h 1 |
|
26 |
1296
|
27 #if defined (__GNUG__) |
|
28 #pragma interface |
|
29 #endif |
|
30 |
465
|
31 class ostream; |
|
32 |
|
33 #include "dColVector.h" |
384
|
34 |
3
|
35 class FEGrid |
|
36 { |
1321
|
37 private: |
|
38 |
|
39 void error (const char* msg) const; |
|
40 void nel_error (void) const; |
|
41 |
|
42 void check_grid (void) const; |
|
43 |
3
|
44 public: |
|
45 |
1528
|
46 FEGrid (void) { } |
|
47 FEGrid (const ColumnVector& elbnds) : elem (elbnds) { check_grid (); } |
3
|
48 FEGrid (int nel, double width); |
|
49 FEGrid (int nel, double left, double right); |
|
50 |
|
51 int element (double x) const; |
|
52 |
1321
|
53 double left (void) const { return elem.elem (0); } |
|
54 double right (void) const { return elem.elem (elem.capacity () - 1); } |
3
|
55 |
1528
|
56 int in_bounds (double x) const { return (x >= left () && x <= right ()); } |
1321
|
57 |
1528
|
58 ColumnVector element_boundaries (void) const { return elem; } |
3
|
59 |
|
60 friend ostream& operator << (ostream&, const FEGrid&); |
|
61 |
|
62 protected: |
|
63 |
1528
|
64 ColumnVector elem; |
3
|
65 }; |
|
66 |
|
67 #endif |
|
68 |
|
69 /* |
|
70 ;;; Local Variables: *** |
|
71 ;;; mode: C++ *** |
|
72 ;;; page-delimiter: "^/\\*" *** |
|
73 ;;; End: *** |
|
74 */ |