159 for (
int j = 0; j <
N; j++ ) {
182 std :: vector< std :: set< int > > columns(neq);
187 elem->giveLocationArray(loc, s);
189 for (
int ii : loc ) {
191 for (
int jj : loc ) {
193 columns [ jj - 1 ].insert(ii - 1);
202 std :: vector< IntArray >r_locs;
203 std :: vector< IntArray >c_locs;
205 for (
auto &gbc : domain->
giveBcs() ) {
209 for ( std :: size_t k = 0; k < r_locs.size(); k++ ) {
212 for (
int ii : krloc ) {
214 for (
int jj : kcloc ) {
216 columns [ jj - 1 ].insert(ii - 1);
225 for (
int i = 0; i < neq; i++ ) {
226 this->
nz_ += columns [ i ].size();
233 for (
int j = 0; j < neq; j++ ) {
235 for (
int row: columns [ j ] ) {
263 OOFEM_ERROR(
"dimension of 'k' and 'loc' mismatch");
267 for (
int j = 0; j <
dim; j++ ) {
272 int last_ii = this->
nRows + 1;
273 for (
int i = 0; i <
dim; i++ ) {
279 else if ( ii > last_ii )
281 for ( ;
rowind_[t] < ii - 1; t++ ) {
284 OOFEM_ERROR(
"Couldn't find row %d in the sparse structure", ii);
287 val_[t] += mat(i, j);
307 for (
int j = 0; j < dim2; j++ ) {
312 int last_ii = this->
nRows + 1;
313 for (
int i = 0; i < dim1; i++ ) {
319 else if ( ii > last_ii )
321 for ( ;
rowind_[t] < ii - 1; t++ ) {
324 OOFEM_ERROR(
"Couldn't find row %d in the sparse structure", ii);
327 val_[t] += mat(i, j);
370 OOFEM_ERROR(
"Array accessing exception -- (%d,%d) out of bounds", i, j);
383 if ( i <=
dim_ [ 0 ] && j <=
dim_ [ 1 ] ) {
386 OOFEM_ERROR(
"Array accessing exception -- (%d,%d) out of bounds", i, j);
399 if ( i <
dim_ [ 0 ] && j <
dim_ [ 1 ] ) {
402 OOFEM_ERROR(
"Array accessing exception -- (%d,%d) out of bounds", i, j);
418 OOFEM_ERROR(
"Array element (%d,%d) not in sparse structure -- cannot assign", i, j);
429 OOFEM_ERROR(
"Error in CompCol -- incompatible dimensions");
435 for (
int i = 0; i <
N; i++ ) {
int giveNumberOfColumns() const
Returns number of columns of receiver.
int nColumns
Number of columns.
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
Base class for all matrices stored in sparse format.
virtual int assemble(const IntArray &loc, const FloatMatrix &mat)
Assembles sparse matrix from contribution of local elements.
SparseMtrx * GiveCopy() const
Returns a newly allocated copy of receiver.
virtual void timesT(const FloatArray &x, FloatArray &answer) const
Evaluates .
virtual void toFloatMatrix(FloatMatrix &answer) const
Converts receiving sparse matrix to a dense float matrix.
double operator()(int i, int j) const
implements 0-based access
#define OOFEM_LOG_DEBUG(...)
Class implementing an array of integers.
virtual double & at(int i, int j)
Returns coefficient at position (i,j).
std::vector< std::unique_ptr< GeneralBoundaryCondition > > & giveBcs()
virtual void zero()
Zeroes the receiver.
REGISTER_SparseMtrx(CompCol, SMT_CompCol)
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
Abstract base class for all active boundary conditions.
void resize(int n)
Checks size of receiver towards requested bounds.
SparseMtrxVersionType version
Allows to track if receiver changes.
virtual int buildInternalStructure(EngngModel *, int, const UnknownNumberingScheme &s)
Builds internal structure of receiver.
Class representing vector of real numbers.
virtual void times(const FloatArray &x, FloatArray &answer) const
Evaluates .
Implementation of matrix containing floating point numbers.
void zero()
Zeroes all coefficients of receiver.
void times(double s)
Multiplies receiver with scalar.
std::vector< std::unique_ptr< Element > > & giveElements()
virtual void printYourself() const
Prints receiver to stdout. Works only for relatively small matrices.
Abstract base class representing the "problem" under consideration.
CompCol & operator=(const CompCol &C)
Assignment operator.
int giveSize() const
Returns the size of receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
Domain * giveDomain(int n)
Service for accessing particular problem domain.
int giveNumberOfRows() const
Returns number of rows of receiver.
virtual void giveLocationArrays(std::vector< IntArray > &rows, std::vector< IntArray > &cols, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s)
Gives a list of location arrays that will be assembled.
void resize(int s)
Resizes receiver towards requested size.