OGS
UnifiedMatrixSetters.h
Go to the documentation of this file.
1
11// TODO merge that with MatrixVectorTraits?
12
13#pragma once
14
15#include <Eigen/Core>
16#include <initializer_list>
17
18#include "MatrixVectorTraits.h"
19
20#ifdef USE_PETSC
21
22// Global PETScMatrix/PETScVector //////////////////////////////////////////
23namespace MathLib
24{
25
26class PETScVector;
27class PETScMatrix;
28
29void setVector(PETScVector& v, std::initializer_list<double> values);
30
31void setVector(PETScVector& v,
32 MatrixVectorTraits<PETScVector>::Index const index,
33 double const value);
34
35void setMatrix(PETScMatrix& m, Eigen::MatrixXd const& tmp);
36
37void addToMatrix(PETScMatrix& m, std::initializer_list<double> values);
38
39void setMatrix(PETScMatrix& m, std::initializer_list<double> values);
40
41} // namespace MathLib
42
43#else
44
45// Sparse global EigenMatrix/EigenVector
46// //////////////////////////////////////////
47
48namespace MathLib
49{
50
51class EigenVector;
52class EigenMatrix;
53
54void setVector(EigenVector& v, std::initializer_list<double> values);
55
56void setVector(EigenVector& v,
57 MatrixVectorTraits<EigenVector>::Index const index,
58 double const value);
59
60void setMatrix(EigenMatrix& m, std::initializer_list<double> values);
61
62void setMatrix(EigenMatrix& m, Eigen::MatrixXd const& tmp);
63
64void addToMatrix(EigenMatrix& m, std::initializer_list<double> values);
65
66} // namespace MathLib
67
68#endif
void addToMatrix(PETScMatrix &m, std::initializer_list< double > values)
void setVector(PETScVector &v, std::initializer_list< double > values)
static const double v
void setMatrix(PETScMatrix &m, std::initializer_list< double > values)