Switch - case in dolphin Expression
Asked by
Chaitanya CH
Hi,
I am modeling resistance inside a cuboid. The resistance varies in steps along the length of the cube.
If it was varying in 2 steps.
0.0 - 0.5 : 100
0.5 - 1.0 : 200
resistance = Expression('x[0]>0 && x[0]<0.5 ? 100 : 200')
However in my case it varies in 4 steps. How do I write an Expression for this?
0.0 - 0.2 : 100
0.2 - 0.5 : 200
0.5 - 0.7 : 150
0.7 - 1.0 : 300
Is there an equivalent of switch - case ?
Thank you.
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Johan Hake
- Solved:
- Last query:
- Last reply:
To post a message you must log in.