[dune-pdelab] Mixed boundaries with PowerGridFunctionSpace

Andreas Lauser andreas.lauser at iws.uni-stuttgart.de
Thu Nov 26 16:46:05 CET 2009


Hi,

Thank you for the quick answer. 

I've found a work around in the mean time: By using a boundary "function" 
which exports the child number it is possible for the  constraints class to 
use this information:

template <int numEq>
class BoundaryIndexHelperFunction
{
public:
    template <int i>
    struct Child {
        struct Type {
            enum { isLeaf = true };
            enum { eqIdx = i };
        };
    };
    
    template <int i>
    const typename Child<i>::Type &getChild() const
    {
        static typename Child<i>::Type dummy;
        return dummy;
    };
    
    enum { isLeaf = false };
    enum { CHILDREN = numEq };
};


class MixedConstraints
{
public:
    // ...
    template<typename F, typename I, typename LFS, typename T>
    void boundary (const F& f,
                   const Dune::PDELab::IntersectionGeometry<I>& ig, 
                   const LFS& lfs,
                   T& trafo) const
    {
	if (isDirichletEq(F::eqIdx)) { /* dirichlet */ }
	else { /*neumann*/ }
   }

   bool isDirichletEq(int eqIdx)
  { return eqIdx == 0; }
};


cheers
  Andreas


Am Donnerstag, 26. November 2009 08:28:04 schrieben Sie:
> Hello Andreas,
> 
> in that case the idea is to have a vector-valued boundary condition
> function with the same number of components as there are components in
> the PowerGridFunctionSpace. Of course, each component of the function
> case may have different boundary conditions.
> 
> -- Peter
> 
> Am Mittwoch, den 25.11.2009, 14:17 +0100 schrieb Andreas Lauser:
> > Hi all,
> >
> > Is there a reasonable easy way to implement mixed boundaries in
> > conjunction with PowerGridFunction space? As far as I can see there is no
> > way to find out the child index of the LFS  in the constraints class when
> > using
> > Dune::PDELab::constraints(). More specifically,
> > ConstraintsCallBoundary::boundary() does not know the child index at all.
> >
> > I modified my copy of PDELab to get this working but I was wondering
> > whether there was a clean way to do this.
> >
> > Kind Regards
> >   Andreas
> 


-- 
Andreas Lauser
Lehrstuhl für Hydromechanik und Hydrosystemmodellierung
Universität Stuttgart - Institut für Wasserbau
Pfaffenwaldring 61
D-70569 Stuttgart
Tel: (+49) 0711/ 685-64719
Fax: (+49) 0711/ 685-60430
e-mail: andreas.lauser at iws.uni-stuttgart.de




More information about the dune-pdelab mailing list