![](https://secure.gravatar.com/avatar/2860f59d1e69ccc40824af495cfe62d0.jpg?s=120&d=mm&r=g)
Hi Robert
for equation in equations: for term in equation: out = evaluate element residuals or matrices assemble out into the residual vector or tangent matrix
Thanks, I'll look into that
Does this help? I see I should write an article about sfepy "architecture".
Yes, very indeed, but an architecture article would really help - keep it short and in overview form - I think then one knows in which routines / classes to dig into.
/Peter
2011/3/12 Robert Cimrman <cimr...@ntc.zcu.cz>:
Hi Peter,
the assembling works basically just like you wrote. It starts either by Equations.eval_residuals() or Equations.eval_tangent_matrices() and has the following structure:
for equation in equations: for term in equation: out = evaluate element residuals or matrices assemble out into the residual vector or tangent matrix
This is the same for both linear and nonlinear problems.
The matrix graph assembling serves only to preallocate the sparse matrix structure as governed by the element connectivity.
As for different load cases, your problem is static and linear, right? So the easiest way is to use an artficial time stepping and to change the load in each time step. If you set the 'problem' attribute of the nonlinear solver to 'linear', the matrix will be assembled and factorized before the time steps. Look at the time-dependent examples sfepy/diffusion/time_poisson.py or examples/linear_elasticity/linear_elastic/dynamic.py.
Another possibility is to write the loading loop yourself using sfepy as a library. This is much more powerful as it allows you to do anything you need (if it is implemented), but you need to know what you are doing...
Does this help? I see I should write an article about sfepy "architecture".
r.
----- Reply message ----- From: "Peter M. Clausen" <petermich...@googlemail.com> To: <sfepy...@googlegroups.com> Subject: Sensitivity calculation with sfepy Date: Sat, Mar 12, 2011 14:35
Hi
My objective is to survey different methods of sensitivity calculation w.r.t. geometry changes (shape and topology optimization) and after looking into many open source FE-codes I believe that Sfepy might be the right choice for me - I love Python, but I am not sure I really grasp the whole structure of Sfepy. I am a structural mechanics guy so I'm starting out with the easiest for me - a simple beam with a traction load.
I am going to ask a lot of questions in the near future. I hope the questions are not too stupid...
- Structure of Sfepy
1.1. Debugging in Eclipse I found it very helpfull to debug in eclipse. I found it pretty easy to set up (on Ubuntu 10.04 at least).
1.2. Setting up the system matrix I am used to classic structural FE-codes where the typical setup (simplified) is: forall elements: ... setup element matrix insert in system matrix ...
Now, in sfepy I cant really figure out where this element loop is, probably not really there. Of course I assume the 'assembling matrix graph...' is pretty much what I am looking for, but I dont really get it. Any explanation or reference would help me.
- More loadcases (different tractions)
I want to use adjoint sensitivity calculation where I need to solve the system once more with a different load (or even a couple of times). What is the easiest way to add loads? In first implementation performance is not really important, but the beautiful solution is of course to keep the inverted system matrix and simply solve for a new right hand side.
Thanks
Best regards
Peter
-- You received this message because you are subscribed to the Google Groups "sfepy-devel" group. To post to this group, send email to sfepy...@googlegroups.com. To unsubscribe from this group, send email to sfepy-devel...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sfepy-devel?hl=en.
-- You received this message because you are subscribed to the Google Groups "sfepy-devel" group. To post to this group, send email to sfepy...@googlegroups.com. To unsubscribe from this group, send email to sfepy-devel...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sfepy-devel?hl=en.
--
-><-><-><-><-><-><-><- Peter Michael Clausen Hirsch Str. 162 76137 Karlsruhe Deutschland petermich...@gmail.com +49 721 161 38 32 +49 151 20 46 82 59 -><-><-><-><-><-><-><-