← Back to team overview

ufl team mailing list archive

Re: coordinate

 

On Sun, Jul 18, 2010 at 08:30:27PM +0100, Kristian Oelgaard wrote:
> On 18 July 2010 20:14, Anders Logg <logg@xxxxxxxxx> wrote:
> > On Sun, Jul 18, 2010 at 08:01:28PM +0100, Garth N. Wells wrote:
> >>
> >>
> >> On 18/07/10 19:57, Anders Logg wrote:
> >> >On Fri, Jul 16, 2010 at 07:48:05PM +0100, Garth N. Wells wrote:
> >> >>I'm not keen on 'x' for the spatial coordinate when it's imported
> >> >>into DOLFIN (just asking for bugs). I would prefer something like
> >> >>
> >> >>     x = SpatialCoordinate()
> >> >
> >> >Yes, perhaps. But isn't this just as good or bad as the default
> >> >indices i, j, k etc which are automatically imported?
> >> >
> >>
> >> I would say that's it a little bit worse. x is not commonly used in
> >> forms as a coordinate, but it commonly used for other things
> >> (vectors, mesh coordinates). Since x is uncommon in forms, I removed
> >> it.
> >
> > Good point, but we should make sure that x = SpatialCoordinate()
> > works.
>
> It will, actually the methods:
>
> cell.n
> cell.x
> cell.volume
> cell.circumradius
>
> are attached as:
> self.x = SpatialCoordinate(self)
> etc.
> insided Cell.
>
> So in a form you can do:
>
> volume = CellVolume(triangle)
> or
> volume = triangle.volume
>
> Kristian

ok, great. Nothing to do then (except maybe adding cell.diameter and
set it to be the longest edge).

--
Anders

Attachment: signature.asc
Description: Digital signature


References