MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / Assemble

Method Assemble

DEVELOPER/core/Matrix.cpp:304–327  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302
303
304int
305Matrix::Assemble(const Matrix &V, const ID &rows, const ID &cols, double fact)
306{
307 int pos_Rows, pos_Cols;
308 int res = 0;
309
310 for (int i=0; i<cols.Size(); i++) {
311 pos_Cols = cols(i);
312 for (int j=0; j<rows.Size(); j++) {
313 pos_Rows = rows(j);
314
315 if ((pos_Cols >= 0) && (pos_Rows >= 0) && (pos_Rows < numRows) &&
316 (pos_Cols < numCols) && (i < V.numCols) && (j < V.numRows))
317 (*this)(pos_Rows,pos_Cols) += V(j,i)*fact;
318 else {
319 opserr << "WARNING: Matrix::Assemble(const Matrix &V, const ID &l): ";
320 opserr << " - position (" << pos_Rows << "," << pos_Cols << ") outside bounds \n";
321 res = -1;
322 }
323 }
324 }
325
326 return res;
327}
328
329#ifdef _WIN32
330#ifndef _DLL

Callers 1

doMvMethod · 0.45

Calls 3

colsFunction · 0.85
rowsFunction · 0.85
SizeMethod · 0.45

Tested by

no test coverage detected