The vector you pass to kinsol must be non-ghosted. In the residual assembly you 
must create a local ghosted copy. Just as you would if you were doing things 
manually. (I.e., After a solve, you copy to a ghosted vector to output or to 
compute error estimators. Here it is the same. )

Luca

> Il giorno 16 ago 2023, alle ore 09:25, 'Norihiro Watanabe' via deal.II User 
> Group <dealii@googlegroups.com> ha scritto:
> 
> Hi,
> 
> I got the below error when calling KINSOL::solve() with Trilinos MPI vectors.
> It looks KINSOL tried to call scale() for a ghosted vector.
> The vector has ghost elemets probably because I passed 
> a ghost vector as  "initial_guess_and_solution" argument to solve(). 
> 
> I can pass a non-ghosted vector as "initial_guess_and_solution", but this 
> will cause another problem in the residual assembly function which requires 
> ghosted elements.
> 
> Any advice on this issue would be appreciated.
> 
> 
> --------------------------------------------------------
> An error occurred in line <2146> of file 
> </usr/src/dealii-v9.5.0/include/deal.II/lac/trilinos_vector.h> in function
>    void dealii::TrilinosWrappers::MPI::Vector::scale(const 
> dealii::TrilinosWrappers::MPI::Vector&)
> The violated condition was: 
>    !has_ghost_elements()
> Additional information: 
>    You are trying an operation on a vector that is only allowed if the
>    vector has no ghost elements, but the vector you are operating on does
>    have ghost elements. Specifically, vectors with ghost elements are
>    read-only and cannot appear in operations that write into these
>    vectors.
> 
>    See the glossary entry on 'Ghosted vectors' for more information.
> 
> Stacktrace:
> -----------
> #0  /usr/local/lib/libdeal_II.g.so.9.5.0: 
> dealii::TrilinosWrappers::MPI::Vector::scale(dealii::TrilinosWrappers::MPI::Vector
>  const&)
> #1  /usr/local/lib/libdeal_II.g.so.9.5.0: double 
> dealii::SUNDIALS::internal::NVectorOperations::weighted_l2_norm<dealii::TrilinosWrappers::MPI::Vector>(_generic_N_Vector*,
>  _generic_N_Vector*)
> #2  /lib/x86_64-linux-gnu/libsundials_kinsol.so.5: N_VWL2Norm
> #3  /lib/x86_64-linux-gnu/libsundials_kinsol.so.5: 
> #4  /lib/x86_64-linux-gnu/libsundials_kinsol.so.5: KINSol
> #5  /usr/local/lib/libdeal_II.g.so.9.5.0: 
> dealii::SUNDIALS::KINSOL<dealii::TrilinosWrappers::MPI::Vector>::solve(dealii::TrilinosWrappers::MPI::Vector&)
> 
> 
> Best regards,
> Norihiro
> 
> -- 
> 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 on the web visit 
> https://groups.google.com/d/msgid/dealii/TYWPR01MB7185E469D5E4148829CA3D4BC415A%40TYWPR01MB7185.jpnprd01.prod.outlook.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 on the web visit 
https://groups.google.com/d/msgid/dealii/B11279AE-470D-4E00-A33F-98C0F283A828%40gmail.com.

Reply via email to