A error of composition

Hi there,
Recently I wanted to construct a two-dimensional model to study lower crustal flow deformation in eastern Tibet. I divided the model into eight parts: SC_uc, Tibet_uc, Tibet_lc, SC_lc, Tibet_lm, SC_lm, Tibet_as, SC_as.
When I run it, I get the following error:


I have checked my initial composition and temperature and the parameters given in the viscoplastic material and there doesn’t seem to be a mismatch error, how do I fix this.
My .prm file is as follows:
Eastern_Tibet.prm (8.5 KB)

All the best,
HangWu

Dear HangWu,

The initial temperature function should have only one expression (temperature is a scalar field). You have provided 8 expressions (delimited by semicolons).

ASPECT expects a single expression for the initial temperature field. You should redesign your function so that the separate expressions are replaced by nested if statements. The syntax for an if statement is if(condition, true-expression, false-expression). Within the false-expression you can put another if statement.

You may also wish to look at lazy evaluation (How to write Function expressions in parameter files — ASPECT 2.6.0-pre) to speed up evaluation.

Best wishes,
Bob

Hi Bob,
Thanks for your reply.
Since I’m considering two different blocks with different thicknesses of their lithosphere, I’m trying to make it difficult to account for this through an equation, or maybe it’s more convenient through an Ascii file?
best,
HangWu

Dear HangWu,

Your expression is almost correct - it just doesn’t make any sense within normal geodynamics frameworks to make temperature a vector field.

Perhaps an ASCII file is more convenient for you, but I think for such a simple temperature structure it’s also fine to have nested if statements.

If you want to test your expression, you might consider trying out GitHub - bobmyhill/pymuparser: Python binding for MuParser library., using the ScalarExpression class (see, for example, pymuparser/examples/example_scalar.py at main · bobmyhill/pymuparser · GitHub).

Best wishes,
Bob