gmarkall / manycore_form_compiler

MCFC is deprecated. See https://code.launchpad.net/~grm08/ffc/pyop2
https://code.launchpad.net/~grm08/ffc/pyop2
GNU General Public License v3.0
3 stars 1 forks source link

Fix index construction #53

Closed gmarkall closed 12 years ago

gmarkall commented 12 years ago

Summary of changes:

Move buildBasisIndex, buildDimIndex, buildConstDimIndex and buildGaussIndex into formutils and remove all references to the methods with the same names in the FormBackend class. This breaks the link between forms and expressions through indices.

There are still some hard-coded assumptions about the number of dimensions, basis functions and gauss points. However, these changes make it easier to remove them as the index construction is no longer tied to the form backend.

The shallow-water.ufl input file is also modified here - although it was untested, it didn't even parse before. It now parses correctly so we can at least use it with the visualiser.

gmarkall commented 12 years ago

I forgot to mention - buildBasisIndex needs to know how many basis functions an element has - we previously passed the hardcoded value to the constructor, but we now pass an element to it instead.

I started writing some code that called FFC to find out the number of basis functions, but found that it was almost a line-by-line duplicate of FFC's fiat interface, so I thought it might be wiser just to make use of ffc.fiatinterface instead.

kynan commented 12 years ago

I was a bit irritated at first to see a dependency on FFC introduced (the reasoning being: we write a form compiler and depend on another form compiler?). However, it does make a lot of sense especially since we ultimately want to inquire with FIAT about the basis function etc. For that we are going to need a FIAT interface anyway and I don't see why we shouldn't use the one from FFC if that suits our needs. If we find that to be a problem we can always take a step back later.

Pull request approved, merging.