The Multigrid hierarchy including meshes, vectors and matrices, prolongations is stored.
More...
#include <jacsolve.h>
The Multigrid hierarchy including meshes, vectors and matrices, prolongations is stored.
Definition at line 57 of file jacsolve.h.
◆ Multigrid() [1/2]
Multigrid::Multigrid |
( |
Mesh const & |
cmesh, |
|
|
int |
nlevel |
|
) |
| |
Generates the mesh hierachy with @p nlevel meshes starting from coarse mesh @p cmesg .
The refined meshes are generated by edge bisection. All memory is allocated but stiffness matrices are yet not calculated
@param[in] cmesh initial coarse mesh
@param[in] nlevel number of meshes in hierarchy, including the initial coarse mesh
Definition at line 104 of file jacsolve.cpp.
◆ Multigrid() [2/2]
◆ ~Multigrid()
Multigrid::~Multigrid |
( |
| ) |
|
◆ DefineOperator()
void Multigrid::DefineOperator |
( |
size_t |
lev | ) |
|
Calculates PDE matrix for level @p lev.
- Parameters
-
Definition at line 146 of file jacsolve.cpp.
◆ DefineOperators()
void Multigrid::DefineOperators |
( |
| ) |
|
Calculates PDE matrices for all levels.
Definition at line 137 of file jacsolve.cpp.
◆ GetMesh()
Mesh const& Multigrid::GetMesh |
( |
int |
lev | ) |
const |
|
inline |
- Returns
- Meshes number
lev
.
Definition at line 92 of file jacsolve.h.
◆ GetSolution()
std::vector<double> const& Multigrid::GetSolution |
( |
int |
lev | ) |
const |
|
inline |
- Returns
- Solution vector at level
lev
.
Definition at line 98 of file jacsolve.h.
◆ JacobiSolve()
void Multigrid::JacobiSolve |
( |
size_t |
lev | ) |
|
Solves the system of equations at level @p lev via Jacobi iterations
- Parameters
-
Definition at line 164 of file jacsolve.cpp.
◆ MG_Solve()
void Multigrid::MG_Solve |
( |
int |
pre_smooth = 1 , |
|
|
double |
eps = 1e-6 , |
|
|
int |
nu = 1 |
|
) |
| |
Solves the system of equations at finest level via multigrid
- Parameters
-
[in] | pre_smooth | number of pre/post-smoothing sweeps |
[in] | eps | stopping criteria (relative error) |
[in] | nu | defines the multigrid cycle (1/2 = V/W) |
Definition at line 207 of file jacsolve.cpp.
◆ MG_Step()
void Multigrid::MG_Step |
( |
size_t |
lev, |
|
|
int |
pre_smooth = 1 , |
|
|
bool const |
bzero = false , |
|
|
int |
nu = 1 |
|
) |
| |
Peformes one multigrid step at level @p lev .
- Parameters
-
[in] | lev | level in hierachy |
[in] | pre_smooth | number of pre/post-smoothing sweeps |
[in] | bzero | start with zero-vector as solution |
[in] | nu | defines the multigrid cycle (1/2 = V/W) |
Definition at line 170 of file jacsolve.cpp.
◆ Ndofs()
int Multigrid::Ndofs |
( |
| ) |
const |
|
inline |
- Returns
- Number of Unknowns.
Definition at line 86 of file jacsolve.h.
◆ Nlevels()
size_t Multigrid::Nlevels |
( |
| ) |
const |
|
inline |
- Returns
- Number of meshes in hierarchy.
Definition at line 80 of file jacsolve.h.
◆ operator=()
◆ _d
std::vector<std::vector<double> > Multigrid::_d |
|
private |
Defect vector on each level.
Definition at line 145 of file jacsolve.h.
◆ _f
std::vector<std::vector<double> > Multigrid::_f |
|
private |
Right hand side vector on each level.
Definition at line 144 of file jacsolve.h.
◆ _meshes
mesh hierarchy from coarse (level 0) to fine.
Definition at line 141 of file jacsolve.h.
◆ _Pc2f
Interpolation to level from next coarser level.
Definition at line 147 of file jacsolve.h.
◆ _SK
Sparse matrix on each level.
Definition at line 142 of file jacsolve.h.
◆ _u
std::vector<std::vector<double> > Multigrid::_u |
|
private |
Solution vector on each level.
Definition at line 143 of file jacsolve.h.
◆ _w
std::vector<std::vector<double> > Multigrid::_w |
|
private |
Correction vector on each level.
Definition at line 146 of file jacsolve.h.
The documentation for this class was generated from the following files: