Skip to content

Commit 62cb2c3

Browse files
committed
Delegating new signature of CellBasis(trian,...)
1 parent 0130040 commit 62cb2c3

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

src/FESpaces/FEBases.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function CellBasis(
6464
trian::Triangulation{D,Z},
6565
fun::Function,
6666
b::FEBasis,
67-
u::Vararg{<:CellField{Z}}) where {D,Z}
67+
u...) where {D,Z}
6868
basis = CellBasis(trian,fun,b.cellbasis,u...)
6969
FEBasis(basis,trian)
7070
end

src/MultiField/MultiFEBases.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function CellBasis(
2727
trian::Triangulation{D,Z},
2828
fun::Function,
2929
b::FEBasisWithFieldId,
30-
u::Vararg{<:CellField{Z}}) where {D,Z}
30+
u...) where {D,Z}
3131

3232
febasis = CellBasis(trian,fun,b.febasis,u...)
3333
FEBasisWithFieldId(febasis,b.fieldid)

test/FESpacesTests/FEBasesTests.jl

+4-3
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ uh = interpolate(fespace,ufun)
2828
trian = Triangulation(model)
2929
quad = CellQuadrature(trian,order=2)
3030

31-
σfun(x,u) = x[1] + u
32-
σ(u) = CellBasis(trian,σfun,u)
33-
cm = inner(bh,σ(bh))
31+
σfun(x,u,i) = x[1] + u
32+
σ(u,i) = CellBasis(trian,σfun,u,i)
33+
ids = ones(Int,ncells(trian))
34+
cm = inner(bh,σ(bh,ids))
3435
m = integrate(cm,trian,quad)
3536
_ = collect(m)
3637

test/FESpacesTests/VectorValuedFEOperatorsTests.jl

+3-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const λ = (E*ν)/((1+ν)*(1-2*ν))
8181
const μ = E/(2*(1+ν))
8282

8383
# Constitutive law
84-
@law σ(x,ε) = λ*tr(ε)*one(ε) + 2*μ*ε
84+
@law σ(x,ε,id) = λ*tr(ε)*one(ε) + 2*μ*ε
8585

8686
# Define manufactured functions
8787
ufun(x) = VectorValue(x[1] + x[2],x[1])
@@ -108,7 +108,8 @@ quad = CellQuadrature(trian,order=2)
108108

109109
# Terms in the volume
110110
bfield = CellField(trian,bfun)
111-
a_elast(v,u) = inner( ε(v), σ(ε(u)) )
111+
ids = ones(Int,ncells(trian))
112+
a_elast(v,u) = inner( ε(v), σ(ε(u),ids) )
112113
b(v) = inner(v,bfield)
113114
t_Ω = AffineFETerm(a_elast,b,trian,quad)
114115

test/MultiFieldTests/MultiFEBasesTests.jl

+5
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,9 @@ bh = FEBasis(V)
9696
@test isa(div(bh[1]),FEBasisWithFieldId)
9797
@test isa(curl(bh[1]),FEBasisWithFieldId)
9898

99+
σfun(x,u,i) = i*u
100+
ids = ones(Int,ncells(trian))
101+
cb = CellBasis(trian,σfun,bh[1],ids)
102+
@test isa(cb,FEBasisWithFieldId)
103+
99104
end # module MultiFEBasesTests

0 commit comments

Comments
 (0)