What's the difference between enforce and condense? #766
-
Is there a time when I can only use one of them? Is one faster? I'm not sure how to chose between them. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yeah, for a long time we only had
Basically condense eliminates the degrees of freedom constrained by essential boundary conditions; enforce leaves them in but modifies the system of equations so that in the solution they have to have the required values. Another alternative is scikit-fem/docs/examples/ex19.py Line 67 in 7500d1c
For direct solvers, I wouldn't think that there would be much difference in speed between any of these three, but I haven't timed them. It's usually more about what's most convenient and tidier in the scripts and this will vary depending on the example (steady or unsteady, linear or nonlinear, &c.). For a good discussion in the literature of different ways of handling essential conditions in the finite element method, I recommend Ern & Guermond, as cited 2019 in #150. |
Beta Was this translation helpful? Give feedback.
Yeah, for a long time we only had
condense
. I was pretty happy with it, although I did (& still do) plan to try out different techniques of imposing Dirichlet/essential boundary conditions in #753 .enforce
was introduced following #591. There's a long discussion there. Quite a productive discussion, as I recall.Basically condense eliminates the degrees of freedom constrained by essential boundary conditions; enforce leaves them in but modifies the system of equations so that in the solution they have to have the required values.
Another alternative is
penalize
, as inscikit-fem/docs/examples/ex19.py
Line 67 in 7500d1c
enforce
…