Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ version = "1.11.0"
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "LLVMOpenMP_jll", "Libdl"]
git-tree-sha1 = "20e95d695fb99e96765770247523eb64284d9143"
uuid = "c3015cfb-32aa-504c-ba3d-5541e7ecaf35"
version = "24.8.0+0"
version = "25.1.0+0"
Binary file removed docs/.DS_Store
Binary file not shown.
1 change: 0 additions & 1 deletion examples/BSpline_example.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Plots
using Gismo
import Gismo.size

KV = KnotVector([0.,0.,0.,1.,1.,1.])
BB = BSplineBasis(KV)
Expand Down
16 changes: 8 additions & 8 deletions examples/OptionList_example.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ println(options)
gsOptionList = OptionList(options)
println(gsOptionList)

Gismo.setInt(gsOptionList,"a",2)
Gismo.setReal(gsOptionList,"b",2.0)
Gismo.setSwitch(gsOptionList,"c",false)
Gismo.setString(gsOptionList,"d","two")
setInt(gsOptionList,"a",2)
setReal(gsOptionList,"b",2.0)
setSwitch(gsOptionList,"c",false)
setString(gsOptionList,"d","two")
println(gsOptionList)

int::Int = Gismo.getInt(gsOptionList,"a")
int::Int = getInt(gsOptionList,"a")
println("Integer read from option list: ",int)
double::Float64 = Gismo.getReal(gsOptionList,"b")
double::Float64 = getReal(gsOptionList,"b")
println("Double read from option list: ",double)
bool::Bool = Gismo.getSwitch(gsOptionList,"c")
bool::Bool = getSwitch(gsOptionList,"c")
println("Bool read from option list: ",bool)
string::Cstring = Gismo.getString(gsOptionList,"d")
string::Cstring = getString(gsOptionList,"d")
println("String read from option list: ",string)
1 change: 0 additions & 1 deletion examples/THBSpline_example.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Plots
using Gismo
import Gismo.size

KV = KnotVector([0.,0.,0.,1.,1.,1.])
TBB = TensorBSplineBasis(KV,KV)
Expand Down
3 changes: 0 additions & 3 deletions examples/TensorBSpline_example.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Plots
using Gismo
import Gismo.size

KV = KnotVector([0.,0.,0.,1.,1.,1.])
TBB = TensorBSplineBasis(KV,KV)
Expand All @@ -13,8 +12,6 @@ coefs = rand(size(TBB),3)
# Create a BSpline geometry
TB = TensorBSpline(TBB,coefs)

Gismo.size(KV)

# Create a matrix of linearly spaced evaluation points
N = 10
points1D = range(0,stop=1,length=N)
Expand Down
3 changes: 3 additions & 0 deletions src/Gismo.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Import Base.size to be able to overload it
import Base.size

module Gismo

import gismo_jll:libgismo
Expand Down
13 changes: 5 additions & 8 deletions src/gsCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,8 @@ Returns the size of a basis
- `obj::Basis`: a Gismo Basis

"""
function size(obj::Basis)::Int
return ccall((:gsBasis_size,libgismo),Cint,(Ptr{gsCBasis},),obj.ptr)
end
function Base.size(obj::Basis)::Int
return Gismo.size(obj)
return ccall((:gsBasis_size,libgismo),Cint,(Ptr{gsCBasis},),obj.ptr)
end

"""
Expand Down Expand Up @@ -285,7 +282,7 @@ Returns the evaluation of a single basis function
- `u::Matrix{Cdouble}`: a matrix of points

"""
function evalSingle(obj::Basis,i::Int,u::Matrix{Cdouble})::EigenMatrix
function val(obj::Basis,i::Int,u::Matrix{Cdouble})::EigenMatrix
@assert Base.size(u,1)==domainDim(obj) "Domain dimension should be equal to the number of rows of the points"
uu = EigenMatrix(Base.size(u,1), Base.size(u,2), pointer(u) )
result = EigenMatrix()
Expand All @@ -304,7 +301,7 @@ Returns the derivative of a single basis function
- `u::Matrix{Cdouble}`: a matrix of points

"""
function derivSingle(obj::Basis,i::Int,u::Matrix{Cdouble})::EigenMatrix
function deriv(obj::Basis,i::Int,u::Matrix{Cdouble})::EigenMatrix
@assert Base.size(u,1)==domainDim(obj) "Domain dimension should be equal to the number of rows of the points"
uu = EigenMatrix(Base.size(u,1), Base.size(u,2), pointer(u) )
result = EigenMatrix()
Expand All @@ -323,7 +320,7 @@ Returns the second derivative of a single basis function
- `u::Matrix{Cdouble}`: a matrix of points

"""
function deriv2Single(obj::Basis,i::Int,u::Matrix{Cdouble})::EigenMatrix
function deriv2(obj::Basis,i::Int,u::Matrix{Cdouble})::EigenMatrix
@assert Base.size(u,1)==domainDim(obj) "Domain dimension should be equal to the number of rows of the points"
uu = EigenMatrix(Base.size(u,1), Base.size(u,2), pointer(u) )
result = EigenMatrix()
Expand Down Expand Up @@ -644,7 +641,7 @@ Returns the size of a MultiPatch (number of patches)
- `obj::MultiPatch`: a Gismo MultiPatch

"""
function size(obj::MultiPatch)::Int
function Base.size(obj::MultiPatch)::Int
return ccall((:gsFunctionSet_nPieces,libgismo),Cint,(Ptr{gsCFunctionSet},),obj.ptr)
end

Expand Down
5 changes: 1 addition & 4 deletions src/gsNurbs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,8 @@ kv = KnotVector(Float64[0.,0.,0.,0.,0.5,1.,1.,1.,1.])
# output
```
"""
function size(kv::KnotVector)::Int
return ccall((:gsKnotVector_size,libgismo),Cint,(Ptr{gsCKnotVector},),kv.ptr)
end
function Base.size(kv::KnotVector)::Int
return Gismo.size(kv)
return ccall((:gsKnotVector_size,libgismo),Cint,(Ptr{gsCKnotVector},),kv.ptr)
end

"""
Expand Down
1 change: 0 additions & 1 deletion test/runbenchmarks.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using BenchmarkTools
using BenchmarkPlots
using Gismo
import Gismo.size

KV = KnotVector([0.,0.,0.,1.,1.,1.])
TBB = TensorBSplineBasis(KV,KV)
Expand Down
1 change: 0 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Gismo
using Test
import Gismo.size

@testset verbose = true "jl" begin
@testset verbose = true "bases" begin
Expand Down
Loading