Re: [petsc-users] Error loading data coming from a .hdf5 file into a DMSwarm

2024-04-01 Thread MIGUEL MOLINOS PEREZ
I see. Thank you for the feedback Matthew! Thanks, Miguel On 1 Apr 2024, at 18:32, Matthew Knepley wrote: On Mon, Apr 1, 2024 at 11:13 AM MIGUEL MOLINOS PEREZ mailto:mmoli...@us.es>> wrote: Dear Matthew, Thank you for your suggestion. I tried to update the vector with the information coming

Re: [petsc-users] Error loading data coming from a .hdf5 file into a DMSwarm

2024-04-01 Thread Matthew Knepley
On Mon, Apr 1, 2024 at 11:13 AM MIGUEL MOLINOS PEREZ wrote: > Dear Matthew, > > Thank you for your suggestion. I tried to update the vector with the > information coming from the hdf5 file inside the main function. Then I > print the vector two times (see the lines below), the first time it has t

Re: [petsc-users] Error loading data coming from a .hdf5 file into a DMSwarm

2024-04-01 Thread MIGUEL MOLINOS PEREZ
Dear Matthew, I came up with a workaround for the problem. I duplicate the vector and use the duplicated copy to read the information from the hdf5 file. Then I swap both vectors and delete the copy. If I invoke VecView outside of the function, the value has been modified properly. However, thi

Re: [petsc-users] Error loading data coming from a .hdf5 file into a DMSwarm

2024-04-01 Thread MIGUEL MOLINOS PEREZ
Dear Matthew, Thank you for your suggestion. I tried to update the vector with the information coming from the hdf5 file inside the main function. Then I print the vector two times (see the lines below), the first time it has the correct data. However, the second time, it has the same values li

Re: [petsc-users] Error loading data coming from a .hdf5 file into a DMSwarm

2024-04-01 Thread Matthew Knepley
On Sun, Mar 31, 2024 at 4:08 PM MIGUEL MOLINOS PEREZ wrote: > Dear all, I am writing a function which store datasets (Vectors) coming > from a DMSwarm structure into a hdf5 file. This step is done nicely > write_function(){ PetscViewerHDF5Open(…) PetscViewerHDF5PushTimestepping(…) > DMSwarmCreate

[petsc-users] Error loading data coming from a .hdf5 file into a DMSwarm

2024-03-31 Thread MIGUEL MOLINOS PEREZ
Dear all, I am writing a function which store datasets (Vectors) coming from a DMSwarm structure into a hdf5 file. This step is done nicely write_function(){ PetscViewerHDF5Open(…) PetscViewerHDF5PushTimestepping(…) DMSwarmCreateGlobalVectorFromField(…) VecLoad(…) DMSwarmDestroyGlobalVectorFromF