# Anisotropic mesh adaptation

**URL:** <https://community.freefem.org/t/anisotropic-mesh-adaptation/1622>\
**Category:** General Discussion\
**Created:** [March 24, 2022, 1:47pm UTC](https://community.freefem.org/t/anisotropic-mesh-adaptation/1622 "2022-03-24T13:47:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trophime](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/trophime/32/215_2.png) [@Trophime](https://community.freefem.org/u/Trophime)\
**Post date:** [March 24, 2022, 1:47pm UTC](https://community.freefem.org/t/anisotropic-mesh-adaptation/1622/1 "2022-03-24T13:47:34Z")

</div>

Hi,  
I would like to run a kind of parabolic pde with anisotropic mesh adaption using a Hessian based metric. For static problem, I guess I can start from CornerLap.edp.  
Is there any example available for transient pb to help me start on the subject?

Best  
C

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [March 24, 2022, 2:23pm UTC](https://community.freefem.org/t/anisotropic-mesh-adaptation/1622/2 "2022-03-24T14:23:37Z")

</div>

This is a good question.

For a parabolic problem, without transport part it is not too hard.

The major issue is du to the interpolation process, if you do this at each time step the risk of lost matter is important.

You can see [FreeFem-sources/NSP1P2.edp at master · FreeFem/FreeFem-sources · GitHub](https://github.com/FreeFem/FreeFem-sources/blob/master/examples/misc/NSP1P2.edp) for exemple

---

<div class="post-metadata">

**Author:** ![Trophime](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/trophime/32/215_2.png) [@Trophime](https://community.freefem.org/u/Trophime)\
**Post date:** [March 24, 2022, 4:04pm UTC](https://community.freefem.org/t/anisotropic-mesh-adaptation/1622/3 "2022-03-24T16:04:59Z")

</div>

@frederichecht thanks for the example.  
The is no transport term in my problem so it shall be ok to follow what is done in the example 🙂  
Still, I have a question:  
Th=adaptmesh(Th,[dx(u1),dy(u1),dx(u1),dy(u2)],…)

The is a typo in the metric no?

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [March 24, 2022, 4:35pm UTC](https://community.freefem.org/t/anisotropic-mesh-adaptation/1622/4 "2022-03-24T16:35:27Z")

</div>

The basic term on adaptmesh

Th=adaptmesh(Th,[u1,u2], …);  
for P1 approximation and for P2 approximation a possibility is  
Th=adaptmesh(Th,[dx(u1),dx(u2),dy(u1),dy(u2)], …);

because the optimal use the third derivative.
