493493
494494
495495# Mount a vector with nodal forces
496- function force_bc (mesh:: Mesh , E:: Float64 , nu:: Float64 , α:: Float64 )
496+ function force_bc (mesh:: Mesh , E:: Float64 , nu:: Float64 , α:: Float64 , fast :: Bool )
497497 n = length (mesh. points)
498498 ndim = mesh. ndim
499499 Fbc = zeros (n* ndim)
@@ -521,7 +521,7 @@ function force_bc(mesh::Mesh, E::Float64, nu::Float64, α::Float64)
521521 K = matrixK (c, ndim, E, nu)
522522 β = 0.97
523523
524- if mesh. qmin> 0.9
524+ if mesh. qmin> 0.9 || fast
525525 F = K* U
526526 else
527527 F = K* U* (β- c. quality)/ (β- mesh. qmin)* α
@@ -540,7 +540,7 @@ function force_bc(mesh::Mesh, E::Float64, nu::Float64, α::Float64)
540540end
541541
542542function smooth! (mesh:: Mesh ; verbose= true , alpha:: Float64 = 0.3 , target:: Float64 = 0.97 , fixed:: Bool = false , maxit:: Int64 = 20 , mintol:: Float64 = 1e-3 ,
543- tol:: Float64 = 1e-4 , facetol= 1e-5 , savesteps:: Bool = false , filekey:: String = " smooth" , conds= nothing )
543+ tol:: Float64 = 1e-4 , facetol= 1e-5 , savesteps:: Bool = false , filekey:: String = " smooth" , conds= nothing , fast = false )
544544
545545 # tol : tolerance in change of mesh quality for succesive iterations
546546 # mintol: tolerance in change of worst cell quality in a mesh for succesive iterations
@@ -582,7 +582,7 @@ function smooth!(mesh::Mesh; verbose=true, alpha::Float64=0.3, target::Float64=0
582582 for i= 1 : maxit
583583
584584 # Forces vector needed for smoothing
585- F = vcat ( force_bc (mesh, E, nu, alpha), zeros (nbc) )
585+ F = vcat ( force_bc (mesh, E, nu, alpha, fast ), zeros (nbc) )
586586
587587 # global stiffness plus LM
588588 K = mountKg (mesh, E, nu, A)
0 commit comments