STARS-H
Software for Testing Accuracy, Reliability and Scalability of Hierarchical computations
Electrostatics problem

Template for electrostatics problems. More...

Collaboration diagram for Electrostatics problem:

Modules

 Kernels
 Set of kernels for electrostatics problems.
 

Enumerations

enum  STARSH_ELECTROSTATICS_KERNEL { STARSH_ELECTROSTATICS_COULOMB_POTENTIAL = 1, STARSH_ELECTROSTATICS_COULOMB_POTENTIAL_SIMD = 2 }
 List of built-in kernels for starsh_esdata_get_kernel(). More...
 
enum  STARSH_ELECTROSTATICS_PARAM { STARSH_ELECTROSTATICS_NDIM = 1, STARSH_ELECTROSTATICS_PLACE = 2 }
 List of parameters for starsh_application(). More...
 

Functions

int starsh_esdata_new (STARSH_esdata **data, STARSH_int count, int ndim)
 Allocate memory for STARSH_esdata object. More...
 
int starsh_esdata_init (STARSH_esdata **data, STARSH_int count, int ndim, double *point)
 Initialize STARSH_esdata object by given data. More...
 
int starsh_esdata_generate (STARSH_esdata **data, STARSH_int count, int ndim, enum STARSH_PARTICLES_PLACEMENT place)
 Generate STARSH_esdata object by given distribution. More...
 
int starsh_esdata_generate_va (STARSH_esdata **data, STARSH_int count, va_list args)
 Generate STARSH_esdata object with incomplete set of parameters. More...
 
int starsh_esdata_generate_el (STARSH_esdata **data, STARSH_int count,...)
 Generate STARSH_esdata object with incomplete set of parameters. More...
 
void starsh_esdata_free (STARSH_esdata *data)
 Free memory of STARSH_esdata object. More...
 

Detailed Description

Template for electrostatics problems.

STARSH_esdata holds all the necessary data.

Enumeration Type Documentation

◆ STARSH_ELECTROSTATICS_KERNEL

List of built-in kernels for starsh_esdata_get_kernel().

For more info on exact formulas inside kernels, take a look at functions starsh_esdata_block_coulomb_potential_kernel_nd(), starsh_esdata_block_coulomb_potential_kernel_nd_simd().

Enumerator
STARSH_ELECTROSTATICS_COULOMB_POTENTIAL 

Coulomb potential kernel.

See also
starsh_esdata_block_coulomb_potential_kernel_nd().
STARSH_ELECTROSTATICS_COULOMB_POTENTIAL_SIMD 

Coulomb potential kernel.

See also
starsh_esdata_block_coulomb_potential_kernel_nd_simd().

◆ STARSH_ELECTROSTATICS_PARAM

List of parameters for starsh_application().

In the table below each constant corresponds to a given argument and type for starsh_esdata_generate(). These constants are used to generate problem with incomplete set of parameters via starsh_application(), starsh_esdata_generate_va() or starsh_esdata_generate_el().

See also
starsh_application(), starsh_esdata_generate(), starsh_esdata_generate_va(), starsh_esdata_generate_el().
Enumerator
STARSH_ELECTROSTATICS_NDIM 

Dimensionality of space (ndim, integer).

STARSH_ELECTROSTATICS_PLACE 

Distribution of particles (place, STARSH_PARTICLES_PLACEMENT).

Function Documentation

◆ starsh_esdata_free()

void starsh_esdata_free ( STARSH_esdata data)

◆ starsh_esdata_generate()

int starsh_esdata_generate ( STARSH_esdata **  data,
STARSH_int  count,
int  ndim,
enum STARSH_PARTICLES_PLACEMENT  place 
)

Generate STARSH_esdata object by given distribution.

Parameters
[out]dataAddress of pointer to STARSH_esdata object.
[in]countNumber of particles.
[in]ndimDimensionality of space.
[in]placePlacement strategy for spatial points.
Returns
Error code STARSH_ERRNO.
See also
starsh_esdata_generate_va(), starsh_esdata_generate_el().

◆ starsh_esdata_generate_el()

int starsh_esdata_generate_el ( STARSH_esdata **  data,
STARSH_int  count,
  ... 
)

Generate STARSH_esdata object with incomplete set of parameters.

Parses possibly incomplete set of parameters for starsh_esdata_generate(). If argument is not in the ..., then its default value is used:

Argument Default value Type –
ndim 2 int
place STARSH_PARTICLES_UNIFORM STARSH_PARTICLES_PLACEMENT

List of arguments in ... should look as pairs (Arg.constant, Value) with 0 as a last argument. For correspondance of arguments and arg.constants take a look at STARSH_ELECTROSTATICS_PARAM.

Parameters
[out]dataAddress of pointer to STARSH_esdata object.
[in]countNumber of particles.
[in]...Variable amount of arguments.
Returns
Error code STARSH_ERRNO.
Examples
See also
starsh_esdata_generate(), starsh_esdata_generate_va().

◆ starsh_esdata_generate_va()

int starsh_esdata_generate_va ( STARSH_esdata **  data,
STARSH_int  count,
va_list  args 
)

Generate STARSH_esdata object with incomplete set of parameters.

Parss possibly incomplete set of parameters for starsh_esdata_generate(). If argument is not in the args, then its default value is used:

Argument Default value Type –
ndim 2 int
place STARSH_PARTICLES_UNIFORM STARSH_PARTICLES_PLACEMENT

List of arguments args should look as pairs (Arg.constant, Value) with 0 as a last argument. For correspondance of arguments and arg.constants take a look at STARSH_ELECTROSTATICS_PARAM.

Parameters
[out]dataAddress of pointer to STARSH_esdata object.
[in]countNumber of particles.
[in]argsArguments, packed into va_args.
Returns
Error code STARSH_ERRNO.
Examples
See also
starsh_esdata_generate(), starsh_esdata_generate_el().

◆ starsh_esdata_init()

int starsh_esdata_init ( STARSH_esdata **  data,
STARSH_int  count,
int  ndim,
double *  point 
)

Initialize STARSH_esdata object by given data.

Array point should be stored in a special way: x_1 x_2 ... x_count y_1 y_2 ... y_count z_1 z_2 .... This function does not allocate memory for coordinates and uses provided pointer point. Do not free memory of point until you finish using returned STARSH_esdata object. Do not forget to sort data->particles by starsh_particles_zsort_inplace() to take advantage of low-rank submatrices.

Parameters
[out]dataAddress of pointer to STARSH_esdata object.
[in]countNumber of particles.
[in]ndimDimensionality of space.
[in]pointPointer to array of coordinates of particles.
Returns
Error code STARSH_ERRNO.
See also
starsh_esdata_new(), starsh_esdata_free(), starsh_esdata_generate(), starsh_esdata_read_from_file(), starsh_particles_zsort_inplace().

◆ starsh_esdata_new()

int starsh_esdata_new ( STARSH_esdata **  data,
STARSH_int  count,
int  ndim 
)

Allocate memory for STARSH_esdata object.

This functions only allocates memory for particles without setting coordinates to any value. Do not forget to sort data->particles by starsh_particles_zsort_inplace() to take advantage of low-rank submatrices.

Parameters
[out]dataAddress of pointer to STARSH_esdata object.
[in]countNumber of particles.
[in]ndimDimensionality of space.
Returns
Error code STARSH_ERRNO.
See also
starsh_esdata_init(), starsh_esdata_free(), starsh_esdata_generate(), starsh_esdata_read_from_file(), starsh_particles_zsort_inplace(), STARSH_particles.