← Back to team overview

dolfin team mailing list archive

Re: Possible bug?

 

ok, I suspected as much.

I'll see if I can reproduce it. It should be an easy fix.

/Anders

On Wed, Nov 09, 2005 at 09:17:27AM -0600, Andy Ray Terrel wrote:

> Okay so I am getting the error when I don't use the arrays as Anders 
> suggested, but the error goes away when I define two functions f0, and 
> f1.  And build the forms off of them.
> 
> Andy
> 
> 
> 
> Anders Logg wrote:
> 
> >Do you get the same error if you don't use arrays? Say that you do
> >
> >#include "Stokes12.h";
> >#include "Stokes23.h";
> >
> >MyFunction f;
> >MyBC bc;
> >
> >Stokes12::BilinearForm bform0;
> >Stokes23::BilinearForm bform1;
> >Stokes12::LinearForm(f) lform0(f);
> >Stokes23::LinearForm(f) lform1(f);
> >
> >UnitSquare mesh(8,8);
> >Matrix A;
> >Vector x, b;
> >
> >FEM::assemble(bform0, lform1, A, b, mesh, bc);
> >FEM::assemble(bform1, lform1, A, b, mesh, bc);
> >
> >The only thing I can think of is that f is used in both forms. That
> >should be ok, but it could be the cause.
> >
> >/Anders
> >
> >On Wed, Nov 09, 2005 at 08:45:52AM -0600, Andy Ray Terrel wrote:
> > 
> >
> >>Recently I have had some trouble putting LinearForm pointers into an 
> >>array and trying to work on them.  Basically if I have more than one in 
> >>the array I either get a segfault or numbers that don't match up to when 
> >>I am doing things without the array.  The code looks something like this:
> >>---------------------------------------------------------------------------------------------------
> >>include "Stokes12.h";
> >>include "Stokes23.h";
> >>
> >>MyFunction f;
> >>MyBC bc;
> >>
> >>BilinearForm* bforms[2]={new Stokes12::BilinearForm(), new 
> >>Stokes23::BilinearForm()};
> >>LinearForm* lforms[2]={new Stokes12::LinearForm(f), new 
> >>Stokes23::LinearForm(f)};
> >>for(int i=0; i<2; i++){
> >>  ...
> >>  UnitSquare mesh(8,8);
> >>  Matrix A;
> >>  Vector x, b;
> >>  FEM::assemble(*(bforms[i]), *(lforms[i]), A, b, mesh, bc);
> >>  ...
> >>}
> >>------------------------------------------------------------------------------------------------
> >>
> >>So I have gotten around the problem by using python to just write the 
> >>different files and running them, but I thought someone might want to 
> >>know about the problem I was having.
> >>
> >>
> >>   
> >>
> >
> > 
> >
> 

-- 
Anders Logg
Research Assistant Professor
Toyota Technological Institute at Chicago
http://www.tti-c.org/logg/



Follow ups

References