Form with domain markers creates duplicated kernels
- Dominant language
- Python
- Stars
- 192
- Forks
- 45
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 16
Description
MWE:
```python
coord_element = VectorElement("Lagrange", interval, 1)
mesh = Mesh(coord_element)
element = FiniteElement("Lagrange", interval, 1)
V = FunctionSpace(mesh, element)
u = TrialFunction(V)
v = TestFunction(V)
a = inner(u, v) * dx((1,2))
```
Produces 2 identitical kernels:
```c
// Code for integral integral_8799b8ef6f5269ca9a672cec402eefb7d5222475
void tabulate_tensor_integral_8799b8ef6f5269ca9a672cec402eefb7d5222475(double* restrict A,
const double* restrict w,
const double* restrict c,
const double* restrict coordinate_dofs,
const int* restrict entity_local_index,
const uint8_t* restrict quadrature_permutation)
{
// Quadrature rules
static const double weights_4a8[2] = { 0.5, 0.5 };
// Precomputed values of basis functions and precomputations
// FE* dimensions: [permutation][entities][points][dofs]
static const double FE0_C0_Q4a8[1][1][2][2] =
{ { { { 0.7886751345948129, 0.2113248654051871 },
{ 0.2113248654051871, 0.7886751345948129 } } } };
static const double FE1_C0_D1_Q4a8[1][1][1][2] = { { { { -1.0, 1.0 } } } };
// Quadrature loop independent computations for quadrature rule 4a8
const double J_c0 = coordinate_dofs[0] * FE1_C0_D1_Q4a8[0][0][0][0] + coordinate_dofs[3] * FE1_C0_D1_Q4a8[0][0][0][1];
double sp_4a8[1];
sp_4a8[0] = fabs(J_c0);
for (int iq = 0; iq < 2; ++iq)
{
const double fw0 = sp_4a8[0] * weights_4a8[iq];
double t0[2];
for (int i = 0; i < 2; ++i)
t0[i] = fw0 * FE0_C0_Q4a8[0][0][iq][i];
for (int i = 0; i < 2; ++i)
for (int j = 0; j < 2; ++j)
A[2 * i + j] += FE0_C0_Q4a8[0][0][iq][j] * t0[i];
}
}
void tabulate_tensor_integral_b1ad34778d813d876edcdf491953bf64df0b3699(double* restrict A,
const double* restrict w,
const double* restrict c,
const double* restrict coordinate_dofs,
const int* restrict entity_local_index,
const uint8_t* restrict quadrature_permutation)
{
// Quadrature rules
static const double weights_4a8[2] = { 0.5, 0.5 };
// Precomputed values of basis functions and precomputations
// FE* dimensions: [permutation][entities][points][dofs]
static const double FE0_C0_Q4a8[1][1][2][2] =
{ { { { 0.7886751345948129, 0.2113248654051871 },
{ 0.2113248654051871, 0.7886751345948129 } } } };
static const double FE1_C0_D1_Q4a8[1][1][1][2] = { { { { -1.0, 1.0 } } } };
// Quadrature loop independent computations for quadrature rule 4a8
const double J_c0 = coordinate_dofs[0] * FE1_C0_D1_Q4a8[0][0][0][0] + coordinate_dofs[3] * FE1_C0_D1_Q4a8[0][0][0][1];
double sp_4a8[1];
sp_4a8[0] = fabs(J_c0);
for (int iq = 0; iq < 2; ++iq)
{
const double fw0 = sp_4a8[0] * weights_4a8[iq];
double t0[2];
for (int i = 0; i < 2; ++i)
t0[i] = fw0 * FE0_C0_Q4a8[0][0][iq][i];
for (int i = 0; i < 2; ++i)
for (int j = 0; j < 2; ++j)
A[2 * i + j] += FE0_C0_Q4a8[0][0][iq][j] * t0[i];
}
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.