ScaFaCoS  1.0.1
Scalable Fast Coulomb Solvers
fcs_vmg_p.h File Reference

file containing all vmg specific functions More...

#include "fcs_definitions.h"
#include "fcs_result_p.h"
#include "fcs_interface_p.h"
+ Include dependency graph for fcs_vmg_p.h:

Go to the source code of this file.

Typedefs

typedef struct fcs_vmg_parameters_t * fcs_vmg_parameters
 

Functions

FCSResult fcs_vmg_setup (FCS handle, fcs_int max_level, fcs_int max_iterations, fcs_int smoothing_steps, fcs_int cycle_type, fcs_float precision, fcs_int near_field_cells, fcs_int interpolation_order, fcs_int discretization_order)
 Function to set all vmg parameters with a single call. More...
 
FCSResult fcs_vmg_set_max_level (FCS handle, fcs_int max_level)
 Set the maximum level of the multigrid algorithm. More...
 
FCSResult fcs_vmg_get_max_level (FCS handle, fcs_int *max_level)
 Get the maximum level of the multigrid algorithm. More...
 
FCSResult fcs_vmg_set_max_iterations (FCS handle, fcs_int max_iterations)
 Set the maximum number of multigrid iterations. More...
 
FCSResult fcs_vmg_get_max_iterations (FCS handle, fcs_int *max_iterations)
 Get the maximum number of multigrid iterations. More...
 
FCSResult fcs_vmg_set_smoothing_steps (FCS handle, fcs_int smoothing_steps)
 Set the number of pre/postsmoothing steps on each level. More...
 
FCSResult fcs_vmg_get_smoothing_steps (FCS handle, fcs_int *smoothing_steps)
 Get the number of pre/postsmoothing steps on each level. More...
 
FCSResult fcs_vmg_set_cycle_type (FCS handle, fcs_int cycle_type)
 Set the cycle_type-number of the multigrid cycle used. More...
 
FCSResult fcs_vmg_get_cycle_type (FCS handle, fcs_int *cycle_type)
 Get the cycle_type-number of the multigrid cycle used. More...
 
FCSResult fcs_vmg_set_precision (FCS handle, fcs_float precision)
 Set the precision of the vmg algorithm. More...
 
FCSResult fcs_vmg_get_precision (FCS handle, fcs_float *precision)
 Get the precision of the vmg algorithm. More...
 
FCSResult fcs_vmg_set_near_field_cells (FCS handle, fcs_int near_field_cells)
 Set the number of near field cells for separating the near/far field part of the potential. More...
 
FCSResult fcs_vmg_get_near_field_cells (FCS handle, fcs_int *near_field_cells)
 Get the number of near field cells for separating the near/far field part of the potential. More...
 
FCSResult fcs_vmg_set_interpolation_order (FCS handle, fcs_int interpolation_order)
 Set the interpolation order for interpolating the gridded potential to the particle positions. More...
 
FCSResult fcs_vmg_get_interpolation_order (FCS handle, fcs_int *interpolation_order)
 Get the interpolation order for interpolating the gridded potential to the particle positions. More...
 
FCSResult fcs_vmg_set_discretization_order (FCS handle, fcs_int discretization_order)
 Set the discretization order. More...
 
FCSResult fcs_vmg_get_discretization_order (FCS handle, fcs_int *discretization_order)
 Get the discretization order. More...
 
void vmg_fcs_print_timer ()
 Print runtimes of various vmg subsystems. More...
 

Detailed Description

file containing all vmg specific functions

Author
Rene Halver

Definition in file fcs_vmg_p.h.

Typedef Documentation

◆ fcs_vmg_parameters

typedef struct fcs_vmg_parameters_t* fcs_vmg_parameters

Definition at line 35 of file fcs_vmg_p.h.

Function Documentation

◆ fcs_vmg_get_cycle_type()

FCSResult fcs_vmg_get_cycle_type ( FCS  handle,
fcs_int *  cycle_type 
)

Get the cycle_type-number of the multigrid cycle used.

E.g. 1 corresponds to a V-Cycle and 2 corresponds to a W-Cycle.

Parameters
handleFCS-object that contains the parameter.
cycle_typetype of multigrid cycle.
Returns
FCSResult-object containing the return value.

◆ fcs_vmg_get_discretization_order()

FCSResult fcs_vmg_get_discretization_order ( FCS  handle,
fcs_int *  discretization_order 
)

Get the discretization order.

This will affect the discretization error heavily, but a higher value also implies more computation. Possible values are 2 or 4.

Parameters
handleFCS-object that contains the parameter.
discretization_orderDiscretization order.
Returns
FCSResult-object containing the return value.

◆ fcs_vmg_get_interpolation_order()

FCSResult fcs_vmg_get_interpolation_order ( FCS  handle,
fcs_int *  interpolation_order 
)

Get the interpolation order for interpolating the gridded potential to the particle positions.

Parameters
handleFCS-object that contains the parameter.
interpolation_orderInterpolation order.
Returns
FCSResult-object containing the return value.

◆ fcs_vmg_get_max_iterations()

FCSResult fcs_vmg_get_max_iterations ( FCS  handle,
fcs_int *  max_iterations 
)

Get the maximum number of multigrid iterations.

Parameters
handleFCS-object that contains the parameter.
max_iterationsNumber of iterations.
Returns
FCSResult-object containing the return state

◆ fcs_vmg_get_max_level()

FCSResult fcs_vmg_get_max_level ( FCS  handle,
fcs_int *  max_level 
)

Get the maximum level of the multigrid algorithm.

The number of grid points of the finest multigrid level will be 2^max_level.

Parameters
handleFCS-object that contains the parameter
max_levelNumber of iterations on return
Returns
FCSResult-object containing the return state

◆ fcs_vmg_get_near_field_cells()

FCSResult fcs_vmg_get_near_field_cells ( FCS  handle,
fcs_int *  near_field_cells 
)

Get the number of near field cells for separating the near/far field part of the potential.

Parameters
handleFCS-object that contains the parameter.
near_field_cellsNumber of near field cells.
Returns
FCSResult-object containing the return value.

◆ fcs_vmg_get_precision()

FCSResult fcs_vmg_get_precision ( FCS  handle,
fcs_float *  precision 
)

Get the precision of the vmg algorithm.

Currently, the relative residual computed in the discrete L2 norm will be tested against this value.

Parameters
handleFCS-object that contains the parameter.
precisionPrecision of the vmg algorithm.
Returns
FCSResult-object containing the return value.

◆ fcs_vmg_get_smoothing_steps()

FCSResult fcs_vmg_get_smoothing_steps ( FCS  handle,
fcs_int *  smoothing_steps 
)

Get the number of pre/postsmoothing steps on each level.

Parameters
handleFCS-object that contains the parameter
smoothing_stepsNumber of pre/postsmoothing steps
Returns
FCSReturn-object containing the return state.

◆ fcs_vmg_set_cycle_type()

FCSResult fcs_vmg_set_cycle_type ( FCS  handle,
fcs_int  cycle_type 
)

Set the cycle_type-number of the multigrid cycle used.

E.g. 1 corresponds to a V-Cycle and 2 corresponds to a W-Cycle.

Parameters
handleFCS-object that contains the parameter.
cycle_typeGamma.
Returns
FCSReturn-object containing the return state.

◆ fcs_vmg_set_discretization_order()

FCSResult fcs_vmg_set_discretization_order ( FCS  handle,
fcs_int  discretization_order 
)

Set the discretization order.

This will affect the discretization error heavily, but a higher value also implies more computation. Possible values are 2 or 4.

Parameters
handleFCS-object that contains the parameter.
discretization_orderDiscretization order.
Returns
FCSResult-object containing the return value.

◆ fcs_vmg_set_interpolation_order()

FCSResult fcs_vmg_set_interpolation_order ( FCS  handle,
fcs_int  interpolation_order 
)

Set the interpolation order for interpolating the gridded potential to the particle positions.

Parameters
handleFCS-object that contains the parameter.
interpolation_orderInterpolation order.
Returns
FCSResult-object containing the return value.

◆ fcs_vmg_set_max_iterations()

FCSResult fcs_vmg_set_max_iterations ( FCS  handle,
fcs_int  max_iterations 
)

Set the maximum number of multigrid iterations.

Parameters
handleFCS-object that contains the parameter
max_iterationsNumber of iterations.
Returns
FCSResult-object containing the return state.

◆ fcs_vmg_set_max_level()

FCSResult fcs_vmg_set_max_level ( FCS  handle,
fcs_int  max_level 
)

Set the maximum level of the multigrid algorithm.

This sets the number of grid points to 2^max_level, so basically this parameter ensures that the number of grid points will be a power of two.

Parameters
handleFCS-object that contains the parameter
max_levelnumber of iterations
Returns
FCSResult-object containing the return state

◆ fcs_vmg_set_near_field_cells()

FCSResult fcs_vmg_set_near_field_cells ( FCS  handle,
fcs_int  near_field_cells 
)

Set the number of near field cells for separating the near/far field part of the potential.

Parameters
handleFCS-object that contains the parameter.
near_field_cellsNear field cells.
Returns
FCSResult-object containing the return value.

◆ fcs_vmg_set_precision()

FCSResult fcs_vmg_set_precision ( FCS  handle,
fcs_float  precision 
)

Set the precision of the vmg algorithm.

Currently, the relative residual computed in the discrete L2 norm will be tested against this value.

Parameters
handleFCS-object that contains the parameter.
precisionPrecision.
Returns
FCSResult-object containing the return value.

◆ fcs_vmg_set_smoothing_steps()

FCSResult fcs_vmg_set_smoothing_steps ( FCS  handle,
fcs_int  smoothing_steps 
)

Set the number of pre/postsmoothing steps on each level.

Parameters
handleFCS-object that contains the parameter
smoothing_stepsNumber of smoothing steps
Returns
FCSResult-object containing the return state

◆ fcs_vmg_setup()

FCSResult fcs_vmg_setup ( FCS  handle,
fcs_int  max_level,
fcs_int  max_iterations,
fcs_int  smoothing_steps,
fcs_int  cycle_type,
fcs_float  precision,
fcs_int  near_field_cells,
fcs_int  interpolation_order,
fcs_int  discretization_order 
)

Function to set all vmg parameters with a single call.

Parameters
handleFCS-object that contains the parameters
max_levelThe maximum level of the algorithm, i.e. n_gridpoints = 2^max_level.
max_iterationsThe maximum number of multigrid iterations.
smoothing_stepsNumber of pre/postsmoothing steps on each level.
cycle_typeCycle-number.
precisionDesired precision.
near_field_cellsNumber of near field cells.
interpolation_orderInterpolation order.
discretization_orderDiscretization order.
Returns
FCSResult-object containing the return value.

◆ vmg_fcs_print_timer()

void vmg_fcs_print_timer ( )

Print runtimes of various vmg subsystems.

vmg has to be configured with –enable-debug-measure-time in order to do so.