22 Matrix(
int nrows,
int ncols);
71 virtual void GetDiag(std::vector<double> &d)
const = 0;
78 std::vector<double>
const &
GetDiag()
const
80 if ( 0 ==
_dd.size() )
85 assert(
Nrows() ==
static_cast<int>(
_dd.size()) );
95 virtual void Mult(std::vector<double> &w, std::vector<double>
const &
u)
const = 0;
105 std::vector<double> &w,
106 std::vector<double>
const &f, std::vector<double>
const &
u)
const = 0;
117 virtual int fetch(
int row,
int col)
const = 0;
122 mutable std::vector<double>
_dd;
152 void GetDiag(std::vector<double> &d)
const override;
166 void Mult(std::vector<double> &w, std::vector<double>
const &
u)
const override;
175 void Defect(std::vector<double> &w,
176 std::vector<double>
const &f, std::vector<double>
const &
u)
const override;
181 void Debug()
const override;
192 int fetch(
int row,
int col)
const override;
206 bool Compare2Old(
int nnode,
int const id[],
int const ik[],
double const sk[])
const;
219 std::vector<double> &fc, std::vector<double> &ff, std::vector<double> &uf);
312 void AddElem_3(
int const ial[3],
double const ske[3][3],
double const fe[3], std::vector<double> &f);
401 void GetDiag(std::vector<double> &d)
const override;
415 void Mult(std::vector<double> &wf, std::vector<double>
const &uc)
const override;
423 void MultT(std::vector<double>
const &wf, std::vector<double> &uc)
const;
432 void Defect(std::vector<double> &w,
433 std::vector<double>
const &f, std::vector<double>
const &
u)
const override;
438 void Debug()
const override;
449 int fetch(
int row,
int col)
const override;
462 std::vector<double> &fc, std::vector<double> &ff, std::vector<double> &uf);
499 BisectIntDirichlet(std::vector<int>
const &fathers, std::vector<int>
const &idxc_dir);
522void CalcElem(
int const ial[3],
double const xc[],
double ske[3][3],
double fe[3]);
540void AddElem(
int const ial[3],
double const ske[3][3],
double const fe[3],
541 int const id[],
int const ik[],
double sk[],
double f[]);
function vertex minimal boundary edge info in an ASCII file Matlab indexing is stored(starts with 1). % % The output file format is compatible with Mesh_2d_3_matlab nnode
~BisectIntDirichlet() override
BisectIntDirichlet(BisectIntDirichlet const &)=default
std::vector< int > _iv
fathers[nnode][2] of fine grid nodes, double entries denote injection points
void Debug() const override
std::vector< double > _vv
weights[nnode][2] of fathers for grid nodes
void Mult(std::vector< double > &wf, std::vector< double > const &uc) const override
**
~BisectInterpolation() override
friend void DefectRestrict(CRS_Matrix const &SK, BisectInterpolation const &P, std::vector< double > &fc, std::vector< double > &ff, std::vector< double > &uf)
BisectInterpolation(BisectInterpolation const &)=default
void MultT(std::vector< double > const &wf, std::vector< double > &uc) const
int fetch(int row, int col) const override
void Defect(std::vector< double > &w, std::vector< double > const &f, std::vector< double > const &u) const override
std::vector< int > _id
start indices of matrix rows
void Mult(std::vector< double > &w, std::vector< double > const &u) const override
**
std::vector< double > _sk
non-zero values
int fetch(int row, int col) const override
virtual ~CRS_Matrix() override
void Defect(std::vector< double > &w, std::vector< double > const &f, std::vector< double > const &u) const override
CRS_Matrix(CRS_Matrix const &)=default
std::vector< int > _ik
column indices
friend void DefectRestrict(CRS_Matrix const &SK, BisectInterpolation const &P, std::vector< double > &fc, std::vector< double > &ff, std::vector< double > &uf)
int _nnz
number of non-zero entries
void Debug() const override
bool Compare2Old(int nnode, int const id[], int const ik[], double const sk[]) const
void CalculateLaplace(std::vector< double > &f)
FEM_Matrix(FEM_Matrix const &)=default
void ApplyDirichletBC(std::vector< double > const &u, std::vector< double > &f)
Mesh const & _mesh
reference to discretization
void Derive_Matrix_Pattern_fast()
void Derive_Matrix_Pattern_slow()
void Derive_Matrix_Pattern()
void AddElem_3(int const ial[3], double const ske[3][3], double const fe[3], std::vector< double > &f)
**
virtual void Mult(std::vector< double > &w, std::vector< double > const &u) const =0
virtual void GetDiag(std::vector< double > &d) const =0
std::vector< double > const & GetDiag() const
int _nrows
number of rows in matrix
virtual int fetch(int row, int col) const =0
virtual void Debug() const =0
Matrix(Matrix const &)=default
virtual void Defect(std::vector< double > &w, std::vector< double > const &f, std::vector< double > const &u) const =0
int _ncols
number of columns in matrix
std::vector< double > _dd
diagonal matrix elements
void AddElem(int const ial[3], double const ske[3][3], double const fe[3], int const id[], int const ik[], double sk[], double f[])
void CalcElem(int const ial[3], double const xc[], double ske[3][3], double fe[3])