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