9 #ifndef _snl_fei_Constraint_hpp_
10 #define _snl_fei_Constraint_hpp_
22 template<
class RecordType>
26 Constraint(
int id=0,
bool isPenaltyConstr=
false);
38 int offsetIntoSlaveField,
39 const double* weights,
164 template<
class RecordType>
168 recordCollection_(NULL),
169 isPenalty_(isPenaltyConstr),
174 offsetIntoSlaveField_(0),
177 masterRecordCollections_(),
185 template<
class RecordType>
187 int constraintIDType,
189 bool isPenaltyConstr,
195 int offsetIntoSlaveField,
196 const double* weights,
200 idType_(constraintIDType),
201 recordCollection_(NULL),
202 isPenalty_(isPenaltyConstr),
207 offsetIntoSlaveField_(offsetIntoSlaveField),
210 masterRecordCollections_(),
221 int constraintIDType,
223 bool isPenaltyConstr,
229 int offsetIntoSlaveField,
230 const double* weights,
234 idType_(constraintIDType),
235 recordCollection_(NULL),
236 isPenalty_(isPenaltyConstr),
241 offsetIntoSlaveField_(offsetIntoSlaveField),
244 masterRecordCollections_(),
249 int weightsOffset = 0;
253 for(
int i=0; i<numIDs; ++i) {
257 vspace->
addDOFs(fieldIDs[i], idTypes[i], 1, &(IDs[i]));
258 int rec_local_id = recordCollection->
getLocalID(IDs[i]);
263 if (isSlave && i == offsetOfSlave) {
268 weightsOffset += fieldSize;
275 if (weights != NULL) {
276 for(
unsigned j=0; j<fieldSize; ++j) {
287 template<
class RecordType>
296 offsetIntoSlaveField_(0),
299 masterRecordCollections_(),
307 template<
class RecordType>
313 template<
class RecordType>
327 if (masters_ != rhs.
masters_)
return(
true);
339 template<
class RecordType>
352 if (masters_ != rhs.
masters_)
return(
false);
361 #endif // _snl_fei_Constraint_hpp_