Rate This Document
Findability
Accuracy
Completeness
Readability

KmlIssPcStructilu0Setup

Analyze and decompose a matrix, compute the ILU0 precondition, and create and return the solver handle.

Interface Definition

C interface:

int KmlIssPcStructilu0Setup(KmlIssPsStructilu0Handle *gSmoother, float *v, const int *xl, const int *xr, const int *yl, const int *yr, const int *zl, const int *zr);

Parameters

Parameter

Type

Description

Input/Output

gSmoother

KmlIssPsStructilu0Handle *

Solver handle.

Output

v

float *

19-diagonal matrix v to be solved. It is stored by using a (l, k, i, j) format array, where l is a diagonal element (l=1:19), and k, i, and j are spatial positions.

Input

xl

const int *

Start position in the x direction of the solving space.

Input

xr

const int *

End position in the x direction of the solving space.

Input

yl

const int *

Start position in the y direction of the solving space.

Input

yr

const int *

End position in the y direction of the solving space.

Input

zl

const int *

Start position in the z direction of the solving space.

Input

zr

const int *

End position in the z direction of the solving space.

Input

Return Value

Return Value

Type

Description

KMLSS_NO_ERROR

int

The execution is successful.

KMLSS_NULL_ARGUMENT

int

A null pointer exists in the input.

KMLSS_BAD_DATA

int

The parameters related to the solving space are invalid.

Dependencies

#include "kml_struct_ilu.h"

Examples

C interface:
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
const int xl = 5;
const int yl = 5;
const int zl = 5;
const int xr = 6;
const int yr = 6;
const int zr = 6;
int ybegin = 5;
int yend = 6;
int zbegin = 5;
int zend = 6;
float *v = (float*)malloc(sizeof(float) * 171);
float *b = (float*)malloc(sizeof(float) * 9);
for (int i=0; i<171; i++) {
    v[i] = rand();
}
for (int i=0; i<9; i++) {
    b[i] = rand();
}
KmlIssPsStructilu0Handle gSmoother;
KmlIssPcStructilu0Setup(&gSmoother, v, &xl, &xr, &yl, &yr, &zl, &zr);