OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
skylineu.C
Go to the documentation of this file.
1 /*
2  *
3  * ##### ##### ###### ###### ### ###
4  * ## ## ## ## ## ## ## ### ##
5  * ## ## ## ## #### #### ## # ##
6  * ## ## ## ## ## ## ## ##
7  * ## ## ## ## ## ## ## ##
8  * ##### ##### ## ###### ## ##
9  *
10  *
11  * OOFEM : Object Oriented Finite Element Code
12  *
13  * Copyright (C) 1993 - 2013 Borek Patzak
14  *
15  *
16  *
17  * Czech Technical University, Faculty of Civil Engineering,
18  * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19  *
20  * This library is free software; you can redistribute it and/or
21  * modify it under the terms of the GNU Lesser General Public
22  * License as published by the Free Software Foundation; either
23  * version 2.1 of the License, or (at your option) any later version.
24  *
25  * This program is distributed in the hope that it will be useful,
26  * but WITHOUT ANY WARRANTY; without even the implied warranty of
27  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28  * Lesser General Public License for more details.
29  *
30  * You should have received a copy of the GNU Lesser General Public
31  * License along with this library; if not, write to the Free Software
32  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33  */
34 
35 #include "skylineu.h"
36 #include "rowcol.h"
37 #include "floatmatrix.h"
38 #include "intarray.h"
39 #include "domain.h"
40 #include "engngm.h"
41 #include "element.h"
42 #include "mathfem.h"
43 #include "verbose.h"
44 #include "error.h"
45 #include "sparsemtrxtype.h"
46 #include "activebc.h"
47 #include "classfactory.h"
48 
49 #ifdef TIME_REPORT
50  #include "timer.h"
51 #endif
52 
53 namespace oofem {
54 REGISTER_SparseMtrx(SkylineUnsym, SMT_SkylineU);
55 
57  // Constructor. Creates an empty skyline unsymmetric.
58 
59 {
60  size = n;
61  rowColumns = NULL;
62  isFactorized = false;
63 }
64 
66 {
67  // Constructor. Creates a skyline of size 0.
68  // nRows = nColumns = 0; // set by SparseMtrx constructor
69  size = 0;
70  rowColumns = NULL;
71  isFactorized = false;
72 }
73 
75 // Destructor.
76 
77 {
78  if ( size ) {
79  int i = size;
80  RowColumn **p = rowColumns;
81  while ( i-- ) {
82  delete *p++;
83  }
84 
85  delete [] rowColumns;
86  }
87 }
88 
89 void
91 {
92  int start;
93 
94  answer.resize(size, size);
95  answer.zero();
96  for ( int j = 1; j <= size; j++ ) {
97  start = this->giveRowColumn(j)->giveStart();
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);
101  }
102  }
103 }
104 
105 
106 double &
107 SkylineUnsym :: at(int i, int j)
108 // Returns the (i,j) coefficient of the receiver. Not very efficient.
109 
110 {
111  // increment version
112  this->version++;
113 
114  if ( i < j ) {
115  return this->giveRowColumn(j)->atU(i);
116  } else if ( i > j ) {
117  return this->giveRowColumn(i)->atL(j);
118  } else {
119  return this->giveRowColumn(i)->atDiag();
120  }
121 }
122 
123 double
124 SkylineUnsym :: at(int i, int j) const
125 // Returns the (i,j) coefficient of the receiver. Not very efficient.
126 
127 {
128  if ( i < j ) {
129  return this->giveRowColumn(j)->atU(i);
130  } else if ( i > j ) {
131  return this->giveRowColumn(i)->atL(j);
132  } else {
133  return this->giveRowColumn(i)->atDiag();
134  }
135 }
136 
137 
138 int
140 // Assembles the elemental matrix 'k' to the receiver, using 'loc' as a
141 // location array. The values in k corresponding to a zero coefficient
142 // in loc are not assembled.
143 // Warning : k is not supposed to be an instance of DiagonalMatrix.
144 
145 {
146  int dim;
147  // RowColumn* rowColumnJJ ; // 13 November 1996 - not needed anymore
148 
149 # ifdef DEBUG
150  dim = mat.giveNumberOfRows();
151  if ( dim != loc.giveSize() ) {
152  OOFEM_ERROR("dimension of 'k' and 'loc' mismatch");
153  }
154 
155  this->checkSizeTowards(loc);
156 # endif
157 
158  // added to make it work for nonlocal model !!!!!!!!!!!!!!!!!!!!!!!!!!
159  // checkSizeTowards(loc) ;
160 
161 
162  dim = mat.giveNumberOfRows();
163 
164  for ( int j = 1; j <= dim; j++ ) {
165  int jj = loc.at(j);
166  if ( jj ) {
167  for ( int i = 1; i <= dim; i++ ) {
168  int ii = loc.at(i);
169  if ( ii ) {
170  this->at(ii, jj) += mat.at(i, j);
171  }
172  }
173  }
174  }
175 
176  // increment version
177  this->version++;
178 
179  return 1;
180 }
181 
182 
183 int
184 SkylineUnsym :: assemble(const IntArray &rloc, const IntArray &cloc, const FloatMatrix &mat)
185 // Assembles the elemental matrix 'k' to the receiver, using 'loc1' as a
186 // location array for rows and 'loc2' as a location array for columns.
187 // The values in 'k' corresponding to a zero coefficient
188 // in loc are not assembled.
189 // Warning : k is not supposed to be an instance of DiagonalMatrix.
190 
191 {
192  int dim1, dim2;
193 
194  this->checkSizeTowards(rloc, cloc);
195 
196  dim1 = mat.giveNumberOfRows();
197  dim2 = mat.giveNumberOfColumns();
198  for ( int i = 1; i <= dim1; i++ ) {
199  int ii = rloc.at(i);
200  if ( ii ) {
201  for ( int j = 1; j <= dim2; j++ ) {
202  int jj = cloc.at(j);
203  if ( jj ) {
204  this->at(ii, jj) += mat.at(i, j);
205  }
206  }
207  }
208  }
209 
210  // increment version
211  this->version++;
212 
213  return 1;
214 }
215 
216 void
218 // Increases the number of columns of the receiver if 'rloc, cloc' points to
219 // out-of-range columns.
220 {
221  int maxCol, dim1, dim2;
222 
223  maxCol = 0; // the largest coefficient in 'loc'
224  dim1 = rloc.giveSize();
225  dim2 = cloc.giveSize();
226 
227  for ( int i = 1; i <= dim1; i++ ) {
228  maxCol = max( maxCol, rloc.at(i) );
229  }
230 
231  for ( int j = 1; j <= dim2; j++ ) {
232  maxCol = max( maxCol, cloc.at(j) );
233  }
234 
235  if ( maxCol > size ) { // enlarge the matrix
236  growTo(maxCol);
237  }
238 
239  for ( int i = 1; i <= dim1; i++ ) {
240  int ii = rloc.at(i);
241  if ( ii ) {
242  giveRowColumn(ii)->checkSizeTowards(cloc);
243  }
244  }
245 
246  for ( int j = 1; j <= dim2; j++ ) {
247  int jj = cloc.at(j);
248  if ( jj ) {
249  giveRowColumn(jj)->checkSizeTowards(rloc);
250  }
251  }
252 }
253 
254 
255 
256 int
258 {
259  // Instanciates the profile of the receiver and initializes all coefficients to zero.
260  // Warning : case diagonal (lumped) matrix to expected.
261 
262  IntArray loc;
263  int first, nonlocal;
264  Domain *domain = eModel->giveDomain(di);
265  int neq = eModel->giveNumberOfDomainEquations(di, s);
266  int nelem = domain->giveNumberOfElements();
267  Element *elem;
268  //nonlocal = aDomain -> giveAlgorithm() -> useNonlocalStiffness();
269  nonlocal = eModel->useNonlocalStiffnessOption();
270 
271  // clear receiver if exist
272 
273  if ( size ) {
274  RowColumn **_p;
275  int _i;
276  _i = size;
277  _p = rowColumns;
278  while ( _i-- ) {
279  delete *_p++;
280  }
281 
282  delete [] rowColumns;
283  rowColumns = NULL;
284  size = 0;
285  }
286 
287  this->growTo(neq); // from now on, size = MaxIndex
288 
289  // Set up the array with indices of first nonzero elements in each row
290  IntArray firstIndex(neq);
291  for ( int i = 1; i <= neq; i++ ) {
292  firstIndex.at(i) = i;
293  }
294 
295  for ( int n = 1; n <= nelem; n++ ) {
296  elem = domain->giveElement(n);
297  //elem -> giveLocationArray (loc) ;
298 
299  if ( !nonlocal ) {
300  elem->giveLocationArray(loc, s);
301  }
302  //else ((StructuralElement*)elem) -> giveNonlocalLocationArray(loc) ;
303  else {
304  elem->giveLocationArray(loc, s);
305  }
306 
307  // Find 'first', the smallest positive number in LocArray
308  first = neq;
309  for ( int i = 1; i <= loc.giveSize(); i++ ) {
310  int ii = loc.at(i);
311  if ( ii && ii < first ) {
312  first = ii;
313  }
314  }
315 
316  // Make sure that the FirstIndex is not larger than 'first'
317  for ( int i = 1; i <= loc.giveSize(); i++ ) {
318  int ii = loc.at(i);
319  if ( ii && ( first < firstIndex.at(ii) ) ) {
320  firstIndex.at(ii) = first;
321  }
322  }
323  }
324 
325  // loop over active boundary conditions
326  int nbc = domain->giveNumberOfBoundaryConditions();
327  std :: vector< IntArray >r_locs;
328  std :: vector< IntArray >c_locs;
329 
330  for ( int i = 1; i <= nbc; ++i ) {
331  ActiveBoundaryCondition *bc = dynamic_cast< ActiveBoundaryCondition * >( domain->giveBc(i) );
332  if ( bc != NULL ) {
333  bc->giveLocationArrays(r_locs, c_locs, UnknownCharType, s, s);
334  for ( std :: size_t j = 0; j < r_locs.size(); j++ ) {
335  IntArray &krloc = r_locs [ j ];
336  IntArray &kcloc = c_locs [ j ];
337  first = neq;
338  for ( int k = 1; k <= kcloc.giveSize(); k++ ) {
339  int kk = kcloc.at(k);
340  if ( kk ) {
341  first = min(first, kk);
342  }
343  }
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;
348  }
349  }
350  }
351  }
352  }
353 
354 
355  // Enlarge the rowcolumns
356  for ( int i = 1; i <= neq; i++ ) {
357  this->giveRowColumn(i)->growTo( firstIndex.at(i) );
358  }
359 
360  // Print out basic information.
361  this->printStatistics();
362 
363  nRows = nColumns = neq;
364  // increment version
365  this->version++;
366 
367  return true;
368 }
369 
370 
372 {
373  // allocates and built structure according to given
374  // array of maximal column heights
375  //
376  IntArray mht, firstIndex;
377  int n = adr1.giveSize();
378  this->growTo(n - 1);
379  size = n - 1; // check
380 
381  // build first index array
382  mht.resize(n - 1);
383  mht.zero();
384  firstIndex.resize(n - 1);
385  firstIndex.zero();
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;
389  }
390 
391  // Enlarge the rowcolumns
392  for ( int i = 1; i <= n - 1; i++ ) {
393  this->giveRowColumn(i)->growTo( firstIndex.at(i) );
394  }
395 
396  // Print out basic information.
397  this->printStatistics();
398 
399  nRows = nColumns = n - 1;
400  // increment version
401  this->version++;
402 
403  return true;
404 }
405 
406 
407 
408 void
410 // Increases the number of columns of the receiver if 'loc' points to
411 // out-of-range columns.
412 {
413  int dim, maxCol;
414 
415  maxCol = 0; // the largest coefficient in 'loc'
416  dim = loc.giveSize();
417  for ( int i = 1; i <= dim; i++ ) {
418  maxCol = max( maxCol, loc.at(i) );
419  }
420 
421  if ( maxCol > size ) { // enlarge the matrix
422  growTo(maxCol);
423  }
424 
425  for ( int i = 1; i <= dim; i++ ) {
426  int ii = loc.at(i);
427  if ( ii ) {
429  }
430  }
431 }
432 
433 /*
434  * int
435  * SkylineUnsym :: computeNumberNegativeEigenvalue()
436  * // Compute the number of negative eigenvalue, equivalent to the number of
437  * // negative diagonal terms.
438  *
439  * {
440  * int j, count;
441  *
442  * if (! isFactorized) factorized();
443  *
444  * count = 0;
445  * for (j=1 ; j<=size ; j++) {
446  * if (at(j,j) <= 0.)
447  * count = count + 1;
448  * }
449  * return count;
450  * }
451  */
452 
453 SparseMtrx *
455 // Returns the receiver in L.D.U factorized form. From Golub & van Loan,
456 // 1rst edition, pp 83-84.
457 
458 {
459  RowColumn *rowColumnK, *rowColumnI;
460  FloatArray r, w;
461  double diag;
462  int start, startK, startI;
463 #ifdef TIME_REPORT
464  Timer timer;
465  timer.startTimer();
466 #endif
467 
468  if ( isFactorized ) {
469  return this;
470  }
471 
472  if ( !size ) {
473  OOFEM_WARNING("null-sized matrix factorized");
474  isFactorized = 1;
475  return this;
476  }
477 
478  for ( int k = 1; k <= size; k++ ) {
479  rowColumnK = this->giveRowColumn(k);
480  startK = rowColumnK->giveStart();
481 
482  // compute vectors r and w
483  r.resize(k - 1);
484  r.zero();
485  w.resize(k - 1);
486  w.zero();
487  for ( int p = startK; p < k; p++ ) {
488  diag = this->giveRowColumn(p)->atDiag();
489  r.at(p) = diag * rowColumnK->atU(p);
490  w.at(p) = diag * rowColumnK->atL(p);
491  }
492 
493  // compute diagonal coefficient of rowColumn k
494  rowColumnK->atDiag() -= rowColumnK->dot(r, 'R', startK, k - 1);
495  diag = rowColumnK->atDiag();
496 
497  // test pivot not too small
498  if ( fabs(diag) < SkylineUnsym_TINY_PIVOT ) {
499  rowColumnK->atDiag() = diag = SkylineUnsym_TINY_PIVOT;
500  OOFEM_LOG_DEBUG("SkylineUnsym :: factorized: zero pivot %d artificially set to a small value", k);
501  }
502 
503  // compute off-diagonal coefficients of rowColumns i>k
504  for ( int i = k + 1; i <= size; i++ ) {
505  rowColumnI = giveRowColumn(i);
506  startI = rowColumnI->giveStart();
507  if ( startI <= k ) {
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;
513  }
514  }
515  }
516 
517  isFactorized = true;
518 
519 #ifdef TIME_REPORT
520  timer.stopTimer();
521  OOFEM_LOG_DEBUG( "SkylineU info: user time consumed by factorization: %.2fs\n", timer.getUtime() );
522 #endif
523  // increment version
524  //this->version++;
525 
526  return this;
527 }
528 
529 
530 
531 FloatArray *
533 // Returns the solution x of the system U.x = y , where U is the upper
534 // half of the receiver. Note : x overwrites y.
535 
536 {
537  int start;
538  double yK, diag;
539  RowColumn *rowColumnK;
540 
541 
542  // forwardReductionWith
543  // if (! isFactorized) this -> factorized();
544 
545  if ( !size ) {
546  return & y; // null size system
547  }
548 
549  if ( y.giveSize() != size ) {
550  OOFEM_ERROR("size mismatch");
551  }
552 
553  for ( int k = 1; k <= size; k++ ) {
554  rowColumnK = this->giveRowColumn(k);
555  start = rowColumnK->giveStart();
556  y.at(k) -= rowColumnK->dot(y, 'R', start, k - 1);
557  }
558 
559  // diagonalScaling
560  /* uprava diagonalniho prvku */
561  for ( int k = 1; k <= size; k++ ) {
562  diag = this->giveRowColumn(k)->atDiag();
563 # ifdef DEBUG
564  if ( fabs(diag) < SkylineUnsym_TINY_PIVOT ) {
565  OOFEM_ERROR("pivot %d is small", k);
566  }
567 
568 # endif
569  y.at(k) /= diag;
570  }
571 
572 
573  for ( int k = size; k > 0; k-- ) {
574  rowColumnK = this->giveRowColumn(k);
575  yK = y.at(k);
576  start = rowColumnK->giveStart();
577  for ( int i = start; i < k; i++ ) {
578  y.at(i) -= rowColumnK->atU(i) * yK;
579  }
580  }
581 
582  return & y;
583 }
584 
585 SparseMtrx *
587 {
588  RowColumn **newRowColumns, *rowColumni;
589  newRowColumns = new RowColumn * [ size ];
590  SkylineUnsym *answer;
591 
592  for ( int i = 1; i <= size; i++ ) {
593  rowColumni = this->giveRowColumn(i);
594  if ( rowColumni ) {
595  newRowColumns [ i - 1 ] = rowColumni->GiveCopy();
596  } else {
597  newRowColumns [ i - 1 ] = NULL;
598  }
599  }
600 
601  answer = new SkylineUnsym(newRowColumns, this->size, this->isFactorized);
602  return answer;
603 }
604 
605 void
607 {
608  int starti;
609  RowColumn *rowColumni;
610  //
611  // first check sizes
612  //
613  if ( this->size != x.giveSize() ) {
614  OOFEM_ERROR("size mismatch");
615  }
616 
617  answer.resize(this->size);
618  answer.zero();
619 
620  for ( int i = 1; i <= size; i++ ) {
621  rowColumni = this->giveRowColumn(i);
622  starti = rowColumni->giveStart();
623  answer.at(i) += rowColumni->dot(x, 'R', starti, i - 1);
624  answer.at(i) += rowColumni->atDiag() * x.at(i);
625 
626  for ( int j = starti; j <= i - 1; j++ ) {
627  answer.at(j) += rowColumni->atU(j) * x.at(i);
628  }
629  }
630 }
631 
632 void SkylineUnsym :: times(double x)
633 {
634  int starti;
635  RowColumn *rowColumni;
636 
637  for ( int i = 1; i <= size; i++ ) {
638  rowColumni = this->giveRowColumn(i);
639  starti = rowColumni->giveStart();
640  for ( int j = starti; j <= i - 1; j++ ) {
641  rowColumni->atU(j) *= x;
642  rowColumni->atL(j) *= x;
643  }
644 
645  rowColumni->atDiag() *= x;
646  }
647 
648  // increment version
649  this->version++;
650 }
651 
652 
653 RowColumn *
655 // Returns the j-th rowColumn of the receiver. Creates it if necessary.
656 
657 {
658  if ( size < j ) {
659  // this -> growTo(j) ;
660  OOFEM_ERROR("size mismatch");
661  }
662 
663  if ( !rowColumns [ j - 1 ] ) {
664  rowColumns [ j - 1 ] = new RowColumn(j, j);
665  }
666 
667  return rowColumns [ j - 1 ];
668 }
669 
670 
671 void
673 // Enlarges the receiver to n columns.
674 {
675  RowColumn **newRowColumns, **p1, **p2;
676  int i;
677 
678  if ( n == size ) {
679  return;
680  }
681 
682 # ifdef DEBUG
683  else if ( n <= size ) {
684  OOFEM_ERROR("cannot grow from %d to %d", size, n);
685  }
686 # endif
687 
688  newRowColumns = new RowColumn * [ n ];
689  p1 = rowColumns;
690  p2 = newRowColumns;
691 
692  i = size;
693  while ( i-- ) {
694  * p2++ = * p1++;
695  }
696 
697  i = n - size;
698  while ( i-- ) {
699  * p2++ = NULL;
700  }
701 
702  if ( rowColumns ) {
703  delete [] rowColumns;
704  }
705 
706  rowColumns = newRowColumns;
707  size = n;
708 }
709 
710 void
712 {
713  int nelem = 0;
714  for ( int i = 1; i <= size; i++ ) {
715  nelem += this->giveRowColumn(i)->giveSize();
716  }
717 
718  OOFEM_LOG_INFO("Skylineu info: neq is %d, nwk is %d\n", size, nelem);
719 }
720 
721 
722 void
723 SkylineUnsym :: writeToFile(const char *fname) const
724 {
725  FILE *file = fopen(fname, "w");
726  FloatMatrix copy;
727  this->toFloatMatrix(copy);
728  for ( int i = 1; i <= nRows; ++i ) {
729  for ( int j = 1; j <= nColumns; ++j ) {
730  fprintf( file, "%.16e ", copy.at(i, j) );
731  }
732  fprintf(file, "\n");
733  }
734  fclose(file);
735 }
736 
737 
738 void
740 // Prints the receiver.
741 {
742  FloatMatrix copy;
743 
744  this->toFloatMatrix(copy);
745  copy.printYourself();
746 }
747 
748 void
750 {
751  // Returns the receiver with all coefficients set to zero.
752  for ( int j = 1; j <= size; j++ ) {
753  this->giveRowColumn(j)->zero();
754  }
755 
756  isFactorized = false;
757 
758  // increment version
759  this->version++;
760 }
761 
762 /*
763  * SkylineSym* SkylineUnsym :: giveSymmetricPart()
764  * {
765  * int i, j, rowcolsize, colsize;
766  * SkylineSym* answer = new SkylineSym();
767  * answer -> growTo(size);
768  * for (i=1; i<=size; i++){
769  * rowcolsize = rowColumns[i-1] -> giveSize();
770  * colsize = (rowcolsize+1)/2;
771  * answer -> giveColumn(i) -> growTo(colsize);
772  * answer->at(i,i) = at(i,i);
773  * j=i+1-colsize;
774  * while(j<i){
775  * answer->at(j,i) = (at(i,j)+at(j,i))/2.;
776  * j++;
777  * }
778  * }
779  * return answer;
780  * }
781  *
782  *
783  * int SkylineUnsym :: computeNumberNegativePivotsOfSymPart()
784  * {
785  * SkylineSym* SymPart = giveSymmetricPart();
786  * int answer = SymPart -> computeNumberNegativeEigenvalue();
787  * delete SymPart;
788  * return answer;
789  * }
790  *
791  */
792 
793 SkylineUnsym :: SkylineUnsym(RowColumn **newRowCol, int newSize, int isFact) : SparseMtrx(newSize, newSize)
794 {
795  size = newSize;
796  rowColumns = newRowCol;
797  isFactorized = isFact;
798 }
799 
800 void SkylineUnsym :: timesT(const FloatArray &x, FloatArray &answer) const
801 {
802  int starti;
803  RowColumn *rowColumni;
804 
805  // first check sizes
806  if ( this->size != x.giveSize() ) {
807  OOFEM_ERROR("size mismatch");
808  }
809 
810  answer.resize(this->size);
811  answer.zero();
812 
813  for ( int i = 1; i <= size; i++ ) {
814  rowColumni = this->giveRowColumn(i);
815  starti = rowColumni->giveStart();
816  answer.at(i) += rowColumni->dot(x, 'C', starti, i - 1);
817  answer.at(i) += rowColumni->atDiag() * x.at(i);
818 
819  for ( int j = starti; j <= i - 1; j++ ) {
820  answer.at(j) += rowColumni->atL(j) * x.at(i);
821  }
822  }
823 }
824 } // end namespace oofem
void checkSizeTowards(const IntArray &)
Definition: rowcol.C:104
virtual void writeToFile(const char *fname) const
Helpful for debugging, writes the matrix to given file.
Definition: skylineu.C:723
int nColumns
Number of columns.
Definition: sparsemtrx.h:69
int giveNumberOfColumns() const
Returns number of columns of receiver.
Definition: floatmatrix.h:158
Class and object Domain.
Definition: domain.h:115
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
Definition: engngm.C:391
This class implements a segment of a unsymmetric matrix stored in segmented form (skyline).
Definition: rowcol.h:65
Base class for all matrices stored in sparse format.
Definition: sparsemtrx.h:60
int giveNumberOfBoundaryConditions() const
Returns number of boundary conditions in domain.
Definition: domain.h:440
virtual void printYourself() const
Prints receiver to stdout. Works only for relatively small matrices.
Definition: skylineu.C:739
virtual int assemble(const IntArray &loc, const FloatMatrix &mat)
Assembles sparse matrix from contribution of local elements.
Definition: skylineu.C:139
void zero()
Sets all component to zero.
Definition: intarray.C:52
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
int max(int i, int j)
Returns bigger value form two given decimals.
Definition: mathfem.h:71
virtual void times(const FloatArray &x, FloatArray &answer) const
Evaluates .
Definition: skylineu.C:606
Abstract base class for all finite elements.
Definition: element.h:145
SkylineUnsym()
Constructor.
Definition: skylineu.C:65
virtual int buildInternalStructure(EngngModel *, int, const UnknownNumberingScheme &s)
Builds internal structure of receiver.
Definition: skylineu.C:257
int giveNumberOfElements() const
Returns number of elements in domain.
Definition: domain.h:434
#define OOFEM_LOG_DEBUG(...)
Definition: logger.h:128
Class implementing an array of integers.
Definition: intarray.h:61
int & at(int i)
Coefficient access function.
Definition: intarray.h:103
void zero()
Definition: rowcol.C:237
virtual int useNonlocalStiffnessOption()
Returns nonzero if nonlocal stiffness option activated.
Definition: engngm.h:1054
RowColumn * giveRowColumn(int j) const
Definition: skylineu.C:654
virtual void printStatistics() const
Prints the receiver statistics (one-line) to stdout.
Definition: skylineu.C:711
void growTo(int)
Definition: skylineu.C:672
GeneralBoundaryCondition * giveBc(int n)
Service for accessing particular domain bc.
Definition: domain.C:243
int nRows
Number of rows.
Definition: sparsemtrx.h:67
This class implements a nonsymmetric matrix stored in a compacted (skyline) form. ...
Definition: skylineu.h:54
double & atDiag()
Definition: rowcol.h:86
#define SkylineUnsym_TINY_PIVOT
"zero" pivot for SkylineUnsym class
Definition: skylineu.h:46
#define OOFEM_LOG_INFO(...)
Definition: logger.h:127
Element * giveElement(int n)
Service for accessing particular domain fe element.
Definition: domain.C:160
virtual SparseMtrx * factorized()
Returns the receiver factorized.
Definition: skylineu.C:454
#define OOFEM_ERROR(...)
Definition: error.h:61
RowColumn ** rowColumns
Row column segments.
Definition: skylineu.h:58
REGISTER_SparseMtrx(CompCol, SMT_CompCol)
virtual FloatArray * backSubstitutionWith(FloatArray &) const
Computes the solution of linear system where A is receiver.
Definition: skylineu.C:532
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...
Definition: element.C:390
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).
Definition: skylineu.C:107
void checkSizeTowards(const IntArray &)
Definition: skylineu.C:409
Abstract base class for all active boundary conditions.
Definition: activebc.h:63
int giveSize()
Definition: rowcol.h:94
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
void resize(int n)
Checks size of receiver towards requested bounds.
Definition: intarray.C:124
SparseMtrxVersionType version
Allows to track if receiver changes.
Definition: sparsemtrx.h:80
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
Class representing vector of real numbers.
Definition: floatarray.h:82
int size
Size of receiver.
Definition: skylineu.h:60
virtual SparseMtrx * GiveCopy() const
Returns a newly allocated copy of receiver.
Definition: skylineu.C:586
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
double dot(const FloatArray &, char, int, int)
Definition: rowcol.C:136
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
Definition: floatmatrix.C:1358
int giveStart()
Definition: rowcol.h:90
virtual void zero()
Zeroes the receiver.
Definition: skylineu.C:749
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
Class implementing single timer, providing wall clock and user time capabilities. ...
Definition: timer.h:46
virtual ~SkylineUnsym()
Destructor.
Definition: skylineu.C:74
void printYourself() const
Prints matrix to stdout. Useful for debugging.
Definition: floatmatrix.C:1458
double & atU(int i)
Definition: rowcol.h:83
void zero()
Zeroes all coefficient of receiver.
Definition: floatmatrix.C:1326
double & atL(int i)
Definition: rowcol.h:84
int isFactorized
Factorization flag.
Definition: skylineu.h:62
virtual void timesT(const FloatArray &x, FloatArray &answer) const
Evaluates .
Definition: skylineu.C:800
int min(int i, int j)
Returns smaller value from two given decimals.
Definition: mathfem.h:59
Abstract base class representing the "problem" under consideration.
Definition: engngm.h:181
int giveSize() const
Definition: intarray.h:203
int giveSize() const
Returns the size of receiver.
Definition: floatarray.h:218
void growTo(int)
Definition: rowcol.C:166
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.
Definition: engngm.C:1720
virtual void toFloatMatrix(FloatMatrix &answer) const
Converts receiving sparse matrix to a dense float matrix.
Definition: skylineu.C:90
RowColumn * GiveCopy()
Definition: rowcol.C:252
int giveNumberOfRows() const
Returns number of rows of receiver.
Definition: floatmatrix.h:156
void startTimer()
Definition: timer.C:69
double getUtime()
Returns total user time elapsed in seconds.
Definition: timer.C:105
#define OOFEM_WARNING(...)
Definition: error.h:62
int setInternalStructure(IntArray &a)
Definition: skylineu.C:371
void stopTimer()
Definition: timer.C:77
Unsymmetric skyline.
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.
Definition: activebc.h:138
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:31 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011