In examples/large_deformation/hyperelastic.py a rotation by displacements is applied. By using a similar function the vectors defining the force couples could be defined for dw_surface_ltr (IMHO). Does it make sense?
r.
----- Reply message -----
From: "Andre Smit" <freev...(a)gmail.com>
To: <sfepy...(a)googlegroups.com>
Subject: Torque
Date: Sat, Dec 18, 2010 05:10
What is the best way to apply a torque load to a model?
--
Andre
--
You received this message because you are subscribed to the Google Groups "sfepy-devel" group.
To post to this group, send email to sfepy...(a)googlegroups.com.
To unsubscribe from this group, send email to sfepy-devel...(a)googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sfepy-devel?hl=en.
Hi,
I am thinking about decoupling the shape of a Field from the number of components of a Variable.
The current state of affairs is that the field shape defines the components of related variables, but in reality the FE base is always scalar, applied to each component of a vector variable separately. This is in contrast with truely vector FE spaces like the edge elements used for the Maxwell equations.
To fix that I propose:
1. For scalar FE approximations the field shape will ve 1 - this is for all examples we have.
2. Variable syntax will be changed to allow for the number of components.
Apart from the clean-up reasons, it will be IMHO easier to implement the edge elements then.
Opinions/ideas?
r.
Yes, the function should return a value of mu in each quadrature point. So the "fill" line initializes those values to a constant 1, which is then modified according to the strain, also evaluated in the quadrature points.
And all is for all quad. points, for all elements at once.
So essentialy, mu = tile(mu, n_element * n_qp)
I see that many more things need to be documented :)
r.
----- Reply message -----
From: "Andre Smit" <freev...(a)gmail.com>
To: <sfepy...(a)googlegroups.com>
Subject: material_nonlinearity example
Date: Mon, Dec 20, 2010 20:44
Robert
In the get_pars function you prepare the mu or val matrix:
if mode != 'qp': return
val = nm.empty((coors.shape[0], 1, 1), dtype=nm.float64)
val.fill(1e0)
I'm trying to make sense of this. Are you repeating the material parameter for each gauss point? So for example, for a quad, there are 4 gauss points and essentially mu = tile(mu,4) and reshaped?
a
On Mon, Dec 20, 2010 at 11:08 AM, Robert Cimrman <cimr...(a)ntc.zcu.cz> wrote:
On 12/20/10 17:45, Andre Smit wrote:
Robert - in the new example I notice you are not using presolve in the
solver definition or definition the history term for the displacement
variable:
'ls' : ('ls.scipy_direct', {
'presolve' : True
}),
presolve set to True means that, for linear problems ('problem' : 'linear' in newton configuration), the matrix is assembled and factorized before the time-stepping starts - the factors are then reused in each time step to quickly solve the linear systems.
It also assumes that the matrix is the same in each time step - this is not the case here, as 'mu' changes... So presolve does not have sense in this example.
variables = {
'u' : ('unknown field', 'displacement', 0., 'previous'),
'v' : ('test field', 'displacement', 'u'),
}
but consistently used these for other time step problems. Any reason? This
really emphasizes my lack of understanding of the internals.
For linear problems with constant matrix, the most efficient would be:
solvers = {
'ls' : ('ls.scipy_direct',
{'presolve' : True
}),
'newton' : ('nls.newton',
{ 'i_max' : 1,
'eps_a' : 1e-10,
'eps_r' : 1.0,
'problem' : 'linear'}),
'ts' : ('ts.simple',
{'t0' : 0.0,
't1' : 1.0,
'dt' : None,
'n_step' : 5,
'quasistatic' : True, # or False
}),
}
I have just fixed a small bug with 'quasistatic' : True
r.
--
You received this message because you are subscribed to the Google Groups "sfepy-devel" group.
To post to this group, send email to sfepy...(a)googlegroups.com.
To unsubscribe from this group, send email to sfepy-devel...(a)googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sfepy-devel?hl=en.
--
Andre
--
You received this message because you are subscribed to the Google Groups "sfepy-devel" group.
To post to this group, send email to sfepy...(a)googlegroups.com.
To unsubscribe from this group, send email to sfepy-devel...(a)googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sfepy-devel?hl=en.
Robert - in the new example I notice you are not using presolve in the
solver definition or definition the history term for the displacement
variable:
'ls' : ('ls.scipy_direct', {
'presolve' : True
}),
variables = {
'u' : ('unknown field', 'displacement', 0., 'previous'),
'v' : ('test field', 'displacement', 'u'),
}
but consistently used these for other time step problems. Any reason? This
really emphasizes my lack of understanding of the internals.
--
Andre
Hi guys
I've generated an array comprising material D matrix or stiffness tensor
values. It looks like this - where each block represents the material value
for a cell or element (yes, they're all the same but will change in
subsequent time steps).
[[[ 1604.9382716 864.19753086 0. ]
[ 864.19753086 1604.9382716 0. ]
[ 0. 0. 370.37037037]]
[[ 1604.9382716 864.19753086 0. ]
[ 864.19753086 1604.9382716 0. ]
[ 0. 0. 370.37037037]]
[[ 1604.9382716 864.19753086 0. ]
[ 864.19753086 1604.9382716 0. ]
[ 0. 0. 370.37037037]]
...,
[[ 1604.9382716 864.19753086 0. ]
[ 864.19753086 1604.9382716 0. ]
[ 0. 0. 370.37037037]]
[[ 1604.9382716 864.19753086 0. ]
[ 864.19753086 1604.9382716 0. ]
[ 0. 0. 370.37037037]]
[[ 1604.9382716 864.19753086 0. ]
[ 864.19753086 1604.9382716 0. ]
[ 0. 0. 370.37037037]]]
I'd like to append this array to the vtk file generated by SfePy which
contains displacements, stress and strains, etc.
I was using the following to generate the array:
Dlist=[]
for i in range(NELS):
Dlist.append(pb.conf.materials.values()[i].values['D'])
Dmatrix=array(Dlist)
print "~~~~~~~~~~~~~~~~~~~~~~~~~~~"
print Dmatrix
Dstate=pb.create_state()
Dstate.set_full(Dmatrix)
outD=Dstate.create_output_dict()
out['D_matrix']=Struct(name='output_data',mode='cell',data=outD,dofs=None)
but get the following *numpy* error:
Traceback (most recent call last):
File "/home/grassy/sfepy/simple.py", line 120, in <module>
main()
File "/home/grassy/sfepy/simple.py", line 117, in main
app()
File "/home/grassy/sfepy/sfepy/applications/application.py", line 29, in
call_basic
return self.call( **kwargs )
File "/home/grassy/sfepy/sfepy/applications/simple_app.py", line 112, in
call
post_process_hook_final=self.post_process_hook_final)
File "/home/grassy/sfepy/sfepy/solvers/generic.py", line 216, in
solve_direct
nls_status=nls_status)
File "/home/grassy/sfepy/sfepy/solvers/generic.py", line 148, in
solve_evolutionary_op
ts=ts)
File "/home/grassy/sfepy/sfepy/fem/problemDef.py", line 535, in save_state
out = post_process_hook( out, self, state, extend = extend )
File "its.py", line 102, in strain_rate
outD=Dstate.create_output_dict()
File "/home/grassy/sfepy/sfepy/fem/state.py", line 188, in
create_output_dict
var_info, extend)
File "/home/grassy/sfepy/sfepy/fem/variables.py", line 587, in
state_to_output
fill_value=fill_value))
File "/home/grassy/sfepy/sfepy/fem/variables.py", line 1468, in
create_output
(self.n_dof / self.n_components, self.n_components))
File "/usr/lib/python2.7/site-packages/numpy/core/fromnumeric.py", line
170, in reshape
return reshape(newshape, order=order)
ValueError: total size of new array must be unchanged
Can I use existing SfePy methods to write this array to the vtk or should I
rather write my own?
--
Andre
Hi guys
Playing around with the dw_lin_elastic_th term. Unfortunately, no examples
for this one. I've pasted my code at [1]. I'm assuming the material
parameter H is similar to that for an isotropic material D. I'm getting a
'history error' as shown below. Any ideas?
Thx
[1] http://paste.pocoo.org/show/306024/
[grassy@myhost sfepy]$ ~/sfepy/simple.py nits.py
sfepy: left over: ['disp', 'verbose', '__builtins__', '_filename',
'__file__', '__name__', 'stress_strain', 'youngpoisson_to_lame', 'young',
'__package__', 'mesh_file', 'Mesh', 'stiffness_tensor_youngpoisson',
'poisson', '__doc__']
sfepy: reading mesh (/home/grassy/sfepy.wiki/msh/its2D.mesh)...
sfepy: ...done in 0.00 s
sfepy: setting up domain edges...
sfepy: ...done in 0.00 s
sfepy: creating regions...
sfepy: Top
sfepy: Bottom
sfepy: Omega
sfepy: Left
sfepy: ...done in 0.01 s
sfepy: equation "equilibrium":
sfepy:
dw_lin_elastic_iso.2.Omega(asphalt.lam,asphalt.mu,v,u)+
dw_lin_elastic_th.2.Omega(ts,asphalt.D,v,du/dt)=0
sfepy: setting up dof connectivities...
sfepy: ...done in 0.00 s
sfepy: using solvers:
ts: ts
nls: newton
ls: ls
sfepy: ====== time 0.000000e+00 (step 1 of 10) =====
sfepy: updating variables...
sfepy: ...done
======================================================================
Displacement: -0.111111111111
sfepy: updating materials...
sfepy: asphalt
sfepy: ...done in 0.00 s
sfepy: matrix shape: (93, 93)
sfepy: assembling matrix graph...
sfepy: ...done in 0.00 s
sfepy: matrix structural nonzeros: 1063 (1.23e-01% fill)
sfepy: nls: iter: 0, residual: 1.015969e+02 (rel: 1.000000e+00)
sfepy: rezidual: 0.00 [s]
sfepy: solve: 0.00 [s]
sfepy: matrix: 0.01 [s]
sfepy: nls: iter: 1, residual: 7.768306e-14 (rel: 7.646202e-16)
sfepy: equation "tmp":
sfepy: de_cauchy_strain.2.Omega(u)
sfepy: equation "tmp":
sfepy: de_cauchy_stress.2.Omega(asphalt.D,u)
sfepy: ====== time 1.111111e-01 (step 2 of 10) =====
sfepy: updating variables...
sfepy: ...done
======================================================================
Displacement: -0.222222222222
sfepy: updating materials...
sfepy: asphalt
sfepy: ...done in 0.00 s
history update!
Traceback (most recent call last):
File "/home/grassy/sfepy/simple.py", line 120, in <module>
main()
File "/home/grassy/sfepy/simple.py", line 117, in main
app()
File "/home/grassy/sfepy/sfepy/applications/application.py", line 29, in
call_basic
return self.call( **kwargs )
File "/home/grassy/sfepy/sfepy/applications/simple_app.py", line 112, in
call
post_process_hook_final=self.post_process_hook_final)
File "/home/grassy/sfepy/sfepy/solvers/generic.py", line 216, in
solve_direct
nls_status=nls_status)
File "/home/grassy/sfepy/sfepy/solvers/generic.py", line 138, in
solve_evolutionary_op
for ts, state in time_solver( state0 ):
File "/home/grassy/sfepy/sfepy/solvers/ts.py", line 118, in __call__
state = step_fun( self.ts, state0, *step_args )
File "/home/grassy/sfepy/sfepy/solvers/generic.py", line 116, in
time_step_function
state = problem.solve(state0=state0)
File "/home/grassy/sfepy/sfepy/fem/problemDef.py", line 799, in solve
vec = solvers.nls(vec0)
File "/home/grassy/sfepy/sfepy/solvers/nls.py", line 183, in __call__
vec_r = fun( vec_x )
File "/home/grassy/sfepy/sfepy/fem/evaluate.py", line 25, in eval_residual
vec_r = pb.equations.eval_residuals(vec)
File "/home/grassy/sfepy/sfepy/fem/equations.py", line 510, in
eval_residuals
self.evaluate(mode='weak', dw_mode='vector', asm_obj=residual)
File "/home/grassy/sfepy/sfepy/fem/equations.py", line 495, in evaluate
asm_obj=asm_obj)
File "/home/grassy/sfepy/sfepy/fem/equations.py", line 674, in evaluate
ret_status=True)
File "/home/grassy/sfepy/sfepy/terms/terms.py", line 1258, in evaluate
**kwargs):
File "/home/grassy/sfepy/sfepy/terms/terms_base.py", line 81, in _call
for ii, fargs in iter_kernel():
File "/home/grassy/sfepy/sfepy/terms/termsLinElasticity.py", line 179, in
iter_kernel
state=state, get_vector=self.get_vector)
File "/home/grassy/sfepy/sfepy/terms/cache.py", line 233, in __call__
out = self._call(key, term, ih, **kwargs)
File "/home/grassy/sfepy/sfepy/terms/cache.py", line 215, in _call
self.update(key, term, ih, **kwargs)
File "/home/grassy/sfepy/sfepy/terms/cachesBasic.py", line 92, in update
print kwargs['history']
KeyError: 'history'
--
Andre
Hi,
you may have noticed that http://sfepy.org, that should point to [1], either
does not work, or points to the main google site. That's because something
changed, and my old DNS settings (ip 69.56.173.218) do not work anymore.
I have tried changing the ip to 209.85.227.100 which is what I found to be the
new ip of code.google.com (one of many), but that just redirects to google.com.
Is there anyone experienced more with those issues around?
r.
[1] http://code.google.com/p/sfepy/
With the code at [1] I was hoping to retrieve the number of elements from
the mesh to use in the problem definition. I'm running into problems - seems
mesh_hook isn't processed early enough to define NELS and although mesh_hook
reads the mesh from file it fails with this error:
grassy@x sfepy]$ ~/sfepy/simple.py its.py
sfepy: left over: ['disp', 'young', '__builtins__', 'youngpoisson_to_lame',
'mesh_file', 'poisson', '_filename', 'Eq', 'NELS', 'verbose', '__doc__',
'i', 'mesh_hook', '__package__', 'stiffness_tensor_youngpoisson',
'__file__', '__name__']
sfepy: reading mesh (function:mesh_hook)...
sfepy: reading mesh (/home/grassy/sfepy.wiki/msh/its2D.mesh)...
sfepy: ...done in 0.01 s
sfepy: ...done in 0.01 s
Traceback (most recent call last):
File "/home/grassy/sfepy/simple.py", line 120, in <module>
main()
File "/home/grassy/sfepy/simple.py", line 113, in main
app = SimpleApp( conf, options, output_prefix )
File "/home/grassy/sfepy/sfepy/applications/simple_app.py", line 71, in
__init__
**kwargs)
File "/home/grassy/sfepy/sfepy/fem/problemDef.py", line 70, in from_conf
mesh = Mesh.from_file(conf.filename_mesh, prefix_dir=conf_dir)
File "/home/grassy/sfepy/sfepy/fem/mesh.py", line 323, in from_file
mesh._set_shape_info()
File "/home/grassy/sfepy/sfepy/fem/mesh.py", line 454, in _set_shape_info
self.n_nod, self.dim = self.coors.shape
AttributeError: 'Mesh' object has no attribute 'coors'
Any suggestions on a workaround?
thx
[1] http://paste.pocoo.org/show/305010/
--
Andre