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

MIGUEL MOLINOS PEREZ mmolinos at us.es
Sun Mar 31 15:07:47 CDT 2024


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(…)
DMSwarmDestroyGlobalVectorFromField(…)
}

The resulting hdf5 file looks good after an inspection using python’s library h5py.

However, I am finding difficulties when I try to use this .hdf5 file as a fresh start for my application. The target field is not properly updated when I try to load the stored data (it keeps the default one).

read_function(){
…
PetscViewerHDF5Open(…)
PetscViewerHDF5PushTimestepping(…)
DMSwarmCreateGlobalVectorFromField(…)
VecLoad(… )
DMSwarmDestroyGlobalVectorFromField(…)
...
}

The puzzling part is: if I print the “updated” vector inside of read_function() using VecView after VecLoad, the vector seem to hold the updated values. However, If I print the field in the main function after the call to read_function(), the field remains the same it was before calling to read_function() and I do not get any erro message.

It is there something wrong with the logic of my programing? Maybe I am missing something.

Thank you in advance.

Best regards,
Miguel

Miguel Molinos
Investigador postdoctoral
Juan de la Cierva
Dpto. Mecánica de Medios Continuos y Teoría de Estructuras - ETSI
Universidad de Sevilla
Camino de los descubrimientos, s/n
41092 Sevilla


[us_logo.jpg]





https://urldefense.us/v3/__http://www.us.es__;!!G_uCfscf7eWS!egnWYkerVjlSmbuh1nUjljGJ4vkEwKUvO9ygc9e5BJ72KxK-T4qbWIxTBbg-BeyxDvqN5Rr5EvaWMAIXee5w9w$ 
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Si no es UD. el destinatario del mensaje, le ruego lo destruya sin hacer copia digital o física, comunicando al emisor por esta misma vía la recepción del presente mensaje. Gracias

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240331/87778169/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: us_logo.jpg
Type: image/jpeg
Size: 21155 bytes
Desc: us_logo.jpg
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240331/87778169/attachment-0001.jpg>


More information about the petsc-users mailing list