SpM Handbook 1.2.4
Loading...
Searching...
No Matches
laplacian.c File Reference
#include "common.h"
#include "spm_drivers.h"
#include "drivers/laplacian.h"

Go to the source code of this file.

Functions

static void laplacian_usage (void)
 Print the usage information to generate correct Laplacian matrices.
 
int genLaplacian (const char *filename, spmatrix_t *spm)
 Generate a Laplacian of size spm->n.
 
int genExtendedLaplacian (const char *filename, spmatrix_t *spm)
 Generate a extended Laplacian of size spm->n.
 
SPM driver
int spmParseLaplacianInfo (const char *filename, spm_coeftype_t *flttype, spm_int_t *dim1, spm_int_t *dim2, spm_int_t *dim3, double *alpha, double *beta, spm_int_t *dof)
 Parse information given through the filename string to configure the laplacian matrix to generate.
 

Variables

static void(* laplacian_7points [6])(spmatrix_t *, spm_int_t, spm_int_t, spm_int_t, spm_fixdbl_t, spm_fixdbl_t)
 Pointers to the 7 points Laplacian generator functions.
 
static void(* laplacian_27points [6])(spmatrix_t *, spm_int_t, spm_int_t, spm_int_t, spm_fixdbl_t, spm_fixdbl_t)
 Pointers to the 27 points Laplacian generator functions.
 

Detailed Description

Version
1.2.4
Author
Mathieu Faverge
Pierre Ramet
Tony Delarue
Gregoire Pichon
Date
2024-05-29

Definition in file laplacian.c.

Function Documentation

◆ laplacian_usage()

static void laplacian_usage ( void  )
static

Print the usage information to generate correct Laplacian matrices.

Definition at line 27 of file laplacian.c.

Referenced by spmParseLaplacianInfo().

◆ genLaplacian()

int genLaplacian ( const char *  filename,
spmatrix_t spm 
)

Generate a Laplacian of size spm->n.

Parameters
[in]filenameConfiguration string of the Laplacian. [type:]dim1[:dim2[:dim3]] type p = pattern only
" s = real simple\n" d = real double [default]
" c = complex simple\n" z = complex double
" dim1 size of the first dimension of the 1D|2D|3D laplacian\n" dim2 size of the second dimension of the 2D|3D laplacian
" dim3 size of the third dimension of the 3D laplacian\n"
[in,out]spmAt start, an allocated spm structure. At exit, contains a laplacian matrix in the spm format.
Return values
SPM_SUCCESSif the matrix has been generated successfully
SPM_ERR_BADPARAMETERif the configuration string is incorrect

Definition at line 291 of file laplacian.c.

References spmatrix_s::dof, spmatrix_s::flttype, spmatrix_s::gN, laplacian_7points, SPM_SUCCESS, spmDofExtend(), spmExit(), spmParseLaplacianInfo(), and spmUpdateComputedFields().

Referenced by spm_read_driver().

◆ genExtendedLaplacian()

int genExtendedLaplacian ( const char *  filename,
spmatrix_t spm 
)

Generate a extended Laplacian of size spm->n.

Parameters
[in]filenameConfiguration string of the Laplacian. [type:]dim1[:dim2[:dim3]] type p = pattern only s = real simple d = real double [default] c = complex simple z = complex double dim1 size of the first dimension of the 1D|2D|3D laplacian dim2 size of the second dimension of the 2D|3D laplacian dim3 size of the third dimension of the 3D laplacian
[in,out]spmAt start, an allocated spm structure. At exit, contains a laplacian matrix in the spm format.
Return values
SPM_SUCCESSif the matrix has been generated successfully
SPM_ERR_BADPARAMETERif the configuration string is incorrect

Definition at line 367 of file laplacian.c.

References spmatrix_s::dof, spmatrix_s::flttype, spmatrix_s::gN, laplacian_27points, SPM_ERR_UNKNOWN, SPM_SUCCESS, spmDofExtend(), spmExit(), spmParseLaplacianInfo(), and spmUpdateComputedFields().

Referenced by spm_read_driver().

Variable Documentation

◆ laplacian_7points

void(* laplacian_7points[6])(spmatrix_t *, spm_int_t, spm_int_t, spm_int_t, spm_fixdbl_t, spm_fixdbl_t) ( spmatrix_t ,
spm_int_t  ,
spm_int_t  ,
spm_int_t  ,
spm_fixdbl_t  ,
spm_fixdbl_t   
)
static
Initial value:
=
{
NULL,
}
void c_spmLaplacian_7points(spmatrix_t *spm, spm_int_t dim1, spm_int_t dim2, spm_int_t dim3, spm_fixdbl_t alpha, spm_fixdbl_t beta)
Generate a laplacian matrix for a 3D 7-points stencil.
void d_spmLaplacian_7points(spmatrix_t *spm, spm_int_t dim1, spm_int_t dim2, spm_int_t dim3, spm_fixdbl_t alpha, spm_fixdbl_t beta)
Generate a laplacian matrix for a 3D 7-points stencil.
void p_spmLaplacian_7points(spmatrix_t *spm, spm_int_t dim1, spm_int_t dim2, spm_int_t dim3, spm_fixdbl_t alpha, spm_fixdbl_t beta)
Generate a laplacian matrix for a 3D 7-points stencil.
void s_spmLaplacian_7points(spmatrix_t *spm, spm_int_t dim1, spm_int_t dim2, spm_int_t dim3, spm_fixdbl_t alpha, spm_fixdbl_t beta)
Generate a laplacian matrix for a 3D 7-points stencil.
void z_spmLaplacian_7points(spmatrix_t *spm, spm_int_t dim1, spm_int_t dim2, spm_int_t dim3, spm_fixdbl_t alpha, spm_fixdbl_t beta)
Generate a laplacian matrix for a 3D 7-points stencil.

Pointers to the 7 points Laplacian generator functions.

Definition at line 234 of file laplacian.c.

Referenced by genLaplacian().

◆ laplacian_27points

void(* laplacian_27points[6])(spmatrix_t *, spm_int_t, spm_int_t, spm_int_t, spm_fixdbl_t, spm_fixdbl_t) ( spmatrix_t ,
spm_int_t  ,
spm_int_t  ,
spm_int_t  ,
spm_fixdbl_t  ,
spm_fixdbl_t   
)
static
Initial value:
=
{
NULL,
}
void c_spmLaplacian_27points(spmatrix_t *spm, spm_int_t dim1, spm_int_t dim2, spm_int_t dim3, spm_fixdbl_t alpha, spm_fixdbl_t beta)
Generate an extended laplacian matrix for a 3D 27-points stencil.
void d_spmLaplacian_27points(spmatrix_t *spm, spm_int_t dim1, spm_int_t dim2, spm_int_t dim3, spm_fixdbl_t alpha, spm_fixdbl_t beta)
Generate an extended laplacian matrix for a 3D 27-points stencil.
void p_spmLaplacian_27points(spmatrix_t *spm, spm_int_t dim1, spm_int_t dim2, spm_int_t dim3, spm_fixdbl_t alpha, spm_fixdbl_t beta)
Generate an extended laplacian matrix for a 3D 27-points stencil.
void s_spmLaplacian_27points(spmatrix_t *spm, spm_int_t dim1, spm_int_t dim2, spm_int_t dim3, spm_fixdbl_t alpha, spm_fixdbl_t beta)
Generate an extended laplacian matrix for a 3D 27-points stencil.
void z_spmLaplacian_27points(spmatrix_t *spm, spm_int_t dim1, spm_int_t dim2, spm_int_t dim3, spm_fixdbl_t alpha, spm_fixdbl_t beta)
Generate an extended laplacian matrix for a 3D 27-points stencil.

Pointers to the 27 points Laplacian generator functions.

Definition at line 249 of file laplacian.c.

Referenced by genExtendedLaplacian().