Subject: [FEniCS-dev] pde.solve() command parameters

From: Brandon Chabaud <[email-masked]>
Date: Mon, 19 Jan 2009 17:39:59 -0600

Hi.

I am trying to use fenics to solve a 2D elasticity problem.  I have written
and compiled a .form file using ffc with no problem.  However, when I try to
compile the main.cpp file that I've written, I get this error message:

main.cpp: In function 'int main(int, char**)':
main.cpp:177: error: no matching function for call to
'dolfin::LinearPDE::solve(dolfin::Function&, dolfin::Function&,
dolfin::Function&, dolfin::Function&)'
/home/grad/chabaud/local/include/dolfin/pde/LinearPDE.h:53: note:
candidates are: void dolfin::LinearPDE::solve(dolfin::Function&)
/home/grad/chabaud/local/include/dolfin/pde/LinearPDE.h:56: note: void
dolfin::LinearPDE::solve(dolfin::Function&, dolfin::Function&)
/home/grad/chabaud/local/include/dolfin/pde/LinearPDE.h:59: note: void
dolfin::LinearPDE::solve(dolfin::Function&, dolfin::Function&,
dolfin::Function&)
scons: *** [main.o] Error 1
scons: building terminated because of errors.
The offending line in my cpp file seems to be

pde.solve(sigma,u,p,epsilon);

The lines immediately above it are

// Set up PDE
SolidBilinearForm a(n);
SolidLinearForm L(f1,g,u_prev,eps_prev,u0,F,uD,n);
LinearPDE pde(a,L,mesh);

// Solve PDE
Function u;
Function epsilon;
Function sigma;
Function p;

The solutions u, epsilon, sigma, p to the problem are defined in my .form
file by

Element1 = VectorElement("Discontinuous Lagrange", "triangle", 0, 4)

Element2 = VectorElement("Discontinuous Lagrange", "triangle", 0, 4)

Element3 = VectorElement("Discontinuous Lagrange", "triangle", 0)

Element4 = FiniteElement("Discontinuous Lagrange", "triangle", 0)

combo = MixedElement([Element1, Element3, Element4, Element2])

(z, v, q, w) = TestFunctions(combo)

(sigma, u, p, epsilon) = TrialFunctions(combo)

Do anyone know how to fix this error? Thanks.

---

From: Anders Logg <[email-masked]>
Date: Tue, 20 Jan 2009 09:56:27 +0100

You seem to be using an old version of DOLFIN. Try the latest release
(0.9.0) where LinearPDE has been replaced by VariationalProblem.

-- 
Anders

On Mon, Jan 19, 2009 at 05:39:59PM -0600, Brandon Chabaud wrote:
> Hi.
> 
> I am trying to use fenics to solve a 2D elasticity problem.  I have written and
> compiled a .form file using ffc with no problem.  However, when I try to

> _______________________________________________
> FEniCS-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/fenics-dev

---

From: Kristian Oelgaard <[email-masked]>
Date: Tue, 20 Jan 2009 10:16:28 +0100

> (0.9.0) where LinearPDE has been replaced by VariationalProblem.

I guess this won't work either because he's solving for 4 Functions.
Only 1,2,3 is currently supported. Is it possible to design for an
arbitrary number of Functions? Otherwise the VariationalProblem files
could end up being very large.

Kristian
 
> and

---

From: Anders Logg <[email-masked]>
Date: Tue, 20 Jan 2009 19:12:56 +0100

> could end up being very large.

It would be easy to add a bunch of extra calls for 4, 5, 6,
etc. arguments but I think we should avoid using varargs for this (it
might also work only for built-in types).

How about just calling solve() for one Function and then picking the
components manually, that's what happens in VariationalProblem for
multiple Function arguments:

  Function u;
  solve(u);

  u0 = u[0];
  u1 = u[1];
  u2 = u[2];

-- 
Anders