1 #ifndef __CS_SLES_PETSC_H__ 2 #define __CS_SLES_PETSC_H__ 34 #include <petscversion.h> 35 #include <petscconf.h> 36 #include <petscviewer.h> 133 cs_sles_petsc_log_setup(KSP ksp)
137 PetscViewerCreate(PETSC_COMM_WORLD, &v);
138 PetscViewerSetType(v, PETSCVIEWERASCII);
139 PetscViewerFileSetMode(v, FILE_MODE_APPEND);
140 PetscViewerFileSetName(v,
"petsc_setup.log");
143 PetscViewerDestroy(&v);
cs_sles_convergence_state_t cs_sles_petsc_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 PETSc linear equation solver.
Definition: cs_sles_petsc.c:1319
struct _cs_sles_petsc_t cs_sles_petsc_t
Definition: cs_sles_petsc.h:83
void cs_sles_petsc_init(void)
Definition: cs_sles_petsc.c:505
void cs_user_sles_petsc_hook(void *context, KSP ksp)
Definition: cs_sles_petsc.c:489
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
bool cs_sles_petsc_error_post_and_abort(cs_sles_t *sles, cs_sles_convergence_state_t state, const cs_matrix_t *a, const cs_real_t *rhs, cs_real_t *vx)
Error handler for PETSc solver.
Definition: cs_sles_petsc.c:1531
void() cs_sles_petsc_setup_hook_t(void *context, KSP ksp)
Function pointer for user settings of a PETSc KSP solver setup.
Definition: cs_sles_petsc.h:78
void cs_sles_petsc_library_info(cs_log_t log_type)
Print information on PETSc library.
Definition: cs_sles_petsc.c:1651
cs_sles_petsc_t * cs_sles_petsc_create(MatType matrix_type, cs_sles_petsc_setup_hook_t *setup_hook, void *context)
Create PETSc linear system solver info and context.
Definition: cs_sles_petsc.c:601
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:93
void cs_sles_petsc_setup(void *context, const char *name, const cs_matrix_t *a, int verbosity)
Setup PETSc linear equation solver.
Definition: cs_sles_petsc.c:748
void * cs_sles_petsc_copy(const void *context)
Create PETSc linear system solver info and context based on existing info and context.
Definition: cs_sles_petsc.c:678
cs_sles_convergence_state_t
Convergence status indicator.
Definition: cs_sles.h:56
struct _cs_sles_t cs_sles_t
Definition: cs_sles.h:68
double precision, dimension(:,:,:), allocatable v
Definition: atimbr.f90:114
double precision, save a
Definition: cs_fuel_incl.f90:146
void cs_sles_petsc_free(void *context)
Free PETSc linear equation solver setup context.
Definition: cs_sles_petsc.c:1485
cs_sles_petsc_t * cs_sles_petsc_define(int f_id, const char *name, MatType matrix_type, cs_sles_petsc_setup_hook_t *setup_hook, void *context)
Define and associate a PETSc linear system solver for a given field or equation name.
Definition: cs_sles_petsc.c:555
cs_log_t
Definition: cs_log.h:48
#define END_C_DECLS
Definition: cs_defs.h:511
void cs_sles_petsc_destroy(void **context)
Destroy PETSc linear system solver info and context.
Definition: cs_sles_petsc.c:702
void cs_sles_petsc_log(const void *context, cs_log_t log_type)
Log sparse linear equation solver info.
Definition: cs_sles_petsc.c:1571