96 for (
int j = 1; j <=
size; j++ ) {
98 for (
int i = start; i <= j; i++ ) {
99 answer.
at(i, j) = this->
at(i, j);
100 answer.
at(j, i) = this->
at(j, i);
116 }
else if ( i > j ) {
130 }
else if ( i > j ) {
152 OOFEM_ERROR(
"dimension of 'k' and 'loc' mismatch");
164 for (
int j = 1; j <= dim; j++ ) {
167 for (
int i = 1; i <= dim; i++ ) {
170 this->
at(ii, jj) += mat.
at(i, j);
198 for (
int i = 1; i <= dim1; i++ ) {
201 for (
int j = 1; j <= dim2; j++ ) {
204 this->
at(ii, jj) += mat.
at(i, j);
221 int maxCol, dim1, dim2;
227 for (
int i = 1; i <= dim1; i++ ) {
228 maxCol =
max( maxCol, rloc.
at(i) );
231 for (
int j = 1; j <= dim2; j++ ) {
232 maxCol =
max( maxCol, cloc.
at(j) );
235 if ( maxCol >
size ) {
239 for (
int i = 1; i <= dim1; i++ ) {
246 for (
int j = 1; j <= dim2; j++ ) {
291 for (
int i = 1; i <= neq; i++ ) {
292 firstIndex.
at(i) = i;
295 for (
int n = 1; n <= nelem; n++ ) {
309 for (
int i = 1; i <= loc.
giveSize(); i++ ) {
311 if ( ii && ii < first ) {
317 for (
int i = 1; i <= loc.
giveSize(); i++ ) {
319 if ( ii && ( first < firstIndex.
at(ii) ) ) {
320 firstIndex.
at(ii) = first;
327 std :: vector< IntArray >r_locs;
328 std :: vector< IntArray >c_locs;
330 for (
int i = 1; i <= nbc; ++i ) {
334 for ( std :: size_t j = 0; j < r_locs.size(); j++ ) {
338 for (
int k = 1; k <= kcloc.
giveSize(); k++ ) {
339 int kk = kcloc.
at(k);
341 first =
min(first, kk);
344 for (
int k = 1; k <= krloc.
giveSize(); k++ ) {
345 int kk = krloc.
at(k);
346 if ( kk && ( first < firstIndex.
at(kk) ) ) {
347 firstIndex.
at(kk) = first;
356 for (
int i = 1; i <= neq; i++ ) {
386 for (
int i = 1; i <= n - 1; i++ ) {
387 mht.
at(i) = adr1.
at(i + 1) - adr1.
at(i);
388 firstIndex.
at(i) = i - mht.
at(i) + 1;
392 for (
int i = 1; i <= n - 1; i++ ) {
417 for (
int i = 1; i <= dim; i++ ) {
418 maxCol =
max( maxCol, loc.
at(i) );
421 if ( maxCol >
size ) {
425 for (
int i = 1; i <= dim; i++ ) {
462 int start, startK, startI;
478 for (
int k = 1; k <=
size; k++ ) {
487 for (
int p = startK; p < k; p++ ) {
489 r.
at(p) = diag * rowColumnK->
atU(p);
490 w.
at(p) = diag * rowColumnK->
atL(p);
494 rowColumnK->
atDiag() -= rowColumnK->
dot(r,
'R', startK, k - 1);
495 diag = rowColumnK->
atDiag();
500 OOFEM_LOG_DEBUG(
"SkylineUnsym :: factorized: zero pivot %d artificially set to a small value", k);
504 for (
int i = k + 1; i <=
size; i++ ) {
508 start =
max(startI, startK);
509 rowColumnI->
atL(k) -= rowColumnI->
dot(r,
'R', start, k - 1);
510 rowColumnI->
atL(k) /= diag;
511 rowColumnI->
atU(k) -= rowColumnI->
dot(w,
'C', start, k - 1);
512 rowColumnI->
atU(k) /= diag;
549 if ( y.giveSize() !=
size ) {
553 for (
int k = 1; k <=
size; k++ ) {
556 y.at(k) -= rowColumnK->
dot(y,
'R', start, k - 1);
561 for (
int k = 1; k <=
size; k++ ) {
573 for (
int k =
size; k > 0; k-- ) {
577 for (
int i = start; i < k; i++ ) {
578 y.at(i) -= rowColumnK->
atU(i) * yK;
592 for (
int i = 1; i <=
size; i++ ) {
595 newRowColumns [ i - 1 ] = rowColumni->
GiveCopy();
597 newRowColumns [ i - 1 ] = NULL;
620 for (
int i = 1; i <=
size; i++ ) {
623 answer.
at(i) += rowColumni->
dot(x,
'R', starti, i - 1);
624 answer.
at(i) += rowColumni->
atDiag() * x.
at(i);
626 for (
int j = starti; j <= i - 1; j++ ) {
627 answer.
at(j) += rowColumni->
atU(j) * x.
at(i);
637 for (
int i = 1; i <=
size; i++ ) {
640 for (
int j = starti; j <= i - 1; j++ ) {
641 rowColumni->
atU(j) *= x;
642 rowColumni->
atL(j) *= x;
645 rowColumni->
atDiag() *= x;
683 else if ( n <=
size ) {
714 for (
int i = 1; i <=
size; i++ ) {
725 FILE *file = fopen(fname,
"w");
728 for (
int i = 1; i <=
nRows; ++i ) {
729 for (
int j = 1; j <=
nColumns; ++j ) {
730 fprintf( file,
"%.16e ", copy.
at(i, j) );
752 for (
int j = 1; j <=
size; j++ ) {
813 for (
int i = 1; i <=
size; i++ ) {
816 answer.
at(i) += rowColumni->
dot(x,
'C', starti, i - 1);
817 answer.
at(i) += rowColumni->
atDiag() * x.
at(i);
819 for (
int j = starti; j <= i - 1; j++ ) {
820 answer.
at(j) += rowColumni->
atL(j) * x.
at(i);
void checkSizeTowards(const IntArray &)
virtual void writeToFile(const char *fname) const
Helpful for debugging, writes the matrix to given file.
int nColumns
Number of columns.
int giveNumberOfColumns() const
Returns number of columns of receiver.
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
This class implements a segment of a unsymmetric matrix stored in segmented form (skyline).
Base class for all matrices stored in sparse format.
int giveNumberOfBoundaryConditions() const
Returns number of boundary conditions in domain.
virtual void printYourself() const
Prints receiver to stdout. Works only for relatively small matrices.
virtual int assemble(const IntArray &loc, const FloatMatrix &mat)
Assembles sparse matrix from contribution of local elements.
void zero()
Sets all component to zero.
double & at(int i)
Coefficient access function.
int max(int i, int j)
Returns bigger value form two given decimals.
virtual void times(const FloatArray &x, FloatArray &answer) const
Evaluates .
Abstract base class for all finite elements.
SkylineUnsym()
Constructor.
virtual int buildInternalStructure(EngngModel *, int, const UnknownNumberingScheme &s)
Builds internal structure of receiver.
int giveNumberOfElements() const
Returns number of elements in domain.
#define OOFEM_LOG_DEBUG(...)
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual int useNonlocalStiffnessOption()
Returns nonzero if nonlocal stiffness option activated.
RowColumn * giveRowColumn(int j) const
virtual void printStatistics() const
Prints the receiver statistics (one-line) to stdout.
GeneralBoundaryCondition * giveBc(int n)
Service for accessing particular domain bc.
This class implements a nonsymmetric matrix stored in a compacted (skyline) form. ...
#define SkylineUnsym_TINY_PIVOT
"zero" pivot for SkylineUnsym class
#define OOFEM_LOG_INFO(...)
Element * giveElement(int n)
Service for accessing particular domain fe element.
virtual SparseMtrx * factorized()
Returns the receiver factorized.
RowColumn ** rowColumns
Row column segments.
REGISTER_SparseMtrx(CompCol, SMT_CompCol)
virtual FloatArray * backSubstitutionWith(FloatArray &) const
Computes the solution of linear system where A is receiver.
void giveLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s, IntArray *dofIds=NULL) const
Returns the location array (array of code numbers) of receiver for given numbering scheme...
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
virtual double & at(int i, int j)
Returns coefficient at position (i,j).
void checkSizeTowards(const IntArray &)
Abstract base class for all active boundary conditions.
double at(int i, int j) const
Coefficient access function.
void resize(int n)
Checks size of receiver towards requested bounds.
SparseMtrxVersionType version
Allows to track if receiver changes.
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
Class representing vector of real numbers.
int size
Size of receiver.
virtual SparseMtrx * GiveCopy() const
Returns a newly allocated copy of receiver.
Implementation of matrix containing floating point numbers.
double dot(const FloatArray &, char, int, int)
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
virtual void zero()
Zeroes the receiver.
void zero()
Zeroes all coefficients of receiver.
Class implementing single timer, providing wall clock and user time capabilities. ...
virtual ~SkylineUnsym()
Destructor.
void printYourself() const
Prints matrix to stdout. Useful for debugging.
void zero()
Zeroes all coefficient of receiver.
int isFactorized
Factorization flag.
virtual void timesT(const FloatArray &x, FloatArray &answer) const
Evaluates .
int min(int i, int j)
Returns smaller value from two given decimals.
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.
Domain * giveDomain(int n)
Service for accessing particular problem domain.
virtual void toFloatMatrix(FloatMatrix &answer) const
Converts receiving sparse matrix to a dense float matrix.
int giveNumberOfRows() const
Returns number of rows of receiver.
double getUtime()
Returns total user time elapsed in seconds.
#define OOFEM_WARNING(...)
int setInternalStructure(IntArray &a)
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.