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_
bool operator!=(const Constraint< RecordType > &rhs)
std::vector< int > & getMasterFieldIDs()
double getRHSValue() const
std::vector< int > masterIDTypes_
void setEqnNumber(int eqn)
void setConstraintID(int id)
int addDOFs(int fieldID, int idType, int numIDs, const int *IDs)
bool structurallySame(const Constraint< RecordType > &rhs)
Constraint< RecordType > & operator=(const Constraint< RecordType > &src)
int getSlaveFieldID() const
Constraint(int id=0, bool isPenaltyConstr=false)
int getLocalID(int global_id) const
void setBlkEqnNumber(int blkEqn)
std::vector< int > masterFields_
std::vector< double > & getMasterWeights()
int getConstraintID() const
std::vector< int > masters_
void setRHSValue(double rhs)
void setIDType(int idType)
void setOffsetIntoSlaveField(int offset)
snl_fei::RecordCollection * recordCollection_
int getOffsetIntoSlaveField() const
fei::Record< int > * getRecordWithLocalID(int lid)
std::vector< snl_fei::RecordCollection * > masterRecordCollections_
void setSlaveFieldID(int f)
void setIsPenalty(bool isPenaltyConstr)
unsigned getFieldSize(int fieldID)
std::vector< snl_fei::RecordCollection * > & getMasterRecordCollections()
int getBlkEqnNumber() const
std::vector< double > masterWeights_
std::vector< int > & getMasters()
int getRecordCollection(int idType, snl_fei::RecordCollection *&records)
snl_fei::RecordCollection * getRecordCollection()
int offsetIntoSlaveField_
std::vector< int > & getMasterIDTypes()