# Minimum refinement function in ASPECT 2.4-pre

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:

``````  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

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.

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

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.