Do FeniCS programs only handle the PDE with even order derivatives?

Asked by cutejeff

I am the newcomer for Fenics, I just read the Tutorial. It seems like it always needs to construct the weak form (at least true for the examples in the tutorial). From the FEM course I have taken, I remember if the differential operator is non-self adjoint or non-linear, then the weak form is variationally inconsistent, therefore there is no unique solution for the weak form method. If this is true, then weak form shouldn't be considered for the PDE with odd order derivatives or non-linear PDE.

My last question is do fenics programs involve Least Squares Method? or is it going to involve least squares process in future?

Thank you.

Question information

Language:
English Edit question
Status:
Solved
For:
FEniCS Project Edit question
Assignee:
No assignee Edit question
Solved by:
Garth Wells
Solved:
Last query:
Last reply:
Revision history for this message
Best Garth Wells (garth-wells) said :
#1

cutejeff wrote:
> New question #98160 on FEniCS Project:
> https://answers.launchpad.net/fenics/+question/98160
>
> I am the newcomer for Fenics, I just read the Tutorial. It seems like
> it always needs to construct the weak form (at least true for the
> examples in the tutorial). From the FEM course I have taken, I
> remember if the differential operator is non-self adjoint or
> non-linear, then the weak form is variationally inconsistent,
> therefore there is no unique solution for the weak form method. If
> this is true, then weak form shouldn't be considered for the PDE with
> odd order derivatives or non-linear PDE.
>

Sounds like someone was leading you astray in the FEM course that you
followed. For problems which are not self-adjoint, one can't pose them
in terms of mimisation of a functional, but the weak form can still be
formulated. Whether or not a particular equation has a unique requires
analysis.

There are plenty of demos in DOLFIN for non self-adjoint PDEs and for
nonlinear problems,

Garth

> My last question is do fenics programs involve Least Squares Method?
> or is it going to involve least squares process in future?
>
> Thank you.
>

Revision history for this message
cutejeff (illw84u) said :
#2

Thank you very much.

Revision history for this message
cutejeff (illw84u) said :
#3

Hello Garth,

Thank you for your answer last time.

I am still confused with the non self-adjoint PDEs. I tried to
construct the weak form, but when I compile it, it shows error saying
"ufl.log.UFLException: Shape mismatch in Sum".

I have attached the scanned problem description. It's a 1D
convection-diffusion equation: grad(u)-0.01*div grad(u)=0 with
Drichlet BCs: u(0)=1, u(1)=0

My question is how we should define the "a" function and let the code
run correctly?

I have tried:

a=(grad(u)*v-0.01*dot(grad(v),grad(u)))*dx
a=inner(grad(v),(u-0.01*grad(u)))*dx

But neither of them worked. I guess the du/dx*v term will cause a
non-symmetric coefficient matrix, that's what the shape mismatch mean.
Can you tell me how to solve it? I will really appreciate your help.

Thank you very much.

Regards,

Bin

On Thu, Jan 21, 2010 at 2:51 AM, Garth Wells
<email address hidden> wrote:
> Your question #98160 on FEniCS Project changed:
> https://answers.launchpad.net/fenics/+question/98160
>
>    Status: Open => Answered
>
> Garth Wells proposed the following answer:
>
> cutejeff wrote:
>> New question #98160 on FEniCS Project:
>> https://answers.launchpad.net/fenics/+question/98160
>>
>> I am the newcomer for Fenics, I just read the Tutorial. It seems like
>> it always needs to construct the weak form (at least true for the
>> examples in the tutorial). From the FEM course I have taken, I
>> remember  if the differential operator is non-self adjoint or
>> non-linear, then the weak form is variationally inconsistent,
>> therefore there is no unique solution for the weak form method.  If
>> this is true, then weak form shouldn't be considered for the PDE with
>> odd order derivatives or non-linear PDE.
>>
>
> Sounds like someone was leading you astray in the FEM course that you
> followed. For problems which are not self-adjoint, one can't pose them
> in terms of mimisation of a functional, but the weak form can still be
> formulated. Whether or not a particular equation has a unique requires
> analysis.
>
> There are plenty of demos in DOLFIN for non self-adjoint PDEs and for
> nonlinear problems,
>
> Garth
>
>
>> My last question is do fenics programs involve Least Squares Method?
>> or is it going to involve least squares process in future?
>>
>> Thank you.
>>
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/fenics/+question/98160/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/fenics/+question/98160
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Harish Narayanan (hnarayanan) said :
#4

It has nothing to do with non-symmetric matrices. There is something strange about the way you're writing your PDE (it only make sense in 1D). In general, grad(u) - dot(grad(v)*grad(u)) doesn't make sense as you are trying to subtract a scalar from a multi-component object. It is this "shape mismatch" that UFL is complaining about.

Try using u.dx(0) (the derivative of u along the x direction) instead of grad(u) and see if it helps in your code above. This way, you are explicitly telling the form compiler that what you really want is a derivative in one direction, not a gradient.

Revision history for this message
cutejeff (illw84u) said :
#5

Now it works, Thanks a lot.