# Mesh from Cahn-Hillard?

**URL:** <https://fenicsproject.discourse.group/t/mesh-from-cahn-hillard/12659>\
**Category:** mesh\
**Created:** [November 6, 2023, 9:58am UTC](https://fenicsproject.discourse.group/t/mesh-from-cahn-hillard/12659 "2023-11-06T09:58:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![willi](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/willi/32/5229_2.png) [@willi](https://fenicsproject.discourse.group/u/willi)\
**Post date:** [November 6, 2023, 10:11am UTC](https://fenicsproject.discourse.group/t/mesh-from-cahn-hillard/12659/2 "2023-11-06T10:11:58Z")

</div>

The first partial solution for this problem seems to be found in this useful post:  
[Identifying subdomains from level set function on fenicsx](https://fenicsproject.discourse.group/t/identifying-subdomains-from-level-set-function-on-fenicsx/11659)  
From what I understand we can use a “conditional” to identfy the subdomains.  
The other suggestion of meshing the boundary seems not possible, since we do not know the the analytic solution.  
To reduce the error we can do 2 things:

- increase the number of elements
- (recommended in the post) increase order of elements  
Therefor we have to rewite the [tutorial](https://docs.fenicsproject.org/dolfinx/main/python/demos/demo_cahn-hilliard.html) to account for higher order elements load a certain example and use the conditional to identify the subdomains

---

_[View the full topic](https://fenicsproject.discourse.group/t/mesh-from-cahn-hillard/12659)._
