# Storing data for each timestep

**URL:** <https://community.freefem.org/t/storing-data-for-each-timestep/1647>\
**Category:** General Discussion\
**Created:** [April 5, 2022, 10:37am UTC](https://community.freefem.org/t/storing-data-for-each-timestep/1647 "2022-04-05T10:37:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zese](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/zese/32/917_2.png) [@zese](https://community.freefem.org/u/zese)\
**Post date:** [April 5, 2022, 10:37am UTC](https://community.freefem.org/t/storing-data-for-each-timestep/1647/1 "2022-04-05T10:37:41Z")

</div>

Dear all

I solve unsteady navier-stokes equation in FF++ and I want to store velocities (u,v) in a matrix for one period and for each time step. is there anyway to write it?  
For instance,  
for (i=0; i\<T/dt; i++)  
Solve Ns;  
store each u and v in a column of matrix for each time and regenerate the matrix  
end  
at the end we need this, U=[[u,v]@t1,[u,v]@t2,…[u,v]@T]

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [April 5, 2022, 11:54am UTC](https://community.freefem.org/t/storing-data-for-each-timestep/1647/2 "2022-04-05T11:54:07Z")

</div>

NO problem,

you can define e fespace Wh(Th,[Pk,Pk]) ; for example where Pkk is the finite element for for u and v;

```auto
Wh [int] [U1,U2](niter); // a array 
for (i=0; i<T/dt; i++)
{
Solve Ns;
  [U1[i],U2[i]] = [u,v]; // store u,v in composante i. 
}

```
