# Storing and Accessing Data from Old Solutions

**URL:** <https://pyfr.discourse.group/t/storing-and-accessing-data-from-old-solutions/274>\
**Category:** General\
**Created:** [4 March 2020 14:44 UTC](https://pyfr.discourse.group/t/storing-and-accessing-data-from-old-solutions/274 "2020-03-04T14:44:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jabir](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@Jabir](https://pyfr.discourse.group/u/Jabir)\
**Post date:** [4 March 2020 14:44 UTC](https://pyfr.discourse.group/t/storing-and-accessing-data-from-old-solutions/274/1 "2020-03-04T14:44:42Z")

</div>

Dear PyFR developers,

I am trying to access data from multiple storage registers (time levels) in the solver’s point-wise kernels.  
For scal\_upts, I currently pass the id of a register of interest to the system.rhs() method, then use that id to set the active matrix of a “scal\_upts\_old” bank, which I declared in base/elements in the same way as scal\_upts\_inb/outb.  
Is this the best approach in this case or is there a more straightforward/efficient way of passing this data to point-wise kernels?

How would I go about storing/accessing non-scal\_upts data from older solutions, such as vect\_upts and scal\_fpts? Is there a way to use a “scratch buf” for that?

I would really appreciate your help with this.

Thanks,

Jabir

---

<div class="post-metadata">

**Author:** ![Akkurt\_Semih](https://avatars.discourse-cdn.com/v4/letter/a/c57346/32.png) [@Akkurt\_Semih](https://pyfr.discourse.group/u/Akkurt_Semih)\
**Post date:** [4 March 2020 15:21 UTC](https://pyfr.discourse.group/t/storing-and-accessing-data-from-old-solutions/274/2 "2020-03-04T15:21:31Z")

</div>

Hi Jabir,

I think your approach for accessing storage registers is good and efficient. The scratch space matrices we allocate are used for temporary storage, and gets overwritten whenever we need to utilize that storage for some other temporary data. But you can of course allocate a new matrix, and copy any matrix of matching size into the new storage any time. You just need to be careful about where to place copy operation. It should be right after when a scratch space matrix gets written the data you actually need.

Best,  
Semih

---

<div class="post-metadata">

**Author:** ![Jabir](https://avatars.discourse-cdn.com/v4/letter/j/7cd45c/32.png) [@Jabir](https://pyfr.discourse.group/u/Jabir)\
**Post date:** [5 March 2020 10:40 UTC](https://pyfr.discourse.group/t/storing-and-accessing-data-from-old-solutions/274/3 "2020-03-05T10:40:30Z")

</div>

Thank you, Semih!

After all, I created new scratch space matrices, since that involves less messing around with the integrator.
