dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #19869
Re: [Question #128351]: making a vector fields with previous solution
On Friday October 8 2010 00:12:26 Anders Logg wrote:
> Question #128351 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/128351
>
> Status: Open => Answered
>
> Anders Logg proposed the following answer:
>
> On Thu, Oct 07, 2010 at 08:01:27PM -0000, Sungick Kim wrote:
> > New question #128351 on DOLFIN:
> > https://answers.launchpad.net/dolfin/+question/128351
> >
> > Let 'u' be a scalar nodal value.
> > Now I want to construct a nodal vector field as below.
> >
> > velocity = Expression(('u', '0.0', '0.0'))
> >
> > There comes no error related this.
> > However, it seems that velocity = (0,0,0) all throughout domain.
> > Can anyone help me to know the right way to do this?
>
> Have you set the value of u?
I am not exactly sure what you want to do, but if you just have a scalar
value, you need to initilize u in your Expression.
This can be done in two ways:
velocity = Expression(('u', '0.0', '0.0'), {'u':value})
or
velocity = Expression(('u', '0.0', '0.0'))
velocity.u = value
There are no errors because u is initialized to Zero. Take a look in the
docstring of Expression.
Johan
Follow ups
References