34#ifndef petscsparsemtrx_h
35#define petscsparsemtrx_h
41#define _IFT_PetscSparseMtrx_Name "petsc"
74 std::unique_ptr<SparseMtrx>
clone()
const override;
79 void times(
double x)
override;
94 double computeNorm()
const override;
95 double &at(
int i,
int j)
override;
96 double at(
int i,
int j)
const override;
97 void toFloatMatrix(
FloatMatrix &answer)
const override;
98 void printStatistics()
const override;
99 void printYourself()
const override;
100 void printMatlab()
const;
102 bool isAsymmetric()
const override;
103 void writeToFile(
const char *fname)
const override;
107 void createVecGlobal(Vec *answer)
const;
109 int scatterG2L(Vec src,
FloatArray &dest)
const;
114 int scatterL2G(
const FloatArray &src, Vec dest)
const;
118 bool giveSymmetryFlag()
const;
119 int setOption(MatOption op, PetscBool flag);
121 int giveDomainIndex()
const;
std::unique_ptr< SparseMtrx > giveSubMatrix(const IntArray &rows, const IntArray &cols) override
IS localIS
Context or scattering/collecting parallel PETSc vectors.
PetscSparseMtrx(int n=0, int m=0)
void times(const FloatArray &x, FloatArray &answer) const override
bool kspInit
Flag if context initialized.
FloatArray * backSubstitutionWith(FloatArray &y) const override
void add(double x, SparseMtrx &m) override
void addDiagonal(double x, FloatArray &m) override
KSP ksp
Linear solver context.
bool canBeFactorized() const override
Determines, whether receiver can be factorized.
bool newValues
Flag if matrix has changed since last solve.
int assembleBegin() override
Starts assembling the elements.
const char * giveClassName() const override
std::unique_ptr< SparseMtrx > clone() const override
SparseMtrx * factorized() override
int assembleEnd() override
Returns when assemble is completed.
void timesT(const FloatArray &x, FloatArray &answer) const override
int assemble(const IntArray &loc, const FloatMatrix &mat) override
int buildInternalStructure(EngngModel *eModel, int n, int m, const IntArray &I, const IntArray &J) override
SparseMtrx(int n=0, int m=0)
FloatMatrixF< N, M > zero()
Constructs a zero matrix (this is the default behavior when constructing a matrix,...