Direct solver without recalculating matrix factorization
Hello, I'm very new to sfepy and therefore it's being a bit hard to find in the documentation a solution to my problem, which first of all I would like to know if it is solvable within sfepy.
I'm solving the elastic equilibrium equations, which I need to solve many times during a single program run. However, in between calls to the solver, only the RHS of the FEM formulation is changing, i.e. the body forces or Neumann conditions. As in this case the stiffness matrix is constant, I would like to use a direct solver (e.g. umfpack) to calculate the matrix factorization (i.e. setup the solver) only once, an then simply call the solver many times with different body forces. I would really appreciate if some of you could point me in the right direction, or provide me with a couple of lines of code showing how this can be (more or less) achieved with this really nice module.
Thank very much!
Hello David,
On 12/04/2017 03:01 PM, David Fernández wrote:
Hello, I'm very new to sfepy and therefore it's being a bit hard to find in the documentation a solution to my problem, which first of all I would like to know if it is solvable within sfepy.
I'm solving the elastic equilibrium equations, which I need to solve many times during a single program run. However, in between calls to the solver, only the RHS of the FEM formulation is changing, i.e. the body forces or Neumann conditions. As in this case the stiffness matrix is constant, I would like to use a direct solver (e.g. umfpack) to calculate the matrix factorization (i.e. setup the solver) only once, an then simply call the solver many times with different body forces. I would really appreciate if some of you could point me in the right direction, or provide me with a couple of lines of code showing how this can be (more or less) achieved with this really nice module.
Yes, this could be done basically in two ways: either modify one of the nonstationary examples with a timestepper (e.g. [1]) where you set the option
'quasistatic' : True,
for the 'ts.simple' timestepper, and the option
'is_linear' : True,
for the 'nls.newton' nonlinear solver and the option
'presolve' : True,
for the 'ls.scipy_direct' linear solver. this will result in prefactorization of the matrix before the first time step, and reuse of the factors in all the time steps.
The other way is to take a script such as [2] and modify it as needed.
Feel free to ask more. Cheers, r.
[1] http://sfepy.org/docdevel/examples/diffusion/time_advection_diffusion.html [2] http://sfepy.org/docdevel/examples/linear_elasticity/linear_elastic_interac...
participants (2)

David Fernández

Robert Cimrman