Leo,

it's probably more interesting for you to look at the relative error
rather than the absolute one.
Also Vector::l2_norm() gives you the l2-norm of the entries, not the
L2-norm of the represented finite element function. Do you compute
that L2-norm, you would use VectorTools::integrate_difference as
demonstrated in step-11.

Best,
Daniel

On Wed, Apr 9, 2025 at 2:52 PM Léonhard YU <leonhard...@gmail.com> wrote:
>
> Dear all,
>  I just wander how to estimate the error of system by
> Error = system_matrix * displacement - system_rhs
> in step-18. I wrote the following codes
> PETScWrappers::MPI::Vector error(locally_owned_dofs, mpi_communicator);
> error.reinit(system_rhs);
> system_matrix.vmult(error, distributed_incremental_displacement);
> error -= system_rhs;
> pcout << " l2_norm of system error " << error.l2_norm();
> after solving section
> cg.solve(system_matrix,
> distributed_incremental_displacement,
> system_rhs,
> preconditioner);
> But the result is very large. Is there any operation that I did wrong? 
> Results are:
>
>   Cycle 0:
>     Number of active cells:       3712 (by partition: 616+624+616+616+624+616)
>     Number of degrees of freedom: 17226 (by partition: 
> 3177+2934+2763+2934+2790+2628)
>     Assembling system... norm of rhs is 1.80592e+10
>     l2_norm of error system 22537.2    Solver converged in 135 iterations.
>     Updating quadrature point data...
>   Cycle 1:
>     Number of active cells:       12805 (by partition: 
> 2136+2136+2134+2130+2137+2132)
>     Number of degrees of freedom: 51744 (by partition: 
> 8919+8433+8580+8376+8163+9273)
>     Assembling system... norm of rhs is 3.60696e+10
>     l2_norm of error system 32196.1    Solver converged in 139 iterations.
>     Updating quadrature point data...
>     Moving mesh...
>
> Best Regards,
> Leo
>
>
> --
> 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.
> To view this discussion visit 
> https://groups.google.com/d/msgid/dealii/24b344a3-4acc-455a-b5d8-38a43a480ca2n%40googlegroups.com.

-- 
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.
To view this discussion visit 
https://groups.google.com/d/msgid/dealii/CAOYDWbKggHuc%2BWX9fUUyZmUrOsLfnHHhWN8h-5_OzcJMBOwsng%40mail.gmail.com.

Reply via email to