STARS-H
Software for Testing Accuracy, Reliability and Scalability of Hierarchical computations
|
Template for electrodynamics problems. More...
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... | |
Template for electrodynamics problems.
STARSH_eddata holds all the necessary data.
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.
|
STARSH_ELECTRODYNAMICS_COS | Helmholtz cos kernel.
|
STARSH_ELECTRODYNAMICS_SIN_SIMD | Helmholtz sin SIMD kernel. |
STARSH_ELECTRODYNAMICS_COS_SIMD | Helmholtz cos SIMD kernel. |
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().
Enumerator | |
---|---|
STARSH_ELECTRODYNAMICS_NDIM | Dimensionality of space ( |
STARSH_ELECTRODYNAMICS_K | Wave number ( |
STARSH_ELECTRODYNAMICS_DIAG | Value of diagonal elements ( |
STARSH_ELECTRODYNAMICS_PLACE | Distribution of particles ( |
void starsh_eddata_free | ( | STARSH_eddata * | data | ) |
Free memory of STARSH_eddata object.
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.
[out] | data | Address of pointer to STARSH_eddata object. |
[in] | count | Number of particles. |
[in] | ndim | Dimensionality of space. |
[in] | k | Wave number. |
[in] | diag | Value of diagonal elements. |
[in] | place | Placement strategy for spatial points. |
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.
[out] | data | Address of pointer to STARSH_eddata object. |
[in] | count | Number of particles. |
[in] | ... | Variable amount of arguments. |
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.
[out] | data | Address of pointer to STARSH_ssdata object. |
[in] | count | Number of particles. |
[in] | args | Arguments, packed into va_args. |
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.
[out] | kernel | Address of pointer to STARSH_kernel function. |
[in] | data | Pointer to STARSH_eddata object. |
[in] | type | Type of kernel. For more info look at STARSH_ELECTRODYNAMICS_KERNEL. |
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.
[out] | data | Address of pointer to STARSH_eddata object. |
[in] | count | Number of particles. |
[in] | ndim | Dimensionality of space. |
[in] | point | Pointer to array of coordinates of particles. |
[in] | k | Wave number. |
[in] | diag | Value of diagonal elements. |
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.
[out] | data | Address of pointer to STARSH_ssdata object. |
[in] | count | Number of particles. |
[in] | ndim | Dimensionality of space. |