diff --git a/ext/TopOptMakieExt/TopOptMakieExt.jl b/ext/TopOptMakieExt/TopOptMakieExt.jl index d75e2042..72c0d62d 100644 --- a/ext/TopOptMakieExt/TopOptMakieExt.jl +++ b/ext/TopOptMakieExt/TopOptMakieExt.jl @@ -226,7 +226,7 @@ function TopOpt.visualize( # https://jkrumbiegel.github.io/MakieLayout.jl/v0.3/layoutables/#LScene-1 # https://makie.juliaplots.org/stable/cameras.html#D-Camera # ax1 = layout[1, 1] = LScene(scene, camera = cam3d!, raw = false) - ax1 = LScene(fig[1, 1]; scenekw=(camera=cam3d!, raw=false)) # , height=750 + ax1 = LScene(fig[1, 1]; scenekw=(camera=(cam3d!), raw=false)) # , height=750 end # * support / load appearance / deformatione exaggeration control @@ -417,7 +417,7 @@ function TopOpt.visualize( # ax1.aspect = AxisAspect(1) ax1.aspect = DataAspect() else - ax1 = LScene(fig[1, 1]; scenekw=(camera=cam3d!, raw=false)) #, height=750) + ax1 = LScene(fig[1, 1]; scenekw=(camera=(cam3d!), raw=false)) #, height=750) end # * linewidth scaling / support / load appearance / deformatione exaggeration control diff --git a/src/CheqFilters/density_filter.jl b/src/CheqFilters/density_filter.jl index e1f96a7f..1815f15d 100644 --- a/src/CheqFilters/density_filter.jl +++ b/src/CheqFilters/density_filter.jl @@ -19,7 +19,7 @@ function DensityFilter( return DensityFilter(Val(filtering), solver, args...) end function DensityFilter( - ::Val{true}, solver::TS, rmin::T, ::Type{TI}=Int + ::Val{true}, solver::TS, rmin::T, (::Type{TI})=Int ) where {T,TI<:Integer,TS<:AbstractFEASolver} metadata = FilterMetadata(solver, rmin, TI) TM = typeof(metadata) @@ -36,7 +36,7 @@ function DensityFilter( end function DensityFilter( - ::Val{false}, solver::TS, rmin::T, ::Type{TI}=Int + ::Val{false}, solver::TS, rmin::T, (::Type{TI})=Int ) where {T,TS<:AbstractFEASolver,TI<:Integer} metadata = FilterMetadata(T, TI) jacobian = zeros(T, 0, 0) diff --git a/src/CheqFilters/sens_filter.jl b/src/CheqFilters/sens_filter.jl index bb5ecf9d..f9c1a61d 100644 --- a/src/CheqFilters/sens_filter.jl +++ b/src/CheqFilters/sens_filter.jl @@ -23,7 +23,7 @@ function SensFilter(::Val{filtering}, solver::AbstractFEASolver, args...) where return SensFilter(Val(filtering), solver, args...) end function SensFilter( - ::Val{true}, solver::TS, rmin::T, ::Type{TI}=Int + ::Val{true}, solver::TS, rmin::T, (::Type{TI})=Int ) where {T,TI<:Integer,TS<:AbstractFEASolver} metadata = FilterMetadata(solver, rmin, TI) TM = typeof(metadata) @@ -47,7 +47,7 @@ function SensFilter( end function SensFilter( - ::Val{false}, solver::TS, rmin::T, ::Type{TI}=Int + ::Val{false}, solver::TS, rmin::T, (::Type{TI})=Int ) where {T,TS<:AbstractFEASolver,TI<:Integer} elementinfo = solver.elementinfo metadata = FilterMetadata(T, TI) diff --git a/src/FEA/assembly_cg_displacement_solvers.jl b/src/FEA/assembly_cg_displacement_solvers.jl index 98a77548..9effd56a 100644 --- a/src/FEA/assembly_cg_displacement_solvers.jl +++ b/src/FEA/assembly_cg_displacement_solvers.jl @@ -76,7 +76,7 @@ function PCGDisplacementSolver( end function (s::PCGDisplacementSolver{T})( - ::Type{Val{safe}}=Val{false}; + (::Type{Val{safe}})=Val{false}; assemble_f=true, rhs=assemble_f ? s.globalinfo.f : s.rhs, lhs=assemble_f ? s.u : s.lhs, diff --git a/src/FEA/direct_displacement_solver.jl b/src/FEA/direct_displacement_solver.jl index c6fa5670..8445edd2 100644 --- a/src/FEA/direct_displacement_solver.jl +++ b/src/FEA/direct_displacement_solver.jl @@ -46,8 +46,8 @@ function DirectDisplacementSolver( ) end function (s::DirectDisplacementSolver{T})( - ::Type{Val{safe}}=Val{false}, - ::Type{newT}=T; + (::Type{Val{safe}})=Val{false}, + (::Type{newT})=T; assemble_f=true, reuse_fact=false, rhs=assemble_f ? s.globalinfo.f : s.rhs, diff --git a/src/Functions/trace.jl b/src/Functions/trace.jl index 8a3213e3..307ac9ad 100644 --- a/src/Functions/trace.jl +++ b/src/Functions/trace.jl @@ -42,7 +42,7 @@ struct TraceEstimationMean{TF,TV,TM} <: AbstractTraceEstimationMeanMethod sample_method::TM end function TraceEstimationMean( - F::SparseMatrixCSC, nv::Int, sample_once::Bool=true, sample_method=hutch_rand! + F::SparseMatrixCSC, nv::Int, sample_once::Bool=true, sample_method=(hutch_rand!) ) V = zeros(eltype(F), size(F, 2), nv) sample_method(V) @@ -56,7 +56,7 @@ struct TraceEstimationSVDMean{TUS,TV,TM} <: AbstractTraceEstimationMeanMethod sample_method::TM end function TraceEstimationSVDMean( - F::SparseMatrixCSC, nv::Int, sample_once::Bool=true, sample_method=hutch_rand! + F::SparseMatrixCSC, nv::Int, sample_once::Bool=true, sample_method=(hutch_rand!) ) US = ExactSVDMean(F).US V = zeros(eltype(F), size(US, 2), nv) @@ -65,7 +65,10 @@ function TraceEstimationSVDMean( return TraceEstimationSVDMean(US, size(F, 2), V, sample_once, sample_method) end function TraceEstimationSVDMean( - F::SparseMatrixCSC, V::AbstractMatrix, sample_once::Bool=true, sample_method=hutch_rand! + F::SparseMatrixCSC, + V::AbstractMatrix, + sample_once::Bool=true, + sample_method=(hutch_rand!), ) US = ExactSVDMean(F).US sample_once = sample_method === hadamard! || sample_once @@ -130,7 +133,7 @@ struct DiagonalEstimation{TF,TY,TQ,TV,Ttemp,TM} <: AbstractDiagonalEstimationMet sample_method::TM end function DiagonalEstimation( - F::SparseMatrixCSC, nv::Int, nE::Int, sample_once::Bool=true, sample_method=hadamard! + F::SparseMatrixCSC, nv::Int, nE::Int, sample_once::Bool=true, sample_method=(hadamard!) ) V = zeros(eltype(F), size(F, 2), nv) sample_method(V) @@ -145,7 +148,7 @@ function DiagonalEstimation( V::AbstractMatrix, nE::Int, sample_once::Bool=true, - sample_method=hadamard!, + sample_method=(hadamard!), ) nv = size(V, 2) Y = zeros(eltype(F), size(F, 1), nv) diff --git a/src/TopOptProblems/IO/INP/Parser/FeatureExtractors/extract_cells.jl b/src/TopOptProblems/IO/INP/Parser/FeatureExtractors/extract_cells.jl index 634fa03e..a94b63a3 100644 --- a/src/TopOptProblems/IO/INP/Parser/FeatureExtractors/extract_cells.jl +++ b/src/TopOptProblems/IO/INP/Parser/FeatureExtractors/extract_cells.jl @@ -1,4 +1,4 @@ -function extract_cells(file, ::Type{TI}=Int) where {TI} +function extract_cells(file, (::Type{TI})=Int) where {TI} line = readline(file) cell_idx_pattern = r"^(\d+)\s*," diff --git a/src/TopOptProblems/IO/INP/Parser/FeatureExtractors/extract_material.jl b/src/TopOptProblems/IO/INP/Parser/FeatureExtractors/extract_material.jl index ed76c1ed..5c81958d 100644 --- a/src/TopOptProblems/IO/INP/Parser/FeatureExtractors/extract_material.jl +++ b/src/TopOptProblems/IO/INP/Parser/FeatureExtractors/extract_material.jl @@ -1,4 +1,4 @@ -function extract_material(file, ::Type{TF}=Float64) where {TF} +function extract_material(file, (::Type{TF})=Float64) where {TF} elastic_heading_pattern = r"\*ELASTIC" Emu_pattern = r"(-?\d+\.?\d*)\s*,\s*(-?\d+\.?\d*)" line = readline(file) diff --git a/src/TopOptProblems/IO/INP/Parser/FeatureExtractors/extract_nodes.jl b/src/TopOptProblems/IO/INP/Parser/FeatureExtractors/extract_nodes.jl index 64222d7c..18becba1 100644 --- a/src/TopOptProblems/IO/INP/Parser/FeatureExtractors/extract_nodes.jl +++ b/src/TopOptProblems/IO/INP/Parser/FeatureExtractors/extract_nodes.jl @@ -1,4 +1,4 @@ -function extract_nodes(file, ::Type{TF}=Float64, ::Type{TI}=Int) where {TF,TI} +function extract_nodes(file, (::Type{TF})=Float64, (::Type{TI})=Int) where {TF,TI} line = readline(file) pattern = r"(\d+)\s*,\s*(-?\d+\.?\d*(e[-\+]?\d*)?)\s*,\s*(-?\d+\.?\d*(e[-\+]?\d*)?)\s*(,\s*(-?\d+\.?\d*(e[-\+]?\d*)?))?" diff --git a/src/TopOptProblems/elementinfo.jl b/src/TopOptProblems/elementinfo.jl index 39ef1521..b787cd5f 100644 --- a/src/TopOptProblems/elementinfo.jl +++ b/src/TopOptProblems/elementinfo.jl @@ -70,7 +70,7 @@ Constructs an instance of `ElementFEAInfo` from a stiffness problem `sp` using a The static matrices and vectors are more performant and GPU-compatible therefore they are used by default. """ function ElementFEAInfo( - sp, quad_order=2, ::Type{Val{mat_type}}=Val{:Static} + sp, quad_order=2, (::Type{Val{mat_type}})=Val{:Static} ) where {mat_type} Kes, weights, dloads, cellvalues, facevalues = make_Kes_and_fes( sp, quad_order, Val{mat_type} @@ -124,7 +124,7 @@ end Constructs an empty instance of `GlobalFEAInfo` where the field `K` is an empty sparse matrix of element type `T` and the field `f` is an empty dense vector of element type `T`. """ -GlobalFEAInfo(::Type{T}=Float64) where {T} = GlobalFEAInfo{T}() +GlobalFEAInfo((::Type{T})=Float64) where {T} = GlobalFEAInfo{T}() function GlobalFEAInfo{T}() where {T} return GlobalFEAInfo(sparse(zeros(T, 0, 0)), zeros(T, 0), cholesky(one(T)), qr(one(T))) end diff --git a/src/TopOptProblems/grids.jl b/src/TopOptProblems/grids.jl index a4654a63..8fc955ff 100644 --- a/src/TopOptProblems/grids.jl +++ b/src/TopOptProblems/grids.jl @@ -511,7 +511,9 @@ function _QuadraticLGrid( ) end -function TieBeamGrid(::Type{Val{CellType}}, ::Type{T}=Float64, refine=1) where {T,CellType} +function TieBeamGrid( + ::Type{Val{CellType}}, (::Type{T})=Float64, refine=1 +) where {T,CellType} if CellType === :Linear return _LinearTieBeamGrid(T, refine) else @@ -519,7 +521,7 @@ function TieBeamGrid(::Type{Val{CellType}}, ::Type{T}=Float64, refine=1) where { end end -function _LinearTieBeamGrid(::Type{T}=Float64, refine=1) where {T} +function _LinearTieBeamGrid((::Type{T})=Float64, refine=1) where {T} nodes = Node{2,T}[] cells = Quadrilateral[] boundary = Tuple{Int,Int}[] @@ -642,7 +644,7 @@ function _LinearTieBeamGrid(::Type{T}=Float64, refine=1) where {T} return Grid(cells, nodes; facesets=facesets, boundary_matrix=boundary_matrix) end -function _QuadraticTieBeamGrid(::Type{T}=Float64, refine=1) where {T} +function _QuadraticTieBeamGrid((::Type{T})=Float64, refine=1) where {T} nodes = Node{2,T}[] cells = QuadraticQuadrilateral[] boundary = Tuple{Int,Int}[] diff --git a/src/TopOptProblems/problem_types.jl b/src/TopOptProblems/problem_types.jl index 917d07ad..283249ed 100644 --- a/src/TopOptProblems/problem_types.jl +++ b/src/TopOptProblems/problem_types.jl @@ -463,7 +463,7 @@ problem = LBeam(Val{celltype}, E = E, ν = ν, force = force) """ function LBeam( ::Type{Val{CellType}}, - ::Type{T}=Float64; + (::Type{T})=Float64; length=100, height=100, upperslab=50, @@ -637,7 +637,7 @@ end - `CellType`: can be either `:Linear` or `:Quadratic` to determine the order of the geometric and field basis functions and element type. Only isoparametric elements are supported for now. """ function TieBeam( - ::Type{Val{CellType}}, ::Type{T}=Float64, refine=1, force=T(1); E=T(1), ν=T(0.3) + ::Type{Val{CellType}}, (::Type{T})=Float64, refine=1, force=T(1); E=T(1), ν=T(0.3) ) where {T,CellType} grid = TieBeamGrid(Val{CellType}, T, refine) dh = DofHandler(grid) diff --git a/src/TrussTopOptProblems/elementinfo.jl b/src/TrussTopOptProblems/elementinfo.jl index f25df57f..86379747 100644 --- a/src/TrussTopOptProblems/elementinfo.jl +++ b/src/TrussTopOptProblems/elementinfo.jl @@ -12,7 +12,7 @@ Constructs an instance of `ElementFEAInfo` from a stiffness **truss** problem `s The static matrices and vectors are more performant and GPU-compatible therefore they are used by default. """ function ElementFEAInfo( - sp::TrussProblem, quad_order=1, ::Type{Val{mat_type}}=Val{:Static} + sp::TrussProblem, quad_order=1, (::Type{Val{mat_type}})=Val{:Static} ) where {mat_type} # weights: self-weight element load vectors, all zeros now Kes, weights, cellvalues, facevalues = make_Kes_and_fes(sp, quad_order, Val{mat_type}) diff --git a/src/Utilities/utils.jl b/src/Utilities/utils.jl index 65ce16ce..7a70b232 100644 --- a/src/Utilities/utils.jl +++ b/src/Utilities/utils.jl @@ -98,7 +98,7 @@ function Base.setindex!(ra::RaggedArray, v, i, j) return ra.values[r[i]] = v end -function find_varind(black, white, ::Type{TI}=Int) where {TI} +function find_varind(black, white, (::Type{TI})=Int) where {TI} nel = length(black) nel == length(white) || throw("Black and white vectors should be of the same length") varind = zeros(TI, nel)