1
2 """
3 This module contains representation classes for integrals.
4 """
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 import swiginac
28
29
30 from sfc.common import sfc_assert, sfc_warning, sfc_debug, sfc_error
31 from ufl.permutation import compute_indices
32
33
34 from sfc.representation.integralrepresentationbase import IntegralRepresentationBase
35
37 - def __init__(self, integrals, formrep, on_facet):
38 IntegralRepresentationBase.__init__(self, integrals, formrep, on_facet)
39
40
41 A_shape = []
42 for i in range(self.formrep.rank):
43 element = self.formrep.formdata.elements[i]
44 rep = self.formrep.element_reps[element]
45 A_shape.append(rep.local_dimension)
46 self.A_shape = tuple(A_shape)
47
48
49
50 self.indices = compute_indices(self.A_shape)
51
52 self.num_quadrature_points = (formrep.facet_quad_rules[0].num_points
53 if on_facet
54 else formrep.quad_rule.num_points)
55
59
63
67
68
69 CellIntegralRepresentation = UflacsCellIntegralRepresentation
70 ExteriorFacetIntegralRepresentation = UflacsExteriorFacetIntegralRepresentation
71 InteriorFacetIntegralRepresentation = UflacsInteriorFacetIntegralRepresentation
72