Skip to content

Commit

Permalink
Delegating new signature of CellBasis(trian,...)
Browse files Browse the repository at this point in the history
  • Loading branch information
fverdugo committed Sep 3, 2019
1 parent 0130040 commit 62cb2c3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/FESpaces/FEBases.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function CellBasis(
trian::Triangulation{D,Z},
fun::Function,
b::FEBasis,
u::Vararg{<:CellField{Z}}) where {D,Z}
u...) where {D,Z}
basis = CellBasis(trian,fun,b.cellbasis,u...)
FEBasis(basis,trian)
end
Expand Down
2 changes: 1 addition & 1 deletion src/MultiField/MultiFEBases.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function CellBasis(
trian::Triangulation{D,Z},
fun::Function,
b::FEBasisWithFieldId,
u::Vararg{<:CellField{Z}}) where {D,Z}
u...) where {D,Z}

febasis = CellBasis(trian,fun,b.febasis,u...)
FEBasisWithFieldId(febasis,b.fieldid)
Expand Down
7 changes: 4 additions & 3 deletions test/FESpacesTests/FEBasesTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ uh = interpolate(fespace,ufun)
trian = Triangulation(model)
quad = CellQuadrature(trian,order=2)

σfun(x,u) = x[1] + u
σ(u) = CellBasis(trian,σfun,u)
cm = inner(bh,σ(bh))
σfun(x,u,i) = x[1] + u
σ(u,i) = CellBasis(trian,σfun,u,i)
ids = ones(Int,ncells(trian))
cm = inner(bh,σ(bh,ids))
m = integrate(cm,trian,quad)
_ = collect(m)

Expand Down
5 changes: 3 additions & 2 deletions test/FESpacesTests/VectorValuedFEOperatorsTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const λ = (E*ν)/((1+ν)*(1-2*ν))
const μ = E/(2*(1+ν))

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

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

# Terms in the volume
bfield = CellField(trian,bfun)
a_elast(v,u) = inner( ε(v), σ(ε(u)) )
ids = ones(Int,ncells(trian))
a_elast(v,u) = inner( ε(v), σ(ε(u),ids) )
b(v) = inner(v,bfield)
t_Ω = AffineFETerm(a_elast,b,trian,quad)

Expand Down
5 changes: 5 additions & 0 deletions test/MultiFieldTests/MultiFEBasesTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,9 @@ bh = FEBasis(V)
@test isa(div(bh[1]),FEBasisWithFieldId)
@test isa(curl(bh[1]),FEBasisWithFieldId)

σfun(x,u,i) = i*u
ids = ones(Int,ncells(trian))
cb = CellBasis(trian,σfun,bh[1],ids)
@test isa(cb,FEBasisWithFieldId)

end # module MultiFEBasesTests

0 comments on commit 62cb2c3

Please sign in to comment.