bugpyFormex - Bugs: bug #39098, duplicate usage of...

 
 

bug #39098: duplicate usage of attribute/function areas

Submitted by:  Wouter Devriendt <whdvrien>
Submitted on:  Tue 28 May 2013 01:34:41 PM UTC  
 
Category: PluginsSeverity: 3 - Normal
Item Group: Functionality errorStatus: Fixed
Privacy: PublicAssigned to: Benedict Verhegghe <bverheg>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 29 May 2013 08:00:33 PM UTC, comment #3:

Fixed in da15174:

TriSurface.area -> TriSurface._area
TriSurface.facetArea -> TriSurface.areas

Mesh.volume = self.toSurface().volume()

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Wed 29 May 2013 08:57:59 AM UTC, comment #2:

I take the occasion for 1 remark:

TriSurface.volume() is much much faster than Mesh.volume().

Mesh.volume() sums the Mesh.volumes(), going through every single element. TriSurface.volume() just consider the volume inside the border.

On a volume mesh if you do:

TriSurface(Mesh.getBorderMesh().convert('tri3')).volume()

you get the result immediately (and with low memory usage)

If you would try

Mesh.volume()
you would need to wait a very long time.

I agree that mesh.py should not depend on trisurface.py, but should Mesh.volume() use the border surface and not all elements?

gianluca de santis <gianlucadesi>
Project Member
Wed 29 May 2013 08:09:33 AM UTC, comment #1:

Well, you can just use

or

But I agree that it is confusing to have M.areas() for a Mesh and T.areas for a TriSurface. So we should probably change it. Maybe by using an attribute _areas in TriSurface and making areas() a property method (because T.areas is used in so many places).
And if we do so, should we also turn lengths(), volumes() etc into property methods.
Or shall we just use normal methods for all, and convert all existing code?

Benedict Verhegghe <bverheg>
Project AdministratorIn charge of this item.
Tue 28 May 2013 01:34:41 PM UTC, original submission:

When initializing a trisurface, self.areas is defined (default = None), while at the same time TriSurface (inherited from Mesh) also has a function areas(self), which calculates the areas of all elements.
As a result, the function cannot be used anymore.

Example:

Wouter Devriendt <whdvrien>
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 gianlucadesi (Posted a comment)
  • -unavailable- added by bverheg (Posted a comment)
  • -unavailable- added by whdvrien (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 29 May 2013 08:00:33 PM UTCbverhegStatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
    Wed 29 May 2013 08:09:33 AM UTCbverhegStatusNone=>Need Info
      Assigned toNone=>bverheg
      Summaryduplicate usage of keyword/function areas=>duplicate usage of attribute/function areas

    Back to the top


    Powered by Savane 3.1-cleanup1