You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am using AMG with its CUDA backend to solve equations from FEM. In each time step, the matrix A will be modified a little, and I want to keep the AMG in order to make the simulation faster. I tried this:
typedef amgcl::backend::cuda<float> Backend;
typedef amgcl::make_solver<
amgcl::amg<
Backend,
amgcl::coarsening::smoothed_aggregation,
amgcl::relaxation::ilu0
>,
amgcl::solver::bicgstab<Backend>>Solver;
auto A0=std::make_tuple(...); //from Eigen to CRS tuple
Solver solve(A0, prm, bprm);
for(double t = 0; t < tmax; t+= dt) {
A = assemble_fresh_matrix();
// This will solve Ax=f with the current preconditioner:
std::tie(iters, error) = solve(A, f, x);
if (iters > rebuild_limit) {
// Too many iterations: time to update the preconditioner
solve = Solver(A, prm,bprm);
}
}
However, the program was broken, I guess the errors occured at std::tie(iters, error) = solve(A, f, x); because when I use std::tie(iters, error) = solve(f, x); , the program runs successfully without changing the matrix A.
I wonder can I change the A matrix without rebuild AMG when using CUDA as backend, just like std::tie(iters, error) = solve(A, f, x);
Thank you!
The text was updated successfully, but these errors were encountered:
pcbcos
changed the title
Can I change matrix A without rebuild AMG when using CUDA as backend?
Can I change matrix A without rebuilding AMG when using CUDA as backend?
Sep 10, 2024
Hello, I am using AMG with its CUDA backend to solve equations from FEM. In each time step, the matrix A will be modified a little, and I want to keep the AMG in order to make the simulation faster. I tried this:
However, the program was broken, I guess the errors occured at
std::tie(iters, error) = solve(A, f, x);
because when I usestd::tie(iters, error) = solve(f, x);
, the program runs successfully without changing the matrix A.I wonder can I change the A matrix without rebuild AMG when using CUDA as backend, just like
std::tie(iters, error) = solve(A, f, x);
Thank you!
The text was updated successfully, but these errors were encountered: