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