Object which contains the multigrid meshes for solving Helmholtz problems. This includes nlvl number of meshes of increasing coarseness, restriction and prolongation matrices.
Frees memory associated with multigrid
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(multigrid_t), | intent(inout) | :: | self |
Instance of the type |
Sets up multigrids, i.e. - creates meshes on all levels - creates prolongation and restriction operators
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(inout) | :: | self |
Instance of the type |
||
| class(equilibrium_t), | intent(inout) | :: | equi |
Equilibrium (not changed) |
||
| real(kind=FP), | intent(in) | :: | phi |
Toroidal angle |
||
| integer, | intent(in) | :: | nlvls |
Number of multigrid levels |
||
| real(kind=FP), | intent(inout) | :: | spacing_f |
Grid spacing on finest level (only adapted possibly for slab geometry) |
||
| integer, | intent(in) | :: | size_neighbor |
Number of neighbor points determined in each direction (for finest level, on coarser levels always 1) |
||
| integer, | intent(in) | :: | size_ghost_layer |
Depth of ghost point layer (for finest level, on coarser levels always 0) |
||
| type(mesh_cart_t), | intent(out), | target | :: | mesh_finest |
Finest mesh (lvl=1) that was created |
|
| integer, | intent(in), | optional, | dimension(nlvls) | :: | reorder_size |
Grid reordering for each level |
| logical, | intent(in) | :: | extend_beyond_wall |
If true, meshes are extend beyond the wall |
||
| integer, | intent(in), | optional | :: | dbgout |
Debug output level, default = 0, none |
Writes information of multigrid to netcdf file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(inout) | :: | self |
Instance of the type |
||
| integer, | intent(in) | :: | fgid |
File or group id number of existing Netcdf4 file |
Reads information of multigrid from netcdf file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(inout) | :: | self |
Instance of the type |
||
| integer, | intent(in) | :: | fgid |
File or group id number of existing Netcdf4 file |
||
| type(mesh_cart_t), | intent(out), | target | :: | mesh_finest |
Finest mesh (lvl=1) that was read from file |
Sets phi value on coarse meshes to a new value On finest mesh that is pointed to, needs to be set separately
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(inout), | target | :: | self |
Instance of the type |
|
| real(kind=FP), | intent(in) | :: | new_phi |
New phi value |
Copies the type to multigrid_copy, setting the internal pointer to mesh_finest
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in) | :: | self |
Instance of the type |
||
| type(multigrid_t), | intent(out) | :: | multigrid_copy |
Copied multigrid |
||
| type(mesh_cart_t), | intent(in), | target | :: | mesh_finest |
Finest (lvl=1) mesh to point to |
Returns nlvls
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in) | :: | self |
Instance of the type |
Returns the number of total mesh points at the given level
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in) | :: | self |
Instance of the type |
||
| integer, | intent(in) | :: | lvl |
Desired multigrid level |
Returns the number of boundary mesh points at the given level
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in) | :: | self |
Instance of the type |
||
| integer, | intent(in) | :: | lvl |
Desired multigrid level |
Returns the number of inner mesh points at the given level
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in) | :: | self |
Instance of the type |
||
| integer, | intent(in) | :: | lvl |
Desired multigrid level |
Returns mesh on desired level
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(inout), | target | :: | self |
Instance of the type |
|
| integer, | intent(in) | :: | lvl |
Multigrid level of desired mesh |
Pointer to desired mesh
Returns a pointer to the first_idx_lvl array
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in), | target | :: | self |
Instance of the type |
Returns first_idx at lvl
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in) | :: | self |
Instance of the type |
||
| integer, | intent(in) | :: | lvl |
Level (up to nlvl+1) |
Returns a pointer to the first_idx_boundary_lvl array
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in), | target | :: | self |
Instance of the type |
Returns first_idx_boundary at lvl
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in) | :: | self |
Instance of the type |
||
| integer, | intent(in) | :: | lvl |
Level (up to nlvl+1) |
Returns a pointer to the first_idx_inner_lvl array
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in), | target | :: | self |
Instance of the type |
Returns first_idx_inner at lvl
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in) | :: | self |
Instance of the type |
||
| integer, | intent(in) | :: | lvl |
Level (up to nlvl+1) |
Returns number of mesh points sumed over all levels
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in) | :: | self |
Instance of the type |
Returns number of inner mesh points sumed over all levels
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in) | :: | self |
Instance of the type |
Restricts quantity from fine grid to coarse grid
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in) | :: | self |
Instance of the type |
||
| integer, | intent(in) | :: | lvl_f |
Level of fine grid |
||
| real(kind=FP), | intent(in), | dimension(:) | :: | uf |
Quantity on fine grid |
|
| integer, | intent(in) | :: | lvl_c |
Level of coarse grid |
||
| real(kind=FP), | intent(out), | dimension(:) | :: | uc |
Quantity on coarse grid |
Restricts quantity defined only on inner grid points from fine grid to coarse grid
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(inout) | :: | self |
Instance of the type |
||
| integer, | intent(in) | :: | lvl_f |
Level of fine grid |
||
| real(kind=FP), | intent(in), | dimension(:) | :: | uf |
Quantity on fine grid |
|
| integer, | intent(in) | :: | lvl_c |
Level of coarse grid |
||
| real(kind=FP), | intent(out), | dimension(:) | :: | uc |
Quantity on coarse grid |
Prolongs quantity from coarse grid to fine grid
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(inout) | :: | self |
Instance of the type |
||
| integer, | intent(in) | :: | lvl_c |
Level of coarse grid |
||
| real(kind=FP), | intent(in), | dimension(:) | :: | uc |
Quantity on coarse grid |
|
| integer, | intent(in) | :: | lvl_f |
Level of fine grid |
||
| real(kind=FP), | intent(out), | dimension(:) | :: | uf |
Quantity on fine grid |
Extrapolates boundary points according to homegeneous Neumann boundary condition
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(inout) | :: | self |
Instance of the type |
||
| integer, | intent(in) | :: | lvl |
Level of mesh |
||
| real(kind=FP), | intent(inout), | dimension(:) | :: | u |
Quantity |
Exposes multigrid data through multigrid_data object boundary condition
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in), | target | :: | self |
Instance of the type |
|
| type(multigrid_intermediate_data_t), | intent(out), | target | :: | intermediate_object |
Intermediate object, holds arrays of mesh_cart and csrmat "data" |
|
| type(multigrid_data_t), | intent(out) | :: | data_object |
Destination multigrid_data object |
Returns pointer to restriction matrix
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in), | target | :: | self |
Instance of the type |
|
| integer, | intent(in) | :: | lvl_f |
Level of restriction matrix (from lvl_f to lvl_f+1) |
Helmholtz matrix for level lvl
Returns pointer to prolongation matrix
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(multigrid_t), | intent(in), | target | :: | self |
Instance of the type |
|
| integer, | intent(in) | :: | lvl_f |
Level of prolongation matrix (from lvl_f+1 to lvl_f) |
Helmholtz matrix for level lvl