$extrastylesheet
Go to the source code of this file.
Classes | |
| class | libMesh::PetscLinearSolver< T > |
Namespaces | |
| namespace | libMesh |
Typedefs | |
| typedef int | PetscInt |
Functions | |
| PetscErrorCode | __libmesh_petsc_preconditioner_setup (void *ctx) |
| PetscErrorCode | __libmesh_petsc_preconditioner_apply (void *ctx, Vec x, Vec y) |
| PetscErrorCode | __libmesh_petsc_preconditioner_setup (PC) |
| PetscErrorCode | __libmesh_petsc_preconditioner_apply (PC, Vec x, Vec y) |
Variables | |
| EXTERN_C_FOR_PETSC_BEGIN EXTERN_C_FOR_PETSC_END typedef int | PetscErrorCode |
| typedef int PetscInt |
Definition at line 61 of file petsc_linear_solver.h.
| PetscErrorCode __libmesh_petsc_preconditioner_apply | ( | void * | ctx, |
| Vec | x, | ||
| Vec | y | ||
| ) |
This function is called by PETSc to acctually apply the preconditioner. ctx will hold the Preconditioner.
Definition at line 63 of file petsc_linear_solver.C.
Referenced by libMesh::PetscNonlinearSolver< T >::init(), and libMesh::PetscLinearSolver< T >::init().
{
Preconditioner<Number> * preconditioner = static_cast<Preconditioner<Number>*>(ctx);
PetscVector<Number> x_vec(x, preconditioner->comm());
PetscVector<Number> y_vec(y, preconditioner->comm());
preconditioner->apply(x_vec,y_vec);
return 0;
}
| PetscErrorCode __libmesh_petsc_preconditioner_apply | ( | PC | , |
| Vec | x, | ||
| Vec | y | ||
| ) |
Definition at line 89 of file petsc_linear_solver.C.
References libMesh::ierr.
{
void *ctx;
PetscErrorCode ierr = PCShellGetContext(pc,&ctx);CHKERRQ(ierr);
Preconditioner<Number> * preconditioner = static_cast<Preconditioner<Number>*>(ctx);
PetscVector<Number> x_vec(x, preconditioner->comm());
PetscVector<Number> y_vec(y, preconditioner->comm());
preconditioner->apply(x_vec,y_vec);
return 0;
}
| PetscErrorCode __libmesh_petsc_preconditioner_setup | ( | void * | ctx | ) |
This function is called by PETSc to initialize the preconditioner. ctx will hold the Preconditioner.
Definition at line 50 of file petsc_linear_solver.C.
Referenced by libMesh::PetscNonlinearSolver< T >::init(), and libMesh::PetscLinearSolver< T >::init().
{
Preconditioner<Number> * preconditioner = static_cast<Preconditioner<Number>*>(ctx);
if (!preconditioner->initialized())
libmesh_error_msg("Preconditioner not initialized! Make sure you call init() before solve!");
preconditioner->setup();
return 0;
}
Definition at line 75 of file petsc_linear_solver.C.
References libMesh::ierr.
{
void *ctx;
PetscErrorCode ierr = PCShellGetContext(pc,&ctx);CHKERRQ(ierr);
Preconditioner<Number> * preconditioner = static_cast<Preconditioner<Number>*>(ctx);
if (!preconditioner->initialized())
libmesh_error_msg("Preconditioner not initialized! Make sure you call init() before solve!");
preconditioner->setup();
return 0;
}
| EXTERN_C_FOR_PETSC_BEGIN EXTERN_C_FOR_PETSC_END typedef int PetscErrorCode |
Petsc include files.
Definition at line 60 of file petsc_linear_solver.h.
Referenced by DMlibMeshGetSystem(), and DMlibMeshSetSystem().