← Back to team overview

dolfin team mailing list archive

Re: unit vectors in FFC?

 

On Thu, Jun 12, 2008 at 2:37 PM, Anders Logg <logg@xxxxxxxxx> wrote:
> On Wed, Jun 11, 2008 at 08:11:56AM -0400, mspieg wrote:
>> Hi all,
>>   is there a simple way to implement a known constant vector (e.g. the unit
>> vector jhat = [ 0 1]') into a FFC form?
>>
>> my specific  issue is that the right hand side of my PDE looks like
>>
>> -\Div f\jhat = - df/dy
>>
>> where f(x,y) is a user defined scalar function (and df/dy is not easily
>> evaluated)
>>
>> Given a test function v, the weak form (in pseudo-latex) is
>>
>> \int dv/dy f dx - \int v f \jhat\dot ds
>>
>> The question is how to evaluate the 2nd term in the FFC form language (the
>> volume integral works fine as  v.dx(1)*f*dx)
>>
>> ideally something like
>>
>> jhat=??
>> L = v.dx(1)*f*dx) - v*f*jhat*ds
>>
>> (or more generally for a known unit vector k  L=dot(grad(v),k)*f*dx - v*f*k*ds
>> )
>>
>> would be nice (in the same way as simple known constants can be built in
>> directly)
>>
>> But I'm flexible...all help greatly appreciated
>> marc
>
> It looks like you expect ds to be a vector. It's not. It's a scalar.

But you can get the surface normal as a vector, right? I think that
is what Marc wants.

   Matt

> --
> Anders
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFIUXr4Qp2CVMGvcgcRAkzUAJ0RBgD/M3qTRMsLolrgGZa9twknawCferA+
> p4dCQdvQsKhVkRwvpFXHq6w=
> =SqMU
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/mailman/listinfo/dolfin-dev
>
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which
their experiments lead.
-- Norbert Wiener


Follow ups

References