I read the FAQs page. As I understand now, it is because of the vector being
deleted while some object is still pointing to it.

Yes.

I have tried several things. I have kept the declaration of the vector in the
header file which means that the vector is not destroyed after exiting the
function and so this error should not occur.

That is one way, but it doesn't sound like the most elegant way to do this. You ought to read a book about C++ to learn about when objects are destroyed (deleted) depending on whether they are global variables, member variables, local variables, etc.


I suspect it is because of this information mention in the class documentation
: "To enable the use of the MappingQ1Eulerian
<https://www.dealii.org/8.4.0/doxygen/deal.II/classMappingQ1Eulerian.html> class
also in the context of parallel codes using the PETSc wrapper classes, the
type of the vector can be specified as template
parameter |EulerVectorType| Not specifying this template argument in
applications using the PETSc vector classes leads to the construction of a
copy of the vector which is not accessible afterwards!"

I am using Petsc vector class. How do I use this template
parameter EulerVectorType?

 MappingQEulerian<dim,EulerVectorType> eulerian_mapping(2, dof_handler, 
displacement_vector); //
mapping to map the mesh to reference configuration

It gives error that
|
 error:‘EulerVectorType’was notdeclared inthisscope
|

You probably need to write
  MappingQEulerian<dim,PETScWrappers::Vector>

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bange...@colostate.edu
                           www: http://www.math.colostate.edu/~bangerth/

--
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.

Reply via email to