jacobi.template
Public Member Functions | Protected Attributes | Friends | List of all members
BisectInterpolation Class Reference

‍** More...

#include <getmatrix.h>

Inheritance diagram for BisectInterpolation:
Matrix BisectIntDirichlet

Public Member Functions

 BisectInterpolation (std::vector< int > const &fathers)
 
 BisectInterpolation ()
 
 BisectInterpolation (BisectInterpolation const &)=default
 
 ~BisectInterpolation () override
 
void GetDiag (std::vector< double > &d) const override
 
void Mult (std::vector< double > &wf, std::vector< double > const &uc) const override
 ‍** More...
 
void MultT (std::vector< double > const &wf, std::vector< double > &uc) const
 
void Defect (std::vector< double > &w, std::vector< double > const &f, std::vector< double > const &u) const override
 
void Debug () const override
 
int fetch (int row, int col) const override
 
- Public Member Functions inherited from Matrix
 Matrix (int nrows, int ncols)
 
 Matrix (Matrix const &)=default
 
virtual ~Matrix ()
 
bool isSquare () const
 
int Nrows () const
 
int Ncols () const
 
const std::vector< double > & GetDiag () const
 

Protected Attributes

std::vector< int > _iv
 fathers[nnode][2] of fine grid nodes, double entries denote injection points More...
 
std::vector< double > _vv
 weights[nnode][2] of fathers for grid nodes More...
 
- Protected Attributes inherited from Matrix
int _nrows
 number of rows in matrix More...
 
int _ncols
 number of columns in matrix More...
 
std::vector< double > _dd
 diagonal matrix elements More...
 

Friends

void DefectRestrict (CRS_Matrix const &SK, BisectInterpolation const &P, std::vector< double > &fc, std::vector< double > &ff, std::vector< double > &uf)
 

Detailed Description

‍**

‍** ‍** ‍** Interpolation matrix for prolongation coarse mesh (C) to a fine mesh (F) generated by bisecting edges.

All interpolation weights are 0.5 (injection points contribute twice).

Definition at line 374 of file getmatrix.h.

Constructor & Destructor Documentation

◆ BisectInterpolation() [1/3]

BisectInterpolation::BisectInterpolation ( std::vector< int > const &  fathers)
explicit

Generates the interpolation matrix for prolongation coarse mesh to a fine mesh generated by bisecting edges. The interpolation weights are all 0.5.

Parameters
[in]fathersvector[nnodes][2] containing the two coarse grid fathers of a fine grid vertex

Definition at line 540 of file getmatrix.cpp.

◆ BisectInterpolation() [2/3]

BisectInterpolation::BisectInterpolation ( )

Definition at line 535 of file getmatrix.cpp.

◆ BisectInterpolation() [3/3]

BisectInterpolation::BisectInterpolation ( BisectInterpolation const &  )
default

◆ ~BisectInterpolation()

BisectInterpolation::~BisectInterpolation ( )
override

Destructor.

Definition at line 546 of file getmatrix.cpp.

Member Function Documentation

◆ Debug()

void BisectInterpolation::Debug ( ) const
overridevirtual

Show the matrix entries.

Implements Matrix.

Definition at line 638 of file getmatrix.cpp.

◆ Defect()

void BisectInterpolation::Defect ( std::vector< double > &  w,
std::vector< double > const &  f,
std::vector< double > const &  u 
) const
overridevirtual

Calculates the defect/residuum w := f - P*u.

Parameters
[in,out]wresulting vector (preallocated)
[in]fload vector
[in]ucoarse vector

Implements Matrix.

Definition at line 624 of file getmatrix.cpp.

◆ fetch()

int BisectInterpolation::fetch ( int  row,
int  col 
) const
overridevirtual

Finds in this matrix the access index for an entry at row row and column col.

Parameters
[in]rowrow index
[in]colcolumn index
Returns
index for element (row, col). If no appropriate entry exists then -1 will be returned.
Warning
assert() stops the function in case that matrix element (row, col) doesn't exist.

Implements Matrix.

Definition at line 649 of file getmatrix.cpp.

◆ GetDiag()

void BisectInterpolation::GetDiag ( std::vector< double > &  d) const
overridevirtual

Extracts the diagonal elements of the matrix.

Parameters
[in,out]d(prellocated) vector of diagonal elements

Implements Matrix.

Definition at line 549 of file getmatrix.cpp.

◆ Mult()

void BisectInterpolation::Mult ( std::vector< double > &  wf,
std::vector< double > const &  uc 
) const
overridevirtual

‍**

Performs the prolongation \( w_F := P*u_C \).

Parameters
[in,out]wfresulting fine vector (preallocated)
[in]uccoarse vector

Implements Matrix.

Definition at line 567 of file getmatrix.cpp.

◆ MultT()

void BisectInterpolation::MultT ( std::vector< double > const &  wf,
std::vector< double > &  uc 
) const

Performs the restriction \( u_C := P^T*w_F \).

Parameters
[in]wffine vector
[in,out]ucresulting coarse vector (preallocated)

Definition at line 598 of file getmatrix.cpp.

Friends And Related Function Documentation

◆ DefectRestrict

void DefectRestrict ( CRS_Matrix const &  SK,
BisectInterpolation const &  P,
std::vector< double > &  fc,
std::vector< double > &  ff,
std::vector< double > &  uf 
)
friend

Calculates the defect and projects it to the next coarser level \( f_C := P^T \cdot (f_F - SK\cdot u_F) \).

Parameters
[in]SKmatrix on fine mesh
[in]Pprolongation operator
[in,out]fcresulting coarse mesh vector (preallocated)
[in]ffr.h.s. on fine mesh
[in]ufstatus vector on fine mesh

Member Data Documentation

◆ _iv

std::vector<int> BisectInterpolation::_iv
protected

fathers[nnode][2] of fine grid nodes, double entries denote injection points

Definition at line 465 of file getmatrix.h.

◆ _vv

std::vector<double> BisectInterpolation::_vv
protected

weights[nnode][2] of fathers for grid nodes

Definition at line 466 of file getmatrix.h.


The documentation for this class was generated from the following files: