109 #define MAP(i, j) map [ ( j ) * neq - ( j ) * ( ( j ) + 1 ) / 2 + ( i ) ] 118 std :: vector< std :: set< int > > columns(neq);
123 elem->giveLocationArray(loc, s);
125 for (
int ii : loc ) {
127 for (
int jj : loc ) {
128 if ( jj > 0 && ii >= jj ) {
129 columns [ jj - 1 ].insert(ii - 1);
137 std :: vector< IntArray >r_locs;
138 std :: vector< IntArray >c_locs;
140 for (
auto &gbc : domain->
giveBcs() ) {
144 for ( std :: size_t k = 0; k < r_locs.size(); k++ ) {
147 for (
int ii : krloc ) {
149 for (
int jj : kcloc ) {
150 if ( jj > 0 && ii >= jj ) {
151 columns [ jj - 1 ].insert(ii - 1);
162 for (
auto &
val : columns ) {
170 for (
int j = 0; j < neq; j++ ) {
172 for (
int row: columns [ j ] ) {
209 for (
int j = 0; j <
N; j++ ) {
238 OOFEM_ERROR(
"dimension of 'k' and 'loc' mismatch");
242 for (
int j = 0; j <
dim; j++ ) {
247 int last_ii = this->
nRows + 1;
248 for (
int i = 0; i <
dim; i++ ) {
254 else if ( ii > last_ii )
256 for ( ;
rowind_[t] < ii - 1; t++ ) {
259 OOFEM_ERROR(
"Couldn't find row %d in the sparse structure", ii);
262 val_[t] += mat(i, j);
282 for (
int j = 0; j < dim2; j++ ) {
287 int last_ii = this->
nRows + 1;
288 for (
int i = 0; i < dim1; i++ ) {
294 else if ( ii > last_ii )
296 for ( ;
rowind_[t] < ii - 1; t++ ) {
299 OOFEM_ERROR(
"Couldn't find row %d in the sparse structure", ii);
302 val_[t] += mat(i, j);
339 if (
rowind_(t) == ( ii - 1 ) ) {
344 OOFEM_ERROR(
"Array accessing exception -- out of bounds");
358 if (
rowind_(t) == ( ii - 1 ) ) {
363 if ( i <=
dim_ [ 0 ] && j <=
dim_ [ 1 ] ) {
366 OOFEM_ERROR(
"Array accessing exception -- index out of bounds (%d,%d)", i, j);
385 if ( i <
dim_ [ 0 ] && j <
dim_ [ 1 ] ) {
388 OOFEM_ERROR(
"Array accessing exception, index out of bounds (%d,%d)", i, j);
410 OOFEM_ERROR(
"Array element (%d,%d) not in sparse structure -- cannot assign", i, j);
int giveNumberOfColumns() const
Returns number of columns of receiver.
int nColumns
Number of columns.
virtual int assemble(const IntArray &loc, const FloatMatrix &mat)
Assembles sparse matrix from contribution of local elements.
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 void times(const FloatArray &x, FloatArray &answer) const
Evaluates .
double operator()(int i, int j) const
implements 0-based access
Class implementing an array of integers.
std::vector< std::unique_ptr< GeneralBoundaryCondition > > & giveBcs()
#define OOFEM_LOG_INFO(...)
const double & val(int i) const
REGISTER_SparseMtrx(CompCol, SMT_CompCol)
Symmetric compressed column.
virtual double & at(int i, int j)
Returns coefficient at position (i,j).
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
virtual int buildInternalStructure(EngngModel *, int, const UnknownNumberingScheme &)
Builds internal structure of receiver.
Abstract base class for all active boundary conditions.
void resize(int n)
Checks size of receiver towards requested bounds.
Implementation of symmetric sparse matrix stored using compressed column/row storage.
SparseMtrxVersionType version
Allows to track if receiver changes.
Class representing vector of real numbers.
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()
Abstract base class representing the "problem" under consideration.
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.
virtual SparseMtrx * GiveCopy() const
Returns a newly allocated copy of receiver.
Domain * giveDomain(int n)
Service for accessing particular problem domain.
virtual void zero()
Zeroes the receiver.
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.