Skip to content

Commit c13c926

Browse files
authored
Remove tdim mapping input (#238)
* Remove tdim input from mappings function * changelog * , * remove tdim input from perform_mapping * remove tdims
1 parent ed72de2 commit c13c926

File tree

4 files changed

+57
-53
lines changed

4 files changed

+57
-53
lines changed

CHANGELOG_SINCE_LAST_VERSION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Remove tdim input from mappings functions

symfem/finite_element.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ def map_to_cell(
682682
for ds in dofs_by_type.values():
683683
mapped_dofs = self.dofs[ds[0]].perform_mapping(
684684
[basis[d] for d in ds],
685-
forward_map, inverse_map, self.reference.tdim)
685+
forward_map, inverse_map)
686686
for d_n, mdof in zip(ds, mapped_dofs):
687687
functions[d_n] = mdof
688688

symfem/functionals.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,21 +85,20 @@ def entity_number(self) -> int:
8585
return self.entity[1]
8686

8787
def perform_mapping(
88-
self, fs: typing.List[AnyFunction], map: PointType, inverse_map: PointType, tdim: int
88+
self, fs: typing.List[AnyFunction], map: PointType, inverse_map: PointType
8989
) -> typing.List[AnyFunction]:
9090
"""Map functions to a cell.
9191
9292
Args:
9393
fs: functions
9494
map: Map from the reference cell to a physical cell
9595
inverse_map: Map to the reference cell from a physical cell
96-
tdim: The topological dimension of the cell
9796
9897
Returns:
9998
Mapped functions
10099
"""
101100
assert self.mapping is not None
102-
return [getattr(mappings, self.mapping)(f, map, inverse_map, tdim) for f in fs]
101+
return [getattr(mappings, self.mapping)(f, map, inverse_map) for f in fs]
103102

104103
def entity_tex(self) -> str:
105104
"""Get the entity the DOF is associated with in TeX format.
@@ -387,15 +386,14 @@ def adjusted_dof_point(self) -> PointType:
387386
return self.dof_point()
388387

389388
def perform_mapping(
390-
self, fs: typing.List[AnyFunction], map: PointType, inverse_map: PointType, tdim: int
389+
self, fs: typing.List[AnyFunction], map: PointType, inverse_map: PointType
391390
) -> typing.List[AnyFunction]:
392391
"""Map functions to a cell.
393392
394393
Args:
395394
fs: functions
396395
map: Map from the reference cell to a physical cell
397396
inverse_map: Map to the reference cell from a physical cell
398-
tdim: The topological dimension of the cell
399397
400398
Returns:
401399
Mapped functions
@@ -882,15 +880,13 @@ def __init__(self, reference: Reference, f_in: FunctionInput,
882880
assert len(f) == self.integral_domain.tdim
883881
self.f = mappings.contravariant(
884882
f, self.integral_domain.get_map_to_self(),
885-
self.integral_domain.get_inverse_map_to_self(),
886-
self.integral_domain.tdim)
883+
self.integral_domain.get_inverse_map_to_self())
887884
elif f.is_matrix:
888885
assert f.shape[0] == self.integral_domain.tdim
889886
assert f.shape[1] == self.integral_domain.tdim
890887
self.f = mappings.double_contravariant(
891888
f, self.integral_domain.get_map_to_self(),
892-
self.integral_domain.get_inverse_map_to_self(),
893-
self.integral_domain.tdim)
889+
self.integral_domain.get_inverse_map_to_self())
894890
else:
895891
self.f = f
896892

@@ -1078,15 +1074,14 @@ def _eval_symbolic(self, function: AnyFunction) -> AnyFunction:
10781074
return integrand.integral(self.integral_domain)
10791075

10801076
def perform_mapping(
1081-
self, fs: typing.List[AnyFunction], map: PointType, inverse_map: PointType, tdim: int
1077+
self, fs: typing.List[AnyFunction], map: PointType, inverse_map: PointType
10821078
) -> typing.List[AnyFunction]:
10831079
"""Map functions to a cell.
10841080
10851081
Args:
10861082
fs: functions
10871083
map: Map from the reference cell to a physical cell
10881084
inverse_map: Map to the reference cell from a physical cell
1089-
tdim: The topological dimension of the cell
10901085
10911086
Returns:
10921087
Mapped functions
@@ -1155,13 +1150,13 @@ def __init__(self, reference: Reference,
11551150
if self.f.is_vector and len(self.f) != reference.gdim:
11561151
self.f = mappings.contravariant(
11571152
self.f, id_def.get_map_to_self(),
1158-
id_def.get_inverse_map_to_self(), id_def.tdim)
1153+
id_def.get_inverse_map_to_self())
11591154
elif self.f.is_matrix:
11601155
assert self.f.shape[0] == id_def.tdim
11611156
assert self.f.shape[1] == id_def.tdim
11621157
self.f = mappings.double_contravariant(
11631158
self.f, id_def.get_map_to_self(),
1164-
id_def.get_inverse_map_to_self(), id_def.tdim)
1159+
id_def.get_inverse_map_to_self())
11651160

11661161
# Map from default reference to reference
11671162
if map_function and reference != reference.default_reference():
@@ -1170,7 +1165,7 @@ def __init__(self, reference: Reference,
11701165
mf = getattr(mappings, f"{mapping}_inverse_transpose")
11711166
self.f = mf(self.f, reference.get_map_to_self(),
11721167
reference.get_inverse_map_to_self(),
1173-
reference.tdim, substitute=False)
1168+
substitute=False)
11741169
self.f *= id_def.volume() / self.integral_domain.volume()
11751170

11761171
def _eval_symbolic(self, function: AnyFunction) -> AnyFunction:

0 commit comments

Comments
 (0)