dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #06152
Re: How to deal with two subdomains with different PDE parameters
On Feb 11, 2008 1:57 PM, Matthew Knepley <knepley@xxxxxxxxx> wrote:
> On Feb 11, 2008 10:27 AM, Anders Logg <logg@xxxxxxxxx> wrote:
> >
> > On Mon, Feb 11, 2008 at 08:05:57AM -0600, Matthew Knepley wrote:
> > > On Feb 11, 2008 5:05 AM, Anders Logg <logg@xxxxxxxxx> wrote:
> > > > On Mon, Feb 11, 2008 at 11:54:14AM +0100, Kristen Kaasbjerg wrote:
> > > > > Hi dolfin users
> > > > >
> > > > > I am trying to use dolfin for the following simple
> > > > > electrostatic problem:
> > > > > - finding the electrostatic potential in a domain composed
> > > > > of two subdomains with different dielectric constants.
> > > > > This amounts to solving Laplace equation with appropriate
> > > > > BC's.
> > > > >
> > > > > One thing that I cannot figure out how to do is to tell dolfin
> > > > > that I have 2 subdomains and on the internal boundary between
> > > > > these two domains, the normal derivative of the potential has
> > > > > a discontinuity given by the difference between the dielectric
> > > > > constants.
> > > > > Could anyone give me a hint of how to approach this problem
> > > > > with dolfin ? I am relatively unexperienced to FEM so a nice
> > > > > reference would also be welcome.
> > > > >
> > > > > Regards
> > > > > Kristen
> > > >
> > > > The easiest thing to do (if there is just a coefficient in your
> > > > problem that is discontinuous) is to just define a Function for the
> > > > dielectric constant and make it discontinuous. Then just plug it in to
> > > > your equation.
> > > >
> > > > Look in the demos (under src/demo/pde) for how to define a function.
> > > >
> > > > For example, if some parameter is 0 or 1 depending on whether x is
> > > > below or above 0.5, then just do something like this in eval():
> > > >
> > > > if (x[0] > 0.5)
> > > > return 1.0;
> > > > else
> > > > return 0.0;
> > >
> > > This is not going to give the correct answer unless you do the boundary integral
> > > that comes from the integration by parts. Or am I missing something?
> > >
> > > Matt
> >
> > I don't know. Maybe I'm ignorant but if you have -div(a*grad(u)) = f,
> > then it looks to me that you may just go ahead and integrate by parts
> > even if the coefficient a is discontinuous. grad(u) is already
> > discontinuous (for the discretization) so I don't see the difference.
>
> I do not agree. There is a jump term along the boundary. You can get
> some solution without it, which looks alright, it is just wrong.
How about this example. You can tell me what is wrong:
Take a 1-D domain from -1 to 1 which is divided at 0 into
\epsilon_0 and \epsilon_1. Then we have something like
\int^1_{-1} v div (\epsilon grad u)
= \int^0_{-1} v div (\epsilon_0 grad u) + \int^1_0 v div (\epsilon_1 grad u)
= -\int^0_{-1} grad v \epsilon_0 grad u + \epsilon_0 v grad u |_0
-\int^1_0 grad v \epsilon_1 grad u - \epsilon_1 v grad u |_0
= -\int^1_{-1} \epsilon grad v grad u - (\epsilon_1 - \epsilon_0) v grad u |_0
Dmitry is now of the opinion that this is wrong based on distribution theory
arguments. However, I was sure that physically we get a layer of induced
charge at a dielectric jump proportional to the jump times the field. I will try
and look it up in Jackson.
Matt
> Matt
>
> > I tried to put in a discontinuous coefficient in the DOLFIN Poisson
> > demo and the solution looks fine.
> >
> > --
> >
> > Anders
> > _______________________________________________
> > DOLFIN-dev mailing list
> > DOLFIN-dev@xxxxxxxxxx
> > http://www.fenics.org/mailman/listinfo/dolfin-dev
> >
>
>
>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which
> their experiments lead.
> -- Norbert Wiener
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which
their experiments lead.
-- Norbert Wiener
Follow ups
References