← Back to team overview

dolfin team mailing list archive

Re: [Question #152914]: onedimensional derivatives

 

Question #152914 on DOLFIN changed:
https://answers.launchpad.net/dolfin/+question/152914

    Status: Open => Answered

Martin Sandve Alnæs proposed the following answer:
Change grad(T) to T.dx(0), i.e. derivative in a single direction.

Maybe we should make grad work like .dx(0) in 1D.

Martin


On 15 April 2011 10:46, Bento <question152914@xxxxxxxxxxxxxxxxxxxxx> wrote:

> New question #152914 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/152914
>
> Hi,
>
> I want to solve a PDE on a one-dimensional domain. The equation involves a
> first derivative. How do I express this in 1D? Here is (basically) my
> equation:
>
> dT/dx + d^2T/dx^2 = 0
>
> and weak form
>
> a = (grad(T)*v - inner(grad(T), grad(v)))*dx
>
> with testfunction v and trialfunction T. When I use grad(T), I get a "shape
> mismatch in sum" error. The mesh is Interval(100, 0, 10)
>
> --
> You received this question notification because you are a member of
> DOLFIN Team, which is an answer contact for DOLFIN.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dolfin
> Post to     : dolfin@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dolfin
> More help   : https://help.launchpad.net/ListHelp
>

-- 
You received this question notification because you are a member of
DOLFIN Team, which is an answer contact for DOLFIN.