I have overhauled the script, so that there are no globals, subiterations can be ended as needed etc. The traction() function is removed, the loading displacement is given simply by value. I hope it does what you intended.
It needs a patch to TimeStepper, that I will be able to upload first on Monday, so either just look at it, or fix it yourself... :)
On Wed, 19 Jan 2011, Andre Smit wrote:
I would use brute force:Robert - I'm trying to change the displacement (disp) in the traction
function when the force stabilizes but for some reason the scope of disp
within traction() appears different to that within calc_force(), even
though disp is defined as global. Any ideas?
old_force = 0
def calc_force(pb, ts, state):
d = state()
f = pb.evaluator.eval_residual(d)
f.shape = (pb.domain.mesh.n_nod, 3)
p = 
for n in pb.domain.regions['Top'].vertices:
p = nm.array(p)
if abs(old_force-p.sum()) < fvar:
disp -= ddisp
def traction(ts, coors, bc=None):
#disp = -(ts.dt*(ts.step+1))
print "traction disp: ", disp
val = nm.empty_like(coors[:,0])
globals()['disp'] = ...
You cannot really change value of a global that is immutable (IMHO)...
A common idiom is to use list instead, like:
disp = disp = ...
def traction(ts, coors, bc=None):That might be the problem causing the oscillations...
What is the meaning of 'smix' stiffness, for strain rate
I'm not sure.
--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.