Moved KSPCreate to the Data constructor

This is where it was always intended to be called, so this fixes a mistake in
earlier development.
This commit is contained in:
Jørgen Kvalsvik 2014-11-12 20:40:46 +01:00
parent 7c78afa13d
commit e69d92cca3

View File

@ -139,6 +139,8 @@ namespace{
CHKERRXX( err );
MatSetFromOptions( A );
MatSetUp( A );
KSPCreate( PETSC_COMM_WORLD, &ksp );
}
~OEM_DATA() {
@ -203,7 +205,6 @@ namespace{
PetscReal residual;
KSPConvergedReason reason;
KSPCreate( PETSC_COMM_WORLD, &t.ksp );
KSPSetOperators( t.ksp, t.A, t.A, DIFFERENT_NONZERO_PATTERN );
KSPGetPC( t.ksp, &t.preconditioner );
auto err = KSPSetType( t.ksp, method );