dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #02038
Re: Simplified solution process
Ok, sounds good. We had a similar structure in early versions of DOLFIN
(StatProblem, TranProblem,...), which I think we removed since we wanted a
more flat structure of PDE tools. But now we have the possibility to
automate a lot of features within each class, so I think a resurrection is
motivated.
/Johan
> I've added the class NonlinearPDE in src/kernel/nls, which has a very
> similar interface to the class PDE, and has similar functionality for
> solving.
>
> I think that Anders' suggestion to split-up PDE in the same fashion as
> Function is good a good idea. I'm working in it now - at this stage for
> linear and nonlinear PDE's.
>
> Garth
>
> On Fri, 2006-02-10 at 14:14 -0600, Anders Logg wrote:
>> The new PDE class is now in place and takes care of some of the
>> standard stuff you need to do to solve a static linear PDE: define
>> vectors and matrices, assemble bilinear and linear forms, solve linear
>> system and create a Function from the degrees of freedom.
>>
>> Here's the new version of the Poisson demo:
>>
>> // Set up problem
>> UnitSquare mesh(16, 16);
>> Poisson::BilinearForm a;
>> Poisson::LinearForm L(f);
>> PDE pde(a, L, mesh, bc);
>>
>> // Solve
>> Function u = pde.solve();
>>
>> // Save function to file
>> File file("poisson.pvd");
>> file << u;
>>
>> This works for all linear static PDEs. I imagine that we can use the
>> PDE class to automate the solution of static nonlinear PDEs,
>> time-dependent etc. Depending on the arguments to the constructor
>> (among other things), the PDE class would know what to do to solve the
>> system. A first step would be to integrate Garth's Newton-solver with
>> the PDE class. Perhaps we need to partition it in the same way as the
>> Function class (GenericPDE, StaticLinearPDE etc) so it's easy to
>> plugin a new solver.
>>
>> Note that as an alternative to
>>
>> Function u = pde.solve();
>>
>> one can do
>>
>> Function u;
>> pde.solve(u);
>>
>> which is slightly more efficient (avoids one copy of the vector of
>> degrees of freedom).
>>
>> The PDE class i parametrized and has one parameter "solver", so you
>> can do either
>>
>> pde.set("solver", "direct"); // default option
>>
>> or
>>
>> pde.set("solver", "iterative");
>>
>> /Anders
>>
>> _______________________________________________
>> DOLFIN-dev mailing list
>> DOLFIN-dev@xxxxxxxxxx
>> http://www.fenics.org/cgi-bin/mailman/listinfo/dolfin-dev
>
>
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/cgi-bin/mailman/listinfo/dolfin-dev
>
Follow ups
References