Read/write 3D solution

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:

// 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");

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

1 Like