Skip to content

Commit

Permalink
remove ApplyStrategy enums (#1013)
Browse files Browse the repository at this point in the history
ApplyStrategy was deprecated in #489, but kept for backwards compat (having no effect). 
This PR removes them completely.
  • Loading branch information
KnutAM authored Jul 31, 2024
1 parent 5d95f89 commit f7f2592
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: |
using Ferrite, ExplicitImports, Metis, BlockArrays
# Check Ferrite
allow_unanalyzable = (ApplyStrategy, ColoringAlgorithm) # baremodules
allow_unanalyzable = (ColoringAlgorithm,) # baremodules
check_no_implicit_imports(Ferrite; allow_unanalyzable)
check_no_stale_explicit_imports(Ferrite; allow_unanalyzable)
check_all_qualified_accesses_via_owners(Ferrite)
Expand Down
6 changes: 2 additions & 4 deletions benchmark/benchmarks-boundary-conditions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,10 @@ for spatial_dim ∈ [2]

# Non-symmetric application
M, f = FerriteAssemblyHelper._assemble_mass(dh, cellvalues, false);
DIRICHLET_SUITE["global"]["apply!(M,f,APPLY_TRANSPOSE)"] = @benchmarkable apply!($M, $f, $ch; strategy=$(Ferrite.APPLY_TRANSPOSE));
DIRICHLET_SUITE["global"]["apply!(M,f,APPLY_INPLACE)"] = @benchmarkable apply!($M, $f, $ch; strategy=$(Ferrite.APPLY_INPLACE));
DIRICHLET_SUITE["global"]["apply!(M,f)"] = @benchmarkable apply!($M, $f, $ch);
# Symmetric application
M, f = FerriteAssemblyHelper._assemble_mass(dh, cellvalues, true);
DIRICHLET_SUITE["global"]["apply!(M_sym,f,APPLY_TRANSPOSE)"] = @benchmarkable apply!($M, $f, $ch; strategy=$(Ferrite.APPLY_TRANSPOSE));
DIRICHLET_SUITE["global"]["apply!(M_sym,f,APPLY_INPLACE)"] = @benchmarkable apply!($M, $f, $ch; strategy=$(Ferrite.APPLY_INPLACE));
DIRICHLET_SUITE["global"]["apply!(M_sym,f)"] = @benchmarkable apply!($M, $f, $ch);

DIRICHLET_SUITE["global"]["apply!(f)"] = @benchmarkable apply!($f, $ch);
DIRICHLET_SUITE["global"]["apply_zero!(f)"] = @benchmarkable apply!($f, $ch);
Expand Down
8 changes: 1 addition & 7 deletions src/Dofs/ConstraintHandler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -595,13 +595,7 @@ function apply_zero!(K::Union{SparseMatrixCSC,Symmetric}, f::AbstractVector, ch:
apply!(K, f, ch, true)
end

# For backwards compatibility, not used anymore
@enumx ApplyStrategy Transpose Inplace
const APPLY_TRANSPOSE = ApplyStrategy.Transpose
const APPLY_INPLACE = ApplyStrategy.Inplace

function apply!(KK::Union{SparseMatrixCSC,Symmetric}, f::AbstractVector, ch::ConstraintHandler, applyzero::Bool=false;
strategy::ApplyStrategy.T=ApplyStrategy.Transpose)
function apply!(KK::Union{SparseMatrixCSC,Symmetric}, f::AbstractVector, ch::ConstraintHandler, applyzero::Bool=false)
@assert isclosed(ch)
sym = isa(KK, Symmetric)
K = sym ? KK.data : KK
Expand Down
2 changes: 1 addition & 1 deletion src/Ferrite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using Base:
using EnumX:
EnumX, @enumx
using LinearAlgebra:
LinearAlgebra, Symmetric, Transpose, cholesky, det, norm, pinv, tr
LinearAlgebra, Symmetric, cholesky, det, norm, pinv, tr
using NearestNeighbors:
NearestNeighbors, KDTree, knn
using OrderedCollections:
Expand Down
1 change: 0 additions & 1 deletion src/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ export
apply_assemble!,
add!,
free_dofs,
ApplyStrategy,

# iterators
CellCache,
Expand Down

0 comments on commit f7f2592

Please sign in to comment.