Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preconditioner setup for steady linear elasticity solver wrong #652

Open
richardschu opened this issue Mar 10, 2024 · 3 comments · May be fixed by #654
Open

Preconditioner setup for steady linear elasticity solver wrong #652

richardschu opened this issue Mar 10, 2024 · 3 comments · May be fixed by #654

Comments

@richardschu
Copy link
Contributor

richardschu commented Mar 10, 2024

(this is more a reminder that I want to fix this in the future, but I do not have time rn)
If I remember correctly, the idea was that the solvers themselves execute a setup of the preconditioner when solve() is called on them. For the nonlinear (QuasiStatic, Unsteady and Steady) solvers, all works fine. In the linear case -- the only one that calls solve_linear() I believe -- the Chebyshev smoother tells me hasn't got a preconditioner. When using Unsteady, the setup works, so its some case we did not consider yet.


An error occurred in line <3545> of file </home/richard/dealii-candi/dealii/include/deal.II/lac/precondition.h> in function
dealii::PreconditionChebyshev<MatrixType, VectorType, PreconditionerType>::EigenvalueInformation dealii::PreconditionChebyshev<MatrixType, VectorType, PreconditionerType>::estimate_eigenvalues(const VectorType&) const [with MatrixType = ExaDG::MultigridOperatorBase<3, float>; VectorType = dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host>; PreconditionerType = ExaDG::JacobiPreconditioner<ExaDG::MultigridOperatorBase<3, float> >]
The violated condition was:
data.preconditioner.get() != nullptr
Additional information:
(none)

Stacktrace:

#0 /home/richard/dealii-candi/exadg/build/libexadg.so: dealii::PreconditionChebyshev<ExaDG::MultigridOperatorBase<3, float>, dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host>, ExaDG::JacobiPreconditioner<ExaDG::MultigridOperatorBase<3, float> > >::estimate_eigenvalues(dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host> const&) const
#1 /home/richard/dealii-candi/exadg/build/libexadg.so: dealii::PreconditionChebyshev<ExaDG::MultigridOperatorBase<3, float>, dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host>, ExaDG::JacobiPreconditioner<ExaDG::MultigridOperatorBase<3, float> > >::vmult(dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host>&, dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host> const&) const
#2 /home/richard/dealii-candi/exadg/build/libexadg.so: ExaDG::ChebyshevSmoother<ExaDG::MultigridOperatorBase<3, float>, dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host> >::vmult(dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host>&, dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host> const&) const
#3 /home/richard/dealii-candi/exadg/build/libexadg.so: ExaDG::MultigridAlgorithm<dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host>, ExaDG::MultigridOperatorBase<3, float>, ExaDG::SmootherBase<dealii::LinearAlgebra::distributed::Vector<float, dealii::MemorySpace::Host> > >::v_cycle(unsigned int, bool) const
#4 /home/richard/dealii-candi/exadg/build/libexadg.so: ExaDG::MultigridPreconditionerBase<3, double, float>::vmult(dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host>&, dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host> const&) const
#5 /home/richard/dealii-candi/exadg/build/libexadg.so: void dealii::SolverFGMRES<dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host> >::solve<ExaDG::Structure::LinearOperator<3, double>, ExaDG::PreconditionerBase >(ExaDG::Structure::LinearOperator<3, double> const&, dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host>&, dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host> const&, ExaDG::PreconditionerBase const&)
#6 /home/richard/dealii-candi/exadg/build/libexadg.so: ExaDG::Krylov::SolverFGMRES<ExaDG::Structure::LinearOperator<3, double>, ExaDG::PreconditionerBase, dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host> >::solve(dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host>&, dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host> const&) const
#7 /home/richard/dealii-candi/exadg/build/libexadg.so: ExaDG::Structure::Operator<3, double>::solve_linear(dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host>&, dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host> const&, double, double, double, bool) const
#8 /home/richard/dealii-candi/exadg/build/libexadg.so: ExaDG::Structure::DriverSteady<3, double>::do_solve()
#9 /home/richard/dealii-candi/exadg/build/libexadg.so: ExaDG::Structure::DriverSteady<3, double>::solve()
#10 /home/richard/--------------------------------------------------------------------------

@richardschu richardschu changed the title Steady linear elasticity solver cannot solve Preconditioner setup for steady linear elasticity solver wrong Mar 10, 2024
@richardschu
Copy link
Contributor Author

Update: I tested all the preconditioners with finite strain/infinitesimal strain, Unsteady/Steady/QuasiStatic.
nc = not converged
y = convergence
setup = something goes wrong with the setup
matrix state = the factorized matrices are in the wrong state (stack trace in nect comment).

FINITE STRAIN unsteady steady quasistatic
PointJacobi y y y
None nc nc y
AdditiveSchwarz matrix state matrix state matrix state
Multigrid y y y
AMG y y y
       
SMALL STRAIN unsteady steady  
PointJacobi y y  
None nc nc  
AdditiveSchwarz matrix state (timestep 2) y  
Multigrid y setup  
AMG y y  

@richardschu
Copy link
Contributor Author

An error occurred in line <1387> of file </home/richard/dealii-candi/dealii/source/lac/lapack_full_matrix.cc> in function
void dealii::LAPACKFullMatrix::compute_lu_factorization() [with number = double]
The violated condition was:
state == matrix
Additional information:
The function cannot be called while the matrix is in state lu
decomposition

Stacktrace:

#0 /home/richard/dealii-candi/dealii/build/lib/libdeal_II.g.so.9.6.0-pre: dealii::LAPACKFullMatrix::compute_lu_factorization()
#1 /home/richard/dealii-candi/exadg/build/libexadg.so: void ExaDG::OperatorBase<3, double, 3>::internal_compute_factorized_additive_schwarz_matricesdealii::TrilinosWrappers::SparseMatrix() const
#2 /home/richard/dealii-candi/exadg/build/libexadg.so: ExaDG::OperatorBase<3, double, 3>::compute_factorized_additive_schwarz_matrices() const
#3 /home/richard/dealii-candi/exadg/build/libexadg.so: ExaDG::AdditiveSchwarzPreconditioner<ExaDG::Structure::LinearOperator<3, double> >::update()
#4 /home/richard/dealii-candi/exadg/build/libexadg.so: ExaDG::Krylov::SolverFGMRES<ExaDG::Structure::LinearOperator<3, double>, ExaDG::PreconditionerBase, dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host> >::update_preconditioner(bool) const
#5 /home/richard/dealii-candi/exadg/build/libexadg.so: ExaDG::Structure::Operator<3, double>::solve_linear(dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host>&, dealii::LinearAlgebra::distributed::Vector<double, dealii::MemorySpace::Host> const&, double, double, double, bool) const
#6 /home/richard/dealii-candi/exadg/build/libexadg.so: ExaDG::Structure::TimeIntGenAlpha<3, double>::do_timestep_solve()
#7 /home/richard/dealii-candi/exadg/build/libexadg.so: ExaDG::TimeIntBase::advance_one_timestep_solve()
#8 /home/richard/dealii-candi/exadg/build/libexadg.so: ExaDG::TimeIntBase::advance_one_timestep()
#9 /home/richard/dealii-candi/exadg/build/libexadg.so: ExaDG::TimeIntBase::timeloop()
#10 /home/richard/dealii-candi/exadg/build/libexadg.so: ExaDG::Structure::Driver<3, double>::solve() const
#11 solver: void ExaDG::run<3, double>(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, unsigned int, unsigned int, unsigned int, ompi_communicator_t* const&, bool)
#12 solver: main

@richardschu
Copy link
Contributor Author

I think the matrix state stuff is a different issue (despite being somewhat related).
I will tackle the Preconditioner::Multigrid in the linear steady case next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant