KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
skyline_lu_factorization_solver.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Pooyan Dadvand
11 //
12 
13 
14 
15 #if !defined(KRATOS_SKYLINE_LU_FACTORIZATION_SOLVER_H_INCLUDED )
16 #define KRATOS_SKYLINE_LU_FACTORIZATION_SOLVER_H_INCLUDED
17 
18 
19 
20 // External includes
21 
22 // Project includes
23 #include "includes/define.h"
26 
27 namespace Kratos
28 {
29 template< class TSparseSpaceType, class TDenseSpaceType > class LUSkylineFactorization
30 {
31 public:
32 
34 
36 
38 
39  typedef std::size_t IndexType;
40 
41 
42  int size;
43  int* rowIndex;
44  int* perm;
45  double* entriesL;
46  double* entriesD;
47  double* entriesU;
48 
49  void clear()
50  {
51  // if size==0, we have just created it and the arrays have not been allocated
52  if (size!=0)
53  {
54  delete[] rowIndex;
55  delete[] entriesL;
56  delete[] entriesD;
57  delete[] entriesU;
58  delete[] perm;
59  size= 0;
60  rowIndex= perm= NULL;
61  entriesL= entriesD= entriesU= NULL;
62  }
63  }
64 
65  //**********************************************************************************
66  //**********************************************************************************
67 
69  {
70  int i, j, newi, newj, indexj, ordering, *invperm;
71  double entry;
72 
73  // First of all, if there was another factorization stored in this object, erase it
74  clear();
75  // The size of the factorization will be the same of A
76  size = A.size1();
77 
78  ordering = 1 ; // 0 - no reordering
79  // 1 - Cuthill-McKee ordering
80  // 2 - reverse Cuthill-McKee ordering
81 
82  // Find the permutation for the reordering.
83  perm = new int[size];
84  invperm= new int[size];
85  if (ordering==0)
86  {
87  // no reordering
88  for (i=0; i<size; i++) perm[i]=i;
89  }
90  else
91  {
92  int initialNode, next, currentLevelSet, nMDICLS, node, soughtDegree;
93  int maxDegreeInCurrentLevelSet, maxDegree, firstVal, finalVal, increment;
94  std::vector<IndexType> neighbors;
95  bool empty, found;
96 
97  // Cuthill-McKee ordering (or its reverse)
98  initialNode= 0; // node where to start search
99  maxDegree=0;
100  int *degree = new int[size];
101  int *levelSet = new int[size];
102  int *nextSameDegree= new int[size];
103  for (i=0; i<size; i++)
104  {
105  degree[i] = TSparseSpaceType::GraphDegree(i, A);
106  if (degree[i]>maxDegree) maxDegree=degree[i];
107  levelSet[i] = 0;
108  nextSameDegree[i]= -1;
109  }
110  int *firstWithDegree = new int[maxDegree+1];
111  int *nFirstWithDegree = new int[maxDegree+1];
112  for (i=0; i<maxDegree+1; i++) firstWithDegree[i]=-1;
113 
114  // The data structure used to sort and traverse the level sets is the following:
115  // The current level set is currentLevelSet.
116  // In this level set, there are nodes with degrees from 0 (not really useful)
117  // to maxDegreeInCurrentLevelSet.
118  // firstWithDegree[i] points to a node with degree i, or to -1 if it does not
119  // exist. nextSameDegree[firstWithDegree[i]] points to the second node with
120  // that degree, etc.
121  // While the level set is being traversed, the structure for the next level
122  // set is generated; nMDICLS will be the next maxDegreeInCurrentLevelSet
123  // and nFirstWithDegree will be firstWithDegree.
124 
125  // Initialize the first level set, made up by initialNode alone
126 
127  perm[0]= initialNode;
128  currentLevelSet= 1;
129  levelSet[initialNode]= currentLevelSet;
130  maxDegreeInCurrentLevelSet= degree[initialNode];
131  firstWithDegree[maxDegreeInCurrentLevelSet]= initialNode;
132  next= 1;
133 
134  // Main loop
135 
136  while (next<size)
137  {
138  nMDICLS= 0;
139  for (i=0; i<maxDegree+1; i++) nFirstWithDegree[i]=-1;
140  empty= true; // used to detect different connected components
141 
142  if (ordering==1)
143  {
144  // Cuthill-McKee ordering
145  firstVal = 0;
146  finalVal = maxDegreeInCurrentLevelSet+1;
147  increment= 1;
148  }
149  else
150  {
151  // reverse Cuthill-McKee ordering
152  firstVal = maxDegreeInCurrentLevelSet;
153  finalVal = -1;
154  increment= -1;
155  }
156 
157 
158  for (soughtDegree=firstVal; soughtDegree!=finalVal; soughtDegree+=increment)
159  {
160  node= firstWithDegree[soughtDegree];
161  while (node!=-1)
162  {
163  // visit neighbors
164  TSparseSpaceType::GraphNeighbors(node, A, neighbors);
165  for (indexj=0; indexj<degree[node]; indexj++)
166  {
167  j = neighbors[indexj];
168  if (levelSet[j]==0)
169  {
170  levelSet[j]= currentLevelSet+1;
171  perm[next]= j;
172  next++;
173  empty= false; // This level set is not empty
174  nextSameDegree[j]= nFirstWithDegree[degree[j]];
175  nFirstWithDegree[degree[j]]= j;
176  if (nMDICLS<degree[j]) nMDICLS=degree[j];
177  }
178  }
179  node= nextSameDegree[node];
180  }
181  }
182 
183 
184 
185  currentLevelSet++;
186  maxDegreeInCurrentLevelSet= nMDICLS;
187  for (i=0; i<nMDICLS+1; i++) firstWithDegree[i]= nFirstWithDegree[i];
188 
189  if (empty==true)
190  {
191  // The graph contains another connected component that we cannot reach.
192  // Search for a node that has not yet been included in a level set,
193  // and start exploring from it.
194  found= false;
195  for (i=0; i<size; i++)
196  {
197  if (levelSet[i]==0)
198  {
199  perm[next]=i;
200  next++;
201  levelSet[i]= currentLevelSet;
202  maxDegreeInCurrentLevelSet= degree[i];
203  firstWithDegree[maxDegreeInCurrentLevelSet]= i;
204  found= true;
205  break;
206  }
207  }
208  if (found==false)
209  {
210  // There must be a weird problem somewhere, because we cannot find a
211  // new connected component.
212  throw std::runtime_error("This cannot happen! Internal consistency error at LUSkylineFactorization::copyFromCSRMatrix(CSRMatrix A)");
213  }
214  }
215 
216  }
217  delete[] degree;
218  delete[] levelSet;
219  delete[] nextSameDegree;
220 
221  delete[] firstWithDegree;
222  delete[] nFirstWithDegree;
223  }
224 
225  // find inverse permutation
226  for (i=0; i<size; i++) invperm[perm[i]]=i;
227 
228  // Let us find how large the rows of L and the columns of U should be.
229  // Provisionally, we will store in rowIndex[i] the minimum required height
230  // of column i over the diagonal, and length of row i below the diagonal.
231  // The entry (i,j) in the reordered matrix will be the same as the entry
232  // (perm[i],perm[j]) in the original matrix; or, the entry (i,j) in the
233  // original matrix will be the same as (invperm[i],invperm[j]) in the
234  // reordered matrix.
235  rowIndex = new int[size+1];
236  for (i=0; i<=size; i++) rowIndex[i]=0;
237  // Traverse the matrix finding nonzero elements
238  for (typename SparseMatrixType::iterator1 a_iterator = A.begin1();
239  a_iterator != A.end1(); a_iterator++)
240  {
241 #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
242  for (typename SparseMatrixType::iterator2 row_iterator = a_iterator.begin() ;
243  row_iterator != a_iterator.end() ; ++row_iterator)
244  {
245 #else
246  for ( SparseMatrixType::iterator2 row_iterator = begin(a_iterator,
247  boost::numeric::ublas::iterator1_tag());
248  row_iterator != end(a_iterator,
249  boost::numeric::ublas::iterator1_tag()); ++row_iterator )
250  {
251 #endif
252  i = row_iterator.index1();
253  j = row_iterator.index2();
254  entry = *row_iterator;
255  newi = invperm[i];
256  newj = invperm[j];
257  if( entry != 0 )
258  {
259  if (newi>newj)
260  {
261  // row newi needs length at least newi-newj
262  if (rowIndex[newi] < newi-newj) rowIndex[newi]= newi-newj;
263  }
264  else if (newi<newj)
265  {
266  // column newj needs height at least newj-newi
267  if (rowIndex[newj] < newj-newi) rowIndex[newj]= newj-newi;
268  }
269  }
270  }
271  }
272 // for (i=0; i<size; i++)
273 // {
274 // for (CSRMatrix<double>::RowIteratorType row_iterator =A[i].begin() ;
275 // row_iterator != A[i].end() ; ++row_iterator)
276 // { // Changed by Pooyan!!!
277 // j= row_iterator->first; // Changed by Pooyan!!!
278 // entry = row_iterator->second; // Changed by Pooyan!!!
279 // newi= invperm[i];
280 // newj= invperm[j];
281 // if (entry!=0)
282 // {
283 // if (newi>newj)
284 // {
285 // // row newi needs length at least newi-newj
286 // if (rowIndex[newi] < newi-newj) rowIndex[newi]= newi-newj;
287 // }
288 // else if (newi<newj)
289 // {
290 // // column newj needs height at least newj-newi
291 // if (rowIndex[newj] < newj-newi) rowIndex[newj]= newj-newi;
292 // }
293 // }
294 // }
295 // }
296 
297  // Transform rowIndex so that it doesn't contain the required lengths
298  // and heights, but the indexes to the entries
299  int oldCarryOut=0;
300  for (i=1; i<=size; i++)
301  {
302  int newCarryOut= rowIndex[i];
303  rowIndex[i]= rowIndex[i-1]+oldCarryOut;
304  oldCarryOut= newCarryOut;
305  }
306 
307  // Allocate variables for skyline format entries
308  entriesL= new double[rowIndex[size]];
309  entriesD= new double[ size ];
310  entriesU= new double[rowIndex[size]];
311  for (i=0; i<rowIndex[size]; i++)
312  {
313  entriesL[i]=0.0;
314  entriesU[i]=0.0;
315  }
316 
317  for (i=0; i<size; i++) entriesD[i]=0.0;
318 
319  // And finally traverse again the CSR matrix, copying its entries into the
320  // correct places in the skyline format
321  for (typename SparseMatrixType::iterator1 a_iterator = A.begin1();
322  a_iterator != A.end1(); a_iterator++)
323  {
324 #ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
325  for (typename SparseMatrixType::iterator2 row_iterator = a_iterator.begin() ;
326  row_iterator != a_iterator.end() ; ++row_iterator)
327  {
328 #else
329  for ( SparseMatrixType::iterator2 row_iterator = begin(a_iterator,
330  boost::numeric::ublas::iterator1_tag());
331  row_iterator != end(a_iterator,
332  boost::numeric::ublas::iterator1_tag()); ++row_iterator )
333  {
334 #endif
335  i = row_iterator.index1();
336  j = row_iterator.index2();
337  entry = *row_iterator;
338  newi= invperm[i];
339  newj= invperm[j];
340  if (entry != 0.00)
341  {
342  if (newi<newj)
343  {
344  entriesU[ rowIndex[newj+1] + newi - newj ]= entry;
345  }
346  else if (newi==newj)
347  {
348  entriesD[newi]= entry;
349  }
350  else
351  {
352  entriesL[ rowIndex[newi+1] + newj - newi ]= entry;
353  }
354  }
355  }
356  }
357 
358 // for (i=0; i<size; i++)
359 // {
360 // for (CSRMatrix<double>::RowIteratorType row_iterator =A[i].begin() ;
361 // row_iterator != A[i].end() ; ++row_iterator)
362 // { // Changed by Pooyan!!!
363 // j= row_iterator->first; // Changed by Pooyan!!!
364 // entry = row_iterator->second; // Changed by Pooyan!!!
365 // newi= invperm[i];
366 // newj= invperm[j];
367 // if (entry != 0.00)
368 // {
369 // if (newi<newj)
370 // {
371 // entriesU[ rowIndex[newj+1] + newi - newj ]= entry;
372 // }
373 // else if (newi==newj)
374 // {
375 // entriesD[newi]= entry;
376 // }
377 // else
378 // {
379 // entriesL[ rowIndex[newi+1] + newj - newi ]= entry;
380 // }
381 // }
382 // }
383 // }
384 // }
385  delete[] invperm;
386 
387  }//copyFromCSRMatrix
388 
404  void factorize()
405  {
406  int i, j, k;
407  int indexEntry, indexL, indexU;
408  int jBeginRow, jBeginCol, jBeginMult, iBeginCol;
409  double sum;
410 
411 
412  if(entriesD[0] == 0.00)
413  {
414  std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! LUSkylineFactorization::factorize: Error zero in diagonal" << std::endl;
415  } //Roport Error zero in diagonal!!!!!!!!!!!
416 
417  for (k=0; k<size-1; k++)
418  {
419  // check whether A(1,k+1) lies within the skyline structure
420  if (rowIndex[k+1] +k+1 == rowIndex[k+2])
421  {
422  entriesU[rowIndex[k+1]] = entriesU[rowIndex[k+1]] / entriesD[0] ;
423  }
424  // Compute column k+1 of U
425  indexEntry= rowIndex[k+1];
426  iBeginCol= k+1-rowIndex[k+2]+rowIndex[k+1];
427  i= iBeginCol;
428  while (i<=k)
429  {
430  // if i==0, there is nothing to do
431  if (i>0)
432  {
433  sum= entriesU[indexEntry]; // this is element U(i,k+1)
434  // Multiply row i of L and Column k+1 of U
435  jBeginRow= i-rowIndex[i+1]+rowIndex[i];
436  jBeginMult= ( iBeginCol > jBeginRow ) ? iBeginCol : jBeginRow ;
437  indexL= rowIndex[i ] + jBeginMult - jBeginRow;
438  indexU= rowIndex[k+1] + jBeginMult - iBeginCol;
439  for (j=jBeginMult; j<i; j++)
440  {
441  sum= sum - entriesL[indexL]*entriesU[indexU];
442  indexL++;
443  indexU++;
444  }
445  entriesU[indexEntry]= sum/entriesD[i];
446  }
447  indexEntry++;
448  i++;
449  }
450  // Compute row k+1 of L
451  indexEntry= rowIndex[k+1];
452  jBeginRow= k+1-rowIndex[k+2]+rowIndex[k+1];
453  i= iBeginCol;
454  while (i<=k)
455  {
456  // if i==0, there is nothing to do
457  if (i>0)
458  {
459  sum=entriesL[indexEntry]; // this is the element L(k+1,i)
460  // multiply row k+1 of L and column i of U
461  jBeginCol = i-rowIndex[i+1]+rowIndex[i];
462  jBeginMult= ( jBeginCol > jBeginRow ) ? jBeginCol : jBeginRow ;
463  indexL= rowIndex[k+1] + jBeginMult - jBeginRow;
464  indexU= rowIndex[i ] + jBeginMult - jBeginCol;
465  for (j=jBeginMult; j<i; j++)
466  {
467  sum= sum - entriesL[indexL]*entriesU[indexU];
468  indexL++;
469  indexU++;
470  }
471  entriesL[indexEntry]= sum; // !!!!!!!!!! optimizar, no hace falta usar sum
472  }
473  indexEntry++;
474  i++;
475  }
476  // Find element in diagonal
477  sum= entriesD[k+1];
478  for (j=rowIndex[k+1]; j<rowIndex[k+2]; j++)
479  {
480  sum= sum - entriesL[j] * entriesU[j];
481  }
482  if(sum == 0.00)
483  {
484  std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! LUSkylineFactorization::factorize: Error zero sum" << std::endl;
485  } // Error reporting !!!!!!!!!!!!!!!!!!!
486 
487  entriesD[k+1]= sum;
488  }
489  }
490 
491 
492  //***************************************************************************************************
493  //*
494  //***************************************************************************************************
495  /* bugfix janosch void backForwardSolve(int vector_size, Vector<double>& b, Vector<double>& x) // n, b, x*/
496  void backForwardSolve(int vector_size, const VectorType& b, VectorType& x) // n, b, x
497  {
498  // y = L^-1 * perm[b] ;
499  // y = U^-1 * y ;
500  // x = invperm[y];
501  int i, j, indexL, indexU;
502  double sum, *y;
503  if (this->size != vector_size)
504  {
505  throw std::runtime_error("matrix and vector have different sizes at LUSkylineFactorization::backForwardSolve");
506  }
507 
508  y= new double[size];
509  for (i=0; i<size; i++)
510  {
511  j= i-rowIndex[i+1]+rowIndex[i];
512  sum= b[perm[i]];
513  for (indexL=rowIndex[i]; indexL<rowIndex[i+1]; indexL++)
514  {
515  sum= sum - entriesL[indexL]*y[j];
516  j++;
517  }
518  y[i]= sum/entriesD[i];
519  }
520  for (j=size-1; j>=0; j--)
521  {
522  i= j-rowIndex[j+1]+rowIndex[j];
523  for (indexU=rowIndex[j]; indexU<rowIndex[j+1]; indexU++)
524  {
525  y[i]= y[i] - entriesU[indexU] * y[j] ;
526  i++;
527  }
528  }
529  for (i=0; i<size; i++) x[perm[i]]= y[i];
530 
531  delete[] y;
532  };
533 
534 
535 
536 
537 
538 
539  //**************************************************************************
540  //**************************************************************************
542  {
543  size=0;
544  rowIndex= NULL;
545  entriesL= entriesD= entriesU= NULL;
546  };
547 
548  //**************************************************************************
549  //**************************************************************************
551  {
552  clear();
553  };
554 };//class LUSkylineFactorization
555 
556 
557 
558 template<class TSparseSpaceType, class TDenseSpaceType,
559  class TReordererType = Reorderer<TSparseSpaceType, TDenseSpaceType> >
561  : public DirectSolver<TSparseSpaceType, TDenseSpaceType, TReordererType>
562 {
563 public:
564 
567 
569 
571 
573 
575 
579 
582 
583 
591  bool Solve(SparseMatrixType& rA, VectorType& rX, VectorType& rB) override
592  {
593  if(this->IsNotConsistent(rA, rX, rB))
594  return false;
595 
596  const int size = TSparseSpaceType::Size(rX);
597 
598  // define an object to store skyline matrix and factorization
600 
601  // copy myMatrix into skyline format
602  myFactorization.copyFromCSRMatrix(rA);
603 
604  // factorize it
605  myFactorization.factorize();
606 
607  // and back solve
608  myFactorization.backForwardSolve(size, rB, rX);
609 
610  return true;
611  }
612 
621  {
622  const int size1 = TDenseSpaceType::Size1(rX);
623  const int size2 = TDenseSpaceType::Size2(rX);
624 
625  bool is_solved = true;
626 
627  VectorType x(size1);
628  VectorType b(size1);
629 
630  // define an object to store skyline matrix and factorization
632  // copy myMatrix into skyline format
633  myFactorization.copyFromCSRMatrix(rA);
634  // factorize it
635  myFactorization.factorize();
636 
637  for(int i = 0 ; i < size2 ; i++)
638  {
639  TDenseSpaceType::GetColumn(i,rX, x);
640  TDenseSpaceType::GetColumn(i,rB, b);
641 
642  // and back solve
643  myFactorization.backForwardSolve(size1, b, x);
644 
645  TDenseSpaceType::SetColumn(i,rX, x);
646  TDenseSpaceType::SetColumn(i,rB, b);
647  }
648 
649  return is_solved;
650  }
651 
652 
653 
655  void PrintInfo(std::ostream& rOStream) const override
656  {
657  rOStream << "LU factorization solver finished.";
658  }
659 
661  void PrintData(std::ostream& rOStream) const override
662  {
663  }
664 
665 
666 
667 
668 private:
669 
670 
671  /* void CopyFromCSRMatrix(SparseMatrixType A)
672  {
673  int i, j, indexj;
674  double entry;
675 
676  // First of all, if there was another factorization stored in this object, erase it
677  this->clear();
678  // The size of the factorization will be the same of A
679  int size = A.size;
680 
681  // Let us find how large the rows of L and the columns of U should be.
682  // Provisionally, we will store in rowIndex[i] the minimum required height
683  // of column i over the diagonal, and length of row i below the diagonal.
684  int* rowIndex = new int[size+1];
685  for (i=0; i<=size; i++) rowIndex[i]=0;
686  // Traverse the matrix finding nonzero elements
687  for (i=0; i<size; i++)
688  {
689  for (indexj=A.rowIndex[i]; indexj<A.rowIndex[i+1]; indexj++)
690  {
691  j= A.columnIndex[indexj];
692  entry= A.entries[indexj];
693  if (entry!=0)
694  {
695  if (i>j)
696  {
697  // row i needs length at least i-j
698  rowIndex[i]= (rowIndex[i] > i-j) ? rowIndex[i] : i-j ;
699  }
700  else if (i<j)
701  {
702  // column j needs height at least j-i
703  rowIndex[j]= (rowIndex[j] > j-i) ? rowIndex[j] : j-i ;
704  }
705  }
706  }
707  }
708 
709  // Transform rowIndex so that it doesn't contain the required lengths
710  // and heights, but the indexes to the entries
711  int oldCarryOut=0;
712  for (i=1; i<=size; i++)
713  {
714  int newCarryOut= rowIndex[i];
715  rowIndex[i]= rowIndex[i-1]+oldCarryOut;
716  oldCarryOut= newCarryOut;
717  }
718 
719  // Allocate variables for skyline format entries
720  double* entriesL= new double[rowIndex[size]];
721  double* entriesD= new double[ size ];
722  double* entriesU= new double[rowIndex[size]];
723  for (i=0; i<rowIndex[size]; i++)
724  {
725  entriesL[i]=0.0;
726  entriesU[i]=0.0;
727  }
728 
729  for (i=0; i<size; i++) entriesD[i]=0.0;
730 
731  // And finally traverse again the CSR matrix, copying its entries into the
732  // correct places in the skyline format
733  for (i=0; i<size; i++)
734  {
735  for (indexj=A.rowIndex[i]; indexj<A.rowIndex[i+1]; indexj++)
736  {
737  j= A.columnIndex[indexj];
738  entry= A.entries[indexj];
739  if (i<j)
740  {
741  entriesU[ rowIndex[j+1] + i - j ]= entry;
742  }
743  else if (i==j) {
744  entriesD[i]= entry;
745  }
746  else
747  {
748  entriesL[ rowIndex[i+1] + j - i ]= entry;
749  }
750  }
751  }
752  delete[] rowIndex;
753  }
754  */
755 
758 
760  //SkylineLUFactorizationSolver(const SkylineLUFactorizationSolver& Other);
761 
762 
763 }; // Class SkylineLUFactorizationSolver
764 
765 
767 template<class TSparseSpaceType, class TDenseSpaceType,class TReordererType>
768 inline std::istream& operator >> (std::istream& rIStream, SkylineLUFactorizationSolver<TSparseSpaceType,
769  TDenseSpaceType,
770  TReordererType>& rThis)
771 {
772  return rIStream;
773 }
774 
776 template<class TSparseSpaceType, class TDenseSpaceType, class TReordererType>
777 inline std::ostream& operator << (std::ostream& rOStream,
778  const SkylineLUFactorizationSolver<TSparseSpaceType,
779  TDenseSpaceType,
780  TReordererType>& rThis)
781 {
782  rThis.PrintInfo(rOStream);
783  rOStream << std::endl;
784  rThis.PrintData(rOStream);
785 
786  return rOStream;
787 }
788 
789 
790 } // namespace Kratos.
791 
792 #endif // KRATOS_SKYLINE_LU_FACTORIZATION_SOLVER_H_INCLUDED defined
793 
794 
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Definition: direct_solver.h:48
Definition: skyline_lu_factorization_solver.h:30
int * rowIndex
Definition: skyline_lu_factorization_solver.h:43
std::size_t IndexType
Definition: skyline_lu_factorization_solver.h:39
void copyFromCSRMatrix(SparseMatrixType &A)
Definition: skyline_lu_factorization_solver.h:68
void clear()
Definition: skyline_lu_factorization_solver.h:49
int size
Definition: skyline_lu_factorization_solver.h:42
double * entriesU
Definition: skyline_lu_factorization_solver.h:47
LUSkylineFactorization()
Definition: skyline_lu_factorization_solver.h:541
TSparseSpaceType::MatrixType SparseMatrixType
Definition: skyline_lu_factorization_solver.h:33
~LUSkylineFactorization()
Definition: skyline_lu_factorization_solver.h:550
void factorize()
Definition: skyline_lu_factorization_solver.h:404
double * entriesD
Definition: skyline_lu_factorization_solver.h:46
int * perm
Definition: skyline_lu_factorization_solver.h:44
void backForwardSolve(int vector_size, const VectorType &b, VectorType &x)
Definition: skyline_lu_factorization_solver.h:496
TSparseSpaceType::VectorType VectorType
Definition: skyline_lu_factorization_solver.h:35
TDenseSpaceType::MatrixType DenseMatrixType
Definition: skyline_lu_factorization_solver.h:37
double * entriesL
Definition: skyline_lu_factorization_solver.h:45
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
Definition: skyline_lu_factorization_solver.h:562
KRATOS_CLASS_POINTER_DEFINITION(SkylineLUFactorizationSolver)
Counted pointer of SkylineLUFactorizationSolver.
bool Solve(SparseMatrixType &rA, DenseMatrixType &rX, DenseMatrixType &rB) override
Definition: skyline_lu_factorization_solver.h:620
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: skyline_lu_factorization_solver.h:661
~SkylineLUFactorizationSolver() override
Destructor.
Definition: skyline_lu_factorization_solver.h:581
DirectSolver< TSparseSpaceType, TDenseSpaceType, TReordererType > BaseType
Definition: skyline_lu_factorization_solver.h:568
TSparseSpaceType::VectorType VectorType
Definition: skyline_lu_factorization_solver.h:572
bool Solve(SparseMatrixType &rA, VectorType &rX, VectorType &rB) override
Definition: skyline_lu_factorization_solver.h:591
SkylineLUFactorizationSolver(Parameters settings)
Definition: skyline_lu_factorization_solver.h:578
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: skyline_lu_factorization_solver.h:655
SkylineLUFactorizationSolver()
Default constructor.
Definition: skyline_lu_factorization_solver.h:577
TSparseSpaceType::MatrixType SparseMatrixType
Definition: skyline_lu_factorization_solver.h:570
TDenseSpaceType::MatrixType DenseMatrixType
Definition: skyline_lu_factorization_solver.h:574
end
Definition: DEM_benchmarks.py:180
Vector VectorType
Definition: geometrical_transformation_utilities.h:56
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
TSpaceType::IndexType Size1(TSpaceType &dummy, typename TSpaceType::MatrixType const &rM)
Definition: add_strategies_to_python.cpp:117
TSpaceType::IndexType Size2(TSpaceType &dummy, typename TSpaceType::MatrixType const &rM)
Definition: add_strategies_to_python.cpp:123
TSpaceType::IndexType Size(TSpaceType &dummy, typename TSpaceType::VectorType const &rV)
Definition: add_strategies_to_python.cpp:111
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
TExpressionType::data_type sum(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:675
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
y
Other simbols definition.
Definition: generate_axisymmetric_navier_stokes_element.py:54
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
A
Definition: sensitivityMatrix.py:70
x
Definition: sensitivityMatrix.py:49
integer i
Definition: TensorModule.f:17
Definition: mesh_converter.cpp:38