← Back to team overview

dolfin team mailing list archive

Re: DirichletBC Dimension Problems

 

If we remove the boundary conditions there are no problems.
Am I doing something wrong?

int main()
{
  Rectangle mesh(0.,0.,10.,4.,101,31,Rectangle::left);
  MyFunctionSpace V(mesh);
  SubSpace V0(V,0), V1(V,1);// V0=V1
  DirichletBoundary dbdry; // (x[0]<DOLFIN_EPS...)
  Constant bc(1.0) ;
  DirichletBC dbc(V1,bc,dbdry);
  Function eta_phi(V), eta(V0), phi(V1);
  MyBilinearForm a(V,V);
  MyLinearForm L(V);
  L.eta0=eta;L.phi0=phi;
  eta_phi.vector().zero();
  phi=eta_phi[1];
  MySubBilinearForm a_p(V1,V1);
  Function p(V1);
  MySubLinearForm Lp(V1);
  VariationalProblem pde(a_p,Lp,dbc);
  Lp.f=phi;
  pde.solve(p);
  return (EXIT_SUCCESS);
}
----------------------------------------------------------------
The ffc form files are of the type:

My.form-------------------------------------------------------------
P=FiniteElement("Lagrange","triangle",1)
Th=P+P
----------------------------------------------------------------
and

MySub.form--------------------------------------------------------------
P =FiniteElement("Lagrange","triangle",1)
P = TestFunction(element)
----------------------------------------------------------------




On Monday 16 March 2009, Anders Logg wrote:
> On Sat, Mar 14, 2009 at 11:25:48PM +0100, ndl@xxxxxxxxxxxxxx wrote:
> > Hi.
> > I'm having some "dimension" troubles when applying some DirichletBC's.
> >
> > I've something like this:
> > -------------------------------
> > MyFunctionSpace V(mesh); //Th=P1+P1
> > SubSpace V0(V,0); //S
> > SubSpace V1(V,1); //P
> > ...
> > DirichletBoundary dirichletboundary;
> > DBC bc(t);
> > DirichletBC dbc(V1,bc,dirichletboundary);
> > .....
> > MyBilinearForm a(V1,V1);
> > Function p(V1);
> > MyLinearForm L(V1);
> > VariationalProblem pde(a,L,dbc);
> > pde.solve(p);
> > ----------------------------------------------
> > The V dimension is 24136 and V1 is half:12068.
>
> How did you define the function space V?
>
> Try sending a minimal example (~10 lines) that reproduces this bug.


-- 
Nuno David Lopes

e-mail:ndl@xxxxxxxxxxxxxx        (FCUL/CMAF)
           nlopes@xxxxxxxxxxxxxxx    (ISEL)
http://ptmat.ptmat.fc.ul.pt/%7Endl/

Mon Mar 16 21:53:37 WET 2009



Follow ups