# Minimum refinement function in ASPECT 2.4-pre

**URL:** <https://community.geodynamics.org/t/minimum-refinement-function-in-aspect-2-4-pre/2470>\
**Category:** ASPECT\
**Created:** [June 22, 2022, 7:52pm UTC](https://community.geodynamics.org/t/minimum-refinement-function-in-aspect-2-4-pre/2470 "2022-06-22T19:52:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaturino](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/vaturino/32/1519_2.png) [@vaturino](https://community.geodynamics.org/u/vaturino)\
**Post date:** [June 22, 2022, 7:52pm UTC](https://community.geodynamics.org/t/minimum-refinement-function-in-aspect-2-4-pre/2470/1 "2022-06-22T19:52:16Z")

</div>

Hi all, I’m modeling subduction in a cartesian box and I’m trying to refine the surface and the upper-lower mantle boundary.  
I’m using the same syntax I was using in the previous aspect version, but I’m having troubles using the && operator. The parameter file section is:

```auto
  subsection Minimum refinement function
    set Coordinate system = cartesian
    set Variable names = x, y
    set Function constants = discontinuity=660.e3, surface=100.e3, ymax = 900.e3
    set Function expression = ( (ymax-y)< surface ? 6 : \
                                (((ymax-y)>(discontinuity-30.e3)) && ((ymax-y)<(discontinuity+30.e3))) ? 5 : \
                                0) 
  end

```

If I use this expression, the surface is refined but the upper-lower mantle boundary is ignored.  
If I use this method and either one of the expressions in the line with &&, it works. If, instead of &&, I use the logical operator ||, it does what I expect it to do.  
Can I please get help with this?

Thanks,  
Valeria

---

<div class="post-metadata">

**Author:** ![bangerth](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/bangerth/32/52_2.png) [@bangerth](https://community.geodynamics.org/u/bangerth)\
**Post date:** [June 23, 2022, 4:53am UTC](https://community.geodynamics.org/t/minimum-refinement-function-in-aspect-2-4-pre/2470/2 "2022-06-23T04:53:17Z")

</div>

Valeria – can you produce a minimal example that illustrates this in a self-contained way? See if you can shrink your input file to the smallest possible, essentially only creating the mesh at the beginning and then solving a dummy problem? (I’m assuming that the problem already appears in time step 0.)  
Best  
W.

---

<div class="post-metadata">

**Author:** ![vaturino](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/vaturino/32/1519_2.png) [@vaturino](https://community.geodynamics.org/u/vaturino)\
**Post date:** [June 25, 2022, 2:04am UTC](https://community.geodynamics.org/t/minimum-refinement-function-in-aspect-2-4-pre/2470/3 "2022-06-25T02:04:57Z")

</div>

Hi,  
I tried what you suggested and modified one of the cookbooks as a dummy model, and in that case this syntax works perfectly, thanks for the suggestion!

There must be something else wrong with my model, then, I’m still trying to figure it out.

Thank you again,  
Valeria

---

<div class="post-metadata">

**Author:** ![bangerth](https://yyz2.discourse-cdn.com/flex036/user_avatar/community.geodynamics.org/bangerth/32/52_2.png) [@bangerth](https://community.geodynamics.org/u/bangerth)\
**Post date:** [June 27, 2022, 3:16am UTC](https://community.geodynamics.org/t/minimum-refinement-function-in-aspect-2-4-pre/2470/4 "2022-06-27T03:16:28Z")

</div>

Valeria:

OK, good to know. Now you have two end points: one that works and one that doesn’t. You’ll have to interpolate between these two and find which step going from one to the other causes the behavior. Add complexity one step at a time until you see things break!

Best  
W.
