Piecewise coefficient function

More
4 years 1 week ago #3336 by bakerk
Hi,

Is there an easy way to define a piecewise coefficient function? I want to use it in defining mass matrices for my fem scheme:
\int \sigma(x)*u*v dx
where sigma(x) will be zeros for a range of values in the space im integrating over.

Thanks!
More
4 years 4 days ago #3351 by JSR
Replied by JSR on topic Piecewise coefficient function
You can use IfPos. For a CoefficientFunction f, IfPos(f, a, b) will be equal to a when f>0 and b otherwise.
The following user(s) said Thank You: bakerk
Time to create page: 0.097 seconds