Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Piecewise coefficient function

More
3 years 5 months 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
3 years 5 months 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.138 seconds