Skip to main content

differential equations - PDEs : automatic method choice : TensorProductGrid or FiniteElement?


A problem that arises when we solve PDEs with NDSolve[] and Method->Automatic is how to know which method has been chosen : TensorProductGrid or FiniteElement ?


The question is important because :




  • NDSolve often use TensorProductGrid (wrongly I think) instead of FiniteElement. I guess the reason is historical : TensorProductGrid is maybe 15 years older than FiniteElement. For compatibility reasons all forms of syntax that was leading to TensorProductGrid should continue to lead to this method.





  • The wrong choice may lead to problems that are very, very advanced (here for example)



  • If we don't know which method is used, we don't know which documentation to read (the one for TensorProductGrid or the one for FiniteElement) and these documentations are very consequent (and it's crucial to understand error messages).

  • Even advanced user can't deduce the choice of the method from the syntax. For example, the use of the expression NeumannValue impose FiniteElement, but Laplacian not, though historically they appeared at the same time.


Here are some ways to find the answer to this question :



  • some error messages may give the information

  • after having done sol=NDSolveValue[...], then if sol["ElementMesh"] gives a object ElementMesh[ blabla ], FiniteElement has been used


  • one can do also NDSolve`ProcessEquations[...] instead of NDSolve[...] and examine the resulting object.


Is there something more friendly, above all for beginners who will use preferently the automatic choice ?




Comments