
I'm getting the following error on my input file:
grassy@lapdog:~/sfepy$ ./simple.py ~/pyfem/its2D.py sfepy: left over: ['_filename', '__builtins__', '__file__', '__name__', '__package__', 'youngpoisson_to_lame', 'filename', 'stress_strain', 'stiffness_tensor_youngpoisson', 'output_dir', 'get_pars', '__doc__'] Traceback (most recent call last): File "./simple.py", line 106, in <module> main() File "./simple.py", line 95, in main conf = ProblemConf.from_file( filename_in, required, other ) File "/home/grassy/sfepy/sfepy/base/conf.py", line 249, in from_file obj.setup( define_dict, funmod, filename, required, other ) File "/home/grassy/sfepy/sfepy/base/conf.py", line 287, in setup self.transform_input() File "/home/grassy/sfepy/sfepy/base/conf.py", line 372, in transform_input self.__dict__[key] = transform( self.__dict__[key] ) File "/home/grassy/sfepy/sfepy/base/conf.py", line 142, in transform_materials d2['material_'+conf['name']] = c2 KeyError: 'name'
The model is posted here: http://groups.google.com/group/sfepy-devel/web/its2D.vtk?hl=en
Can someone see the problem?
Here's its2D.py:
# 02.04.2010 # Diametrically point loaded disk.
from sfepy.mechanics.matcoefs import youngpoisson_to_lame, stiffness_tensor_youngpoisson
filename = 'its2D.vtk' output_dir = 'pyfem' filename_mesh = filename
def get_pars(young, poisson, dim, plane = 'strain', full = False): if full: return stiffness_tensor_youngpoisson(dim, young, poisson, plane) else: lam,mu=youngpoisson_to_lame(young, poisson, plane) return lam,mu
def stress_strain(out, pb, state, extend = False): ''' Strain and stress for given displacements. ''' from sfepy.base.base import Struct from sfepy.fem.evaluate import eval_term_op strain = eval_term_op(state, 'de_cauchy_strain.i1.Omega(u)', pb) out['cauchy_strain'] = Struct(name = 'output_data', mode = 'cell', data = strain, dofs = None) stress = eval_term_op(state, 'de_cauchy_stress.i1.Omega(solid.D, u)', pb) out['cauchy_stress'] = Struct(name = 'output_data', mode = 'cell', data = stress, dofs = None) return out
options = { 'output_dir' : output_dir, 'output_format' : 'vtk', 'post_process_hook' : 'stress_strain', }
regions = { 'Omega' : ('all', {}), 'Left' : ('nodes in (x < 0.001)', {}), 'Bottom' : ('nodes in (y < 0.001)', {}), 'Top' : ('node 2', {}), }
materials = { 'name' : 'solid', 'region' : 'Omega', 'values' : { 'lam' : get_pars(2000., 0.4, 2, 'stress')[0], 'mu' : get_pars(2000., 0.4, 2, 'stress')[1], 'D' : get_pars(2000., 0.4, 2, 'stress', full = True), 'density' : 0.2500, # in 1e4 kg/m3 }, 'flags' : {'special_constant' : True}, }
fields = { 'displacement': ((2,1), 'real', 'Omega', {'Omega' : '2_3_P1'}), }
integrals = { 'i1' : ('v', 'gauss_o3_d2'), }
variables = { 'u' : ('unknown field', 'displacement', 0), 'v' : ('test field' , 'displacement', 'u'), }
ebcs = { 'XSym' : ('Left', {'u.0' : 0.0}), 'YSym' : ('Bottom', {'u.1' : 0.0}), 'Load' : ('Top', {'u.0' : 0.0, 'u.1' : -0.5}), }
equations = { 'balance_of_forces' : """dw_lin_elastic_iso.i1.Omega(solid.lam, solid.mu, v, u ) = 0""", }
solvers = { 'ls' : ('ls.scipy_direct', {}), 'newton' : ('nls.newton', { 'i_max' : 1, 'eps_a' : 1e-6, 'problem' : 'nonlinear'}), }
fe = { 'chunk_size' : 10000 }
Andre