88#
99# Modified by Nacime Bouziani, 2021-2022
1010
11- from ufl .action import Action
1211from ufl .argument import Argument , Coargument
13- from ufl .coefficient import Cofunction
1412from ufl .constantvalue import as_ufl
1513from ufl .core .base_form_operator import BaseFormOperator
1614from ufl .core .ufl_type import ufl_type
1715from ufl .duals import is_dual
18- from ufl .form import BaseForm , Form
16+ from ufl .form import BaseForm
1917from ufl .functionspace import AbstractFunctionSpace
2018
2119
@@ -35,16 +33,15 @@ def __init__(self, expr, v):
3533 v: the FunctionSpace to interpolate into or the Coargument
3634 defined on the dual of the FunctionSpace to interpolate into.
3735 """
38- # This check could be more rigorous.
39- dual_args = (Coargument , Cofunction , Form , Action , BaseFormOperator )
36+ dual_args = (Coargument , BaseForm )
4037
4138 if isinstance (v , AbstractFunctionSpace ):
4239 if is_dual (v ):
4340 raise ValueError ("Expecting a primal function space." )
4441 v = Argument (v .dual (), 0 )
4542 elif not isinstance (v , dual_args ):
4643 raise ValueError (
47- "Expecting the second argument to be FunctionSpace, FiniteElement or dual ."
44+ "Expecting the second argument to be FunctionSpace, Coargument, or BaseForm ."
4845 )
4946
5047 expr = as_ufl (expr )
@@ -54,11 +51,9 @@ def __init__(self, expr, v):
5451 # Reversed order convention
5552 argument_slots = (v , expr )
5653 # Get the primal space (V** = V)
57- if isinstance (v , BaseForm ):
58- arg , * _ = v .arguments ()
59- function_space = arg .ufl_function_space ()
60- else :
61- function_space = v .ufl_function_space ().dual ()
54+ arg , * _ = v .arguments ()
55+ function_space = arg .ufl_function_space ()
56+
6257 # Set the operand as `expr` for DAG traversal purpose.
6358 operand = expr
6459 BaseFormOperator .__init__ (
0 commit comments