[dune-fem] Boundary integrals in dune-fem

Sacconi, Andrea a.sacconi11 at imperial.ac.uk
Fri Oct 12 17:32:51 CEST 2012


Hi,

thanks for the hint. You're right, it's not necessary to access the Base class.
Last question (since now everything compiles and runs, but it doesn't do what I want ...): how do I take the local representation of the test function, which lives on the whole domain, and not only on the boundary (strictly speaking, it's its trace that multiplies the Neumann data)?

For the standard RHS, I did

LocalFunctionType rhsLocal = rhs.localFunction( entity );
...
rhsLocal.axpy( quadrature[ pt ], f );

where entity refers to the element, not to the boundary.

Do I have to do something different for the boundary integral, apart from selecting the quadrature points as you indicated?

Cheers,
Andrea
__________________________________________________________

Andrea Sacconi
PhD student, Applied Mathematics
AMMP Section, Department of Mathematics, Imperial College London,
London SW7 2AZ, UK
a.sacconi11 at imperial.ac.uk
________________________________
From: Dedner, Andreas [A.S.Dedner at warwick.ac.uk]
Sent: 12 October 2012 16:00
To: Sacconi, Andrea; dune-fem at dune-project.org
Subject: RE: Boundary integrals in dune-fem

This is what I have in my code:
typedef Dune::Fem::ElementQuadrature< GridPartType, 1 > FaceQuadratureType;
or (if your intersection is conforming which it is on the boundary):
typedef Dune::Fem::CachingQuadrature< GridPartType, 1 > FaceQuadratureType;
FaceQuadratureType quadInside( dfSpace.gridPart(), intersection, quadOrder, FaceQuadratureType::INSIDE );
So I do not think you need the BaseType to access the enum....
Andreas

________________________________
From: Sacconi, Andrea [a.sacconi11 at imperial.ac.uk]
Sent: 12 October 2012 11:10
To: Dedner, Andreas; dune-fem at dune-project.org
Subject: RE: Boundary integrals in dune-fem

Hi Andreas, hi all,

many thanks for your answer!
I'm almost done with the quadrature for the Neumann boundary ... there is only one detail I got stuck with.
Precisely, look at the constructor for the quadrature rule over the boundary:

QuadratureType quadrature ( gridPart, intersection, 2 * dfSpace.order() + 1, QuadratureType::BaseType::INSIDE );

The fourth parameter is not correct, since BaseType is private. I think the constructor requires an "enum" value (either INSIDE or OUTSIDE) but apparently it didn't work.
Where am I wrong? Which is the correct parameter to pass?

Cheers,
Andrea
__________________________________________________________

Andrea Sacconi
PhD student, Applied Mathematics
AMMP Section, Department of Mathematics, Imperial College London,
London SW7 2AZ, UK
a.sacconi11 at imperial.ac.uk
________________________________
From: Dedner, Andreas [A.S.Dedner at warwick.ac.uk]
Sent: 11 October 2012 15:56
To: Sacconi, Andrea; dune-fem at dune-project.org
Subject: RE: Boundary integrals in dune-fem

Hi.

> 1) what's the ratio behind this additional class? I've to confess I'm a bit lost. I don't get the > different roles played by the operator (), applyLocal and the class AssembledFunctional.

applyLocal computes the contribution on a single entity while operator() basically adds
the loop over the elements. The difference between AssembbledFunctional and
the IntegralFunctional is the same as in the operator case - the first
applies to function to a given function, i.e., the operator() returs
   l(u) = int_Omega f u   (f is the function given in the constructor)
the second actually assembles the functional, i.e.,  computed
   l_i   = int_Omega f phi_i  (i=1,...,N)


> 2) when I introduce a Neumann condition on a portion of the boundary, a new boundary >
> contribution to the rhs arises. Would it be possible to modify the file into a new one,
> changing only some details?
> In this case, what do I have to change in the local functions and the quadrature points?

That is easily possible.
Have a look at the dg example in the howto (I hope it is available in your version).
There you also have boundary integrals to compute. Basically you need to add an
intersection iterator in operator() and use a CachingQuadrature<GP,1> on the
boundary intersetion (intersection.boundary()). But perhaps somebody
out there has already the code snipped needed to add Neumann boundary conditions?

Hope that helps,
Andreas
________________________________
From: dune-fem-bounces+a.s.dedner=warwick.ac.uk at dune-project.org [dune-fem-bounces+a.s.dedner=warwick.ac.uk at dune-project.org] on behalf of Sacconi, Andrea [a.sacconi11 at imperial.ac.uk]
Sent: 10 October 2012 17:04
To: dune-fem at dune-project.org
Subject: [dune-fem] Boundary integrals in dune-fem

Hi everyone,

I have a question about boundary integrals in dune-fem.

Let's suppose you want to solve the Laplace equation; so I have taken dune-fem-howto where this problem is already implemented.
However, if I wanted to implement different boundary conditions in different portions of the boundary, that tutorial needs to be enriched.

The file functional.hh (for simplicity taken from the tutorial and attached to my mail) defines an integral functional, that is subsequently used to assemble the rhs of the Laplace equation.
My questions are:

1) what's the ratio behind this additional class? I've to confess I'm a bit lost. I don't get the different roles played by the operator (), applyLocal and the class AssembledFunctional.
2) when I introduce a Neumann condition on a portion of the boundary, a new boundary contribution to the rhs arises. Would it be possible to modify the file into a new one, changing only some details?
In this case, what do I have to change in the local functions and the quadrature points?

Many thanks in advance!

Andrea

__________________________________________________________

Andrea Sacconi
PhD student, Applied Mathematics
AMMP Section, Department of Mathematics, Imperial College London,
London SW7 2AZ, UK
a.sacconi11 at imperial.ac.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune-fem/attachments/20121012/42becb98/attachment.htm>


More information about the dune-fem mailing list