Hello,
I am considering using SfePy for some test problems. I am wondering if SfePy will grant me access to the discretized problem. More precisely, if a set of PDEs is discretized over a given domain to yield a system of nonlinear equations, say F(x)=b, it is possible/easy to evaluate F(x) and its Jacobian F'(x) from my own code?
On a similar topic, I presume it is sufficient to specify a value for the 'lin_solver' argument to a NonlinearSolver instance to "plug in" different linear system solvers to solve F(x)=b?! In order to make an educated choice, I would like to access and see the structure of the linear systems. Is there an example showing how this can be done?
Finally, since SfePy allows for the solution of Stokes problems, I presume it is possible to obtain a mixed FEM discretization for a given set of PDEs?
Thanks in advance! Dominique
Hi Dominique,
On 04/07/10 18:51, Dominique wrote:
Hello,
I am considering using SfePy for some test problems. I am wondering if SfePy will grant me access to the discretized problem. More precisely, if a set of PDEs is discretized over a given domain to yield a system of nonlinear equations, say F(x)=b, it is possible/easy to evaluate F(x) and its Jacobian F'(x) from my own code?
By access to the discretized problem you mean the mesh, base functions, etc.? It looks like you want to implement a new term actually.
On a similar topic, I presume it is sufficient to specify a value for the 'lin_solver' argument to a NonlinearSolver instance to "plug in" different linear system solvers to solve F(x)=b?! In order to make an educated choice, I would like to access and see the structure of the linear systems. Is there an example showing how this can be done?
Yes, it should be sufficient. You can get easily both the matrix and the right hand side by calling problem.evaluate() on your equations. I can show you how to do it, if that's what you need.
Finally, since SfePy allows for the solution of Stokes problems, I presume it is possible to obtain a mixed FEM discretization for a given set of PDEs?
Yes. For example, in examples/navier_stokes/navier_stokes.py we use P1B approximation for the velocity and P1 for the pressure. But keep in mind, that the choice of approximations is still rather limited...
I hope this answers some of your questions... keep asking.
r.
Hi Robert,
On Apr 7, 6:05 pm, Robert Cimrman cimr...@ntc.zcu.cz wrote:
Hi Dominique,
On 04/07/10 18:51, Dominique wrote:
Hello,
I am considering using SfePy for some test problems. I am wondering if SfePy will grant me access to the discretized problem. More precisely, if a set of PDEs is discretized over a given domain to yield a system of nonlinear equations, say F(x)=b, it is possible/easy to evaluate F(x) and its Jacobian F'(x) from my own code?
By access to the discretized problem you mean the mesh, base functions, etc.? It looks like you want to implement a new term actually.
I don't think I will need access to the mesh and basis functions just yet but that might be necessary in the future. Being able to evaluate what I naively described as F(x), F'(x) and b would be great for now. Second derivatives of the components of F would be a plus, but I realize that that might not be implemented in SfePy.
On a similar topic, I presume it is sufficient to specify a value for the 'lin_solver' argument to a NonlinearSolver instance to "plug in" different linear system solvers to solve F(x)=b?! In order to make an educated choice, I would like to access and see the structure of the linear systems. Is there an example showing how this can be done?
Yes, it should be sufficient. You can get easily both the matrix and the right hand side by calling problem.evaluate() on your equations. I can show you how to do it, if that's what you need.
A simple example would be great to get me started. Thanks for offering! I do realize that I have to RTFM. I only wanted to be sure those things could be done before I invested more time and effort.
Finally, since SfePy allows for the solution of Stokes problems, I presume it is possible to obtain a mixed FEM discretization for a given set of PDEs?
Yes. For example, in examples/navier_stokes/navier_stokes.py we use P1B approximation for the velocity and P1 for the pressure. But keep in mind, that the choice of approximations is still rather limited...
I hope this answers some of your questions... keep asking.
Great. I will study the examples. Thanks much, Robert!
Dominique
On 04/07/10 21:19, Dominique wrote:
Hi Robert,
On Apr 7, 6:05 pm, Robert Cimrmancimr...@ntc.zcu.cz wrote:
Hi Dominique,
On 04/07/10 18:51, Dominique wrote:
Hello,
I am considering using SfePy for some test problems. I am wondering if SfePy will grant me access to the discretized problem. More precisely, if a set of PDEs is discretized over a given domain to yield a system of nonlinear equations, say F(x)=b, it is possible/easy to evaluate F(x) and its Jacobian F'(x) from my own code?
By access to the discretized problem you mean the mesh, base functions, etc.? It looks like you want to implement a new term actually.
I don't think I will need access to the mesh and basis functions just yet but that might be necessary in the future. Being able to evaluate what I naively described as F(x), F'(x) and b would be great for now. Second derivatives of the components of F would be a plus, but I realize that that might not be implemented in SfePy.
Correct, second derivatives are not implemented. F(x) and F'(x) is no problem, as long as there is a term corresponding to F, see [1].
On a similar topic, I presume it is sufficient to specify a value for the 'lin_solver' argument to a NonlinearSolver instance to "plug in" different linear system solvers to solve F(x)=b?! In order to make an educated choice, I would like to access and see the structure of the linear systems. Is there an example showing how this can be done?
Yes, it should be sufficient. You can get easily both the matrix and the right hand side by calling problem.evaluate() on your equations. I can show you how to do it, if that's what you need.
A simple example would be great to get me started. Thanks for offering! I do realize that I have to RTFM. I only wanted to be sure those things could be done before I invested more time and effort.
Actually, the newly added examples/linear_elasticity/linear_elastic_probes.py shows how to use problem.evaluate() (sort of). Also try to check the functions eval_term_op() and eval_term() to see which keyword arguments are available (especially 'dw_mode' which ciould be 'vector' or 'matrix' - basically that's all).
Finally, since SfePy allows for the solution of Stokes problems, I presume it is possible to obtain a mixed FEM discretization for a given set of PDEs?
Yes. For example, in examples/navier_stokes/navier_stokes.py we use P1B approximation for the velocity and P1 for the pressure. But keep in mind, that the choice of approximations is still rather limited...
I hope this answers some of your questions... keep asking.
Great. I will study the examples. Thanks much, Robert!
hth, r.
participants (2)
-
Dominique
-
Robert Cimrman