misleading Cell::diameter()

Bug #1132490 reported by Jan Blechta
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
DOLFIN
New
Undecided
Unassigned

Bug Description

Cell::diameter() returns two times circumradius. I think correct way would be to return length of a longest edge (for simplices) as it is consistent with a normal use of term "diameter" in mathematics, see http://mathworld.wolfram.com/GeneralizedDiameter.html. Presently implemented diameter can return arbitrarily large values as cells' true diameter remains bounded.

This issue is related to bug 1082157 and bug 948379.

I think changing Cell::diameter() to the length of a longest edge (and moving the existing computation to Cell::circumradius()) would solve all isssues of this kind and prevent some confussion in a future. I would take care of this in case of agreement.

EDIT: Warning: as this kind of change or similiar is done CellType::radius_ratio() implementtation needs updating as it assumes that diameter() returns 2.*circumradius!

Jan Blechta (blechta)
description: updated
Revision history for this message
Nico Schlömer (nschloe) wrote :

If it's confusing, the function name 'diameter' should probably be banned entirely, and replaced by "circumradius()" and "max_edge()" or similar.

Revision history for this message
Jan Blechta (blechta) wrote : Re: [Bug 1132490] Re: misleading Cell::diameter()

On Tue, 19 Mar 2013 18:17:05 -0000
Nico Schlömer <email address hidden> wrote:
> If it's confusing, the function name 'diameter' should probably be
> banned entirely, and replaced by "circumradius()" and "max_edge()" or
> similar.
>

That's probably not good idea as function diameter() is used in working
DG codes.

For clarification I suggest that diameter() would calculate a quantity
which we call diameter in mathematics (that would be max edge length
for simplices). Existing calculation of diameter of a circumscribed
sphere would be moved to new function called circumradius().

What I consider confusing is that diameter() calculates a quantity
which can be arbitrarily larger than diameter!

Still, I'm waiting for some response to start a work.

Jan

description: updated
Jan Blechta (blechta)
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.