FEI Version of the Day
Loading...
Searching...
No Matches
fei_Record.hpp
1/*--------------------------------------------------------------------*/
2/* Copyright 2005 Sandia Corporation. */
3/* Under the terms of Contract DE-AC04-94AL85000, there is a */
4/* non-exclusive license for use of this work by or on behalf */
5/* of the U.S. Government. Export of this program may require */
6/* a license from the United States Government. */
7/*--------------------------------------------------------------------*/
8
9#ifndef _fei_Record_hpp_
10#define _fei_Record_hpp_
11
12#include <fei_macros.hpp>
13
14namespace fei {
15class FieldMask;
16
19template<typename GlobalIDType>
20class Record {
21public:
23 Record();
24
27 : ID_(src.ID_),
28 number_(src.number_),
29 fieldMask_(src.fieldMask_),
30 offsetIntoEqnNumbers_(src.offsetIntoEqnNumbers_),
31 ownerProc_(src.ownerProc_),
33 hasSlaveDof_(src.hasSlaveDof_)
34 {}
35
37 virtual ~Record();
38
40 void setID(const GlobalIDType& ID)
41 {
42 ID_ = ID;
43 }
44
46 GlobalIDType getID() const
47 {
48 return(ID_);
49 }
50
52 void setNumber(const GlobalIDType& num)
53 {
54 number_ = num;
55 }
56
58 GlobalIDType getNumber() const
59 {
60 return(number_);
61 }
62
64 bool operator==(const Record<GlobalIDType>& rcd) const
65 {
66 return( ID_ == rcd.ID_ );
67 }
68
70 bool operator!=(const Record<GlobalIDType>& rcd) const
71 {
72 return( ID_ != rcd.ID_ );
73 }
74
76 bool operator<(const Record<GlobalIDType>& rcd) const
77 {
78 return( ID_ < rcd.ID_ );
79 }
80
82 bool operator>(const Record<GlobalIDType>& rcd) const
83 {
84 return( ID_ > rcd.ID_ );
85 }
86
88 void setOwnerProc(int owner)
89 {
90 ownerProc_ = owner;
91 }
92
94 int getOwnerProc() const
95 {
96 return(ownerProc_);
97 }
98
101 {
102 fieldMask_ = fm;
103 }
104
107 {
108 return( fieldMask_ );
109 }
110
113 {
114 return( fieldMask_ );
115 }
116
119 void setOffsetIntoEqnNumbers(int offset)
120 {
121 offsetIntoEqnNumbers_ = offset;
122 }
123
127 {
128 return(offsetIntoEqnNumbers_);
129 }
130
131 bool hasSlaveDof() const
132 { return( hasSlaveDof_ ); }
133
134 void hasSlaveDof(bool flag)
135 { hasSlaveDof_ = flag; }
136
137 Record<GlobalIDType>& operator=(const Record<GlobalIDType>& src)
138 {
139 ID_ = src.ID_;
140 number_ = src.number_;
141 fieldMask_ = src.fieldMask_;
142 offsetIntoEqnNumbers_ = src.offsetIntoEqnNumbers_;
143 ownerProc_ = src.ownerProc_;
144 isInLocalSubdomain_ = src.isInLocalSubdomain_;
145 hasSlaveDof_ = src.hasSlaveDof_;
146 return *this;
147 }
148
149private:
150
151 GlobalIDType ID_;
152 GlobalIDType number_;
153
154 fei::FieldMask* fieldMask_;
155
156 int offsetIntoEqnNumbers_;
157
158 int ownerProc_;
159
160public:
163
164private:
165 bool hasSlaveDof_;
166};
167
169template<class GlobalIDType>
171 public:
174
176 virtual void operator()(Record<GlobalIDType>& record) = 0;
177
178};//class Record_Operator
179
180template<class GlobalIDType>
182 : ID_(-1),
183 number_(-1),
184 fieldMask_(NULL),
185 offsetIntoEqnNumbers_(0),
186 ownerProc_(-1),
187 isInLocalSubdomain_(false),
188 hasSlaveDof_(false)
189{
190}
191
192template<class GlobalIDType>
196
197
198} //namespace fei
199
200#endif // _fei_Record_hpp_
201
virtual void operator()(Record< GlobalIDType > &record)=0
void setID(const GlobalIDType &ID)
fei::FieldMask * getFieldMask()
GlobalIDType getID() const
bool isInLocalSubdomain_
int getOffsetIntoEqnNumbers() const
void setNumber(const GlobalIDType &num)
void setOffsetIntoEqnNumbers(int offset)
Record(const Record< GlobalIDType > &src)
bool operator>(const Record< GlobalIDType > &rcd) const
void setOwnerProc(int owner)
const fei::FieldMask * getFieldMask() const
bool operator==(const Record< GlobalIDType > &rcd) const
bool operator<(const Record< GlobalIDType > &rcd) const
virtual ~Record()
bool operator!=(const Record< GlobalIDType > &rcd) const
void setFieldMask(fei::FieldMask *fm)
GlobalIDType getNumber() const
int getOwnerProc() const