1 |
// $Id$ |
2 |
/* |
3 |
****************************************************************************** |
4 |
* * |
5 |
* COPYRIGHT ACcESS 2005 - All Rights Reserved * |
6 |
* * |
7 |
* This software is the property of ACcESS. No part of this code * |
8 |
* may be copied in any form or by any means without the expressed written * |
9 |
* consent of ACcESS. Copying, use or modification of this software * |
10 |
* by any unauthorised person is illegal unless that person has a software * |
11 |
* license agreement with ACcESS. * |
12 |
* * |
13 |
****************************************************************************** |
14 |
*/ |
15 |
|
16 |
#if !defined bruce_Bruce_20050829_H |
17 |
#define bruce_Bruce_20050829_H |
18 |
|
19 |
#include "escript/Data/AbstractContinuousDomain.h" |
20 |
#include "escript/Data/FunctionSpaceFactory.h" |
21 |
#include "escript/Data/FunctionSpace.h" |
22 |
#include "escript/Data/Data.h" |
23 |
|
24 |
#include <string> |
25 |
|
26 |
namespace bruce { |
27 |
|
28 |
/** |
29 |
\brief |
30 |
Bruce implements the AbstractContinuousDomain |
31 |
interface for the Bruce library. |
32 |
|
33 |
Description: |
34 |
Bruce implements the AbstractContinuousDomain |
35 |
interface for the Bruce library. |
36 |
*/ |
37 |
|
38 |
class Bruce : public escript::AbstractContinuousDomain { |
39 |
|
40 |
public: |
41 |
|
42 |
// |
43 |
// Codes for function space types supported |
44 |
static const int Nodes; |
45 |
static const int Elements; |
46 |
|
47 |
/** |
48 |
\brief |
49 |
Constructor for Bruce. |
50 |
|
51 |
Description: |
52 |
Constructor for Bruce. |
53 |
*/ |
54 |
Bruce(); |
55 |
|
56 |
/** |
57 |
\brief |
58 |
Copy constructor. |
59 |
*/ |
60 |
Bruce(const Bruce& other); |
61 |
|
62 |
/** |
63 |
\brief |
64 |
Destructor for Bruce. |
65 |
*/ |
66 |
~Bruce(); |
67 |
|
68 |
/** |
69 |
\brief |
70 |
Return this as an AbstractContinuousDomain. |
71 |
*/ |
72 |
inline |
73 |
const AbstractContinuousDomain& |
74 |
asAbstractContinuousDomain() const |
75 |
{ |
76 |
return *(static_cast<const AbstractContinuousDomain*>(this)); |
77 |
} |
78 |
|
79 |
/** |
80 |
\brief |
81 |
Return this as an AbstractDomain. |
82 |
*/ |
83 |
inline |
84 |
const AbstractDomain& |
85 |
asAbstractDomain() const |
86 |
{ |
87 |
return *(static_cast<const AbstractDomain*>(this)); |
88 |
} |
89 |
|
90 |
/** |
91 |
\brief |
92 |
Returns true if the given integer is a valid function space type |
93 |
for this domain. |
94 |
*/ |
95 |
virtual |
96 |
bool |
97 |
isValidFunctionSpaceType(int functionSpaceType) const; |
98 |
|
99 |
/** |
100 |
\brief |
101 |
Return the spatial dimension of the mesh. |
102 |
*/ |
103 |
virtual |
104 |
int |
105 |
getDim() const; |
106 |
|
107 |
/** |
108 |
\brief |
109 |
Return the number of data points per sample, and the number of samples |
110 |
needed to represent data on parts of the mesh. |
111 |
*/ |
112 |
virtual |
113 |
std::pair<int,int> |
114 |
getDataShape(int functionSpaceCode) const; |
115 |
|
116 |
/** |
117 |
\brief |
118 |
Returns the locations in the domain of the FEM nodes. |
119 |
*/ |
120 |
virtual |
121 |
escript::Data |
122 |
getX() const; |
123 |
|
124 |
/** |
125 |
\brief |
126 |
Returns the element size. |
127 |
*/ |
128 |
virtual |
129 |
escript::Data |
130 |
getSize() const; |
131 |
|
132 |
/** |
133 |
\brief |
134 |
Comparison operators. |
135 |
*/ |
136 |
virtual bool operator==(const AbstractDomain& other) const; |
137 |
virtual bool operator!=(const AbstractDomain& other) const; |
138 |
|
139 |
protected: |
140 |
|
141 |
private: |
142 |
|
143 |
}; |
144 |
|
145 |
} // end of namespace |
146 |
|
147 |
#endif |