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

2010-09-17 Thread Johan Hake
On Thursday September 16 2010 21:19:24 Harish Narayanan wrote:
> On 9/17/10 3:25 AM, Johan Hake wrote:
> >> 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...
> >>> 
> >>> Anders is talking about the area of Face/Facet of a 2D mesh which is
> >>> where this discussion originated from.
> >>> 
> >>> Kristian
> >> 
> >> I agree it might be confusing. Perhaps measure() and
> >> boundary_measure() would work?
> 
> The above, for me, would really be a lot less ambiguous.
> 
> > What whith:
> >   measure(std::string type)
> > 
> > which then takes a "volume", "area", or "length" argument together with
> > an optional MeshFunction and subdomain?
> 
> This would likely just reintroduce the problem. The original concern
> here seems to have stemmed from the contextual meaning of word "area."

The point with passing a string of what you want is that you then can check 
what topology the mesh has and return exactly what the user ask for. 

The method is not dimension independent though.

  mesh.measure("area")

would mean two different things for a 2D and 3D mesh, where the first one 
gives that area of the cells, and the second one the area of the facets.

Johan

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Harish Narayanan
On 9/17/10 3:25 AM, Johan Hake wrote:
>> 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...
>>>
>>> Anders is talking about the area of Face/Facet of a 2D mesh which is
>>> where this discussion originated from.
>>>
>>> Kristian
>>
>> I agree it might be confusing. Perhaps measure() and
>> boundary_measure() would work?

The above, for me, would really be a lot less ambiguous.

> What whith:
> 
>   measure(std::string type)
> 
> which then takes a "volume", "area", or "length" argument together with an 
> optional MeshFunction and subdomain?

This would likely just reintroduce the problem. The original concern
here seems to have stemmed from the contextual meaning of word "area."

Harish

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Johan Hake
On Thursday September 16 2010 14:40:12 Anders Logg wrote:
> On Thu, Sep 16, 2010 at 11:13:01PM +0200, Kristian Ølgaard wrote:
> > On 16 September 2010 22:45, Johan Hake  wrote:
> > > 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...
> > 
> > Anders is talking about the area of Face/Facet of a 2D mesh which is
> > where this discussion originated from.
> > 
> > Kristian
> 
> I agree it might be confusing. Perhaps measure() and
> boundary_measure() would work?

What whith:

  measure(std::string type)

which then takes a "volume", "area", or "length" argument together with an 
optional MeshFunction and subdomain?

Johan

> --
> Anders

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Anders Logg
On Thu, Sep 16, 2010 at 11:13:01PM +0200, Kristian Ølgaard wrote:
> On 16 September 2010 22:45, Johan Hake  wrote:
> > 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...
>
> Anders is talking about the area of Face/Facet of a 2D mesh which is
> where this discussion originated from.
>
> Kristian

I agree it might be confusing. Perhaps measure() and
boundary_measure() would work?

--
Anders

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Johan Hake
On Thursday September 16 2010 14:13:01 Kristian Ølgaard wrote:
> On 16 September 2010 22:45, Johan Hake  wrote:
> > 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...
> 
> Anders is talking about the area of Face/Facet of a 2D mesh which is
> where this discussion originated from.

I think he here talks aout the area of a mesh. Asking for the area of a 
subdomain of that mesh would give me a length. I think that is strange, but I 
might get used to it ;)

I think the area of a facet is different. Because it has codimension of -1 and 
follows the topology of the mesh. I realise that this argumentation can be 
used for a mesh too. But it would be strange to for example calculate the 
volume of a 2D mesh, when you actually mean the area.

The area of a face is always _the_ area as it always has a topology of 2.

Johan


> Kristian
> 
> > Johan
> > 
> >> --
> >> Anders
> > 
> > ___
> > Mailing list: https://launchpad.net/~dolfin
> > Post to : dolfin@lists.launchpad.net
> > Unsubscribe : https://launchpad.net/~dolfin
> > More help   : https://help.launchpad.net/ListHelp

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Kristian Ølgaard
On 16 September 2010 22:45, Johan Hake  wrote:
> 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...

Anders is talking about the area of Face/Facet of a 2D mesh which is
where this discussion originated from.

Kristian

> Johan
>>
>> --
>> Anders
>
> ___
> Mailing list: https://launchpad.net/~dolfin
> Post to     : dolfin@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dolfin
> More help   : https://help.launchpad.net/ListHelp
>

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Johan Hake
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

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Anders Logg
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.

--
Anders

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Johan Hake
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?

Johan

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Garth N. Wells



On 16/09/10 21:15, 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;



That would be helpful.

Garth



--
Anders

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Anders Logg
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;

--
Anders

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Johan Hake
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

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Anders Logg
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?

> 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. ;-)

--
Anders

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Johan Hake
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. 

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 :)

Johan

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Anders Logg
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.

--
Anders

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Johan Hake
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!

Johan

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Anders Logg
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.

> 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.

--
Anders


> Johan
>
> On Thursday September 16 2010 08:21:30 nore...@launchpad.net wrote:
> > 
> > revno: 5202
> > committer: Johan Hake 
> > branch nick: dolfin
> > timestamp: Thu 2010-09-16 08:17:33 -0700
> > message:
> >   Added area to Face.
> > modified:
> >   dolfin/mesh/Face.cpp
> >   dolfin/mesh/Face.h
> >
> >
>
> ___
> Mailing list: https://launchpad.net/~dolfin
> Post to : dolfin@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dolfin
> More help   : https://help.launchpad.net/ListHelp

--
Anders

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp


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

2010-09-16 Thread Johan Hake
Hello!

I added the method area to the Face class. I guess a Face is always a triangle 
so it should be safe. There might be other methods that can be usefull like 
normal? Others?

Should we do the same for Facet, but then check for topological dimension 
before making the computation, a la the generalized volume in CellTypes?

Johan

On Thursday September 16 2010 08:21:30 nore...@launchpad.net wrote:
> 
> revno: 5202
> committer: Johan Hake 
> branch nick: dolfin
> timestamp: Thu 2010-09-16 08:17:33 -0700
> message:
>   Added area to Face.
> modified:
>   dolfin/mesh/Face.cpp
>   dolfin/mesh/Face.h
> 
> 
> --
> lp:dolfin
> https://code.launchpad.net/~dolfin-core/dolfin/main
> 
> Your team DOLFIN Core Team is subscribed to branch lp:dolfin.
> To unsubscribe from this branch go to
> https://code.launchpad.net/~dolfin-core/dolfin/main/+edit-subscription

___
Mailing list: https://launchpad.net/~dolfin
Post to : dolfin@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dolfin
More help   : https://help.launchpad.net/ListHelp