SolutionTranfer with PETScWrappers::MPI::Vector

49 views
Skip to first unread message

Carlo Marcati

unread,
Oct 18, 2017, 6:46:11 AM10/18/17
to deal.II User Group

Hi,
I am trying to use a SolutionTrasfer object with PETScWrappers::MPI::Vector. When trying to do solution_trasfer.interpolate(in, out), the program crashes at the last line of the 
void SolutionTransfer<dim, VectorType, DoFHandlerType>::interpolate
(const VectorType &in,
 
VectorType       &out) const
function, i.e., at
    out=all_out[0];
This happens because all_out[0] is in the wrong state.

Writing
all_out[0].compress (VectorOperation::insert);
before that line would probably solve the issue, though it is obviously specific to PETSc vectors.

The version of the interpolate function that takes vectors of vectors as input, i.e.,
void SolutionTransfer<dim, VectorType, DoFHandlerType>::
interpolate
(const std::vector<VectorType> &all_in,
             std
::vector<VectorType>       &all_out) const
 works fine.

Best regards,
Carlo


Bruno Turcksin

unread,
Oct 18, 2017, 8:20:52 AM10/18/17
to deal.II User Group
Carlo,

what is the error that you get? The program crashes is too vague.

Best,

Bruno

Carlo Marcati

unread,
Oct 18, 2017, 8:31:21 AM10/18/17
to deal.II User Group
Here's the error and stack trace. To replicate it, it should be sufficient to use the SolutionTrasfer::interpolate function on two PETScWrappers::MPI::Vector.
--------------------------------------------------------
An error occurred in line <104> of file </home/carlo/software/dealii/source/lac/petsc_parallel_vector.cc> in function
    dealii
::PETScWrappers::MPI::Vector& dealii::PETScWrappers::MPI::Vector::operator=(const dealii::PETScWrappers::MPI::Vector&)
The violated condition was:
    v
.last_action == VectorOperation::unknown
Additional information:
   
You tried to do a ??? operation but the vector is currently in 'set' mode. You first have to call 'compress()'.

Stacktrace:
-----------
#0  /usr/local/lib/libdeal_II.g.so.9.0.0-pre: dealii::PETScWrappers::MPI::Vector::operator=(dealii::PETScWrappers::MPI::Vector const&)
#1  /usr/local/lib/libdeal_II.g.so.9.0.0-pre: dealii::SolutionTransfer<2, dealii::PETScWrappers::MPI::Vector, dealii::hp::DoFHandler<2, 2> >::interpolate(dealii::PETScWrappers::MPI::Vector const&, dealii::PETScWrappers::MPI::Vector&) const
#2  ./linear: Step27::LaplaceProblem<2>::setup_system(dealii::SolutionTransfer<2, dealii::PETScWrappers::MPI::Vector, dealii::hp::DoFHandler<2, 2> > const&)
#3  ./linear: Step27::LaplaceProblem<2>::postprocess(unsigned int, bool, bool, unsigned int)
#4  ./linear: Step27::LaplaceProblem<2>::run()
#5  ./linear: main
--------------------------------------------------------

Bruno Turcksin

unread,
Oct 18, 2017, 8:43:16 AM10/18/17
to dea...@googlegroups.com
Carlo,

I think the problem is that you are using SolutionTransfer instead of parallel::distributed::SolutionTransfer see http://dealii.org/8.5.0/doxygen/deal.II/classparallel_1_1distributed_1_1SolutionTransfer.html

Best,

Bruno

--
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 a topic in the Google Groups "deal.II User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dealii/SJeEE8HfNSs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dealii+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Carlo Marcati

unread,
Oct 18, 2017, 9:01:38 AM10/18/17
to deal.II User Group
Dear Bruno,
thank you. I ended up using prepare_for_pure_refinement() and refine_interpolate(), and they work fine, at least for my case. I'll also try distributed::SolutionTransfer were I to use distributed vectors. Still, I think that the error given by

void SolutionTransfer<dim, VectorType, DoFHandlerType>::interpolate
(const VectorType &in,
 
VectorType       &out) const

could be easily corrected, since

void SolutionTransfer<dim, VectorType, DoFHandlerType>::
interpolate
(const std::vector<VectorType> &all_in,
             std
::vector<VectorType>       &all_out) const
works.

Thank you again.

Best,
Carlo
To unsubscribe from this group and all its topics, send an email to dealii+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages