Cache FFC compiled forms
Merge pull request #51 from OP2/ffc-form-cache

Cache FFC compiled forms

Look up UFL forms in a cache first before FFC compiling them.
Add support for iteration spaces for RHS vectors.
Add vector field assembly and iteration space tests.
FFC interface/demos use iteration spaces for RHS

pyop2_utils is modified so that FFC is responsible for inserting
facet_p into the argument list. Since this changes the interface,
the version number is bumped.

All the FFC demos are changed to use iteration spaces for the RHS
assembly, to match the change in the interface.
Merge pull request #52 from OP2/vec-iteration-spaces

Add support for iteration spaces for vector assembly (to be consistent
with matrix assembly).

New tests exercise this functionality for both scalar and vector field
assembly.
Space in .gitmodules to appease the pre-commit hook
Trick sphinx-build to not require OP2_DIR to be set
Fix: missing call to 'dump_gen_code'.
Merge pull request #54 from OP2/fix-dump-gencode

Fix: missing call to 'dump_gen_code'.
opencl.py wants os imported when using dump_gen_code
Add Mat properties to check the type of field

_is_scalar_field returns True if this Mat represents the linear system
for a scalar field, _is_vector_field does the same but for vector
fields.
Optimise scalar field assembly in sequential backend

For scalar field assembly, we can avoid some function calls in the
inner assembly loop by assembling the entire local element matrix and
then inserting it into the global matrix in one go, rather than
inserting one element at a time into the global matrix.
Merge pull request #57 from OP2/faster-scalar-field-assembly

An optimisation for assembling into matrices representing scalar fields.
Add stub _setup function to cuda backend
Import missing classes into cuda and opencl backends

A backend should explicitly expose all classes that are exposed in
op2.  This is in preparation for lazy loading of backend modules.
Remove magic backend fallback to sequential

Don't fall back to sequential backend to find a class that we don't
find in the current backend.  Especially since the new class hierarchy
reorganisation this is not what we want to do.  In addition, it forces
us to always load the sequential backend.
Simplify core.op_arg initialisation

Since the great class hierarchy reordering, the file defining the base
pyop2 classes no longer imports op_lib_core.  So we can happily import
base into op_lib_core and use isinstance(arg.data, base.Dat) to
determine if this arg is actually a Dat or a Global when instantiating
the C level op_arg.
Only load backend modules on demand

Rather than eagerly loading all available backend modules, only load
the relevant module when calling set_backend (from op2.init).  This
way, we don't even attempt to load backends we don't care about.
Allow python GC to clean up core op_mat objects

Add a __del__ method to runtime_base and op_lib_core Mat objects.  The
former explicitly calls __del__ on the latter which just destroys the
C level matrix object and sets the pointer to NULL, the _lib_handle is
then set to None.

This fixes memory leaks in the case where we do:

    for i in range(...):
        mat = op2.Mat(...)