# Savesol readsol for P2 FE fields?

**URL:** <https://community.freefem.org/t/savesol-readsol-for-p2-fe-fields/2337>\
**Category:** General Discussion\
**Created:** [March 15, 2023, 10:03pm UTC](https://community.freefem.org/t/savesol-readsol-for-p2-fe-fields/2337 "2023-03-15T22:03:38Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![plouraboue](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/plouraboue/32/1584_2.png) [@plouraboue](https://community.freefem.org/u/plouraboue)\
**Post date:** [April 5, 2023, 8:08pm UTC](https://community.freefem.org/t/savesol-readsol-for-p2-fe-fields/2337/3 "2023-04-05T20:08:21Z")

</div>

Many thanks Frédéric. It works indeed. Here are some line codes for people interested :

fespace Vh(Th, P2);  
Vh c, ctest;  
// copy the data c into a vector  
ctest= c;  
// save the P2 FE field  
{ofstream ff(“csol.txt”); ff \<\< ctest\<\< endl;  
}  
read the P2 FE field  
{ifstream gg(“csol.txt”); gg \>\> ctest3;  
}  
// plot the read data  
plot(ctest3, Th, value=true, wait=true);

---

_[View the full topic](https://community.freefem.org/t/savesol-readsol-for-p2-fe-fields/2337)._
