PDE Toolbox: evaluateGradient for legacy workflow or convert legacy solution to PDE solution
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Maxime Krier
am 11 Feb. 2020
Kommentiert: Hanwen Zhang
am 5 Mär. 2021
I am solving a scalar, time independent PDE in 2d with mesh refinement with the adaptmesh function from the legacy workflow.
Now, I would like to evaluate the gradient of my solution u in an arbitrary point, say .
For the legacy worklflow, I found the function pdegrad, which lets me evaluate the gradient in the triangle centroids of my mesh. However I need a function similar to evaluateGradient. Is there a similar function for the legacy workflow?
If not, is there another easy way to solve my problem? My only idea would be to convert my legacy solution u to a PDE solution of the recommended workflow. Is there an elegant way to achieve this? My idea up to now is to solve a "PDE"
with the recommended workflow, where is an interpolant of my solution u and Ω is my domain. However this seems way to complicated for me.
Thanks for your help
0 Kommentare
Akzeptierte Antwort
Ravi Kumar
am 12 Feb. 2020
Hi Maxime,
You can create a result object of the kind you need using the solution from the legacy solver and the createPDEResults function. Once you have a results object you get the evaluateGradient with it, so you should be good to go.
Note the warning on the createPDEResults is to note that new solvers produce the results object directly and there is no use of this function. However, in your use case this would simplify your work after you get the solution form the legacy solver.
Regards,
Ravi
1 Kommentar
Hanwen Zhang
am 5 Mär. 2021
Hi Ravi,
When you create a results object you will need to convert [p,e,t] tripe in adaptmesh output to FEMesh object. Could you give some tips on that?
Thanks,
Hanwen
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Geometry and Mesh finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!