Skip to content

Commit 0d37b51

Browse files
committed
SimulationModel renamed to InstantiatedModel (due to change in Modia)
1 parent 4ee7cab commit 0d37b51

File tree

13 files changed

+28
-28
lines changed

13 files changed

+28
-28
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ HTTP = "0.9"
1212
JSON = "0.21"
1313
Measurements = "2"
1414
MeshIO = "0.4.10"
15-
Modia = "0.11.0"
15+
Modia = "0.12.0, 0.11.0"
1616
MonteCarloMeasurements = "1"
1717
OrderedCollections = "1"
1818
Reexport = "1.0"

src/Composition/ForceElements/Bushing.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ function torqueFromMoments(largeAngles::Bool, moments::SVector{3,F}, sico::SMatr
201201
end
202202

203203

204-
function initializeForceElement(model::Modia.SimulationModel{F,TimeType}, force::Bushing{F})::Nothing where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
204+
function initializeForceElement(model::Modia.InstantiatedModel{F,TimeType}, force::Bushing{F})::Nothing where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
205205
force.obj1.hasForceElement = true
206206
force.obj2.hasForceElement = true
207207

@@ -220,7 +220,7 @@ function initializeForceElement(model::Modia.SimulationModel{F,TimeType}, force:
220220
return nothing
221221
end
222222

223-
function evaluateForceElement(model::Modia.SimulationModel{F,TimeType}, force::Bushing{F}, time::TimeType) where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
223+
function evaluateForceElement(model::Modia.InstantiatedModel{F,TimeType}, force::Bushing{F}, time::TimeType) where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
224224
R12 = measFrameRotation(force.obj2; frameOrig=force.obj1)
225225
r12 = measFramePosition(force.obj2; frameOrig=force.obj1, frameCoord=force.obj1)
226226
w12 = measFrameRotVelocity(force.obj2; frameOrig=force.obj1, frameCoord=force.obj1)

src/Composition/ForceElements/SpringDamperPtP.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ end
8383
SpringDamperPtP(; kwargs...) = SpringDamperPtP{Float64}(; kwargs...)
8484

8585

86-
function initializeForceElement(model::Modia.SimulationModel{F,TimeType}, force::SpringDamperPtP{F}) where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
86+
function initializeForceElement(model::Modia.InstantiatedModel{F,TimeType}, force::SpringDamperPtP{F}) where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
8787
force.obj1.hasForceElement = true
8888
force.obj2.hasForceElement = true
8989

@@ -98,7 +98,7 @@ function initializeForceElement(model::Modia.SimulationModel{F,TimeType}, force:
9898
return nothing
9999
end
100100

101-
function evaluateForceElement(model::Modia.SimulationModel{F,TimeType}, force::SpringDamperPtP{F}, time::TimeType) where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
101+
function evaluateForceElement(model::Modia.InstantiatedModel{F,TimeType}, force::SpringDamperPtP{F}, time::TimeType) where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
102102
(pos, norm) = measFrameDistance(force.obj2; frameOrig=force.obj1)
103103
vel = measFrameDistVelocity(force.obj2; frameOrig=force.obj1)
104104

src/Composition/ForceElements/WorldForce.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ end
4444
WorldForce(; kwargs...) = WorldForce{Float64}(; kwargs...)
4545

4646

47-
function initializeForceElement(model::Modia.SimulationModel{F,TimeType}, force::WorldForce{F})::Nothing where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
47+
function initializeForceElement(model::Modia.InstantiatedModel{F,TimeType}, force::WorldForce{F})::Nothing where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
4848

4949
force.objectApply.hasForceElement = true
5050
if !isnothing(force.objectCoord)
@@ -56,7 +56,7 @@ function initializeForceElement(model::Modia.SimulationModel{F,TimeType}, force:
5656
return nothing
5757
end
5858

59-
function evaluateForceElement(model::Modia.SimulationModel{F,TimeType}, force::WorldForce{F}, time::TimeType) where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
59+
function evaluateForceElement(model::Modia.InstantiatedModel{F,TimeType}, force::WorldForce{F}, time::TimeType) where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
6060

6161
forceVector = force.forceFunction(; time=time, objectApply=force.objectApply, objectCoord=force.objectCoord)
6262

src/Composition/ForceElements/WorldTorque.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ end
4444
WorldTorque(; kwargs...) = WorldTorque{Float64}(; kwargs...)
4545

4646

47-
function initializeForceElement(model::Modia.SimulationModel{F,TimeType}, force::WorldTorque{F})::Nothing where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
47+
function initializeForceElement(model::Modia.InstantiatedModel{F,TimeType}, force::WorldTorque{F})::Nothing where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
4848

4949
force.objectApply.hasForceElement = true
5050
if !isnothing(force.objectCoord)
@@ -56,7 +56,7 @@ function initializeForceElement(model::Modia.SimulationModel{F,TimeType}, force:
5656
return nothing
5757
end
5858

59-
function evaluateForceElement(model::Modia.SimulationModel{F,TimeType}, force::WorldTorque{F}, time::TimeType) where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
59+
function evaluateForceElement(model::Modia.InstantiatedModel{F,TimeType}, force::WorldTorque{F}, time::TimeType) where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
6060

6161
torqueVector = force.torqueFunction(; time=time, objectApply=force.objectApply, objectCoord=force.objectCoord)
6262

src/Composition/_module.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export isFree, isNotFree, changeJointFromFreeMotionToFix!, changeJointFromFixToF
6969

7070
export fullName, instanceName
7171

72-
# export updateSimulationModel!
72+
# export updateInstantiatedModel!
7373

7474
export rot123fromR, rot132fromR, Rfromrot123, Rfromrot132
7575

src/Composition/dynamicCollision.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# between objs with mpr algorithm, and use them as zero-crossing functions
55
# (see file ...\ContactDetectionMPR\handler.jl)
66
# after computing all distances between colliding shapes response calculations are done
7-
function computeContactForcesAndTorques(sim::Modia.SimulationModel, scene, world, time, file)
7+
function computeContactForcesAndTorques(sim::Modia.InstantiatedModel, scene, world, time, file)
88
if typeof(scene.options.contactDetection) <: Modia3D.ContactDetectionMPR_handler
99
ch::Modia3D.ContactDetectionMPR_handler = scene.options.contactDetection
1010
# Compute signed distances of all contact shapes during zero-crossing computation
@@ -39,7 +39,7 @@ end
3939
# (see file ...\Composition\responseCalculation\elasticCollisionResponse.jl)
4040
# further, at an event simulation status is updated, contact material is replaced
4141
# and the actual contactDict is stored
42-
function dealWithContacts!(sim::Modia.SimulationModel{F, T}, scene::Scene{F}, ch::Composition.ContactDetectionMPR_handler{M,F}, world::Composition.Object3D{F}, time::Float64, file::Nothing)::Nothing where {F <: Modia3D.VarFloatType, T, M}
42+
function dealWithContacts!(sim::Modia.InstantiatedModel{F, T}, scene::Scene{F}, ch::Composition.ContactDetectionMPR_handler{M,F}, world::Composition.Object3D{F}, time::Float64, file::Nothing)::Nothing where {F <: Modia3D.VarFloatType, T, M}
4343

4444
simh::Modia.EventHandler{F,T} = sim.eventHandler
4545
f1::SVector{3,F}=Modia3D.ZeroVector3D(F)

src/Composition/dynamics.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ end
105105

106106

107107
"""
108-
initSegment_Model3D!(partiallyInstantiatedModel::Modia.SimulationModel,
108+
initSegment_Model3D!(partiallyInstantiatedModel::Modia.InstantiatedModel,
109109
modelPath::String, ID, parameters::AbstractDict; log=false)
110110
111111
Called once before initialization of a new simulation segment to instantiate/re-initialize a Model3D model
112112
"""
113-
function initSegment_Model3D!(partiallyInstantiatedModel::Modia.SimulationModel{F,TimeType},
113+
function initSegment_Model3D!(partiallyInstantiatedModel::Modia.InstantiatedModel{F,TimeType},
114114
modelPath::String, ID, parameters::AbstractDict; log=false)::Nothing where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
115115
TimerOutputs.@timeit partiallyInstantiatedModel.timer "Modia3D_0 initSegment_Model3D!" begin
116116
if log
@@ -215,7 +215,7 @@ Open Model3D:
215215
- Copy der(r):=v and der(rot):= f(w) into hidden derivatives.
216216
- Return mbs.
217217
"""
218-
function openModel3D!(instantiatedModel::Modia.SimulationModel{F,TimeType}, modelPath::String, x::AbstractVector, time::TimeType)::MultibodyData{F,TimeType} where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
218+
function openModel3D!(instantiatedModel::Modia.InstantiatedModel{F,TimeType}, modelPath::String, x::AbstractVector, time::TimeType)::MultibodyData{F,TimeType} where {F <: Modia3D.VarFloatType, TimeType <: AbstractFloat}
219219
# println("bin in openModel3D ", instantiatedModel.eventHandler.restart)
220220
mbsBuild::MultibodyBuild{F,TimeType} = instantiatedModel.buildDict[modelPath]
221221

src/Composition/joints/joints.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77

88
mutable struct MultibodyData{F <: Modia3D.VarFloatType, TimeType}
9-
instantiatedModel::Modia.SimulationModel{F,TimeType}
9+
instantiatedModel::Modia.InstantiatedModel{F,TimeType}
1010
path::String # Path of Model3D(...)
1111

1212
world::Object3D{F} # Pointer to world object
@@ -41,7 +41,7 @@ mutable struct MultibodyData{F <: Modia3D.VarFloatType, TimeType}
4141
# for multibodyAccelerations
4242
leq::Vector{Modia.LinearEquations{F}}
4343

44-
function MultibodyData{F,TimeType}(partiallyInstantiatedModel::Modia.SimulationModel{F,TimeType}, modelPath::String, world, scene,
44+
function MultibodyData{F,TimeType}(partiallyInstantiatedModel::Modia.InstantiatedModel{F,TimeType}, modelPath::String, world, scene,
4545
revoluteObjects, prismaticObjects, freeMotionObjects, hiddenJointObjects,
4646
revoluteIndices, prismaticIndices, freeMotionIndices,
4747
zStartIndex, nz) where {F,TimeType}
@@ -642,7 +642,7 @@ Change rotation sequence of `freeMotion.rot` from `x-axis, y-axis, z-axis` to `x
642642
643643
- If `freeMotion.isrot123 = false`, set `freeMotion.isrot123 = true` and `x[..] = x_segmented[..] = rot123fromR(Rfromrot132(freeMotion.rot))`
644644
"""
645-
function change_rotSequence!(m::Modia.SimulationModel, freeMotion::FreeMotion, x::AbstractVector, x_segmented::AbstractVector)::Nothing
645+
function change_rotSequence!(m::Modia.InstantiatedModel, freeMotion::FreeMotion, x::AbstractVector, x_segmented::AbstractVector)::Nothing
646646
if freeMotion.isrot123
647647
freeMotion.rot = rot132fromR(Rfromrot123(freeMotion.rot))
648648
freeMotion.isrot123 = false
@@ -680,12 +680,12 @@ end
680680

681681

682682
"""
683-
setStatesHiddenJoints!(instantiatedModel::Modia.SimulationModel, mbs::MultibodyData, x)
683+
setStatesHiddenJoints!(instantiatedModel::Modia.InstantiatedModel, mbs::MultibodyData, x)
684684
685685
Copy states from the hidden state vector instantiatedModel.x_segmented to the hidden joints into the corresponding Object3Ds
686686
and copy some state derivatives into instantiatedModel.der_x_segmented.
687687
"""
688-
function setStatesHiddenJoints!(m::Modia.SimulationModel{F,TimeType}, mbs::MultibodyData{F,TimeType}, _x)::Nothing where {F,TimeType}
688+
function setStatesHiddenJoints!(m::Modia.InstantiatedModel{F,TimeType}, mbs::MultibodyData{F,TimeType}, _x)::Nothing where {F,TimeType}
689689
x_segmented = m.x_segmented
690690
der_x_segmented = m.der_x_segmented
691691
j1::Int = 0
@@ -790,7 +790,7 @@ end
790790
791791
Copy derivatives of hidden states to instantiatedModel.der_x_segmented
792792
"""
793-
function setHiddenStatesDerivatives!(m::Modia.SimulationModel{F,TimeType}, mbs::MultibodyData{F,TimeType}, genForces::Vector{F})::Nothing where {F,TimeType}
793+
function setHiddenStatesDerivatives!(m::Modia.InstantiatedModel{F,TimeType}, mbs::MultibodyData{F,TimeType}, genForces::Vector{F})::Nothing where {F,TimeType}
794794
for obj in mbs.hiddenJointObjects
795795
freeMotion = mbs.freeMotion[obj.jointIndex]
796796

src/Composition/object3D.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ end
607607

608608

609609
# Inquire properties of a Object3D
610-
fullName( obj::Object3D{F}) where F <: Modia3D.VarFloatType = obj.path # Modia.SimulationModel.modelName + Object3D.path (wird ca. 98x verwendet)
610+
fullName( obj::Object3D{F}) where F <: Modia3D.VarFloatType = obj.path # Modia.InstantiatedModel.modelName + Object3D.path (wird ca. 98x verwendet)
611611
instanceName( obj::Object3D{F}) where F <: Modia3D.VarFloatType = obj.path
612612
fullName(obj) = error("fullName not implemented for ", typeof(obj))
613613
instanceName(obj) = error("instanceName not implemented for ", typeof(obj))

0 commit comments

Comments
 (0)