Files
JuliaFEM.jl/src/problems_contact.jl
T
Jukka Aho 48006a144d Contact algorithms testing & develpoment (#95)
* contact 3d patch test, standard lagrange, small sliding, linear tet4 elements

* tet4 dual basis contact patch test pass

* contact 3d patch test, standard lagrange, small sliding, linear tet4 elements

* tet4 dual basis contact patch test pass

* Patch test for linear elements standard lagrange / dual lagrange pass now

* Patch test for quadratic contact surfaces for standard + dual basis pass

* refactoring

* renamed files

* Improvements to preprocess scripts

* convert several elements to node sets in one command

* possibility to find particular node from mesh filtered by node set

* 2d small sliding contact patch test, linear elements

* Added backward compatibility

* 2d contact algorithms pass patch tests

* test data for 2d contacts

* no common models in different tests. testing generalized alpha stabilization

* Preprocess tests

* moved tests from test_preprocess_aster_reader.jl to test_preprocess.jl

* generalized-alpha time integration, alpha=0.0 by default

* Improvements to logging

* JuliaFEM.jl: can set environment variable to one of logging levels: OFF, CRITICAL, ERROR, WARNING, INFO, DEBUG

* problems_contact_2d_autodiff.jl: do not loop over nodes if logging level != DEBUG
2017-03-02 08:43:58 +02:00

92 lines
3.1 KiB
Julia

# This file is a part of JuliaFEM.
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
"""
Parameters
----------
distval
a charasteristic measure to skip element pair, 0..5 => near, 10+ => far
5 means that distance of slave element midpoint and point to project
is 5 times larger than length of element
"""
type Contact <: BoundaryProblem
dimension :: Int
rotate_normals :: Bool
finite_sliding :: Bool
friction :: Bool
dual_basis :: Bool
use_forwarddiff :: Bool
forwarddiff_assemble_in_pieces :: Bool
minimum_active_set_size :: Int
distval :: Float64
remove_from_set :: Bool # allow removal of non-potential contact pairs
allow_quads :: Bool
remove_nodes :: Vector{Int}
always_in_contact :: Bool
update_contact_pairing :: Bool
iteration :: Int
contact_state_in_first_iteration :: Symbol
alpha :: Float64
drop_tolerance :: Float64
store_fields :: Vector{AbstractString}
end
function Contact()
default_fields = ["element area", "contact area", "weighted gap",
"contact pressure", "active nodes", "inactive nodes", "stick nodes",
"slip nodes", "complementarity condition", "contact error"]
return Contact(
-1, # dimension
false, # rotate_normals
false, # finite_sliding
false, # friciton
true, # dual basis
false, # use forwarddiff
false, # when using forwarddiff, assemble interface in pieces
0, # minimum active set size
5.0, # distance value for contact detection
false, # allow removal of non-potential contact pairs
false, # allow quadrangles in contact discretization
[], # remove these nodes always from set
false, # mainly for debugging, do not remove inactive nodes
true, # update contact pairing on each loop
1, # iteration counter
:AUTO, # contact state in first iteration, AUTO, INACTIVE, ACTIVE
0.0, # alpha basis transform parameter
1.0e-9, # drop tolerance
default_fields)
end
function get_unknown_field_name(problem::Problem{Contact})
return "reaction force"
end
function get_formulation_type(problem::Problem{Contact})
#=
if problem.properties.use_forwarddiff
return :forwarddiff
else
return :incremental
end
=#
return :incremental
#return :forwarddiff
end
function assemble!(problem::Problem{Contact}, time::Real)
if problem.properties.dimension == -1
problem.properties.dimension = dim = size(first(problem.elements), 1)
debug("assuming dimension of mesh tie surface is $dim")
debug("if this is wrong set is manually using problem.properties.dimension")
end
dimension = Val{problem.properties.dimension}
finite_sliding = Val{problem.properties.finite_sliding}
friction = Val{problem.properties.friction}
use_forwarddiff = Val{problem.properties.use_forwarddiff}
assemble!(problem, time, dimension, finite_sliding, friction, use_forwarddiff)
problem.properties.iteration += 1
end
typealias ContactElements2D Union{Seg2}