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,
164template<
class RecordType>
168 recordCollection_(NULL),
169 isPenalty_(isPenaltyConstr),
174 offsetIntoSlaveField_(0),
177 masterRecordCollections_(),
185template<
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) {
287template<
class RecordType>
296 offsetIntoSlaveField_(0),
299 masterRecordCollections_(),
307template<
class RecordType>
313template<
class RecordType>
327 if (masters_ != rhs.
masters_)
return(
true);
339template<
class RecordType>
352 if (masters_ != rhs.
masters_)
return(
false);
unsigned getFieldSize(int fieldID)
int addDOFs(int fieldID, int idType, int numIDs, const int *IDs)
int getRecordCollection(int idType, snl_fei::RecordCollection *&records)
void setEqnNumber(int eqn)
std::vector< int > & getMasterIDTypes()
std::vector< int > & getMasterFieldIDs()
std::vector< int > masterFields_
void setIDType(int idType)
bool structurallySame(const Constraint< RecordType > &rhs)
std::vector< snl_fei::RecordCollection * > masterRecordCollections_
std::vector< snl_fei::RecordCollection * > & getMasterRecordCollections()
void setConstraintID(int id)
bool operator!=(const Constraint< RecordType > &rhs)
void setBlkEqnNumber(int blkEqn)
void setOffsetIntoSlaveField(int offset)
Constraint(int id=0, bool isPenaltyConstr=false)
std::vector< int > & getMasters()
snl_fei::RecordCollection * recordCollection_
std::vector< double > masterWeights_
void setRHSValue(double rhs)
snl_fei::RecordCollection * getRecordCollection()
std::vector< int > masterIDTypes_
void setIsPenalty(bool isPenaltyConstr)
void setSlaveFieldID(int f)
std::vector< int > masters_
std::vector< double > & getMasterWeights()
int getBlkEqnNumber() const
int getSlaveFieldID() const
int offsetIntoSlaveField_
Constraint< RecordType > & operator=(const Constraint< RecordType > &src)
double getRHSValue() const
int getConstraintID() const
int getOffsetIntoSlaveField() const
int getLocalID(int global_id) const
fei::Record< int > * getRecordWithLocalID(int lid)