← Back to team overview

ffc team mailing list archive

Re: including a file in .form

 

ok, sounds good.

I just realized that you need to name the file you include
"ConvectionDiffusion.py" instead of "ConvectionDiffusion.form", since
it is not a valid form file and the script scripts/compileforms in
DOLFIN would otherwise try to compile it.

/Anders


On Fri, Dec 30, 2005 at 04:43:27PM +0100, Garth N. Wells wrote:
> On Fri, 2005-12-30 at 09:34 -0600, Anders Logg wrote:
> > We could add some built-in support to the parser/command-line
> > interface to handle both 2D and 3D problems, but one could also argue
> > that we should keep it as simple as possible, since all the
> > flexibility you need is available anyway through the Python interface.
> > 
> 
> The procedure to include files seems really simple, so I think that
> there is no need to build in any extra functionality for 2D/3D.
> 
> Garth
> 
> > /Anders
> > 
> > 
> > On Fri, Dec 30, 2005 at 10:57:59AM +0100, Garth N. Wells wrote:
> > > Is it to "include" a .form (or .py) file in a .form file? If not, could
> > > this be done easily in the FFC parser?
> > > 
> > > I'm setting up the convection-diffusion solver in DOLFIN for both 2D and
> > > 3D, and the only difference in the FFC .form files is the definition of
> > > the finite elements at the top (3 lines in the case of
> > > convection-diffusion). I'd like to have something like
> > > 
> > > ConvectionDiffusion.form:
> > >   u = BasisFunction(scalar)
> > >   .
> > >   .
> > >   a = . . .
> > >   L = ...
> > > 
> > > ConvectionDiffusion_3D.form:
> > >   scalar = FiniteElement("Lagrange", "tetrahedron", 1)
> > >   .
> > >   include ConvectionDiffusion.form
> > > 
> > > ConvectionDiffusion_2D.form:
> > >   scalar = FiniteElement("Lagrange", "triangle", 1)
> > >   .
> > >   include ConvectionDiffusion.form
> > > 
> > > Since "ConvectionDiffusion.form" is incomplete, a better name might be
> > > "ConvectionDiffusion.pde".
> > > 
> > > This would be useful for developing 2D and 3D versions of a particular
> > > PDE, as well as different order elements. 
> > > 
> > > Garth
> > > 
> > > 
> > > _______________________________________________
> > > FFC-dev mailing list
> > > FFC-dev@xxxxxxxxxx
> > > http://www.fenics.org/cgi-bin/mailman/listinfo/ffc-dev
> > > 
> > 

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



References