7.0
general documentation
cs_sles_mumps.c File Reference

handling of MUMPS-based linear solvers More...

#include "cs_defs.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <math.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "bft_printf.h"
#include "cs_base.h"
#include "cs_log.h"
#include "cs_fp_exception.h"
#include "cs_halo.h"
#include "cs_matrix.h"
#include "cs_matrix_default.h"
#include "cs_timer.h"
#include "cs_sles.h"
#include "cs_sles_mumps.h"
+ Include dependency graph for cs_sles_mumps.c:

Functions

void cs_user_sles_mumps_hook (void *context, DMUMPS_STRUC_C *mumps)
 Function pointer for user settings of a MUMPS solver. This function is called at the end of the setup stage. More...
 
cs_sles_mumps_tcs_sles_mumps_define (int f_id, const char *name, int sym, int verbosity, cs_sles_mumps_setup_hook_t *setup_hook, void *context)
 Define and associate a MUMPS linear system solver for a given field or equation name. More...
 
cs_sles_mumps_tcs_sles_mumps_create (int sym, int verbosity, cs_sles_mumps_setup_hook_t *setup_hook, void *context)
 Create MUMPS linear system solver info and context. More...
 
void * cs_sles_mumps_copy (const void *context)
 Create MUMPS linear system solver info and context based on existing info and context. More...
 
void cs_sles_mumps_free (void *context)
 Free MUMPS linear equation solver setup context. More...
 
void cs_sles_mumps_destroy (void **context)
 Destroy MUMPS linear system solver info and context. More...
 
void cs_sles_mumps_setup (void *context, const char *name, const cs_matrix_t *a, int verbosity)
 Setup MUMPS linear equation solver. More...
 
cs_sles_convergence_state_t cs_sles_mumps_solve (void *context, const char *name, const cs_matrix_t *a, int verbosity, cs_halo_rotation_t rotation_mode, double precision, double r_norm, int *n_iter, double *residue, const cs_real_t *rhs, cs_real_t *vx, size_t aux_size, void *aux_vectors)
 Call MUMPS linear equation solver. More...
 
void cs_sles_mumps_log (const void *context, cs_log_t log_type)
 Log sparse linear equation solver info. More...
 

Detailed Description

handling of MUMPS-based linear solvers

Function Documentation

◆ cs_sles_mumps_copy()

void* cs_sles_mumps_copy ( const void *  context)

Create MUMPS linear system solver info and context based on existing info and context.

Parameters
[in]contextpointer to reference info and context (actual type: cs_sles_mumps_t *)
Returns
pointer to newly created solver info object. (actual type: cs_sles_mumps_t *)

◆ cs_sles_mumps_create()

cs_sles_mumps_t* cs_sles_mumps_create ( int  sym,
int  verbosity,
cs_sles_mumps_setup_hook_t setup_hook,
void *  context 
)

Create MUMPS linear system solver info and context.

Parameters
[in]symtype of matrix (unsymmetric, SPD, symmetric)
[in]verbositylevel of verbosity
[in]setup_hookpointer to optional setup epilogue function
[in,out]contextpointer to optional (untyped) value or structure for setup_hook, or NULL
Returns
pointer to associated linear system object.

◆ cs_sles_mumps_define()

cs_sles_mumps_t* cs_sles_mumps_define ( int  f_id,
const char *  name,
int  sym,
int  verbosity,
cs_sles_mumps_setup_hook_t setup_hook,
void *  context 
)

Define and associate a MUMPS linear system solver for a given field or equation name.

If this system did not previously exist, it is added to the list of "known" systems. Otherwise, its definition is replaced by the one defined here.

This is a utility function: if finer control is needed, see cs_sles_define and cs_sles_mumps_create.

Note that this function returns a pointer directly to the sparse direct solver management structure. This may be used to set further options. If needed, cs_sles_find may be used to obtain a pointer to the matching cs_sles_t container.

Parameters
[in]f_idassociated field id, or < 0
[in]nameassociated name if f_id < 0, or NULL
[in]symtype of matrix (unsymmetric, SPD, symmetric)
[in]verbositylevel of verbosity
[in]setup_hookpointer to optional setup epilogue function
[in,out]contextpointer to optional (untyped) value or structure for setup_hook, or NULL
Returns
pointer to newly created sparse direct solver info object.

◆ cs_sles_mumps_destroy()

void cs_sles_mumps_destroy ( void **  context)

Destroy MUMPS linear system solver info and context.

Parameters
[in,out]contextpointer to sparse direct solver info and context (actual type: cs_sles_mumps_t **)

◆ cs_sles_mumps_free()

void cs_sles_mumps_free ( void *  context)

Free MUMPS linear equation solver setup context.

This function frees resolution-related data, such as buffers and preconditioning but does not free the whole context, as info used for logging (especially performance data) is maintained.

Parameters
[in,out]contextpointer to sparse direct solver info and context (actual type: cs_sles_mumps_t *)

◆ cs_sles_mumps_log()

void cs_sles_mumps_log ( const void *  context,
cs_log_t  log_type 
)

Log sparse linear equation solver info.

Parameters
[in]contextpointer to sparse direct solver info and context (actual type: cs_sles_mumps_t *)
[in]log_typelog type

◆ cs_sles_mumps_setup()

void cs_sles_mumps_setup ( void *  context,
const char *  name,
const cs_matrix_t a,
int  verbosity 
)

Setup MUMPS linear equation solver.

Parameters
[in,out]contextpointer to sparse direct solver info and context (actual type: cs_sles_mumps_t *)
[in]namepointer to system name
[in]aassociated matrix
[in]verbosityassociated verbosity

◆ cs_sles_mumps_solve()

cs_sles_convergence_state_t cs_sles_mumps_solve ( void *  context,
const char *  name,
const cs_matrix_t a,
int  verbosity,
cs_halo_rotation_t  rotation_mode,
double  precision,
double  r_norm,
int *  n_iter,
double *  residue,
const cs_real_t rhs,
cs_real_t vx,
size_t  aux_size,
void *  aux_vectors 
)

Call MUMPS linear equation solver.

Parameters
[in,out]contextpointer to sparse direct solver info and context (actual type: cs_sles_mumps_t *)
[in]namepointer to system name
[in]amatrix
[in]verbosityassociated verbosity
[in]rotation_modehalo update option for rotational periodicity
[in]precisionsolver precision
[in]r_normresidue normalization
[out]n_iternumber of "equivalent" iterations
[out]residueresidue
[in]rhsright hand side
[in,out]vxsystem solution
[in]aux_sizenumber of elements in aux_vectors (in bytes)
aux_vectorsoptional working area (internal allocation if NULL)
Returns
convergence state

◆ cs_user_sles_mumps_hook()

void cs_user_sles_mumps_hook ( void *  context,
DMUMPS_STRUC_C *  mumps 
)

Function pointer for user settings of a MUMPS solver. This function is called at the end of the setup stage.

Note: if the context pointer is non-NULL, it must point to valid data when the selection function is called so that structure should not be temporary (i.e. local);

Parameters
[in,out]contextpointer to optional (untyped) value or structure
[in,out]mumpspointer to DMUMPS_STRUCT_C structure