Skip to content

Commit bbb82e9

Browse files
committed
k
1 parent c3c5de5 commit bbb82e9

File tree

2 files changed

+31
-31
lines changed

2 files changed

+31
-31
lines changed

test/test_mixed_function_space_with_mesh_sequence.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_mixed_function_space_with_mesh_sequence_cell():
4747
dx2 = Measure(
4848
"dx",
4949
mesh2,
50-
extra_measures=(
50+
intersect_measures=(
5151
Measure("dx", mesh0),
5252
Measure("dx", mesh1),
5353
),
@@ -106,12 +106,12 @@ def test_mixed_function_space_with_mesh_sequence_facet():
106106
dS1 = Measure(
107107
"dS",
108108
mesh1,
109-
extra_measures=(Measure("ds", mesh2),),
109+
intersect_measures=(Measure("ds", mesh2),),
110110
)
111111
ds2 = Measure(
112112
"ds",
113113
mesh2,
114-
extra_measures=(
114+
intersect_measures=(
115115
Measure("dS", mesh0),
116116
Measure("ds", mesh1),
117117
),

ufl/measure.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ class Measure:
104104

105105
__slots__ = (
106106
"_domain",
107-
"_extra_measures",
108107
"_integral_type",
108+
"_intersect_measures",
109109
"_metadata",
110110
"_subdomain_data",
111111
"_subdomain_id",
@@ -118,7 +118,7 @@ def __init__(
118118
subdomain_id="everywhere",
119119
metadata=None,
120120
subdomain_data=None,
121-
extra_measures=None,
121+
intersect_measures=None,
122122
):
123123
"""Initialise.
124124
@@ -130,10 +130,10 @@ def __init__(
130130
affecting how code is generated, including parameters
131131
for optimization or debugging of generated code
132132
subdomain_data: object representing data to interpret subdomain_id with
133-
extra_measures: a `tuple` of extra measures that defines
133+
intersect_measures: a `tuple` of extra measures that defines
134134
domain-integral_type map for each domain in a multi-domain problem. For instance,
135135
if integral_type="dS" on ``domain``, while integral_type="ds" on domainZ, say,
136-
one must pass extra_measures=(Measure("ds", domainZ),). Currently,
136+
one must pass intersect_measures=(Measure("ds", domainZ),). Currently,
137137
the extra measures must have "everywhere" subdomain_id.
138138
"""
139139
# Map short name to long name and require a valid one
@@ -169,25 +169,25 @@ def __init__(
169169
raise ValueError("Invalid metadata.")
170170
self._metadata = metadata or {}
171171

172-
if extra_measures is None:
173-
self._extra_measures = ()
172+
if intersect_measures is None:
173+
self._intersect_measures = ()
174174
else:
175-
if not all(m.subdomain_id() == "everywhere" for m in extra_measures):
175+
if not all(m.subdomain_id() == "everywhere" for m in intersect_measures):
176176
raise NotImplementedError(
177177
f"Currently, all extra measures must have 'everywhere' subdomain_id: "
178-
f"got {extra_measures}"
178+
f"got {intersect_measures}"
179179
)
180-
if not all(m.extra_measures() == () for m in extra_measures):
180+
if not all(m.intersect_measures() == () for m in intersect_measures):
181181
raise ValueError(
182-
f"All extra measures must have empty extra_measures: got {extra_measures}"
182+
f"All extra measures must have empty intersect_measures: got {intersect_measures}"
183183
)
184-
if not all(m.metadata() == {} for m in extra_measures):
184+
if not all(m.metadata() == {} for m in intersect_measures):
185185
raise ValueError(
186-
f"All extra measures must have empty metadata: got {extra_measures}"
186+
f"All extra measures must have empty metadata: got {intersect_measures}"
187187
)
188-
_extra_measures = {}
189-
self._extra_measures = tuple(
190-
sorted(extra_measures, key=lambda m: m.ufl_domain()._ufl_sort_key_())
188+
_intersect_measures = {}
189+
self._intersect_measures = tuple(
190+
sorted(intersect_measures, key=lambda m: m.ufl_domain()._ufl_sort_key_())
191191
)
192192

193193
def integral_type(self):
@@ -208,9 +208,9 @@ def subdomain_id(self):
208208
"""Return the domain id of this measure (integer)."""
209209
return self._subdomain_id
210210

211-
def extra_measures(self):
211+
def intersect_measures(self):
212212
"""Return the extra measures."""
213-
return self._extra_measures
213+
return self._intersect_measures
214214

215215
def metadata(self):
216216
"""Return the integral metadata.
@@ -228,7 +228,7 @@ def reconstruct(
228228
domain=None,
229229
metadata=None,
230230
subdomain_data=None,
231-
extra_measures=None,
231+
intersect_measures=None,
232232
):
233233
"""Construct a new Measure object with some properties replaced with new values.
234234
@@ -245,8 +245,8 @@ def reconstruct(
245245
subdomain_id = self.subdomain_id()
246246
if domain is None:
247247
domain = self.ufl_domain()
248-
if extra_measures is None:
249-
extra_measures = self.extra_measures()
248+
if intersect_measures is None:
249+
intersect_measures = self.intersect_measures()
250250
if metadata is None:
251251
metadata = self.metadata()
252252
if subdomain_data is None:
@@ -257,7 +257,7 @@ def reconstruct(
257257
subdomain_id=subdomain_id,
258258
metadata=metadata,
259259
subdomain_data=subdomain_data,
260-
extra_measures=extra_measures,
260+
intersect_measures=intersect_measures,
261261
)
262262

263263
def subdomain_data(self):
@@ -328,8 +328,8 @@ def __str__(self):
328328
args.append(f"subdomain_id={self._subdomain_id}")
329329
if self._domain is not None:
330330
args.append(f"domain={self._domain}")
331-
if self._extra_measures:
332-
args.append(f"extra_measures={self._extra_measures}")
331+
if self._intersect_measures:
332+
args.append(f"intersect_measures={self._intersect_measures}")
333333
if self._metadata: # Stored as {} if None
334334
args.append(f"metadata={self._metadata}")
335335
if self._subdomain_data is not None:
@@ -346,8 +346,8 @@ def __repr__(self):
346346
args.append(f"subdomain_id={self._subdomain_id!r}")
347347
if self._domain is not None:
348348
args.append(f"domain={self._domain!r}")
349-
if self._extra_measures:
350-
args.append(f"extra_measures={self._extra_measures!r}")
349+
if self._intersect_measures:
350+
args.append(f"intersect_measures={self._intersect_measures!r}")
351351
if self._metadata: # Stored as {} if None
352352
args.append(f"metadata={self._metadata!r}")
353353
if self._subdomain_data is not None:
@@ -365,7 +365,7 @@ def __hash__(self):
365365
hash(self._domain),
366366
metadata_hashdata,
367367
id_or_none(self._subdomain_data),
368-
self._extra_measures,
368+
self._intersect_measures,
369369
)
370370
return hash(hashdata)
371371

@@ -383,7 +383,7 @@ def __eq__(self, other):
383383
and self._domain == other._domain
384384
and id_or_none(self._subdomain_data) == id_or_none(other._subdomain_data)
385385
and sorted_metadata == sorted_other_metadata
386-
and self._extra_measures == other._extra_measures
386+
and self._intersect_measures == other._intersect_measures
387387
)
388388

389389
def __add__(self, other):
@@ -492,7 +492,7 @@ def __rmul__(self, integrand):
492492
metadata=self.metadata(),
493493
subdomain_data=self.subdomain_data(),
494494
extra_domain_integral_type_map={
495-
m.ufl_domain(): m.integral_type() for m in self.extra_measures()
495+
m.ufl_domain(): m.integral_type() for m in self.intersect_measures()
496496
},
497497
)
498498
return Form([integral])

0 commit comments

Comments
 (0)