Ritz-Method #1086
-
Hello, is there a way to implement a functional and solve it with the ritz method? I have an energy functional that represents elasto-plastic material behaviour at small strains and I would like to solve and implement the problem directly with the functional and not with the weak form. The specific functional is on the picture. The solution is u and pi, where the functional is minimized. Can you link a code example? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @jon21as , I don't have a code example in mind, but you can just use any julia optimiser + gridap's automatic differentiation to do this. Code your energy as a function of your variable, using Gridap's API. You can then take the gradient of it like we do in most non-linear tutorials. If you work with regular optimiser libraries, you may need to wrap these such that your energy and gradient functions take in vectors instead of FEFunctions. You can use There are more complex things being done in the context of Topology Optimisation in one of the tutorials. Good luck! |
Beta Was this translation helpful? Give feedback.
Hi @jon21as ,
I don't have a code example in mind, but you can just use any julia optimiser + gridap's automatic differentiation to do this.
Code your energy as a function of your variable, using Gridap's API. You can then take the gradient of it like we do in most non-linear tutorials.
If you work with regular optimiser libraries, you may need to wrap these such that your energy and gradient functions take in vectors instead of FEFunctions. You can use
uh = FEFunction(V,x)
andx = get_free_dof_values(uh)
to map between vector and FEFunction representations of your unknowns.There are more complex things being done in the context of Topology Optimisation in one of the tutorials.
Good luck!