-
Notifications
You must be signed in to change notification settings - Fork 50
Grid Structured Solvers
Sam Reeve edited this page Sep 12, 2024
·
2 revisions
Cabana::Grid provides a conjugate gradient structured solver for use with grid field data.
Cabana_Grid_ReferenceStructuredSolver.hpp
- Structured Solver Unit Test (used to verify HYPRE solutions)
auto vector_layout = Cabana::Grid::createArrayLayout( local_mesh, 1, Cell() );
auto lhs = Cabana::Grid::createArray<double, MemorySpace>( "lhs", vector_layout );
auto rhs = Cabana::Grid::createArray<double, MemorySpace>( "rhs", vector_layout );
auto solver = Cabana::Grid::createReferenceConjugateGradient<double, memory_space>( *vector_layout );
solver->setMatrixStencil( stencil );
solver->setMatrixValues( *matrix_entries );
solver->setPreconditionerStencil( diag_stencil );
solver->setTolerance( 1.0e-11 );
solver->setPrintLevel( 1 );
solver->setup();
solver->solve( *rhs, *lhs );
This is part of the Programming Guide series
Cabana - A Co-Designed Library for Exascale Particle Simulations