Hello everyone, I am working on a code for time dependent simulation. In the part of code I have an error after a certain number of time steps for a large size problem. The error occurs when it is calculating the k1 coefficient of implicit Runge Kutta method by solving system of equations using SolverBicgstab. I have set the maximum number of iterations to 1000000 and abortion criteria 1e-12.
Following is the part where the code fails: SolverControl solver_control (parameters.maximum_number_of_iteration_steps, parameters.abort_criterion * system_rhs_k1.l2_norm()); SolverBicgstab<> bicgstab (solver_control); PreconditionJacobi<> preconditioner; preconditioner.initialize(system_matrix_k1, 1.2); bicgstab.solve (system_matrix_k1, k1_update, system_rhs_k1, preconditioner); In the error message I have following: ---------------------------------------------------- Exception on processing: -------------------------------------------------------- An error occurred in line <495> of file </home/sfb814/spack/opt/spack/linux-ubuntu16-x86_64/gcc-5.4.0/dealii-develop-mlfap6oyiyr5ng6a5ticxjq665eem5vd/include/deal.II/lac/solver_bicgstab.h> in function void dealii::SolverBicgstab<VectorType>::solve(const MatrixType&, VectorType&, const VectorType&, const PreconditionerType&) [with MatrixType = dealii::SparseMatrix<double>; PreconditionerType = dealii::PreconditionJacobi<>; VectorType = dealii::Vector<double>] The violated condition was: state.state == SolverControl::success Additional information: Iterative method reported convergence failure in step 1. The residual in the last step was nan. This error message can indicate that you have simply not allowed a sufficiently large number of iterations for your iterative solver to converge. This often happens when you increase the size of your problem. In such cases, the last residual will likely still be very small, and you can make the error go away by increasing the allowed number of iterations when setting up the SolverControl object that determines the maximal number of iterations you allow. The other situation where this error may occur is when your matrix is not invertible (e.g., your matrix has a null-space), or if you try to apply the wrong solver to a matrix (e.g., using CG for a matrix that is not symmetric or not positive definite). In these cases, the residual in the last iteration is likely going to be large. -------------------------------------------------------- Also when I tried it in the debug mode: ------------------------------------------------------------------------------------------- Time step 250 at t=50 ADAPTIVE GRID REFINEMENT STEP: 1 Adaptive refining of grid... Completed Number of active cells: 46792 Number of degrees of freedom for the temperature: 22515 Number of degrees of freedom for the Parameters k of the implicit Runge-Kutta method: 22515 Calculate k2 in parallel with shared memory... Time for assembling system of equations for k2: 0.911958 seconds Solving system of equations for k2... Time for solving systems of equations: 0.0781541 seconds Assembling system of equations in parallel with shared memory... Time for building up the system matrix and the vector of the right hand side: 1.58716 seconds Solving system of equations... Time for solving systems of equations: 0.158167 seconds L2 Norm der rechten Seite nach der 1. Newton Raphson Iteration: 0.140345 Assembling system of equations in parallel with shared memory... Time for building up the system matrix and the vector of the right hand side: 1.61191 seconds Solving system of equations... Time for solving systems of equations: 0.169431 seconds L2 Norm der rechten Seite nach der 2. Newton Raphson Iteration: 4.58376e-07 Assembling system of equations in parallel with shared memory... Time for building up the system matrix and the vector of the right hand side: 1.60747 seconds Solving system of equations... Time for solving systems of equations: 0.166696 seconds L2 Norm der rechten Seite nach der 3. Newton Raphson Iteration: 3.84739e-14 Number of Newton Raphson iterations in the current time step: 3 Number of integration points enclosed by the heat source respectively beam: 749589 Current position of the beam: x: -0.031 y: 0 z: -0.0034 Writing results to output file... Completed Time step 251 at t=50.2 Deposition of the next powder layer... Deposition of the next powder layer COMPLETED ADAPTIVE GRID REFINEMENT STEP: 1 Adaptive refining of grid... Completed Number of active cells: 48416 Number of degrees of freedom for the temperature: 24965 Number of degrees of freedom for the Parameters k of the implicit Runge-Kutta method: 24965 Calculate k2 in parallel with shared memory... Time for assembling system of equations for k2: 0.914275 seconds Solving system of equations for k2... Time for solving systems of equations: 0.10148 seconds Assembling system of equations in parallel with shared memory... Time for building up the system matrix and the vector of the right hand side: 2.21326 seconds Solving system of equations... Time for solving systems of equations: 0.145032 seconds L2 Norm der rechten Seite nach der 1. Newton Raphson Iteration: 1.18614e+06 Assembling system of equations in parallel with shared memory... Time for building up the system matrix and the vector of the right hand side: 1.71319 seconds Solving system of equations... Time for solving systems of equations: 0.7223 seconds L2 Norm der rechten Seite nach der 2. Newton Raphson Iteration: 8.3161 Assembling system of equations in parallel with shared memory... Time for building up the system matrix and the vector of the right hand side: 1.71675 seconds Solving system of equations... Time for solving systems of equations: 3.78979 seconds L2 Norm der rechten Seite nach der 3. Newton Raphson Iteration: 5.42624 Assembling system of equations in parallel with shared memory... Time for building up the system matrix and the vector of the right hand side: 1.70202 seconds Solving system of equations... Time for solving systems of equations: 3.06816 seconds L2 Norm der rechten Seite nach der 4. Newton Raphson Iteration: 10.2496 Assembling system of equations in parallel with shared memory... Time for building up the system matrix and the vector of the right hand side: 1.68715 seconds Solving system of equations... Time for solving systems of equations: 8.42527 seconds L2 Norm der rechten Seite nach der 5. Newton Raphson Iteration: 8.33079 Assembling system of equations in parallel with shared memory... Time for building up the system matrix and the vector of the right hand side: 1.71263 seconds Solving system of equations... -------------------------------------------------------- An error occurred in line <541> of file </home/sfb814/spack/var/spack/stage/dealii-develop-mlfap6oyiyr5ng6a5ticxjq665eem5vd/dealii/include/deal.II/lac/vector.templates.h> in function dealii::Vector<Number>::real_type dealii::Vector<Number>::l2_norm() const [with Number = double; dealii::Vector<Number>::real_type = double] The violated condition was: dealii::numbers::is_finite(scale*std::sqrt(sum)) Additional information: In a significant number of places, deal.II checks that some intermediate value is a finite number (as opposed to plus or minus infinity, or NaN/Not a Number). In the current function, we encountered a number that is not finite (its value is (nan,0) and therefore violates the current assertion). This may be due to the fact that some operation in this function created such a value, or because one of the arguments you passed to the function already had this value from some previous operation. In the latter case, this function only triggered the error but may not actually be responsible for the computation of the number that is not finite. There are two common cases where this situation happens. First, your code (or something in deal.II) divides by zero in a place where this should not happen. Or, you are trying to solve a linear system with an unsuitable solver (such as an indefinite or non-symmetric linear system using a Conjugate Gradient solver); such attempts oftentimes yield an operation somewhere that tries to divide by zero or take the square root of a negative value. In any case, when trying to find the source of the error, recall that the location where you are getting this error is simply the first place in the program where there is a check that a number (e.g., an element of a solution vector) is in fact finite, but that the actual error that computed the number may have happened far earlier. To find this location, you may want to add checks for finiteness in places of your program visited before the place where this error is produced.One way to check for finiteness is to use the 'AssertIsFinite' macro. Stacktrace: ----------- #0 /home/sfb814/spack/opt/spack/linux-ubuntu16-x86_64/gcc-5.4.0/dealii-develop-mlfap6oyiyr5ng6a5ticxjq665eem5vd/lib/libdeal_II.g.so.8.5.0-pre: dealii::Vector<double>::l2_norm() const #1 ./Nonlinear_Heat_Transfer: dealii::SolverControl::State dealii::SolverBicgstab<dealii::Vector<double> >::start<dealii::SparseMatrix<double> >(dealii::SparseMatrix<double> const&) #2 ./Nonlinear_Heat_Transfer: void dealii::SolverBicgstab<dealii::Vector<double> >::solve<dealii::SparseMatrix<double>, dealii::PreconditionJacobi<dealii::SparseMatrix<double> > >(dealii::SparseMatrix<double> const&, dealii::Vector<double>&, dealii::Vector<double> const&, dealii::PreconditionJacobi<dealii::SparseMatrix<double> > const&) #3 ./Nonlinear_Heat_Transfer: NonlinearHeatTransfer<3>::assemble_and_solve_system_in_parallel_with_shared_memory() #4 ./Nonlinear_Heat_Transfer: NonlinearHeatTransfer<3>::run() #5 ./Nonlinear_Heat_Transfer: main -------------------------------------------------------- Its clear that at t 50.2 sec I have some problem with the system of equation leading to l2 residual norm to increase. I believe the source of failure is in the assert check in SolverBicgstab.h with the L2 residual norm: // in case of failure: throw exception AssertThrow(state.state == SolverControl::success, SolverControl::NoConvergence (state.last_step, state.last_residual)); Could someone help in how to debug such a case and solve it? Thanks in advance. Regards, Vinayak Gholap -- The deal.II project is located at http://www.dealii.org/ For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en --- You received this message because you are subscribed to the Google Groups "deal.II User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to dealii+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.