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