3#ifndef DUNE_ISTL_SUPERMATRIX_HH
4#define DUNE_ISTL_SUPERMATRIX_HH
30#include <dune/common/fmatrix.hh>
31#include <dune/common/fvector.hh>
32#include <dune/common/typetraits.hh>
53 float *values,
int *rowindex,
int*
colindex,
73 struct SuperMatrixCreateSparseChooser<double>
75 static void create(SuperMatrix *
mat,
int n,
int m,
int offset,
76 double *values,
int *rowindex,
int* colindex,
77 Stype_t stype, Dtype_t dtype, Mtype_t mtype)
79 dCreate_CompCol_Matrix(
mat, n, m, offset, values, rowindex, colindex,
85 struct SuperMatrixPrinter<double>
87 static void print(
char* name, SuperMatrix*
mat)
89 dPrint_CompCol_Matrix(name,
mat);
96 struct SuperMatrixCreateSparseChooser<std::complex<float> >
98 static void create(SuperMatrix *
mat,
int n,
int m,
int offset,
99 std::complex<float> *values,
int *rowindex,
int* colindex,
100 Stype_t stype, Dtype_t dtype, Mtype_t mtype)
102 cCreate_CompCol_Matrix(
mat, n, m, offset,
reinterpret_cast< ::complex*
>(values),
103 rowindex, colindex, stype, dtype, mtype);
108 struct SuperMatrixPrinter<std::complex<float> >
110 static void print(
char* name, SuperMatrix*
mat)
112 cPrint_CompCol_Matrix(name,
mat);
119 struct SuperMatrixCreateSparseChooser<std::complex<double> >
121 static void create(SuperMatrix *
mat,
int n,
int m,
int offset,
122 std::complex<double> *values,
int *rowindex,
int* colindex,
123 Stype_t stype, Dtype_t dtype, Mtype_t mtype)
125 zCreate_CompCol_Matrix(
mat, n, m, offset,
reinterpret_cast<doublecomplex*
>(values),
126 rowindex, colindex, stype, dtype, mtype);
131 struct SuperMatrixPrinter<std::complex<double> >
133 static void print(
char* name, SuperMatrix*
mat)
135 zPrint_CompCol_Matrix(name,
mat);
152 std::is_same<T,float>::value ?
SLU_S :
153 ( std::is_same<T,std::complex<double> >::value ?
SLU_Z :
154 ( std::is_same<T,std::complex<float> >::value ?
SLU_C :
SLU_D ));
203 template<
class B,
class TA,
int n,
int m>
207 template<
class M,
class X,
class TM,
class TD,
class T1>
231 if (this->N_+this->M_*this->Nnz_ != 0)
251 ::create(&A, this->N_, this->M_, this->colstart[this->N_],
252 this->values,this->rowindex, this->colstart,
SLU_NC,
261 ::create(&A, this->N_, this->M_, this->colstart[this->N_],
262 this->values,this->rowindex, this->colstart,
SLU_NC,
275 if(this->N_+this->M_+this->Nnz_!=0)
277 this->N_=
mrs.size()*n;
278 this->M_=
mrs.size()*m;
304 template<
class T,
class A,
int n,
int m>
308 template<
class I,
class S,
class D>
325 ::create(&slumat->A, slumat->N_, slumat->M_, slumat->colstart[
this->cols],
326 slumat->values,slumat->rowindex, slumat->colstart,
SLU_NC,
Implementation of the BCRSMatrix class.
This file implements a vector space as a tensor product of a given vector space. The number of compon...
Matrix & mat
Definition matrixmatrix.hh:343
Definition basearray.hh:19
void copyToColCompMatrix(F &initializer, const MRS &mrs)
Definition colcompmatrix.hh:428
Statistics about compression achieved in implicit mode.
Definition bcrsmatrix.hh:81
A sparse block matrix with compressed row storage.
Definition bcrsmatrix.hh:412
A::size_type size_type
The type for the index access and the size.
Definition bcrsmatrix.hh:446
Provides access to an iterator over an arbitrary subset of matrix rows.
Definition colcompmatrix.hh:60
Utility class for converting an ISTL Matrix into a column-compressed matrix.
Definition colcompmatrix.hh:145
Inititializer for the ColCompMatrix as needed by OverlappingSchwarz.
Definition colcompmatrix.hh:154
Sequential overlapping Schwarz preconditioner.
Definition overlappingschwarz.hh:742
Definition overlappingschwarz.hh:683
Definition matrixutils.hh:25
Initializer for SuperLU Matrices representing the subdomains.
Definition overlappingschwarz.hh:43
Definition supermatrix.hh:42
Definition supermatrix.hh:46
static void create(SuperMatrix *mat, int n, int m, int offset, float *values, int *rowindex, int *colindex, Stype_t stype, Dtype_t dtype, Mtype_t mtype)
Definition supermatrix.hh:52
static void print(char *name, SuperMatrix *mat)
Definition supermatrix.hh:64
Definition supermatrix.hh:142
static const Dtype_t type
Definition supermatrix.hh:143
Definition supermatrix.hh:148
double float_type
Definition supermatrix.hh:160
float float_type
Definition supermatrix.hh:167
double float_type
Definition supermatrix.hh:174
float float_type
Definition supermatrix.hh:181
Utility class for converting an ISTL Matrix into a SuperLU Matrix.
Definition supermatrix.hh:191
Definition supermatrix.hh:195
SuperLUMatrix< BCRSMatrix< FieldMatrix< B, n, m >, TA > > & operator=(const BCRSMatrix< FieldMatrix< B, n, m >, TA > &mat)
Definition supermatrix.hh:247
virtual void setMatrix(const Matrix &mat)
Initialize data from given matrix.
Definition supermatrix.hh:285
Matrix::size_type size_type
Definition supermatrix.hh:216
virtual ~SuperLUMatrix()
Destructor.
Definition supermatrix.hh:229
SuperLUMatrix(const Matrix &mat)
Constructor that initializes the data.
Definition supermatrix.hh:222
BCRSMatrix< FieldMatrix< B, n, m >, TA > Matrix
The type of the matrix to convert.
Definition supermatrix.hh:212
virtual void setMatrix(const Matrix &mat, const std::set< std::size_t > &mrs)
Initialize data from a given set of matrix rows and columns.
Definition supermatrix.hh:273
virtual void free()
free allocated space.
Definition supermatrix.hh:295
SuperLUMatrix()
Definition supermatrix.hh:225
SuperLUMatrix< BCRSMatrix< FieldMatrix< B, n, m >, TA > > & operator=(const SuperLUMatrix< BCRSMatrix< FieldMatrix< B, n, m >, TA > > &mat)
Definition supermatrix.hh:257
SuperMatrixInitializer(SuperLUMatrix &lum)
Definition supermatrix.hh:314
Dune::SuperLUMatrix< Matrix > SuperLUMatrix
Definition supermatrix.hh:312
virtual void createMatrix() const
Definition supermatrix.hh:321
SuperMatrixInitializer()
Definition supermatrix.hh:318
BCRSMatrix< FieldMatrix< T, n, m >, A > Matrix
Definition supermatrix.hh:311