Skip to content

Commit 414e1c5

Browse files
authored
Revert ProductFun space promotion (#544)
* Revert ProductFun space promotion * multiply KroneckerOperator with Fun
1 parent d3ad693 commit 414e1c5

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

src/Multivariate/ProductFun.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,8 @@ true
109109
```
110110
"""
111111
function ProductFun(M::AbstractVector{VFun{S,T}}, dy::V) where {S<:UnivariateSpace,V<:UnivariateSpace,T<:Number}
112-
sp = mapreduce(space, maxspace, M)
113-
Msp = [Fun(f, sp) for f in M]
114-
prodsp = sp dy
115-
ProductFun{S,V,typeof(prodsp),T}(Msp, prodsp)
112+
prodsp = ProductSpace(map(space, M), dy)
113+
ProductFun{S,V,typeof(prodsp),T}(copy(M), prodsp)
116114
end
117115

118116
## Adaptive construction

src/PDE/KroneckerOperator.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,16 @@ end
452452
function (*)(ko::KroneckerOperator{<:Operator, <:ConstantOperator}, pf::ProductFun)
453453
O1, O2 = ko.ops
454454
O12 = O2.λ * O1
455-
ProductFun(map(x -> O12*x, pf.coefficients), factor(pf.space, 2))
455+
vc = map(x -> O12*x, pf.coefficients)
456+
if space(pf) isa TensorSpace
457+
ProductFun(vc, space(vc[1]), factor(pf.space, 2))
458+
else
459+
ProductFun(vc, factor(pf.space, 2))
460+
end
461+
end
462+
function (*)(ko::KroneckerOperator{<:Operator, <:ConstantOperator}, f::Fun{<:TensorSpace})
463+
q = ko * ProductFun(f)
464+
Fun(q)
456465
end
457466

458467
function (*)(ko::KroneckerOperator, lrf::LowRankFun)

0 commit comments

Comments
 (0)