escript  Revision_
SystemMatrix.h
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2020 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Apache License, version 2.0
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
14 * Development from 2019 by School of Earth and Environmental Sciences
15 **
16 *****************************************************************************/
17 
18 
19 /****************************************************************************/
20 
21 /* Paso: SystemMatrix */
22 
23 /****************************************************************************/
24 
25 /* Copyrights by ACcESS Australia 2003,2004,2005,2006 */
26 /* Author: Lutz Gross, l.gross@uq.edu.au */
27 
28 /****************************************************************************/
29 
30 #ifndef __PASO_SYSTEMMATRIX_H__
31 #define __PASO_SYSTEMMATRIX_H__
32 
33 #include "SparseMatrix.h"
34 #include "SystemMatrixPattern.h"
35 
36 #include <escript/AbstractSystemMatrix.h>
37 
38 namespace paso {
39 
40 struct Options;
41 class SystemMatrix;
42 typedef boost::shared_ptr<SystemMatrix> SystemMatrix_ptr;
43 typedef boost::shared_ptr<const SystemMatrix> const_SystemMatrix_ptr;
44 
45 typedef int SystemMatrixType;
46 
48 class SystemMatrix : public escript::AbstractSystemMatrix
49 {
50 public:
52  SystemMatrix();
53 
55  dim_t rowBlockSize, dim_t columnBlockSize,
56  bool patternIsUnrolled, const escript::FunctionSpace& rowFS,
57  const escript::FunctionSpace& colFS);
58 
60 
65  virtual void nullifyRowsAndCols(escript::Data& mask_row,
66  escript::Data& mask_col,
67  double main_diagonal_value);
68 
69  virtual inline void saveMM(const std::string& filename) const
70  {
71  if (mpi_info->size > 1) {
72  //throw PasoException("SystemMatrix::saveMM: Only single rank supported.");
74  if (mpi_info->rank == 0)
75  merged->saveMM(filename.c_str());
76  } else {
77  mainBlock->saveMM(filename.c_str());
78  }
79  }
80 
81  virtual inline void saveHB(const std::string& filename) const
82  {
83  if (mpi_info->size > 1) {
84  throw PasoException("SystemMatrix::saveHB: Only single rank supported.");
85  } else if (!(type & MATRIX_FORMAT_CSC)) {
86  throw PasoException("SystemMatrix::saveHB: Only CSC format supported.");
87  } else {
88  mainBlock->saveHB_CSC(filename.c_str());
89  }
90  }
91 
92  virtual void resetValues(bool preserveSolverData = false);
93 
98  void nullifyRows(double* mask_row, double main_diagonal_value);
99 
100  void add(dim_t, index_t*, dim_t, dim_t, index_t*, dim_t, double*);
101 
102  void makeZeroRowSums(double* left_over);
103 
112  void copyColCoupleBlock();
113 
114  void copyRemoteCoupleBlock(bool recreatePattern);
115 
116  void fillWithGlobalCoordinates(double f1);
117 
118  void print() const;
119 
123 
124  void mergeMainAndCouple(index_t** p_ptr, index_t** p_idx, double** p_val) const;
125 
126  void mergeMainAndCouple_CSR_OFFSET0(index_t** p_ptr, index_t** p_idx, double** p_val) const;
127  void mergeMainAndCouple_CSR_OFFSET0_Block(index_t** p_ptr, index_t** p_idx, double** p_val) const;
128 
129  void mergeMainAndCouple_CSC_OFFSET1(index_t** p_ptr, index_t** p_idx, double** p_val) const;
130 
131  void copyMain_CSC_OFFSET1(index_t** p_ptr, index_t** p_idx, double** p_val);
132 
133  void extendedRowsForST(dim_t* degree_ST, index_t* offset_ST, index_t* ST);
134 
135  void applyBalanceInPlace(double* x, bool RHS) const;
136 
137  void applyBalance(double* x_out, const double* x, bool RHS) const;
138 
139  void balance();
140 
141  double getGlobalSize() const;
142 
143  void setPreconditioner(Options* options);
144 
149  void solvePreconditioner(double* x, double* b);
150 
151  void freePreconditioner();
152 
154 
155  inline void startCollect(const double* in) const
156  {
157  startColCollect(in);
158  }
159 
160  inline double* finishCollect() const
161  {
162  return finishColCollect();
163  }
164 
165  inline void startColCollect(const double* in) const
166  {
167  col_coupler->startCollect(in);
168  }
169 
170  inline double* finishColCollect() const
171  {
172  return col_coupler->finishCollect();
173  }
174 
175  inline void startRowCollect(const double* in)
176  {
177  row_coupler->startCollect(in);
178  }
179 
180  inline double* finishRowCollect()
181  {
182  return row_coupler->finishCollect();
183  }
184 
185  inline dim_t getNumRows() const
186  {
187  return mainBlock->numRows;
188  }
189 
190  inline dim_t getNumCols() const
191  {
192  return mainBlock->numCols;
193  }
194 
195  inline dim_t getTotalNumRows() const
196  {
197  return getNumRows() * row_block_size;
198  }
199 
200  inline dim_t getTotalNumCols() const
201  {
202  return getNumCols() * col_block_size;
203  }
204 
205  inline dim_t getRowOverlap() const
206  {
207  return row_coupler->getNumOverlapComponents();
208  }
209 
210  inline dim_t getColOverlap() const
211  {
212  return col_coupler->getNumOverlapComponents();
213  }
214 
215  inline dim_t getGlobalNumRows() const
216  {
217  if (type & MATRIX_FORMAT_CSC) {
218  return pattern->input_distribution->getGlobalNumComponents();
219  }
220  return pattern->output_distribution->getGlobalNumComponents();
221  }
222 
223  inline dim_t getGlobalNumCols() const
224  {
225  if (type & MATRIX_FORMAT_CSC) {
226  return pattern->output_distribution->getGlobalNumComponents();
227  }
228  return pattern->input_distribution->getGlobalNumComponents();
229  }
230 
231  inline dim_t getGlobalTotalNumRows() const
232  {
233  return getGlobalNumRows() * row_block_size;
234  }
235 
236  inline dim_t getGlobalTotalNumCols() const
237  {
238  return getGlobalNumCols() * col_block_size;
239  }
240 
241  inline double getSparsity() const
242  {
243  return getGlobalSize() /
245  }
246 
247  inline dim_t getNumOutput() const
248  {
249  return pattern->getNumOutput();
250  }
251 
252  inline void copyBlockFromMainDiagonal(double* out) const
253  {
254  mainBlock->copyBlockFromMainDiagonal(out);
255  }
256 
257  inline void copyBlockToMainDiagonal(const double* in)
258  {
259  mainBlock->copyBlockToMainDiagonal(in);
260  }
261 
262  inline void copyFromMainDiagonal(double* out) const
263  {
264  mainBlock->copyFromMainDiagonal(out);
265  }
266 
267  inline void copyToMainDiagonal(const double* in)
268  {
269  mainBlock->copyToMainDiagonal(in);
270  }
271 
272  inline void setValues(double value)
273  {
274  mainBlock->setValues(value);
275  col_coupleBlock->setValues(value);
276  row_coupleBlock->setValues(value);
277  is_balanced = false;
278  }
279 
280  inline void rowSum(double* row_sum) const
281  {
283  throw PasoException("SystemMatrix::rowSum: No normalization "
284  "available for compressed sparse column or index offset 1.");
285  } else {
286  const dim_t nrow = mainBlock->numRows*row_block_size;
287 #pragma omp parallel for
288  for (index_t irow=0; irow<nrow; ++irow) {
289  row_sum[irow]=0.;
290  }
291  mainBlock->addRow_CSR_OFFSET0(row_sum);
292  col_coupleBlock->addRow_CSR_OFFSET0(row_sum);
293  }
294  }
295 
296  void MatrixVector(double alpha, const double* in, double beta,
297  double* out) const;
298 
299  void MatrixVector_CSR_OFFSET0(double alpha, const double* in, double beta,
300  double* out) const;
301 
302  static SystemMatrix_ptr loadMM_toCSR(const char* filename);
303 
304  static SystemMatrix_ptr loadMM_toCSC(const char* filename);
305 
306  static int getSystemMatrixTypeId(int solver, int preconditioner,
307  int package, bool symmetry,
308  const escript::JMPI& mpi_info);
309 
312 
315 
319 
323 
326 
335 
337 
343  double* balance_vector;
344 
346  mutable index_t* global_id;
347 
349  mutable index_t solver_package;
350 
352  void* solver_p;
353 
354 private:
355  virtual void setToSolution(escript::Data& out, escript::Data& in,
356  boost::python::object& options) const;
357 
358  virtual void ypAx(escript::Data& y, escript::Data& x) const;
359 
360  void solve(double* out, double* in, Options* options) const;
361 };
362 
363 
364 void RHS_loadMM_toCSR(const char* filename, double* b, dim_t size);
365 
366 
367 } // namespace paso
368 
369 #endif // __PASO_SYSTEMMATRIX_H__
370 
MATRIX_FORMAT_BLK1
#define MATRIX_FORMAT_BLK1
Definition: Paso.h:64
paso::SystemMatrix::copyFromMainDiagonal
void copyFromMainDiagonal(double *out) const
Definition: SystemMatrix.h:276
escript::Data::isComplex
bool isComplex() const
True if components of this data are stored as complex.
Definition: Data.cpp:1160
paso::SystemMatrix::nullifyRowsAndCols
virtual void nullifyRowsAndCols(escript::Data &mask_row, escript::Data &mask_col, double main_diagonal_value)
Definition: SystemMatrix.cpp:259
paso::SystemMatrix::getGlobalSize
double getGlobalSize() const
Definition: SystemMatrix.cpp:186
paso::SystemMatrix::loadMM_toCSC
static SystemMatrix_ptr loadMM_toCSC(const char *filename)
Definition: SystemMatrix_loadMM.cpp:215
paso::SystemMatrix::nullifyRows
void nullifyRows(double *mask_row, double main_diagonal_value)
Definition: SystemMatrix.cpp:238
escript::DataTypes::real_t
double real_t
type of all real-valued scalars in escript
Definition: DataTypes.h:79
paso::SystemMatrix::mpi_info
escript::JMPI mpi_info
Definition: SystemMatrix.h:336
escript::Data::requireWrite
void requireWrite()
Ensures data is ready for write access. This means that the data will be resolved if lazy and will be...
Definition: Data.cpp:1239
paso::SystemMatrix::is_balanced
bool is_balanced
Definition: SystemMatrix.h:350
paso::SystemMatrix::freePreconditioner
void freePreconditioner()
Definition: SystemMatrix.cpp:179
paso::SystemMatrix::copyBlockFromMainDiagonal
void copyBlockFromMainDiagonal(double *out) const
Definition: SystemMatrix.h:266
escript::Distribution_ptr
boost::shared_ptr< Distribution > Distribution_ptr
Definition: Distribution.h:39
paso::SystemMatrix::copyColCoupleBlock
void copyColCoupleBlock()
Definition: SystemMatrix.cpp:380
paso::SystemMatrix::col_distribution
escript::Distribution_ptr col_distribution
Definition: SystemMatrix.h:335
MATRIX_FORMAT_CSC
#define MATRIX_FORMAT_CSC
Definition: Paso.h:63
paso::RHS_loadMM_toCSR
void RHS_loadMM_toCSR(const char *filename, double *b, dim_t size)
Definition: SystemMatrix_loadMM.cpp:314
paso::SystemMatrix::print
void print() const
Definition: SystemMatrix_debug.cpp:123
paso::solve_free
void solve_free(SystemMatrix *in)
Definition: solve.cpp:143
paso::SystemMatrix::getColOverlap
dim_t getColOverlap() const
Definition: SystemMatrix.h:224
paso::SystemMatrix::resetValues
virtual void resetValues(bool preserveSolverData=false)
resets the matrix entries
Definition: SystemMatrix.cpp:321
paso::SystemMatrix::mergeMainAndCouple_CSR_OFFSET0
void mergeMainAndCouple_CSR_OFFSET0(index_t **p_ptr, index_t **p_idx, double **p_val) const
Definition: SystemMatrix_mergeMainAndCouple.cpp:82
paso::SystemMatrix::rowSum
void rowSum(double *row_sum) const
Definition: SystemMatrix.h:294
paso::Coupler
Definition: Coupler.h:56
paso::SystemMatrix::saveHB
virtual void saveHB(const std::string &filename) const
writes the matrix to a file using the Harwell-Boeing file format
Definition: SystemMatrix.h:95
paso::SystemMatrix::getGlobalNumCols
dim_t getGlobalNumCols() const
Definition: SystemMatrix.h:237
paso::SystemMatrix::copyBlockToMainDiagonal
void copyBlockToMainDiagonal(const double *in)
Definition: SystemMatrix.h:271
paso::SystemMatrix::getGlobalTotalNumRows
dim_t getGlobalTotalNumRows() const
Definition: SystemMatrix.h:245
paso::SystemMatrix::getGlobalTotalNumCols
dim_t getGlobalTotalNumCols() const
Definition: SystemMatrix.h:250
paso::SystemMatrix::mergeMainAndCouple_CSC_OFFSET1
void mergeMainAndCouple_CSC_OFFSET1(index_t **p_ptr, index_t **p_idx, double **p_val) const
Definition: SystemMatrix_mergeMainAndCouple.cpp:302
paso::SystemMatrix_ptr
boost::shared_ptr< SystemMatrix > SystemMatrix_ptr
Definition: SystemMatrix.h:55
paso::Options::getPackage
static int getPackage(int solver, int package, bool symmetry, const escript::JMPI &mpi_info)
Definition: Options.cpp:325
paso::SystemMatrix::getSparsity
double getSparsity() const
Definition: SystemMatrix.h:255
MPI_SUM
#define MPI_SUM
Definition: EsysMPI.h:52
paso::SystemMatrix::add
void add(dim_t, index_t *, dim_t, dim_t, index_t *, dim_t, double *)
paso::SystemMatrixPattern_ptr
boost::shared_ptr< SystemMatrixPattern > SystemMatrixPattern_ptr
Definition: SystemMatrixPattern.h:54
paso::SystemMatrix::mergeMainAndCouple_CSR_OFFSET0_Block
void mergeMainAndCouple_CSR_OFFSET0_Block(index_t **p_ptr, index_t **p_idx, double **p_val) const
Definition: SystemMatrix_mergeMainAndCouple.cpp:194
paso::Options::mapEscriptOption
static int mapEscriptOption(int escriptOption)
returns the corresponding paso option code for an escript option code
Definition: Options.cpp:365
escript::AbstractSystemMatrix::getColumnFunctionSpace
FunctionSpace getColumnFunctionSpace() const
returns the column function space
Definition: AbstractSystemMatrix.h:106
paso::SystemMatrix::copyRemoteCoupleBlock
void copyRemoteCoupleBlock(bool recreatePattern)
Definition: SystemMatrix_copyRemoteCoupleBlock.cpp:54
escript::Data::getDataPointSize
int getDataPointSize() const
Return the size of the data point. It is the product of the data point shape dimensions.
Definition: Data.cpp:1360
escript::FunctionSpace
Definition: FunctionSpace.h:49
paso::SystemMatrix::applyBalanceInPlace
void applyBalanceInPlace(double *x, bool RHS) const
Definition: SystemMatrix.cpp:458
escript::DataTypes::DataVectorAlt::data
ElementType * data()
Definition: DataVectorAlt.h:228
escript::Data::getFunctionSpace
const FunctionSpace & getFunctionSpace() const
Return the function space.
Definition: Data.h:463
paso::SystemMatrix::setPreconditioner
void setPreconditioner(Options *options)
Definition: SystemMatrix.cpp:164
PASO_MKL
#define PASO_MKL
Definition: Options.h:50
MATRIX_FORMAT_OFFSET1
#define MATRIX_FORMAT_OFFSET1
Definition: Paso.h:65
SparseMatrix.h
paso::SystemMatrix::finishCollect
double * finishCollect() const
Definition: SystemMatrix.h:174
paso::SystemMatrix::startCollect
void startCollect(const double *in) const
Definition: SystemMatrix.h:169
MPI_INT
#define MPI_INT
Definition: EsysMPI.h:46
Options.h
paso::SystemMatrix::applyBalance
void applyBalance(double *x_out, const double *x, bool RHS) const
Definition: SystemMatrix.cpp:477
MPI_MAX
#define MPI_MAX
Definition: EsysMPI.h:54
paso::SystemMatrix::solver_package
index_t solver_package
package code controlling the solver pointer
Definition: SystemMatrix.h:363
Solver.h
paso::SystemMatrix::balance_vector
double * balance_vector
Definition: SystemMatrix.h:357
escript::Data
Data represents a collection of datapoints.
Definition: Data.h:64
escript::AbstractSystemMatrix::getPtr
ASM_ptr getPtr()
Returns smart pointer which is managing this object. If one does not exist yet it creates one.
Definition: AbstractSystemMatrix.cpp:56
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:93
paso::SystemMatrix::mergeSystemMatrix
SparseMatrix_ptr mergeSystemMatrix() const
Definition: SystemMatrix.cpp:581
escript::JMPI
boost::shared_ptr< JMPI_ > JMPI
Definition: EsysMPI.h:72
paso::SystemMatrix::type
SystemMatrixType type
Definition: SystemMatrix.h:324
paso::SystemMatrix::getGlobalNumRows
dim_t getGlobalNumRows() const
Definition: SystemMatrix.h:229
escript::AbstractSystemMatrix
Base class for escript system matrices.
Definition: AbstractSystemMatrix.h:57
paso::SystemMatrix::col_coupler
Coupler_ptr< real_t > col_coupler
Definition: SystemMatrix.h:338
paso::SystemMatrix::borrowMainDiagonalPointer
index_t * borrowMainDiagonalPointer() const
Definition: SystemMatrix.cpp:202
paso::SystemMatrix::solver_p
void * solver_p
pointer to data needed by a solver
Definition: SystemMatrix.h:366
paso::SystemMatrix::balance
void balance()
Definition: SystemMatrix.cpp:496
paso::SystemMatrix::mainBlock
SparseMatrix_ptr mainBlock
main block
Definition: SystemMatrix.h:342
paso::Coupler_ptr
boost::shared_ptr< Coupler< T > > Coupler_ptr
Definition: Coupler.h:57
SystemMatrixPattern.h
paso::SystemMatrix::copyMain_CSC_OFFSET1
void copyMain_CSC_OFFSET1(index_t **p_ptr, index_t **p_idx, double **p_val)
paso::SystemMatrix::global_id
index_t * global_id
stores the global ids for all cols in col_coupleBlock
Definition: SystemMatrix.h:360
SystemMatrix.h
paso::SystemMatrix::ypAx
virtual void ypAx(escript::Data &y, escript::Data &x) const
performs y+=this*x
Definition: SystemMatrix.cpp:356
paso::SystemMatrix::row_coupler
Coupler_ptr< real_t > row_coupler
Definition: SystemMatrix.h:339
paso::SystemMatrix::row_coupleBlock
SparseMatrix_ptr row_coupleBlock
coupling to neighbouring processors (col - row)
Definition: SystemMatrix.h:346
paso::const_SystemMatrix_ptr
boost::shared_ptr< const SystemMatrix > const_SystemMatrix_ptr
Definition: SystemMatrix.h:57
paso::SystemMatrix::col_block_size
dim_t col_block_size
Definition: SystemMatrix.h:331
PASO_PASO
#define PASO_PASO
Definition: Options.h:56
PASO_UMFPACK
#define PASO_UMFPACK
Definition: Options.h:51
paso::SystemMatrix::extendedRowsForST
void extendedRowsForST(dim_t *degree_ST, index_t *offset_ST, index_t *ST)
Definition: SystemMatrix_extendedRows.cpp:56
paso::SystemMatrix::getRowOverlap
dim_t getRowOverlap() const
Definition: SystemMatrix.h:219
paso::SystemMatrix::copyToMainDiagonal
void copyToMainDiagonal(const double *in)
Definition: SystemMatrix.h:281
paso::SystemMatrix::getTotalNumCols
dim_t getTotalNumCols() const
Definition: SystemMatrix.h:214
paso::SystemMatrix::row_block_size
dim_t row_block_size
Definition: SystemMatrix.h:330
paso::SparseMatrix_ptr
boost::shared_ptr< SparseMatrix > SparseMatrix_ptr
Definition: SparseMatrix.h:50
paso::SystemMatrix::pattern
SystemMatrixPattern_ptr pattern
Definition: SystemMatrix.h:325
MPI_DOUBLE
#define MPI_DOUBLE
Definition: EsysMPI.h:47
paso::SystemMatrix::fillWithGlobalCoordinates
void fillWithGlobalCoordinates(double f1)
Definition: SystemMatrix_debug.cpp:60
paso::Preconditioner
Definition: Preconditioner.h:50
paso::SystemMatrix::getTotalNumRows
dim_t getTotalNumRows() const
Definition: SystemMatrix.h:209
paso::SystemMatrix::solvePreconditioner
void solvePreconditioner(double *x, double *b)
Definition: SystemMatrix.cpp:172
paso::PasoException
PasoException exception class.
Definition: PasoException.h:47
paso::SystemMatrix::getNumCols
dim_t getNumCols() const
Definition: SystemMatrix.h:204
paso::SystemMatrix::remote_coupleBlock
SparseMatrix_ptr remote_coupleBlock
coupling of rows-cols on neighbouring processors (may not be valid)
Definition: SystemMatrix.h:348
paso::SystemMatrix::startColCollect
void startColCollect(const double *in) const
Definition: SystemMatrix.h:179
paso::SystemMatrixType
int SystemMatrixType
Definition: SystemMatrix.h:59
paso::SystemMatrix::getNumOutput
dim_t getNumOutput() const
Definition: SystemMatrix.h:261
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:88
paso::SystemMatrix::logical_row_block_size
dim_t logical_row_block_size
Definition: SystemMatrix.h:327
paso::SystemMatrix::finishRowCollect
double * finishRowCollect()
Definition: SystemMatrix.h:194
escript
Definition: AbstractContinuousDomain.cpp:23
paso::SystemMatrix::solve
void solve(double *out, double *in, Options *options) const
Definition: solve.cpp:54
paso::SystemMatrix::mergeMainAndCouple
void mergeMainAndCouple(index_t **p_ptr, index_t **p_idx, double **p_val) const
Definition: SystemMatrix_mergeMainAndCouple.cpp:66
paso::SystemMatrix::getNumRows
dim_t getNumRows() const
Definition: SystemMatrix.h:199
paso::Preconditioner_alloc
Preconditioner * Preconditioner_alloc(SystemMatrix_ptr A, Options *options)
Definition: Preconditioner.cpp:65
Preconditioner.h
paso::SystemMatrix::setValues
void setValues(double value)
Definition: SystemMatrix.h:286
escript::AbstractSystemMatrix::getRowFunctionSpace
FunctionSpace getRowFunctionSpace() const
returns the row function space
Definition: AbstractSystemMatrix.h:117
PasoException.h
paso::Pattern_ptr
boost::shared_ptr< Pattern > Pattern_ptr
Definition: Pattern.h:52
paso::SystemMatrix::SystemMatrix
SystemMatrix()
default constructor - throws exception.
Definition: SystemMatrix.cpp:56
paso::SystemMatrix::finishColCollect
double * finishColCollect() const
Definition: SystemMatrix.h:184
paso::SystemMatrix::MatrixVector
void MatrixVector(double alpha, const double *in, double beta, double *out) const
Definition: SystemMatrix_MatrixVector.cpp:49
paso::SystemMatrix::makeZeroRowSums
void makeZeroRowSums(double *left_over)
Definition: SystemMatrix.cpp:216
paso::SystemMatrix::getSystemMatrixTypeId
static int getSystemMatrixTypeId(int solver, int preconditioner, int package, bool symmetry, const escript::JMPI &mpi_info)
Definition: SystemMatrix.cpp:547
paso::SystemMatrix::startRowCollect
void startRowCollect(const double *in)
Definition: SystemMatrix.h:189
paso::SystemMatrix::loadMM_toCSR
static SystemMatrix_ptr loadMM_toCSR(const char *filename)
Definition: SystemMatrix_loadMM.cpp:115
escript::Data::getExpandedVectorReference
DataTypes::RealVectorType & getExpandedVectorReference(DataTypes::real_t dummy=0)
Ensures that the Data is expanded and returns its underlying vector Does not check for exclusive writ...
Definition: Data.cpp:5841
paso::SystemMatrix::block_size
dim_t block_size
Definition: SystemMatrix.h:332
paso
Definition: BiCGStab.cpp:26
paso::SystemMatrix::MatrixVector_CSR_OFFSET0
void MatrixVector_CSR_OFFSET0(double alpha, const double *in, double beta, double *out) const
Definition: SystemMatrix_MatrixVector.cpp:78
paso::Preconditioner_free
void Preconditioner_free(Preconditioner *in)
Definition: Preconditioner.cpp:54
escript::AbstractSystemMatrix::getRowBlockSize
int getRowBlockSize() const
returns the row block size
Definition: AbstractSystemMatrix.h:128
escript::Data::expand
void expand()
Whatever the current Data type make this into a DataExpanded.
Definition: Data.cpp:1180
escript::AbstractSystemMatrix::getColumnBlockSize
int getColumnBlockSize() const
returns the column block size
Definition: AbstractSystemMatrix.h:139
paso::SystemMatrix::setToSolution
virtual void setToSolution(escript::Data &out, escript::Data &in, boost::python::object &options) const
solves the linear system this*out=in
Definition: SystemMatrix.cpp:328
paso::Preconditioner_solve
void Preconditioner_solve(Preconditioner *prec, SystemMatrix_ptr A, double *x, double *b)
Definition: Preconditioner.cpp:130
paso::SparseMatrix
Definition: SparseMatrix.h:57
paso::Options
Definition: Options.h:78
MATRIX_FORMAT_DEFAULT
#define MATRIX_FORMAT_DEFAULT
Definition: Paso.h:62
MATRIX_FORMAT_DIAGONAL_BLOCK
#define MATRIX_FORMAT_DIAGONAL_BLOCK
Definition: Paso.h:66
paso::SystemMatrix::row_distribution
escript::Distribution_ptr row_distribution
Definition: SystemMatrix.h:334
paso::SystemMatrix::logical_col_block_size
dim_t logical_col_block_size
Definition: SystemMatrix.h:328
paso::SystemMatrix::saveMM
virtual void saveMM(const std::string &filename) const
writes the matrix to a file using the Matrix Market file format
Definition: SystemMatrix.h:83
paso::SystemMatrix::~SystemMatrix
~SystemMatrix()
Definition: SystemMatrix.cpp:157
paso::SystemMatrix::col_coupleBlock
SparseMatrix_ptr col_coupleBlock
coupling to neighbouring processors (row - col)
Definition: SystemMatrix.h:344