← Back to team overview

dolfin team mailing list archive

a question about non homogeneous boundary conditions

 

Hi,

I want to ask a question about Dolfin. I need to solve an elliptic mixed
boundary value problem
with non-homogeneous Dirichlet conditions.

I've modified the example that comes with dolfin to do so.

Is it ok if I set the Dirichlet boundary condition like this...

// Dirichlet boundary condition
 class DirichletBC : public BoundaryCondition
 {
   void eval(BoundaryValue& value, const Point& p, unsigned int i)
   {
     real x = p.x();
     real y = p.y();
     if ( std::abs(y) < DOLFIN_EPS )
       value = x*x;
     else if ( std::abs(y - 1.0) < DOLFIN_EPS )
       value = x*x+1.0;
   }
 };


The program seems to work, but by doubt is because the set of functions that
verify this
boundary condition is not a vector space (but rather a linear manifold)
(and I don't know if the code in Dolfin assumes that the boundary condition
should be zero,
as this is not documented in the manual)

best regards,
Pablo

Follow ups