← Back to team overview

ffc team mailing list archive

Re: defining sudbomain integrals

 

And for anyone paying attention, here are the missing files.



Jake Ostien wrote:
Hi,

Something doesn't seem right when I try and define multiple integrals over subdomains in a form file.

See the attached test.form and test.txt. Basically I copied the element tensor section of the generated header file from two different compilations of test.form, one where

a = v*u*dx  (for a reference)

and one with

dx0 = Integral("cell", 0)
dx1 = Integral("cell", 1)

a = v*u*dx0 + 10*v*u*dx1

Now I would expect that the cell_integral_0 from the second compilation to be identical to the reference compilation, and that cell_integral_1 would be just scaled by 10, but that is not what is happening. It appears that in the second compilation the two subdomain integrals are just added together (see test.txt).

I didn't get too much out of running ffc with the -d1 flag, but I really don't know what I am looking for. Any help on where to look?

Thanks,
Jake
_______________________________________________
FFC-dev mailing list
FFC-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/ffc-dev



element = FiniteElement("CG", "tetrahedron", 1)

v = TestFunction(element)
u = TrialFunction(element)

dx0 = Integral("cell", 0)
dx1 = Integral("cell", 1)

#a = v*u*dx
a = v*u*dx0 + 10.0*v*u*dx1
reference
a = v*u*dx

    // Compute element tensor
    A[0] = 0.0166666666666666*G0_;
    A[1] = 0.00833333333333331*G0_;
    A[2] = 0.00833333333333331*G0_;
    A[3] = 0.00833333333333331*G0_;
    A[4] = 0.00833333333333331*G0_;
    A[5] = 0.0166666666666666*G0_;
    A[6] = 0.00833333333333331*G0_;
    A[7] = 0.00833333333333331*G0_;
    A[8] = 0.00833333333333331*G0_;
    A[9] = 0.00833333333333331*G0_;
    A[10] = 0.0166666666666666*G0_;
    A[11] = 0.00833333333333331*G0_;
    A[12] = 0.00833333333333331*G0_;
    A[13] = 0.00833333333333331*G0_;
    A[14] = 0.00833333333333331*G0_;
    A[15] = 0.0166666666666666*G0_;

Using subdomains
a = v*u*dx0 + 10.0*v*u*dx1
cell_integral_0

    // Compute element tensor
    A[0] = 0.0166666666666666*G0_ + 0.166666666666666*G1_;
    A[1] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[2] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[3] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[4] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[5] = 0.0166666666666666*G0_ + 0.166666666666666*G1_;
    A[6] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[7] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[8] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[9] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[10] = 0.0166666666666666*G0_ + 0.166666666666666*G1_;
    A[11] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[12] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[13] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[14] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[15] = 0.0166666666666666*G0_ + 0.166666666666666*G1_;

cell_integral_1

    // Compute element tensor
    A[0] = 0.0166666666666666*G0_ + 0.166666666666666*G1_;
    A[1] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[2] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[3] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[4] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[5] = 0.0166666666666666*G0_ + 0.166666666666666*G1_;
    A[6] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[7] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[8] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[9] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[10] = 0.0166666666666666*G0_ + 0.166666666666666*G1_;
    A[11] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[12] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[13] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[14] = 0.00833333333333331*G0_ + 0.0833333333333331*G1_;
    A[15] = 0.0166666666666666*G0_ + 0.166666666666666*G1_;

Follow ups

References