← Back to team overview

ffc team mailing list archive

including a file in .form

 

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




Follow ups