Re: [deal.II] Compilation error: use of deleted function
On 09/25/2018 08:33 AM, Michał Wichrowski wrote: > multigrids_sc_pointers[level] = new Multigrid( > mg_matrix_sc, > mg_coarse_sc, > mg_transfer_sc, > mg_smoother_sc, > mg_smoother_sc); This won't compile. You'll have to write this as multigrids_sc_pointers[level] = std_cxx14::make_unique>( mg_matrix_sc, mg_coarse_sc, mg_transfer_sc, mg_smoother_sc, mg_smoother_sc); 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.
Re: [deal.II] Compilation error: use of deleted function
Michal. > Ok, now I understand the idea. I do not need to copy a specific object, > just several Multigrid objects, so it should work. > If I understand correctly, I should do something like this: > std::vector > > > multigrids_sc_pointers(triangulation.n_global_levels()); > for (unsigned int level = 0; level ++level) > multigrids_sc_pointers[level] = new Multigrid( > mg_matrix_sc, > mg_coarse_sc, > mg_transfer_sc, > mg_smoother_sc, > mg_smoother_sc); > It does not work, I have almost no experience with unique pointers and I > have no idea how to do it. Could you help me? > What exactly is not working? In which line do you get an error message? What does it say? Best, Daniel -- 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.
Re: [deal.II] Compilation error: use of deleted function
> > On 09/25/2018 07:38 AM, Michał Wichrowski wrote: > > > > > > Yes, I need triangulation.n_global_levels() copies of multigrid. I > modify each > > of them in next line: > > > >std::vector > > > multigrids_sc(triangulation.n_global_levels(), > >mg_sc); > >for (unsigned int level = 0; level ++level) > >multigrids_sc[level].reinit(0, level); > > I know you need this many objects, but what I meant is: do you actually > need > to copy one object to another? If you use a > std::vector>, > you can also have as many copies as you showed. > > Best > W. > > Ok, now I understand the idea. I do not need to copy a specific object, just several Multigrid objects, so it should work. If I understand correctly, I should do something like this: std::vector > > multigrids_sc_pointers(triangulation.n_global_levels()); for (unsigned int level = 0; level( mg_matrix_sc, mg_coarse_sc, mg_transfer_sc, mg_smoother_sc, mg_smoother_sc); It does not work, I have almost no experience with unique pointers and I have no idea how to do it. Could you help me? Thanks -- 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.
Re: [deal.II] Compilation error: use of deleted function
On 09/25/2018 07:38 AM, Michał Wichrowski wrote: > > > Yes, I need triangulation.n_global_levels() copies of multigrid. I modify > each > of them in next line: > > std::vector > > multigrids_sc(triangulation.n_global_levels(), > mg_sc); > for (unsigned int level = 0; level ++level) > multigrids_sc[level].reinit(0, level); I know you need this many objects, but what I meant is: do you actually need to copy one object to another? If you use a std::vector>, you can also have as many copies as you showed. 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.
Re: [deal.II] Compilation error: use of deleted function
W dniu wtorek, 25 września 2018 15:30:06 UTC+2 użytkownik Wolfgang Bangerth napisał: > > On 09/25/2018 05:56 AM, Michał Wichrowski wrote: > > > > Yep, I am trying to copy Multigrid object on purpose, I found the line > > corresponding to the problem: > > Line 762: > >std::vector > > > multigrids_sc(triangulation.n_global_levels(), > >mg_sc); > > > > I need a vector of objects of type Multigrid, how can I fix this? > > Do you actually need to copy the Multigrid objects, or do you just want to > store them in a vector? (std::vector of course requires its objects to be > copiable.) > > If you don't actually need copies, then just use a > std::vector>. > > Best > W. > Yes, I need triangulation.n_global_levels() copies of multigrid. I modify each of them in next line: std::vector > multigrids_sc(triangulation.n_global_levels(), mg_sc); for (unsigned int level = 0; levelhttp://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.
Re: [deal.II] Compilation error: use of deleted function
On 09/25/2018 05:56 AM, Michał Wichrowski wrote: > > Yep, I am trying to copy Multigrid object on purpose, I found the line > corresponding to the problem: > Line 762: > std::vector > > multigrids_sc(triangulation.n_global_levels(), > mg_sc); > > I need a vector of objects of type Multigrid, how can I fix this? Do you actually need to copy the Multigrid objects, or do you just want to store them in a vector? (std::vector of course requires its objects to be copiable.) If you don't actually need copies, then just use a std::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.
Re: [deal.II] Compilation error: use of deleted function
> > Michal, > the error is in your code, but since I don't have it, I can't tell > where. I suspect that you are trying to copy an object of type > Multigrid, in StokeMatrixFree/StokesMatrixFree.cc:34 of your project. > This copy may happen implicitly if you call a function that takes a > Multigrid object by value, rather than by reference. (Or does so for an > object that has a Multigrid object as a member variable.) > > Best > W. > Yep, I am trying to copy Multigrid object on purpose, I found the line corresponding to the problem: Line 762: std::vector > multigrids_sc(triangulation.n_global_levels(), mg_sc); I need a vector of objects of type Multigrid, how can I fix this? -- 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.
Re: [deal.II] Compilation error: use of deleted function
On 09/21/2018 05:22 AM, Michał Wichrowski wrote: > Dear all, > > I have errors when compiling my code with the devellpment version of > deal.II . The same problems occurs also with 9.0.0, the code works well > with 9.0.0-pre. I have no idea how to resolve these problems. > > Michał > > /home/mwichro/lib/deal.II/include/deal.II/multigrid/multigrid.h:137:7: > error: use of deleted function ‘dealii::mg::Signals::Signals(const > dealii::mg::Signals&)’ Michal, the error is in your code, but since I don't have it, I can't tell where. I suspect that you are trying to copy an object of type Multigrid, in StokeMatrixFree/StokesMatrixFree.cc:34 of your project. This copy may happen implicitly if you call a function that takes a Multigrid object by value, rather than by reference. (Or does so for an object that has a Multigrid object as a member variable.) 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.