Is the destination ("triangulation_coarse_" in your case) empty when
you call the function? I think the error message says that it needs to
be empty.On Thu, Sep 29, 2022 at 5:08 AM Katharina Jerg <[email protected]> wrote: > > Dear all, > > I am trying to copy an adaptively refined triangulation (not even > parallel::distributed::Triangulation) in order to change the refinement at > some parts of the mesh, but still keep the original triangulation for futher > calculations. > When I try to copy a simple (not adaptively refined yet) triangulation using > " this->triangulation_coarse_.copy_triangulation(this->triangulation_);" I > get the following error: > > -------------------------------------------------------- > An error occurred in line <11502> of file > </home/dev/dealii/source/grid/tria.cc> in function > void dealii::Triangulation<<anonymous>, <anonymous> > >::copy_triangulation(const dealii::Triangulation<<anonymous>, <anonymous> > >&) [with int dim = 3; int spacedim = 3] > The violated condition was: > (vertices.size() == 0) && (levels.size() == 0) && (faces == nullptr) > Additional information: > You are trying to perform an operation on a triangulation that is only > allowed if the triangulation is currently empty. However, it currently > stores 27 vertices and has cells on 2 levels. > > Is there a way to copy adaptively refined triangulations by now? I was not > able to find an answer to this question in the mailing list or the > documentation. I would like to avoid the workaround suggested here, because I > need a new copy of the triangulation multiple times during computation. > > Thanks, > Katharina > > On Tuesday, September 22, 2015 at 2:00:39 PM UTC+2 Timo Heister wrote: >> >> Hey Ben, >> >> yes, unfortunately we haven't gotten around implementing this. It >> actually shouldn't be too difficult, because there is p4est_copy that >> one can use to clone the p4est (but the connectivity has to be >> recreated). Sam's suggestions will work as a workaround... >> >> On Tue, Sep 22, 2015 at 5:16 AM, Sam Cox <[email protected]> wrote: >> > Hi Ben, >> > >> > it's my understanding that the mesh will be given the same partitioning >> > after importing, as this is calculated only from the ordering of the cells. >> > See https://groups.google.com/d/msg/dealii/94G5GU-flag/WEdBGil2WUoJ for >> > Wolfgang's comment on this. (A caveat: I'd guess things would break if you >> > have >> > parallel::distributed:Triangulation::Settings::no_automatic_repartitioning >> > set). >> > >> > As a workaround, if you are happy to have two meshes existing throughout >> > execution you could do similar to what I once did (in that same thread, for >> > a different scenario, but it should work in your case) and generate two >> > unrefined meshes then apply the same refine/coarsen flags to each at each >> > stage. >> > >> > Sam >> > >> > -- >> > 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. >> >> >> >> -- >> Timo Heister >> http://www.math.clemson.edu/~heister/ > > -- > 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]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/dealii/963eeb1d-3e54-4d8d-8acb-2b58a813beb4n%40googlegroups.com. -- Timo Heister http://www.math.clemson.edu/~heister/ -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/CAMRj59GROBcupwgY7V9YZaF-Q3aM_J8zcGj8Mkb%2BS-TAsnXzEQ%40mail.gmail.com.
