#include "cs_base.h"
#include "cs_halo_perio.h"
#include "cs_matrix.h"
#include "cs_param_sles.h"
#include "cs_time_plot.h"
#include "cs_sles.h"
#include "cs_sles_pc.h"
Go to the source code of this file.
Macros | |
#define | CS_SLES_MUMPS_JOB_INIT -1 |
#define | ICNTL(I) icntl[(I)-1] |
#define | CNTL(I) cntl[(I)-1] |
#define | INFOG(I) infog[(I)-1] |
#define | INFO(I) info[(I)-1] |
#define | RINFOG(I) rinfog[(I)-1] |
#define | RINFO(I) rinfo[(I)-1] |
#define | KEEP(I) keep[(I)-1] |
Typedefs | |
typedef void() | cs_sles_mumps_setup_hook_t(const cs_param_sles_t *slesp, void *context, void *mumps) |
Function pointer for user settings of a MUMPS solver. This function is called at the end of the setup stage. More... | |
typedef struct _cs_sles_mumps_t | cs_sles_mumps_t |
Functions | |
void | cs_user_sles_mumps_hook (const cs_param_sles_t *slesp, void *context, void *pmumps) |
Function pointer for advanced user settings of a MUMPS solver. This function is called two times during the setup stage. More... | |
cs_sles_mumps_t * | cs_sles_mumps_define (int f_id, const char *name, const cs_param_sles_t *slesp, 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_pc_t * | cs_sles_mumps_pc_create (const cs_param_sles_t *slesp) |
Create a preconditioner structure relying on MUMPS solver. More... | |
cs_sles_mumps_t * | cs_sles_mumps_create (const cs_param_sles_t *slesp, 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, 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... | |
void | cs_sles_mumps_library_info (cs_log_t log_type) |
Print information on MUMPS library. More... | |
#define CNTL | ( | I | ) | cntl[(I)-1] |
#define CS_SLES_MUMPS_JOB_INIT -1 |
#define ICNTL | ( | I | ) | icntl[(I)-1] |
#define INFO | ( | I | ) | info[(I)-1] |
#define INFOG | ( | I | ) | infog[(I)-1] |
#define KEEP | ( | I | ) | keep[(I)-1] |
#define RINFO | ( | I | ) | rinfo[(I)-1] |
#define RINFOG | ( | I | ) | rinfog[(I)-1] |
cs_sles_mumps_setup_hook_t |
Function pointer for user settings of a MUMPS solver. This function is called at the end of the setup stage.
Function pointer for user settings of a MUMPS DMUMPS_STRUC_C solver setup.
Note: if the context pointer is non-NULL, it must point to valid data when the selection function is called so that value or structure should not be temporary (i.e. local);
[in] | slesp | pointer to the related cs_param_sles_t structure |
[in,out] | context | pointer to optional (untyped) value or structure |
[in,out] | mumps | pointer to DMUMPS_STRUC_C or SMUMPS_STRUC_C |
This function is called 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 value or structure should not be temporary (i.e. local);
[in,out] | context | pointer to optional (untyped) value or structure |
[in,out] | dmumps | pointer to DMUMPS_STRUC_C structure |
typedef struct _cs_sles_mumps_t cs_sles_mumps_t |
void* cs_sles_mumps_copy | ( | const void * | context | ) |
Create MUMPS linear system solver info and context based on existing info and context.
[in] | context | pointer to reference info and context (actual type: cs_sles_mumps_t *) |
cs_sles_mumps_t* cs_sles_mumps_create | ( | const cs_param_sles_t * | slesp, |
cs_sles_mumps_setup_hook_t * | setup_hook, | ||
void * | context | ||
) |
Create MUMPS linear system solver info and context.
[in] | slesp | pointer to a cs_param_sles_t structure |
[in] | setup_hook | pointer to optional setup epilogue function |
[in,out] | context | pointer to optional (untyped) value or structure for setup_hook, or NULL |
cs_sles_mumps_t* cs_sles_mumps_define | ( | int | f_id, |
const char * | name, | ||
const cs_param_sles_t * | slesp, | ||
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.
[in] | f_id | associated field id, or < 0 |
[in] | name | associated name if f_id < 0, or NULL |
[in] | slesp | pointer to a cs_param_sles_t structure |
[in] | setup_hook | pointer to optional setup epilogue function |
[in,out] | context | pointer to optional (untyped) value or structure for setup_hook, or NULL |
void cs_sles_mumps_destroy | ( | void ** | context | ) |
Destroy MUMPS linear system solver info and context.
[in,out] | context | pointer to sparse direct solver info and context (actual type: cs_sles_mumps_t **) |
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.
[in,out] | context | pointer to sparse direct solver info and context (actual type: cs_sles_mumps_t *) |
void cs_sles_mumps_library_info | ( | cs_log_t | log_type | ) |
Print information on MUMPS library.
[in] | log_type | log type |
void cs_sles_mumps_log | ( | const void * | context, |
cs_log_t | log_type | ||
) |
Log sparse linear equation solver info.
[in] | context | pointer to sparse direct solver info and context (actual type: cs_sles_mumps_t *) |
[in] | log_type | log type |
cs_sles_pc_t* cs_sles_mumps_pc_create | ( | const cs_param_sles_t * | slesp | ) |
Create a preconditioner structure relying on MUMPS solver.
[in] | slesp | pointer to a cs_param_sles_t structure |
void cs_sles_mumps_setup | ( | void * | context, |
const char * | name, | ||
const cs_matrix_t * | a, | ||
int | verbosity | ||
) |
Setup MUMPS linear equation solver.
[in,out] | context | pointer to sparse direct solver info and context (actual type: cs_sles_mumps_t *) |
[in] | name | pointer to system name |
[in] | a | associated matrix |
[in] | verbosity | associated verbosity |
cs_sles_convergence_state_t cs_sles_mumps_solve | ( | void * | context, |
const char * | name, | ||
const cs_matrix_t * | a, | ||
int | verbosity, | ||
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.
[in,out] | context | pointer to sparse direct solver info and context (actual type: cs_sles_mumps_t *) |
[in] | name | pointer to system name |
[in] | a | matrix |
[in] | verbosity | associated verbosity |
[in] | precision | solver precision |
[in] | r_norm | residue normalization |
[out] | n_iter | number of "equivalent" iterations |
[out] | residue | residue |
[in] | rhs | right hand side |
[in,out] | vx | system solution |
[in] | aux_size | number of elements in aux_vectors (in bytes) |
aux_vectors | optional working area (internal allocation if NULL) |
void cs_user_sles_mumps_hook | ( | const cs_param_sles_t * | slesp, |
void * | context, | ||
void * | pmumps | ||
) |
Function pointer for advanced user settings of a MUMPS solver. This function is called two times during the setup stage.
One can recover the MUMPS step through the "job" member. MUMPS_JOB_ANALYSIS or MUMPS_JOB_FACTORIZATION
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);
[in] | slesp | pointer to the related cs_param_sles_t structure |
[in,out] | context | pointer to optional (untyped) value or structure |
[in,out] | pmumps | pointer to DMUMPS_STRUC_C or SMUMPS_STRUC_C struct. |