On 08/18/2016 03:34 PM, Chenchen Liu wrote:
Why it does not work when I use a vector of triangulations? And any
suggestions when using a collection of triangulations?
The C++ standard says that what you can store in a std::vector needs to
be copyable (because std::vector dynamically resizes how many elements
it stores, and so needs to be able to copy things from the old storage
to the new). Consequently, you can't store a Triangulation in a vector.
But, you can store *pointers* to Triangulations in std::vector, or even
better something like
std_cxx11::shared_ptr<Triangulation<dim>>
The pointers are copyable, even if the triangulations are not.
In addition, it is said that copy_triangulation() is not efficient.
That's not true. The operation is *efficient*. It's just not *cheap*,
because it has to copy *lots* of data.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.