Skip to content

Commit

Permalink
fix build?
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Hahn <[email protected]>
  • Loading branch information
quantumsteve committed Jun 25, 2024
1 parent c01e8e5 commit 7a69a8a
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions src/solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,24 +180,6 @@ simple_gmres_euler(const P dt, kronmult_matrix<P> const &mat,
restart, max_iter, tolerance);
}

template<typename P, resource resrc>
gmres_info<P>
bicgstab_euler(const P dt, kronmult_matrix<P> const &mat,
fk::vector<P, mem_type::owner, resrc> &x,
fk::vector<P, mem_type::owner, resrc> const &b,
int const max_iter, P const tolerance)
{
return bicgstab(
[&](P const alpha, fk::vector<P, mem_type::view, resrc> const x_in,
P const beta, fk::vector<P, mem_type::view, resrc> y) -> void {
tools::time_event performance("kronmult - implicit", mat.flops());
mat.template apply<resrc>(-dt * alpha, x_in.data(), beta, y.data());
lib_dispatch::axpy<resrc>(y.size(), alpha, x_in.data(), 1, y.data(), 1);
},
fk::vector<P, mem_type::view, resrc>(x), b, no_op_preconditioner<P>(),
max_iter, tolerance);
}
#endif

template<typename P, resource resrc>
gmres_info<P>
Expand Down Expand Up @@ -234,6 +216,25 @@ simple_gmres_euler(adapt::distributed_grid<P> const &adaptive_grid, int const el
#endif
return simple_gmres_euler(dt, mat, x, b, restart, max_iter, tolerance);
}
#endif

template<typename P, resource resrc>
gmres_info<P>
bicgstab_euler(const P dt, kronmult_matrix<P> const &mat,
fk::vector<P, mem_type::owner, resrc> &x,
fk::vector<P, mem_type::owner, resrc> const &b,
int const max_iter, P const tolerance)
{
return bicgstab(
[&](P const alpha, fk::vector<P, mem_type::view, resrc> const x_in,
P const beta, fk::vector<P, mem_type::view, resrc> y) -> void {
tools::time_event performance("kronmult - implicit", mat.flops());
mat.template apply<resrc>(-dt * alpha, x_in.data(), beta, y.data());
lib_dispatch::axpy<resrc>(y.size(), alpha, x_in.data(), 1, y.data(), 1);
},
fk::vector<P, mem_type::view, resrc>(x), b, no_op_preconditioner<P>(),
max_iter, tolerance);
}

/*! Generates a default number inner iterations when no use input is given
* \param num_cols Number of columns in the A matrix.
Expand Down

0 comments on commit 7a69a8a

Please sign in to comment.