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.

Non-constant coefficients in NGSolve

More
2 years 11 months ago #3761 by Fritz
Hello,

I am a relatively new user of NG Solve and was curious how one defines non-constant coefficients. I am trying to solve a PDE with a coefficient that is piecewise constant. From following the tutorial on solving Poisson's equation, I have x and y coordinates, however, from looking at the documentation, it does not allude to how to loop through the x and y coordinates and change the value of the coefficient accordingly.
More
2 years 11 months ago #3762 by hvwahl
Hi Fritz,

you can use the
Code:
IfPos(x,if,else)
or multiples of these to do this. See also the documentation

Best wishes,
Henry
Time to create page: 0.143 seconds