|
30 | 30 | )
|
31 | 31 | from ufl.algorithms import expand_derivatives
|
32 | 32 | from ufl.algorithms.apply_derivatives import apply_derivatives
|
| 33 | +from ufl.coefficient import Cofunction |
33 | 34 | from ufl.core.external_operator import ExternalOperator
|
34 | 35 | from ufl.form import BaseForm, ZeroBaseForm
|
35 | 36 | from ufl.pullback import identity_pullback
|
@@ -551,20 +552,24 @@ def test_extraction_external_operator_composition(V1, V2, V3, V4, V5):
|
551 | 552 | assert u2.ufl_function_space() == V2
|
552 | 553 | assert u1.ufl_function_space() == V1
|
553 | 554 |
|
554 |
| - arg1 = Argument(V1, 0) |
555 |
| - vstar1 = Argument(V1.dual(), 0) |
556 |
| - e1 = ExternalOperator(arg1, function_space=V1, argument_slots=(vstar1, arg1)) |
557 |
| - |
| 555 | + u1 = Cofunction(V1.dual()) |
558 | 556 | arg2 = Argument(V2, 0)
|
559 |
| - e2 = ExternalOperator(arg2, function_space=V2, argument_slots=(e1, arg2)) |
| 557 | + e1 = ExternalOperator(arg2, function_space=V1, argument_slots=(u1, arg2)) |
560 | 558 |
|
561 | 559 | arg3 = Argument(V3, 0)
|
562 |
| - e3 = ExternalOperator(arg3, function_space=V3, argument_slots=(e2, arg3)) |
| 560 | + e2 = ExternalOperator(arg3, function_space=V2, argument_slots=(e1, arg3)) |
563 | 561 |
|
564 | 562 | arg4 = Argument(V4, 0)
|
565 |
| - e4 = ExternalOperator(arg4, function_space=V4, argument_slots=(e3, arg4)) |
| 563 | + e3 = ExternalOperator(arg4, function_space=V3, argument_slots=(e2, arg4)) |
| 564 | + |
| 565 | + arg5 = Argument(V5, 0) |
| 566 | + e4 = ExternalOperator(arg5, function_space=V4, argument_slots=(e3, arg5)) |
566 | 567 |
|
567 | 568 | args = extract_arguments(e4)
|
568 | 569 |
|
569 |
| - assert all(isinstance(arg, Argument | Coargument) for arg in args) |
570 |
| - assert set(args) == {arg1, vstar1, arg2, arg3, arg4} |
| 570 | + assert e1.ufl_function_space() == V2.dual() |
| 571 | + assert e2.ufl_function_space() == V3.dual() |
| 572 | + assert e3.ufl_function_space() == V4.dual() |
| 573 | + assert e4.ufl_function_space() == V5.dual() |
| 574 | + |
| 575 | + assert set(args) == {arg2, arg3, arg4, arg5, Argument(V1, 0)} |
0 commit comments