I have a question regarding boundary conditions in FreeFEM++. Specifically, I would like to know if it is possible to apply a heat flux boundary condition to a one-dimensional line element at any of its boundaries.

For context, I am working on a heat transfer problem where I need to specify a heat flux instead of a temperature at one of the boundaries. The problem statement and the .edp file are attached below. I would appreciate any guidance on how to implement this in FreeFEM++, or if there are specific commands or examples you could point me to.

I think that you need to set non-homogeneous Neumann BC.
For your heat equation it means -K\frac{dT}{dx}n=g, with g a given boundary flux, n the external normal (+1 on the right, -1 on the left of the domain)
For that you juste delete the +on(1,T=1000)
and replace it by +int0d(Th)(g*v)
However if you want to put different conditions on the left and on the right, you need to define boundary labels, I donâ€™t know how to do it in 1d.

Iâ€™m working on a simulation where a material surface is undergoing ablation (material is being â€śburnedâ€ť or removed) over time, which causes the surface to shrink. In FreeFem++,
I need to do the following:
Update the mesh: As the material shrinks, I need to update the mesh at each time step to reflect this shrinkage and also remesh the surface.
Update the finite element space (Fespace): After the mesh is updated, I also need to update the finite element space to reflect the new geometry.
Transfer old solution fields: After the mesh is updated, I need to transfer my old solution fields (like temperature, density, etc.) to the new mesh.

My questions are:

How do I properly update the mesh and remesh during the simulation?
How do I reinitialize the finite element space after remeshing?
How do I transfer the old solution fields (temperature, density, etc.) to the new mesh? Should I interpolate them, or can I initialize them based on the new geometry?
It would be helpful if you can provide any guidance on how to implement this in FreeFEM++, or if there are specific commands or examples you could point me to.
Thank you!!!