bugpyFormex - Bugs: bug #45382, drawField gives wrong colors for...

 
 

bug #45382: drawField gives wrong colors for nodal fields

Submitted by:  gianluca de santis <gianlucadesi>
Submitted on:  Tue 23 Jun 2015 03:00:15 PM UTC  
 
Category: RenderingSeverity: 2 - Minor
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 23 Jun 2015 07:23:53 PM UTC, comment #2:

Sounds very reasonable. There is one catch though: the Field documentation states that the geometry can be a Formex or a Mesh.
Then using fld.geometry.elems would be problematic.

However, the Field defined on Formex seems to be not implemented (yet). A pyformex search for 'fieldtype' gives

Then the Formex field, if/when implemented should be, as already documented, only of type 'elemc' or 'elemn' (or other elem...).
As the Formex has no info about element coherence, it can not accept data on fused nodes. Thus it would be save to just test for the fieldtype 'node' and expect geometry.elems to exist.
Though we should watch out if we implement other data models.

Finally, there is already use of geometry.elems in the implementation of the Field.convert method. It is there twice: in the conversion from 'node' type to another, and the convert from another to 'node' type. By the same reasoning as above, it can not go wrong, if Formex does not have the 'node' in its
fieldtypes.

So I implemented this in c129817.
And added it to the FieldDraw example.

Benedict Verhegghe <bverheg>
Project Administrator
Tue 23 Jun 2015 03:12:46 PM UTC, comment #1:

In addition to nodal fields we could also the name of the field using drawtext on top of the color legend

gianluca de santis <gianlucadesi>
Project Member
Tue 23 Jun 2015 03:00:15 PM UTC, original submission:

In opengl.draw.py there is drawfield(), which is used in the example FieldDraw.py

The plot is wrong if the fld is nodal
You can see this replacing in the example:

drawField(M.getField('dist'))

One solution would be to let the drawfield() check what type of field (fld.fldtype) and if the fldtype is nodal:

draw(fld.geometry, color=cval[fld.geometry.elems])

gianluca de santis <gianlucadesi>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bverheg (Posted a comment)
  • -unavailable- added by gianlucadesi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 15 Sep 2015 02:44:01 PM UTCgianlucadesiStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1