On 10 Dec 2015, at 15:53, David Ham <David.Ham@imperial.ac.uk> wrote:Dear David,I think you have confused what Lawrence was asking. Since you are working with Sebastian Reich, we assume you are solving atmospheric problems. In this context, the definite Helmholtz equation usually occurs:laplacian u - u = fwhile you appear to be solving the indefinite Helmholtz equation:laplacian u + u = fWe were just attempting to ascertain whether you were deliberately solving the indefinite version of the problem. Is this the case?David_______________________________________________On Thu, 10 Dec 2015 at 14:47 Angwenyi David <kipkoej@gmail.com> wrote:Integration by parts is equivalent to using Green’s function; and so it turns out as follows:
laplacian u = - u + f
Greens function: integ((laplacian u)v) + integ(dot(grad u, grad v)) = surfinteg((partial_n u)v)
So that the weak form is obtained by substituting laplacian u = -u + f from the Helmholtz equation in the Green’s function. The same is arrived at by integration by parts.
Sincerely,
David
> On 10 Dec 2015, at 15:23, Lawrence Mitchell <lawrence.mitchell@imperial.ac.uk> wrote:
>
>
>
> On 10/12/15 14:12, Angwenyi David wrote:
>>>>> nx = 10
>>>>> ny = 10
>>>>> nz = 20
>>>>> mesh = BoxMesh(nx, ny, nz, 1.0, 1.0, 2.0)
>>>>> V = FunctionSpace(mesh, "CG", 1)
>>>>> u = TrialFunction(V)
>>>>> v = TestFunction(V)
>>>>> f = Function(V)
>>>>> f.interpolate(Expression("(2*x[0])+(3*x[1])+(0.5*x[2])"))
>> Coefficient(FunctionSpace(Mesh(VectorElement('Lagrange', tetrahedron,
>> 1, dim=3), 3), FiniteElement('Lagrange', tetrahedron, 1)), 4)
>>>>> a = (dot(grad(v), grad(u)) - v * u) * dx
>
> This is the indefinite form of the Helmholtz equation. Did you
> actually want the sign-positive Helmholtz equation?
>
> The later has strong form:
>
> -laplacian u + u = f
>
> When integrating by parts the weak form becomes:
>
> <grad u, grad v> + <u, v> = <f, v>
>
> As to incorporation of boundary conditions, see
>
> http://firedrakeproject.org/variational-problems.html#incorporating-boundary-conditions
>
> Cheers,
>
> Lawrence
>
> _______________________________________________
> firedrake mailing list
> firedrake@imperial.ac.uk
> https://mailman.ic.ac.uk/mailman/listinfo/firedrake
_______________________________________________
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake
firedrake mailing list
firedrake@imperial.ac.uk
https://mailman.ic.ac.uk/mailman/listinfo/firedrake