← Back to team overview

ffc team mailing list archive

Re: [question103102@xxxxxxxxxxxxxxxxxxxxx: Re: [Question #103102]: multiply spatial coordinates x in the variational formulation]

 

On Thursday 04 March 2010 11:48:03 Kristian Oelgaard wrote:
> On 4 March 2010 20:45, Anders Logg <logg@xxxxxxxxx> wrote:
> > On Thu, Mar 04, 2010 at 08:35:49PM +0100, Kristian Oelgaard wrote:
> >> On 4 March 2010 19:49, Anders Logg <logg@xxxxxxxxx> wrote:
> >> >Could you add a demo for this?
> >>
> >> Sure, to FFC, DOLFIN or both?
> >> The Poisson demo would be good to do because it has both dx and ds
> >> integrals.
> >>
> >> Kristian
> >
> > Both.
> >
> > What would the Poisson demo look like with this feature?
> 
> element = FiniteElement("Lagrange", triangle, 1)
> 
> v = TestFunction(element)
> u = TrialFunction(element)
> 
> x = triangle.x[0]
> d_x = triangle.x[0] - 0.5
> d_y = triangle.x[1] - 0.5
> f = 10.0*exp(-(d_x*d_x + d_y*d_y) / 0.02)
> g = sin(5.0*x)
> 
> a = inner(grad(v), grad(u))*dx
> L = v*f*dx + v*g*ds

Cool!

Who needs Expressions when you can generate code for the above?

Johan

> What should we call the demo, and where do we put it in DOLFIN?
> 
> Kristian
> 
> > --
> > Anders
> >
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.9 (GNU/Linux)
> >
> > iEYEARECAAYFAkuQDc0ACgkQTuwUCDsYZdHIKwCffXYlQdeq+14pKrWhSAgtmTQn
> > C3YAnjmeSG75WfLojfI56pKQqzD/VDjO
> > =RHAJ
> > -----END PGP SIGNATURE-----
> 



Follow ups

References