Developer Reference for Intel® oneAPI Math Kernel Library for C

ID 766684
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

?_init_Helmholtz_2D/?_init_Helmholtz_3D

Initializes basic data structures of the Fast 2D/3D Helmholtz Solver.

Syntax

void d_init_Helmholtz_2D (const double * ax, const double * bx, const double * ay, const double * by, const MKL_INT * nx, const MKL_INT * ny, const char * BCtype, const double * q, MKL_INT * ipar, double * dpar, MKL_INT * stat);

void s_init_Helmholtz_2D (const float * ax, const float * bx, const float * ay, const float * by, const MKL_INT * nx, const MKL_INT * ny, const char * BCtype, const float * q, MKL_INT * ipar, float * spar, MKL_INT * stat);

void d_init_Helmholtz_3D (const double * ax, const double * bx, const double * ay, const double * by, const double * az, const double * bz, const MKL_INT * nx, const MKL_INT * ny, const MKL_INT * nz, const char * BCtype, const double * q, MKL_INT *ipar, double * dpar, MKL_INT * stat);

void s_init_Helmholtz_3D (const float * ax, const float * bx, const float * ay, const float * by, const float * az, const float * bz, const MKL_INT * nx, const MKL_INT * ny, const MKL_INT * nz, const char * BCtype, const float * q, MKL_INT * ipar, float * spar, MKL_INT * stat);

Include Files

  • mkl.h

Input Parameters

ax

double* for d_init_Helmholtz_2D/d_init_Helmholtz_3D,

float* for s_init_Helmholtz_2D/s_init_Helmholtz_3D.

The coordinate of the leftmost boundary of the domain along the x-axis.

bx

double* for d_init_Helmholtz_2D/d_init_Helmholtz_3D,

float* for s_init_Helmholtz_2D/s_init_Helmholtz_3D.

The coordinate of the rightmost boundary of the domain along the x-axis.

ay

double* for d_init_Helmholtz_2D/d_init_Helmholtz_3D,

float* for s_init_Helmholtz_2D/s_init_Helmholtz_3D.

The coordinate of the leftmost boundary of the domain along the y-axis.

by

double* for d_init_Helmholtz_2D/d_init_Helmholtz_3D,

float* for s_init_Helmholtz_2D/s_init_Helmholtz_3D.

The coordinate of the rightmost boundary of the domain along the y-axis.

az

double* for d_init_Helmholtz_3D,

float* for s_init_Helmholtz_3D.

The coordinate of the leftmost boundary of the domain along the z-axis. This parameter is needed only for the ?_init_Helmholtz_3D routine.

bz

double* for d_init_Helmholtz_3D,

float* for s_init_Helmholtz_3D.

The coordinate of the rightmost boundary of the domain along the z-axis. This parameter is needed only for the ?_init_Helmholtz_3D routine.

nx

MKL_INT*. The number of mesh intervals along the x-axis.

ny

MKL_INT*. The number of mesh intervals along the y-axis.

nz

MKL_INT*. The number of mesh intervals along the z-axis. This parameter is needed only for the ?_init_Helmholtz_3D routine.

BCtype

char*. Contains the type of boundary conditions on each boundary. Must contain four characters for ?_init_Helmholtz_2D and six characters for ?_init_Helmholtz_3D. Each of the characters can be 'N' (Neumann boundary condition), 'D' (Dirichlet boundary condition), or 'P' (periodic boundary conditions). Specify the types of boundary conditions for the boundaries in the following order: bd_ax, bd_bx, bd_ay, bd_by, bd_az, and bd_bz. Specify periodic boundary conditions on the respective boundaries in pairs (for example, 'PPDD' or 'NNPP' in the 2D case). The types of boundary conditions for the last two boundaries are needed only in the 3D case.

q

double* for d_init_Helmholtz_2D/d_init_Helmholtz_3D,

float* for s_init_Helmholtz_2D/s_init_Helmholtz_3D .

The constant Helmholtz coefficient. Note that to solve Poisson or Laplace problem, you should set the value of q to 0.

Output Parameters

ipar

MKL_INT array of size 128. Contains integer data to be used by Fast Helmholtz Solver (for details, refer to ipar).

dpar

double array of size 5*nx/2+7 in the 2D case or 5*(nx+ny)/2+9 in the 3D case. Contains double-precision data to be used by Fast Helmholtz Solver (for details, refer to dpar and spar).

spar

float array of size 5*nx/2+7 in the 2D case or 5*(nx+ny)/2+9 in the 3D case. Contains single-precision data to be used by Fast Helmholtz Solver (for details, refer to dpar and spar).

stat

MKL_INT*. Routine completion status, which is also written to ipar[0]. Continue to call other Poisson Solver routines only if the status is 0.

Description

The ?_init_Helmholtz_2D/?_init_Helmholtz_3D routines initialize basic data structures for Poisson Solver computations of the appropriate precision. All routines invoked after a call to a ?_init_Helmholtz_2D/?_init_Helmholtz_3D routine use values of the ipar, dpar and spar array parameters returned by the routine. Detailed description of the array parameters can be found in Common Parameters.

CAUTION:

Data structures initialized and created by 2D flavors of the routine cannot be used by 3D flavors of any Poisson Solver routines, and vice versa.

You can skip calls to these routines in your code. However, see Caveat on Parameter Modifications for information on initializing the data structures.

Return Values

stat= 0

The routine successfully completed the task. In general, to proceed with computations, the routine should complete with this stat value.

stat= -99999

The routine failed to complete the task because of a fatal error.