@@ -108,37 +108,31 @@ about the contact situation.
108108- `neps`: Small number used to check whether a floating number is close to zero (> 0.0).
109109
110110"""
111- mutable struct ContactDetectionMPR_handler <: Modia3D.AbstractContactDetection
112- contactPairs:: Composition.ContactPairs
113- distanceComputed:: Bool
114-
115- lastContactDict:: Dict{PairID,ContactPair}
116- contactDict:: Dict{ PairID,ContactPair}
117- noContactMinVal:: Float64
118-
119- tol_rel:: Float64
120- niter_max:: Int
121- neps:: Float64
122-
123- # Visualization options
124- visualizeContactPoints:: Bool
125- visualizeSupportPoints:: Bool
126- defaultContactSphereDiameter:: Float64
127-
128- function ContactDetectionMPR_handler (;tol_rel = 1.0e-7 ,
129- niter_max = 100 ,
130- neps = sqrt (eps ()))
131- @assert (tol_rel > 0.0 )
132- @assert (niter_max > 0 )
133- @assert (neps > 0.0 )
134- handler = new ()
135- handler. distanceComputed = false
136- handler. lastContactDict = Dict {PairID,ContactPair} ()
137- handler. contactDict = Dict {PairID,ContactPair} ()
138- handler. noContactMinVal = 42.0
139- handler. tol_rel = tol_rel
140- handler. niter_max = niter_max
141- handler. neps = neps
142- return handler
143- end
111+ mutable struct ContactDetectionMPR_handler{T} <: Modia3D.AbstractContactDetection
112+ distanceComputed:: Bool
113+
114+ lastContactDict:: Dict{PairID,ContactPair}
115+ contactDict:: Dict{ PairID,ContactPair}
116+ noContactMinVal:: Float64
117+
118+ tol_rel:: T
119+ niter_max:: Int
120+ neps:: T
121+
122+ contactPairs:: Composition.ContactPairs
123+
124+ # Visualization options
125+ visualizeContactPoints:: Bool
126+ visualizeSupportPoints:: Bool
127+ defaultContactSphereDiameter:: Float64
128+
129+ function ContactDetectionMPR_handler {T} (;tol_rel = 1.0e-7 ,
130+ niter_max = 100 ,
131+ neps = sqrt (eps (T))) where {T}
132+ @assert (tol_rel > 0.0 )
133+ @assert (niter_max > 0 )
134+ @assert (neps > 0.0 )
135+ new (false , Dict {PairID,ContactPair} (), Dict {PairID,ContactPair} (), 42.0 , tol_rel, niter_max, neps)
136+ end
144137end
138+ ContactDetectionMPR_handler () = ContactDetectionMPR_handler {Modia3D.MPRFloatType} ()
0 commit comments