Skip to content

Commit

Permalink
Format and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lebuller committed Jan 16, 2024
1 parent 06a19cd commit 8d9a2df
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions grid/src/Cabana_Grid_HypreStructuredSolver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,6 @@ class HypreStructuredSolver
// Spatial dimension.
const std::size_t num_space_dim = Array_t::num_space_dim;

// Intialize the matrix for setting values.
// Moving this to the place where the matrix is created
// auto error = HYPRE_StructMatrixInitialize( _A );
// checkHypreError( error );

// Copy the matrix entries into HYPRE. The HYPRE layout is fixed as
// layout-right.
auto owned_space = values.layout()->indexSpace( Own(), Local() );
Expand All @@ -275,7 +270,6 @@ class HypreStructuredSolver
auto values_subv = createSubview( values.view(), owned_space );
Kokkos::deep_copy( a_values, values_subv );


// Insert values into the HYPRE matrix.
std::vector<HYPRE_Int> indices( _stencil_size );
std::iota( indices.begin(), indices.end(), 0 );
Expand All @@ -285,8 +279,6 @@ class HypreStructuredSolver
checkHypreError( error );
error = HYPRE_StructMatrixAssemble( _A );
checkHypreError( error );


}

/*!
Expand Down Expand Up @@ -353,6 +345,7 @@ class HypreStructuredSolver
if ( _is_preconditioner )
throw std::logic_error( "Cannot call setup() on preconditioners" );

// FIXME: appears to be a memory issue in the call to this function
this->setupImpl( _A, _b, _x );
}

Expand Down Expand Up @@ -391,10 +384,6 @@ class HypreStructuredSolver
// Spatial dimension.
const std::size_t num_space_dim = Array_t::num_space_dim;

// Initialize the RHS.
// auto error = HYPRE_StructVectorInitialize( _b );
// checkHypreError( error );

// Copy the RHS into HYPRE. The HYPRE layout is fixed as layout-right.
auto owned_space = b.layout()->indexSpace( Own(), Local() );
std::array<long, num_space_dim + 1> reorder_size;
Expand All @@ -418,7 +407,7 @@ class HypreStructuredSolver
checkHypreError( error );

// Solve the problem
this->solveImpl( _A, _b, _x );
this->solveImpl( _A, _b, _x );

// Extract the solution from the LHS
error = HYPRE_StructVectorGetBoxValues(
Expand Down

0 comments on commit 8d9a2df

Please sign in to comment.