Thank you very much for the answer. I need to evaluate a high number of frequencies, so in that case I would need to have a large number of vectors to track the results, which is not optimal in my case. Is it any other way to do that? Would be possible to call data_out.add_data_vector() and data_out.write_hdf5_parallel() in each iteartion? Would that keep the previous written information?
Thank you El martes, 15 de febrero de 2022 a las 19:43:02 UTC+1, Timo Heister escribió: > The call to data_out.add_data_vector() does not copy the contents of the > vector but it just keeps track of it until the data is actually written. > You will need to store your solutions in different vectors without > touching the old ones. > > On Tue, Feb 15, 2022, 11:05 Uclus Heis <uclu...@gmail.com> wrote: > >> Good afternoon, >> >> I want to store my results in a hdf5 file using a distributed >> implementation. I am computing different frequencies, so I have a loop in >> my run() function where I solve for each frequency. When for example >> computing 5 frequencies, I get 5 results with the same value in my hdf5 >> file, however, the solution vector inside dealii is correct. Can I ask for >> help, I do not know what am I doing wrong when exporting the results, my >> code looks like the following: >> >> DataOut<dim> data_out; >> data_out.attach_dof_handler(dof_handler); >> for(int freq_iter=0 ... ) *//solver loop, * >> { >> ... //*computes the solution per frequency* >> string nname = "rb"; >> string nit = to_string(freq_iter); >> string fitame =nname+nit; >> data_out.add_data_vector(locally_relevant_solution, fitame); >> } >> data_out.build_patches(); >> DataOutBase::DataOutFilterFlags flags(true, true); >> DataOutBase::DataOutFilter data_filter(flags); >> data_out.write_filtered_data(data_filter); >> data_out.write_hdf5_parallel(data_filter, "solution.h5", MPI_COMM_WORLD); >> >> >> Thank you for you time. >> >> -- >> 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+un...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/dealii/540023f3-2531-4d00-97dc-8d24c3e9219en%40googlegroups.com >> >> <https://groups.google.com/d/msgid/dealii/540023f3-2531-4d00-97dc-8d24c3e9219en%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- 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/252db675-766c-476d-b7d6-758d2c403f39n%40googlegroups.com.