# Modelisation of Heat Equation with variable diffusivity

**URL:** <https://fenicsproject.discourse.group/t/modelisation-of-heat-equation-with-variable-diffusivity/5263>\
**Category:** mesh\
**Created:** [March 8, 2021, 5:25pm UTC](https://fenicsproject.discourse.group/t/modelisation-of-heat-equation-with-variable-diffusivity/5263 "2021-03-08T17:25:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Raphael](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/raphael/32/2253_2.png) [@Raphael](https://fenicsproject.discourse.group/u/Raphael)\
**Post date:** [March 8, 2021, 5:25pm UTC](https://fenicsproject.discourse.group/t/modelisation-of-heat-equation-with-variable-diffusivity/5263/1 "2021-03-08T17:25:20Z")

</div>

Hello everyone.  
I have a simple question : have you got an code that shows how to use fenics if there is 2 solids that are stuck, so with different diffusivity. I can’t find any recent code with the explaination of how making 2 subdomains.  
Thank you very much.

---

<div class="post-metadata">

**Author:** ![Raphael](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/raphael/32/2253_2.png) [@Raphael](https://fenicsproject.discourse.group/u/Raphael)\
**Post date:** [March 8, 2021, 5:30pm UTC](https://fenicsproject.discourse.group/t/modelisation-of-heat-equation-with-variable-diffusivity/5263/2 "2021-03-08T17:30:03Z")

</div>

It would be useful for me to use `dx = Measure('dx')[subdomains]` but it has been deleted

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [March 8, 2021, 6:48pm UTC](https://fenicsproject.discourse.group/t/modelisation-of-heat-equation-with-variable-diffusivity/5263/3 "2021-03-08T18:48:51Z")

</div>

You can use `dx = Measure("dx", subdomain_data=subdomains)`  
See for instance: [MultiMeshShapeOpt\_code/MulticableSolver.py at master · jorgensd/MultiMeshShapeOpt\_code · GitHub](https://github.com/jorgensd/MultiMeshShapeOpt_code/blob/master/Poisson_MultiCable/single_mesh/MulticableSolver.py#L99-L102)
