← Back to team overview

dolfin team mailing list archive

Re: [HG DOLFIN] Fix assembly over interior facets, DG demo seems to work now

 

On Tue, Oct 28, 2008 at 03:13:52PM +0100, Martin Sandve Alnæs wrote:
> 2008/10/28 Kristian Oelgaard <k.b.oelgaard@xxxxxxxxxx>:
> > Quoting DOLFIN <dolfin@xxxxxxxxxx>:
> >
> >> One or more new changesets pushed to the primary dolfin repository.
> >> A short summary of the last three changesets is included below.
> >>
> >> changeset:   5040:14dbf71b2272b246d861b28d38a8cf79cbabadbd
> >> tag:         tip
> >> user:        Anders Logg <logg@xxxxxxxxx>
> >> date:        Tue Oct 28 14:28:50 2008 +0100
> >> files:       dolfin/fem/Assembler.cpp
> >> description:
> >> Fix assembly over interior facets, DG demo seems to work now
> >
> > Yes indeed. When I was re-writing the main.cpp file for this demo I noticed that
> > it was easy to get confused about which FunctionSpace to use.
> >
> > E.g., for u and v I could use one of the following:
> > PoissonBilinearFormArgumentSpace0
> > PoissonBilinearFormArgumentSpace1
> > PoissonLinearFormArgumentSpace0
> > PoissonLinearFormCoefficientSpace0
> > PoissonTestSpace
> > PoissonTrialSpace
> >
> > and still get the same result. For forms with many functions this only gets
> > worse. A nice feature would be if one could do:
> >
> > PoissonFunctionSpace v("v");
> > PoissonFunctionSpace u("u");
> > PoissonFunctionSpace n("n");
> > PoissonFunctionSpace h("h");
> >
> > or something similar, to be sure that the function space was picked correctly.
> >
> > Kristian
> 
> Perhaps it's better to encode this name in the classname though?
> 
> PoissonFunctionSpace_h
> PoissonFunctionSpace::h
> 
> these can just be typedefs to a unique "FunctionSpace_CHECKSUM",
> where checksum is something like the cache checksum.

How about some magic?

We can extend Martin's suggestion from yesterday to make the following
possible:

  Function f;
  Function g;

  Form a(V, V);
  a.f = f;
  a.g = g;

We just need to make sure that the assignment operator checks whether
or not the Function assigned has a FunctionSpace defined, and
otherwise figures out which one to use and then sets it.

-- 
Anders

Attachment: signature.asc
Description: Digital signature


Follow ups

References