Skip to content

Commit

Permalink
k
Browse files Browse the repository at this point in the history
  • Loading branch information
ksagiyam committed Sep 15, 2023
1 parent 342a923 commit 95f0807
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
11 changes: 6 additions & 5 deletions ufl/algorithms/compute_form_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

from ufl.utils.sequences import max_degree

from ufl.classes import GeometricFacetQuantity, Coefficient, Form, FunctionSpace
from ufl.classes import GeometricFacetQuantity, Coefficient, Subspace, Form, FunctionSpace
from ufl.corealg.traversal import traverse_unique_terminals
from ufl.algorithms.analysis import extract_coefficients, extract_sub_elements, unique_tuple
from ufl.algorithms.analysis import extract_coefficients, extract_subspaces, extract_sub_elements, unique_tuple
from ufl.algorithms.formdata import FormData
from ufl.algorithms.formtransformations import compute_form_arities
from ufl.algorithms.check_arities import check_form_arity
Expand Down Expand Up @@ -128,7 +128,8 @@ def _compute_form_data_elements(self, arguments, coefficients, subspaces, domain
# almost working, with the introduction of the coordinate
# elements here.

all_elements = self.argument_elements + self.coefficient_elements + self.subspace_elements + self.coordinate_elements
all_elements = self.argument_elements + self.coefficient_elements + \
self.subspace_elements + self.coordinate_elements
all_sub_elements = extract_sub_elements(all_elements)

self.unique_elements = unique_tuple(all_elements)
Expand Down Expand Up @@ -175,7 +176,7 @@ def _build_object_replace_map(objects, element_mapping=None):
elif all(isinstance(o, Subspace) for o in objects):
object_type = Subspace
else:
raise ValueError(f"objects must either be all Coefficents or Subspaces.")
raise ValueError("objects must either be all Coefficents or Subspaces.")
if element_mapping is None:
element_mapping = {}

Expand All @@ -194,7 +195,7 @@ def _build_object_replace_map(objects, element_mapping=None):
new_objects.append(new_f)
replace_map[f] = new_f

return new_coefficients, replace_map
return new_objects, replace_map


def attach_estimated_degrees(form):
Expand Down
4 changes: 2 additions & 2 deletions ufl/algorithms/strip_terminal_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def coefficient(self, o):

def subspace(self, o):
o_new = Subspace(strip_function_space(o.ufl_function_space()),
o.count())
o.count())
return self.mapping.setdefault(o, o_new)

def constant(self, o):
Expand Down Expand Up @@ -123,4 +123,4 @@ def strip_domain(domain):
meshes = [strip_domain(mesh) for mesh in domain.ufl_meshes()]
return TensorProductMesh(meshes, domain.ufl_id())
else:
raise NotImplemen`tedError(f"{type(domain)} cannot be stripped")
raise NotImplementedError(f"{type(domain)} cannot be stripped")
1 change: 1 addition & 0 deletions ufl/projected.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from ufl.constantvalue import Zero
from ufl.core.ufl_type import ufl_type
from ufl.core.expr import Expr, ufl_err_str
from ufl.core.operator import Operator
from ufl.subspace import Subspace
from ufl.precedence import parstr
Expand Down
5 changes: 1 addition & 4 deletions ufl/subspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
from ufl.core.terminal import Terminal
from ufl.finiteelement import FiniteElementBase
from ufl.domain import default_domain
from ufl.functionspace import AbstractFunctionSpace, FunctionSpace, MixedFunctionSpace
from ufl.form import BaseForm
from ufl.split_functions import split
from ufl.functionspace import AbstractFunctionSpace, FunctionSpace
from ufl.utils.counted import Counted
from ufl.duals import is_primal, is_dual

# --- The Subspace class represents a subspace in a form ---

Expand Down

0 comments on commit 95f0807

Please sign in to comment.