Triangulation data serialization Question

81 views
Skip to first unread message

Jerett Cherry

unread,
Feb 17, 2025, 3:08:26 PM2/17/25
to deal.II User Group
Hello,

In my application, I store many copies of a distributed vector which all share the same . The method requires me to load in a few different checkpoint files. (eg. at t=0 and t=1). Since these share the same triangulation, I would like to call triangulation::load() many times, once for each checkpoint I'd need to load in.

When I try to do this, I trigger an assertion:

  The violated condition was:
    dest_data_fixed.empty()
  Additional information:
    Previously loaded data has not been released yet!

My understanding is that dest_data_fixed is the data buffer into which the data is put before being written into my vector. 

Does this data buffer, once I load in t=0, actually need to be saved? Said another way, is there a problem if, after t=0 is loaded in, I clear the data buffer? Reading in the class, it is unclear to me if this data buffer cannot be cleared to read in a different checkpoint into a different vector.

I think that the checkpointing in deal.II probably assumes this process only happens once, so I may be exceeding the design of the Triangulation class.

Thanks,
Jerett

Wolfgang Bangerth

unread,
Feb 17, 2025, 9:09:44 PM2/17/25
to dea...@googlegroups.com

Nice to see you here on this forum, Jerett! :-)

> I think that the checkpointing in deal.II probably assumes this process only
> happens once, so I may be exceeding the design of the Triangulation class.

Quite possibly. What happens if you call triangulation.clear() between calls?

If that doesn't help, can you create a small program that is (i)
self-contained, (ii) demonstrates the problem?

Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/


Jerett Cherry

unread,
Feb 19, 2025, 1:02:26 PM2/19/25
to deal.II User Group
triangulation.clear() removes all data. Apparently, load() requires that triangulation already contain a coarse mesh. Therefore clear() cannot work. I'll write a small program that demonstrates the issue today.

Would it be to add a line in the implementation of load() which clears the buffer? I would argue that if a user calls load(), they intend to load different data into that buffer. I still don't understand the structure of the triangulation class entirely, so maybe there is some reason that the authors want to prevent a data buffer from being used before it is 'released'. 

But even that word is confusing, since there is no indication that the triangulation class has any way to tell the data serializer to 'release' the buffer's data. Note that CellAttachedDataSerializer<dim, spacedim> has a clear() method which would do what I want.

-Jerett

blais...@gmail.com

unread,
Feb 20, 2025, 8:43:17 PM2/20/25
to deal.II User Group
I think a temporary fix could be to
generate_coarse_mesh in the triangulation
load checkpoint
load data

And then for each step you want to load, to 
clear
generate_coarse_mesh
load checkpoint
load data

Which when thinking about it looks a bit absurd. If you have a small example i'd be happy to look at it!

Jerett Cherry

unread,
Feb 28, 2025, 2:38:51 PM2/28/25
to deal.II User Group
Bruno, 

This temporary fix works. I was unable to create a small example to illustrate the problem with the detail I desired, so unfortunately cannot share this. The workflow that resolved this issue is as follows:
1. generate coarse mesh
2. load checkpoint
3. reinitialize and prepare associated data structures now that the triangulation has been set.
4. load data.

Since the mesh I am loading the data into is coarse, this re-generation of the mesh is reasonable. For me, the key observation was that I need to also reinitialize some associated data structures once the triangulation has been loaded.

Thanks all.

Reply all
Reply to author
Forward
0 new messages