Re: compute_nodal_normals and higher order elements

Cool!
I write from my phone, so I do not have the sources at hand, but I have a few remarks nevertheless:
to get nodes in a given region, you should use Field.get_dofs_in_region() as in tests/test_laplace_unit_disk.py, since region.all_vertices are just the vertex nodes, while higher order approximations have also edge, face, and bubble nodes depeding on order.
the same for connectivities and coordinates - those of the mesh contain just the mesh, you need field connectvities, coordinates: Field.aps[ig].econn, Field.coors, ig is the element group.
to get stress in nodes, look at sfepy primer by Andre. There is also Variable.data_from_qp(), used e.g. in schroedinger.py
I am no completely sure what your functions aim to do (docstrings :)), so that's my response for now, hope that helps.
r.
----- Reply message ----- From: "Peter M. Clausen" <petermich...@googlemail.com> To: <sfepy...@googlegroups.com> Subject: compute_nodal_normals and higher order elements Date: Tue, Mar 15, 2011 02:17
Hi again
I'm just playing around right now getting to know sfepy better - and I like it the more I see.
Attached is a hack of an simple Optimality Criteria method: Move nodes outward with large stress, inwards with low stress. Some first implementation of a simple mesh smoothing, which currently only works for inner nodes.
Then I wanted to check what happens with a 2nd degree field (Quadratic elements, right?). And here the compute_nodal_normals fails:
Traceback (most recent call last): File "../../simple.py", line 113, in <module> main() File "../../simple.py", line 110, in main app() File "/opt/sfepy/sfepy-release-2011.1_beta/sfepy/sfepy/applications/application.py", line 33, in call_parametrized for aux in generator: File "linear_elastic_tractions_beam_oc.py", line 179, in shape_oc normals = compute_nodal_normals(top_nodes, top_reg, disp_field) File "/opt/sfepy/sfepy-release-2011.1_beta/sfepy/sfepy/fem/utils.py", line 42, in compute_nodal_normals mask[econn] += 1 IndexError: index 582 out of bounds 0<=index<525
I guess the problem is the extra nodes appended due to the higher order elements, but I kind of get stuck in debugging the routine...
I am also not quite sure what to expect - I mean, the regions are 'simple' corner nodes, but I would actually like to also get the higher order nodes in the regions as well. Should I initialize the regions differently or ...?
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.
participants (1)
-
Robert Cimrman