29 cout <<
"matrixContributions don't match." << endl;
34 cout <<
"rhsContributions don't match." << endl;
43 return( !( *
this == rhs) );
65 cout <<
"elemBlockIDs don't match." << endl;
69 for(
int i=0; i<
elemIDs.length(); i++) {
73 for(
int j=0; j<
elemIDs[i]->length(); j++) {
75 int id2 = (*(rhs.
elemIDs[i]))[j];
78 cout <<
"elemIDs don't match. element-block " <<
elemBlockIDs[i]
79 <<
", elemID in position " << j <<
" is " << id1
80 <<
", doesn't match " << id2 <<
"." << endl;
84 if (elems[j] != rhsElems[j]) {
85 cout <<
"element-block " <<
elemBlockIDs[i] <<
", elemID " << id1
86 <<
"'s element-contributions don't match." << endl;
97 return( !( (*
this) == rhs) );
105 int err, insertPoint = -1;
106 int blkInd =
elemBlockIDs.binarySearch(elemBlockID, insertPoint);
109 err +=
elemIDs.insert(
elemIDs.begin()+insertPoint,
new std::vector<int>);
111 if (err != 0)
return(err);
112 blkInd = insertPoint;
115 std::vector<int>& IDs = *(
elemIDs[blkInd]);
118 err = IDs.insertSorted(elemID);
119 if (err == -2)
return(err);
122 if (err >= 0) err = ec.insert(ec.begin()+err, dummy);
123 if (err == -2)
return(err);
128 int addElemMatrix(
int elemBlockID,
int elemID, std::vector<double>& matrixData)
130 int insertPoint = -1;
131 int blkInd =
elemBlockIDs.binarySearch(elemBlockID, insertPoint);
133 cerr <<
" addElemMatrix ERROR, elemBlockID " << (int)elemBlockID
134 <<
" not found" << endl;
138 int elemIdx =
elemIDs[blkInd]->binarySearch(elemID);
140 cerr <<
"addElemMatrix ERROR, elemID " << (int)elemID <<
" not found."
148 int len = matrixData.length();
149 int oldLen = elemContrMatrix.length();
151 elemContrMatrix.resize(len);
152 for(
int i=oldLen; i<len; i++) elemContrMatrix[i] = 0.0;
155 for(
int i=0; i<matrixData.length(); i++) {
156 elemContrMatrix[i] += matrixData[i];
162 int addElemRHS(
int elemBlockID,
int elemID, std::vector<double>& rhsData)
164 int insertPoint = -1;
165 int blkInd =
elemBlockIDs.binarySearch(elemBlockID, insertPoint);
167 cerr <<
" addElemRHS ERROR, elemBlockID " << (int)elemBlockID
168 <<
" not found" << endl;
172 int elemIdx =
elemIDs[blkInd]->binarySearch(elemID);
174 cerr <<
"addElemRHS ERROR, elemID " << (int)elemID <<
" not found."<<endl;
181 int len = rhsData.length();
182 int oldLen = elemContrRHS.length();
184 elemContrRHS.resize(len);
185 for(
int i=oldLen; i<len; i++) elemContrRHS[i] = 0.0;
188 for(
int i=0; i<rhsData.length(); i++) {
189 elemContrRHS[i] += rhsData[i];
196 #endif // _InputData_h_
std::vector< double > matrixContributions
bool operator==(const ElemContribution &rhs)
ElemContribution(const ElemContribution &src)
bool operator!=(const ElemContribution &rhs)
std::vector< double > rhsContributions