← Back to team overview

dolfin team mailing list archive

Re: [Branch ~dolfin-core/dolfin/main] Rev 5202: Added area to Face.

 

On Thursday September 16 2010 13:03:44 Anders Logg wrote:
> On Thu, Sep 16, 2010 at 12:51:28PM -0700, Johan Hake wrote:
> > On Thursday September 16 2010 12:27:57 Anders Logg wrote:
> > > On Thu, Sep 16, 2010 at 12:23:48PM -0700, Johan Hake wrote:
> > > > On Thursday September 16 2010 11:46:02 Anders Logg wrote:
> > > > > On Thu, Sep 16, 2010 at 11:24:34AM -0700, Johan Hake wrote:
> > > > > > Hello!
> > > > > > 
> > > > > > I added the method area to the Face class. I guess a Face is
> > > > > > always a triangle so it should be safe.
> > > > > 
> > > > > Yes.
> > > > 
> > > > ok
> > > > 
> > > > > > There might be other methods that can be usefull like
> > > > > > normal? Others?
> > > > > 
> > > > > Probably but can't think of any more right now.
> > > > > 
> > > > > > Should we do the same for Facet, but then check for topological
> > > > > > dimension before making the computation, a la the generalized
> > > > > > volume in CellTypes?
> > > > > 
> > > > > Facet should have normal but not area.
> > > > 
> > > > I wont add these now. I first thought they were straight forward, but
> > > > all kindoff R^1, R^2, R^3 stuff needs to be checked for. Leave it
> > > > for now...
> > > > 
> > > > Added a blueprint!
> > > 
> > > I thought I already did that. We have Cell.normal() which should
> > > handle that.
> > 
> > That just calls normal of TriangleCell or TetrahedronCell. TriangleCell
> > only returns a normal for topological dimension 2.
> 
> Isn't that enough? What else do you need?

For a Face I need to check if it is in R^2 or R^3.

> > It is really not difficult, it just took some more time than I
> > anticipated, and I do not need the feature. I just needed area :)
> 
> Oh so you didn't need anything else. ;-)

Nope! Not for the moment.

But now it is at least straight forward to iterate over faces of a 3D mesh and 
calculate the area of a certain boundary domain given by a MeshFunction :)

Johan



Follow ups

References