 |
6.3
general documentation
|
|
Go to the documentation of this file. 1 #ifndef __CS_SLES_PETSC_H__
2 #define __CS_SLES_PETSC_H__
34 #include <petscviewer.h>
122 cs_sles_petsc_init(
void)
128 PetscBool is_initialized;
129 PetscInitialized(&is_initialized);
131 if (is_initialized == PETSC_FALSE) {
132 #if defined(HAVE_MPI)
135 PetscInitializeNoArguments();
146 cs_sles_petsc_log_setup(KSP ksp)
150 PetscViewerCreate(PETSC_COMM_WORLD, &
v);
151 PetscViewerSetType(
v, PETSCVIEWERASCII);
152 PetscViewerFileSetMode(
v, FILE_MODE_APPEND);
153 PetscViewerFileSetName(
v,
"petsc_setup.log");
156 PetscViewerDestroy(&
v);
void cs_sles_petsc_destroy(void **context)
Destroy PETSc linear system solver info and context.
Definition: cs_sles_petsc.c:680
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:1474
struct _cs_sles_petsc_t cs_sles_petsc_t
Definition: cs_sles_petsc.h:81
void cs_sles_petsc_log(const void *context, cs_log_t log_type)
Log sparse linear equation solver info.
Definition: cs_sles_petsc.c:1563
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:76
cs_sles_convergence_state_t cs_sles_petsc_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 PETSc linear equation solver.
Definition: cs_sles_petsc.c:1298
#define END_C_DECLS
Definition: cs_defs.h:493
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:726
double precision, dimension(:,:,:), allocatable v
Definition: atimbr.f90:114
double cs_real_t
Floating-point value.
Definition: cs_defs.h:304
#define BEGIN_C_DECLS
Definition: cs_defs.h:492
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:94
cs_sles_convergence_state_t
Convergence status indicator.
Definition: cs_sles.h:56
MPI_Comm cs_glob_mpi_comm
Definition: cs_defs.c:179
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:656
cs_log_t
Definition: cs_log.h:48
struct _cs_sles_t cs_sles_t
Definition: cs_sles.h:68
void cs_user_sles_petsc_hook(void *context, KSP ksp)
Definition: cs_sles_petsc.c:489
cs_halo_rotation_t
Definition: cs_halo.h:60
bool cs_sles_petsc_error_post_and_abort(cs_sles_t *sles, cs_sles_convergence_state_t state, const cs_matrix_t *a, cs_halo_rotation_t rotation_mode, const cs_real_t *rhs, cs_real_t *vx)
Error handler for PETSc solver.
Definition: cs_sles_petsc.c:1521
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:533
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:579