[deal.II] Re: Saving particles for checkpointing
Hi Bruno, The particles do indeed have a serialize function, but it is somewhat tricky to use directly and not really necessary (you can see an example here: https://github.com/dealii/dealii/pull/11314/files#diff-fbe7d72b2e0af27fba150e987a3ce0c2cad90b6054decc94810c898fef6d9eaf). The more common case is that you have the particles inside a ParticleHandler that is connected to a triangulation. For this case the ParticleHandler can take care of the serialization by attaching the particle data to the triangulation data that is serialized anyway. An example is inside the test serialization/particle_handler_01 and _02. Hope that helps, let me know in case you run into problems (e.g. if you want to serialize particles and a FE solution vector the order of serialization/deserialization is critical and a bit confusing due to the triangulation signals), Best, Rene On Wednesday, December 9, 2020 at 5:15:09 PM UTC-5 blais...@gmail.com wrote: > Dear all, I hope you are well. > I am trying to add checkpointing in our particle code. Particles do not > have a save function, but they have a serialize function, which I think > would be exactly what I need. > However, the function is not documented. It takes as an argument something > of class Archive, which I could not find any information on. > I also grepped all over the tests, but I could not find a usage of this > function. > > https://www.dealii.org/current/doxygen/deal.II/classParticles_1_1ParticleHandler.html#a877e1aac8ef0ad6fa85ed400bf71eb1c > > Would anybody have a quick tutorial or example on how this function could > be used for checkpoint the particle_handler and the properties of the > particles? > Thank you so much :)! > 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 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. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/4c7b783e-54c1-419b-b58e-b8af91f3b22cn%40googlegroups.com.
Re: [deal.II] Re: Saving particles for checkpointing
Awesome. It works perfectly Thank you all :)! On Wednesday, December 9, 2020 at 8:10:13 p.m. UTC-5 Wolfgang Bangerth wrote: > On 12/9/20 5:32 PM, blais...@gmail.com wrote: > > I have one tiny question actually. > > In all tests, the std::ostringstream oss which contains some information > about > > the number of particles and the data being serialized is kept. > > Generally, I guess this should be written to an auxiliary file, then > re-read > > before deserialization can occur? > > Yes, precisely. In fact, instead of a std::ostringstring, when you write > to > file you might as well have directly given a std::ofstream. > > That that data could be written to a file is not important for the test, > though, and so it doesn't do that. > > Best > W. > > > -- > > Wolfgang Bangerth email: bang...@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. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/87d7f871-1bc9-420d-9da7-c5ba69acfedan%40googlegroups.com.
Re: [deal.II] Re: Saving particles for checkpointing
On 12/9/20 5:32 PM, blais...@gmail.com wrote: I have one tiny question actually. In all tests, the std::ostringstream oss which contains some information about the number of particles and the data being serialized is kept. Generally, I guess this should be written to an auxiliary file, then re-read before deserialization can occur? Yes, precisely. In fact, instead of a std::ostringstring, when you write to file you might as well have directly given a std::ofstream. That that data could be written to a file is not important for the test, though, and so it doesn't do that. 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. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/aa85fbe5-5f91-9edb-b20c-3de81e5a0dcd%40colostate.edu.
[deal.II] Re: Saving particles for checkpointing
I have one tiny question actually. In all tests, the std::ostringstream oss which contains some information about the number of particles and the data being serialized is kept. Generally, I guess this should be written to an auxiliary file, then re-read before deserialization can occur? On Wednesday, December 9, 2020 at 7:13:08 p.m. UTC-5 blais...@gmail.com wrote: > I think they will! I feel kind-off dumb not having realized that :) > Thanks! > Bruno > > > On Wednesday, December 9, 2020 at 6:06:17 p.m. UTC-5 peterrum wrote: > >> Do the following links help? >> - >> https://github.com/dealii/dealii/blob/master/tests/serialization/particle_handler_01.cc >> - >> https://github.com/dealii/dealii/blob/master/tests/serialization/particle_handler_02.cc >> >> Peter >> >> On Wednesday, 9 December 2020 at 23:15:09 UTC+1 blais...@gmail.com wrote: >> >>> Dear all, I hope you are well. >>> I am trying to add checkpointing in our particle code. Particles do not >>> have a save function, but they have a serialize function, which I think >>> would be exactly what I need. >>> However, the function is not documented. It takes as an argument >>> something of class Archive, which I could not find any information on. >>> I also grepped all over the tests, but I could not find a usage of this >>> function. >>> >>> https://www.dealii.org/current/doxygen/deal.II/classParticles_1_1ParticleHandler.html#a877e1aac8ef0ad6fa85ed400bf71eb1c >>> >>> Would anybody have a quick tutorial or example on how this function >>> could be used for checkpoint the particle_handler and the properties of the >>> particles? >>> Thank you so much :)! >>> 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 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. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/9e3ea43b-ab68-44e9-b85d-c0e47069e848n%40googlegroups.com.
[deal.II] Re: Saving particles for checkpointing
I think they will! I feel kind-off dumb not having realized that :) Thanks! Bruno On Wednesday, December 9, 2020 at 6:06:17 p.m. UTC-5 peterrum wrote: > Do the following links help? > - > https://github.com/dealii/dealii/blob/master/tests/serialization/particle_handler_01.cc > - > https://github.com/dealii/dealii/blob/master/tests/serialization/particle_handler_02.cc > > Peter > > On Wednesday, 9 December 2020 at 23:15:09 UTC+1 blais...@gmail.com wrote: > >> Dear all, I hope you are well. >> I am trying to add checkpointing in our particle code. Particles do not >> have a save function, but they have a serialize function, which I think >> would be exactly what I need. >> However, the function is not documented. It takes as an argument >> something of class Archive, which I could not find any information on. >> I also grepped all over the tests, but I could not find a usage of this >> function. >> >> https://www.dealii.org/current/doxygen/deal.II/classParticles_1_1ParticleHandler.html#a877e1aac8ef0ad6fa85ed400bf71eb1c >> >> Would anybody have a quick tutorial or example on how this function could >> be used for checkpoint the particle_handler and the properties of the >> particles? >> Thank you so much :)! >> 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 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. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/8b8fb15a-4ba7-40dd-9cfe-151677b307e5n%40googlegroups.com.
[deal.II] Re: Saving particles for checkpointing
Do the following links help? - https://github.com/dealii/dealii/blob/master/tests/serialization/particle_handler_01.cc - https://github.com/dealii/dealii/blob/master/tests/serialization/particle_handler_02.cc Peter On Wednesday, 9 December 2020 at 23:15:09 UTC+1 blais...@gmail.com wrote: > Dear all, I hope you are well. > I am trying to add checkpointing in our particle code. Particles do not > have a save function, but they have a serialize function, which I think > would be exactly what I need. > However, the function is not documented. It takes as an argument something > of class Archive, which I could not find any information on. > I also grepped all over the tests, but I could not find a usage of this > function. > > https://www.dealii.org/current/doxygen/deal.II/classParticles_1_1ParticleHandler.html#a877e1aac8ef0ad6fa85ed400bf71eb1c > > Would anybody have a quick tutorial or example on how this function could > be used for checkpoint the particle_handler and the properties of the > particles? > Thank you so much :)! > 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 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. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/53991163-d407-4616-b69c-355f8853ac00n%40googlegroups.com.