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

Template for electrodynamics problems. More...

Collaboration diagram for Electrodynamics problem:

Modules

 Kernels
 Set of kernels for electrodynamics problems.
 

Data Structures

struct  starsh_eddata
 Structure for electrodynamics problems. More...
 

Typedefs

typedef struct starsh_eddata STARSH_eddata
 Structure for electrodynamics problems.
 

Enumerations

enum  STARSH_ELECTRODYNAMICS_KERNEL { STARSH_ELECTRODYNAMICS_SIN = 1, STARSH_ELECTRODYNAMICS_COS = 2, STARSH_ELECTRODYNAMICS_SIN_SIMD = 11, STARSH_ELECTRODYNAMICS_COS_SIMD = 12 }
 List of built-in kernels for starsh_eddata_get_kernel(). More...
 
enum  STARSH_ELECTRODYNAMICS_PARAM { STARSH_ELECTRODYNAMICS_NDIM = 1, STARSH_ELECTRODYNAMICS_K = 2, STARSH_ELECTRODYNAMICS_DIAG = 3, STARSH_ELECTRODYNAMICS_PLACE = 4 }
 List of parameters for starsh_application(). More...
 

Functions

int starsh_eddata_new (STARSH_eddata **data, STARSH_int count, int ndim)
 Allocate memory for STARSH_eddata object. More...
 
int starsh_eddata_init (STARSH_eddata **data, STARSH_int count, int ndim, double *point, double k, double diag)
 Initialize STARSH_eddata object by given data. More...
 
int starsh_eddata_generate (STARSH_eddata **data, STARSH_int count, int ndim, double k, double diag, enum STARSH_PARTICLES_PLACEMENT place)
 Generate STARSH_ssdata object by given distribution. More...
 
int starsh_eddata_generate_va (STARSH_eddata **data, STARSH_int count, va_list args)
 Generate STARSH_eddata object with incomplete set of parameters. More...
 
int starsh_eddata_generate_el (STARSH_eddata **data, STARSH_int count,...)
 Generate STARSH_eddata object with incomplete set of parameters. More...
 
void starsh_eddata_free (STARSH_eddata *data)
 Free memory of STARSH_eddata object. More...
 
int starsh_eddata_get_kernel (STARSH_kernel **kernel, STARSH_eddata *data, enum STARSH_ELECTRODYNAMICS_KERNEL type)
 Get kernel for electrodynamics problem. More...
 

Detailed Description

Template for electrodynamics problems.

STARSH_eddata holds all the necessary data.

Enumeration Type Documentation

◆ STARSH_ELECTRODYNAMICS_KERNEL

List of built-in kernels for starsh_eddata_get_kernel().

For more info on exact formulas inside kernels, take a look at functions starsh_eddata_block_sin_kernel_nd(), starsh_eddata_block_cos_kernel_nd(), starsh_eddata_block_sin_kernel_nd_simd(), starsh_eddata_block_cos_kernel_nd_simd().

Enumerator
STARSH_ELECTRODYNAMICS_SIN 

Helmholtz sin kernel.

See also
starsh_eddata_block_sin_kernel_nd().
STARSH_ELECTRODYNAMICS_COS 

Helmholtz cos kernel.

See also
starsh_eddata_block_cos_kernel_nd().
STARSH_ELECTRODYNAMICS_SIN_SIMD 

Helmholtz sin SIMD kernel.

See also
starsh_eddata_block_sin_kernel_nd_simd().
STARSH_ELECTRODYNAMICS_COS_SIMD 

Helmholtz cos SIMD kernel.

See also
starsh_eddata_block_cos_kernel_nd_simd().

◆ STARSH_ELECTRODYNAMICS_PARAM

List of parameters for starsh_application().

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

See also
starsh_application(), starsh_eddata_generate(), starsh_eddata_generate_va(), starsh_eddata_generate_el().
Enumerator
STARSH_ELECTRODYNAMICS_NDIM 

Dimensionality of space (ndim, integer).

STARSH_ELECTRODYNAMICS_K 

Wave number (k, double).

STARSH_ELECTRODYNAMICS_DIAG 

Value of diagonal elements (diag, double).

STARSH_ELECTRODYNAMICS_PLACE 

Distribution of particles (place, STARSH_PARTICLES_PLACEMENT).

Function Documentation

◆ starsh_eddata_free()

void starsh_eddata_free ( STARSH_eddata data)

◆ starsh_eddata_generate()

int starsh_eddata_generate ( STARSH_eddata **  data,
STARSH_int  count,
int  ndim,
double  k,
double  diag,
enum STARSH_PARTICLES_PLACEMENT  place 
)

Generate STARSH_ssdata object by given distribution.

Parameters
[out]dataAddress of pointer to STARSH_eddata object.
[in]countNumber of particles.
[in]ndimDimensionality of space.
[in]kWave number.
[in]diagValue of diagonal elements.
[in]placePlacement strategy for spatial points.
Returns
Error code STARSH_ERRNO.
See also
starsh_eddata_generate_va(), starsh_eddata_generate_el().

◆ starsh_eddata_generate_el()

int starsh_eddata_generate_el ( STARSH_eddata **  data,
STARSH_int  count,
  ... 
)

Generate STARSH_eddata object with incomplete set of parameters.

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

Argument Default value Type –
ndim 2 int
k 1.0 double
diag 1.0 double
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_ELECTRODYNAMICS_PARAM.

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

◆ starsh_eddata_generate_va()

int starsh_eddata_generate_va ( STARSH_eddata **  data,
STARSH_int  count,
va_list  args 
)

Generate STARSH_eddata object with incomplete set of parameters.

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

Argument Default value Type –
ndim 2 int
k 1.0 double
diag 1.0 double
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_ELECTRODYNAMICS_PARAM.

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

◆ starsh_eddata_get_kernel()

int starsh_eddata_get_kernel ( STARSH_kernel **  kernel,
STARSH_eddata data,
enum STARSH_ELECTRODYNAMICS_KERNEL  type 
)

Get kernel for electrodynamics problem.

Kernel can be selected with this call or manually. To select kernel manually look into Kernels.

Parameters
[out]kernelAddress of pointer to STARSH_kernel function.
[in]dataPointer to STARSH_eddata object.
[in]typeType of kernel. For more info look at STARSH_ELECTRODYNAMICS_KERNEL.
Returns
Error code STARSH_ERRNO.
See also
starsh_eddata_block_sin_kernel_nd(), starsh_eddata_block_sin_kernel_nd_simd(), starsh_eddata_block_cos_kernel_nd(), starsh_eddata_block_cos_kernel_nd_simd().

◆ starsh_eddata_init()

int starsh_eddata_init ( STARSH_eddata **  data,
STARSH_int  count,
int  ndim,
double *  point,
double  k,
double  diag 
)

Initialize STARSH_eddata 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_eddata 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_eddata object.
[in]countNumber of particles.
[in]ndimDimensionality of space.
[in]pointPointer to array of coordinates of particles.
[in]kWave number.
[in]diagValue of diagonal elements.
Returns
Error code STARSH_ERRNO.
See also
starsh_eddata_new(), starsh_eddata_free(), starsh_eddata_generate(), starsh_eddata_read_from_file(), starsh_particles_zsort_inplace().

◆ starsh_eddata_new()

int starsh_eddata_new ( STARSH_eddata **  data,
STARSH_int  count,
int  ndim 
)

Allocate memory for STARSH_eddata 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_ssdata object.
[in]countNumber of particles.
[in]ndimDimensionality of space.
Returns
Error code STARSH_ERRNO.
See also
starsh_eddata_init(), starsh_eddata_free(), starsh_eddata_generate(), starsh_eddata_read_from_file(), starsh_particles_zsort_inplace(), STARSH_particles.