# Save solution with savehdf5sol in subdirectory

**URL:** <https://community.freefem.org/t/save-solution-with-savehdf5sol-in-subdirectory/2190>\
**Category:** General Discussion\
**Created:** [December 15, 2022, 5:24pm UTC](https://community.freefem.org/t/save-solution-with-savehdf5sol-in-subdirectory/2190 "2022-12-15T17:24:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fvgt](https://avatars.discourse-cdn.com/v4/letter/f/3ec8ea/32.png) [@fvgt](https://community.freefem.org/u/fvgt)\
**Post date:** [December 15, 2022, 5:24pm UTC](https://community.freefem.org/t/save-solution-with-savehdf5sol-in-subdirectory/2190/1 "2022-12-15T17:24:21Z")

</div>

Dear FreeFem++ users and developpers,

Is it possible to use `savehdf5sol` to write a finite element function in a subdirectory ?

Let me explain. If I do:

```auto
load "iohdf5"
system("mkdir -p result");
mesh Th = square(10,10);
fespace Vh(Th,P1);
Vh u = x+y;
savemesh(Th,"result/function.mesh.h5");
savehdf5sol("result/function.sol.h5",Th,u,"u");

```

the .xmf and .h5 files are written in the subdirectory “result” but the .xmf files are wrong since the references to .h5 files contain the name of the subdirectory “result” which should not appear. For example, here is the content of function.mesh.xmf:

```auto
<?xml version="1.0" ?>
<!DOCTYPE Xdmf SYSTEM "Xdmf.dtd" []>
<Xdmf Version="2.0">
  <Domain>
    <Grid Name="full mesh" GridType="Uniform">
      <Topology TopologyType="Triangle" NumberOfElements="200">
	<DataItem Format="HDF" NumberType="Int" Dimensions="200 3">
           result/function.mesh.h5:/Connectivity/ELEM2NODE
        </DataItem>
      </Topology>
      <Geometry GeometryType="XY">
	<DataItem NumberType="Float" Precision="8" Dimensions="121 2" Format="HDF">
           result/function.mesh.h5:/Coordinates/XY
        </DataItem>
      </Geometry>
    </Grid>
  </Domain>
</Xdmf>

```

Cheers.

PS : I use FreeFem++ - version 4.11 on Ubuntu 20.04. Installation have been made using the .deb file released on github.
