dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #19749
Re: [Branch ~dolfin-core/dolfin/main] Rev 5202: Added area to Face.
On Thursday September 16 2010 13:33:03 Anders Logg wrote:
> On Thu, Sep 16, 2010 at 01:27:07PM -0700, Johan Hake wrote:
> > On Thursday September 16 2010 13:15:51 Anders Logg wrote:
> > > On Thu, Sep 16, 2010 at 01:10:55PM -0700, Johan Hake wrote:
> > > > 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 :)
> > >
> > > Perhaps we could have
> > >
> > > double::Mesh::area(const FacetFunction& boundary_markers, uint
> > > boundary)
> > >
> > > const;
> >
> > +
> >
> > Why not add a volume method while at it? Maybe we should let these be
> > free functions as it does not always make sense to get an area or volume
> > of a mesh?
>
> I don't know what the dimension-independent terms are but most people
> would probably accept "area" as meaning the length of the boundary of
> a 2D domain.
If I had a 2D mesh and it had a method area, I would definetly think that it
would return the area of that mesh. But that might be just me...
Johan
>
> --
> Anders
Follow ups
References