# Read/write 3D solution

**URL:** <https://community.freefem.org/t/read-write-3d-solution/2256>\
**Category:** General Discussion\
**Created:** [January 31, 2023, 12:08am UTC](https://community.freefem.org/t/read-write-3d-solution/2256 "2023-01-31T00:08:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsmacd](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jsmacd](https://community.freefem.org/u/jsmacd)\
**Post date:** [January 31, 2023, 12:08am UTC](https://community.freefem.org/t/read-write-3d-solution/2256/1 "2023-01-31T00:08:16Z")

</div>

Is there a special way to read and write a solution in 3d?

I am able to save and read my meshes correctly. Also, I can see that I have a saved solution. But when I try to read my solution: I get the error

error operator = \<NSt3\_\_14pairIP6FEbaseId6v\_fes3EiEE\>, \<3KN\_IdE\> and then a list of choices.

The commands I am using are:

```auto
// to save
savemesh(Th, "refMesh.mesh");
savesol("ref.sol", Th, u, order = 1);

// to read after 
mesh3 Thread = readmesh3("refMesh.mesh");
fespace Vh(Thread, P1); 
Vh uread;
uread = readsol("ref.sol");

```

---

<div class="post-metadata">

**Author:** ![mojtaba.barzegari](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/mojtaba.barzegari/32/20_2.png) [@mojtaba.barzegari](https://community.freefem.org/u/mojtaba.barzegari)\
**Post date:** [January 31, 2023, 8:25am UTC](https://community.freefem.org/t/read-write-3d-solution/2256/2 "2023-01-31T08:25:18Z")

</div>

FF reads it back as an array, so you should write it like `uread[] = readsol("ref.sol");`.
