firedrakeproject / tsfc

Two-stage form compiler
Other
15 stars 24 forks source link

SLATE compilation error #122

Closed stephankramer closed 7 years ago

stephankramer commented 7 years ago

I am trying to use SLATE to implement a preconditioner for a Schur system A11-A10 A00^{-1} A01, where A00 is a DG mass matrix that assembles the Schur system explicitly (on @wence- 's suggestion here: https://github.com/thetisproject/thetis/pull/97#discussion_r116945058). The relevant code is:

    mass = Tensor(dot(v, u)*dx)
    fs = dict(formmanipulation.split_form(a))
    A01 = Tensor(fs[(0, 1)])
    A10 = Tensor(fs[(1, 0)])
    A11 = Tensor(fs[(1, 1)])
    S = A11 - A10*mass.inv*A01

    Smat = assemble(S, form_compiler_parameters=ctx.fc_params)
    Smat.force_evaluation()

here a is the form of the coupled SWE system (only linear terms). This fails in the last step with a compilation error because the generated code contains a subroutine:

static inline void compile_slate (double  A4[6][6] , double **  coords , double *  w_0 , double **  w_1 , double **  w_2_0 , double **  w_2_1 , double *  w_3 , double **  w_4_0 , double **  w_6 , double **  w_5 , double **  w_6 , double **  w_7 , double *  w_8 )

which contains a w_6 argument twice.

Unfortunately I haven't been able to reproduce in a standalone test yet. To reproduce in thetis, checkout the assembledschur-slate branch of thetis, and run py.test -k pressurep -svx test/swe2d/test_standing_wave.py.

thomasgibson commented 7 years ago

This isn't a TSFC issue, so it should be posted in https://github.com/firedrakeproject/firedrake/issues (Slate only uses TSFC to generate local tensor assembly kernels). But I'll look into this and update. For now, repost this issue in the Firedrake github for reference.

miklos1 commented 7 years ago

TSFC is responsible for the compilation of UFL only, SLATE is a separate story. The SLATE language and its compilation resides in Firedrake, so please post this issue there as Thomas have suggested.