30 #ifndef CONSTRAINT_DYNAMICS_H 31 #define CONSTRAINT_DYNAMICS_H 33 #include "all_particle_dynamics.h" 36 #include "all_body_relations.h" 43 template <
typename VariableType>
45 template <
typename VariableType>
48 namespace solid_dynamics
53 typedef DataDelegateSimple<SolidBody, SolidParticles, Solid> SolidDataSimple;
54 typedef DataDelegateInner<SolidBody, SolidParticles, Solid> SolidDataInner;
71 virtual Vecd getDisplacement(Vecd &pos_0, Vecd &pos_n) {
return pos_n; };
72 virtual Vecd getVelocity(Vecd &pos_0, Vecd &pos_n, Vecd &vel_n) {
return Vecd(0); };
73 virtual Vecd getAcceleration(Vecd &pos_0, Vecd &pos_n, Vecd &acc) {
return Vecd(0); };
74 virtual SimTK::Rotation getBodyRotation(Vecd &pos_0, Vecd &pos_n, Vecd &acc) {
return SimTK::Rotation(); }
75 virtual void Update(
size_t index_i, Real dt = 0.0)
override;
88 StdLargeVec<bool> &GetApplyConstrainToParticle() {
return apply_constrain_to_particle_; }
93 StdLargeVec<bool> apply_constrain_to_particle_;
95 virtual Vecd getDisplacement(Vecd &pos_0, Vecd &pos_n) {
return pos_n; };
96 virtual void Update(
size_t index_i, Real dt = 0.0)
override;
114 Real start_time_, end_time_;
115 Vecd pos_0_center_, pos_end_center_, translation_;
116 Vecd getDisplacement(
size_t index_i, Real dt);
117 virtual Vecd getVelocity() {
return Vecd(0); };
118 virtual Vecd getAcceleration() {
return Vecd(0); };
119 virtual SimTK::Rotation getBodyRotation() {
return SimTK::Rotation(); }
120 virtual void Update(
size_t index_i, Real dt = 0.0)
override;
138 Real start_time_, end_time_, end_scale_;
140 Vecd getDisplacement(
size_t index_i, Real dt);
141 virtual Vecd getVelocity() {
return Vecd(0); };
142 virtual Vecd getAcceleration() {
return Vecd(0); };
143 virtual SimTK::Rotation getBodyRotation() {
return SimTK::Rotation(); }
144 virtual void Update(
size_t index_i, Real dt = 0.0)
override;
161 Real start_time_, end_time_;
163 Vecd getDisplacement(
size_t index_i, Real dt);
164 virtual Vecd getVelocity() {
return Vecd(0); };
165 virtual Vecd getAcceleration() {
return Vecd(0); };
166 virtual SimTK::Rotation getBodyRotation() {
return SimTK::Rotation(); }
167 virtual void Update(
size_t index_i, Real dt = 0.0)
override;
183 virtual void Update(
size_t index_i, Real dt = 0.0)
override;
194 Vecd constrained_direction = Vecd(0))
196 constrain_matrix_(Matd(1.0))
198 for (
int k = 0; k != Dimensions; ++k)
199 constrain_matrix_[k][k] = constrained_direction[k];
204 Matd constrain_matrix_;
205 virtual Vecd getVelocity(Vecd &pos_0, Vecd &pos_n, Vecd &vel_n)
207 return constrain_matrix_ * vel_n;
226 virtual void Interaction(
size_t index_i, Real dt = 0.0)
override;
227 virtual void Update(
size_t index_i, Real dt = 0.0)
override;
243 virtual void exec(Real dt = 0.0)
override;
244 virtual void parallel_exec(Real dt = 0.0)
override;
259 virtual void Update(
size_t index_i, Real dt = 0.0)
override;
263 Matd correction_matrix_;
264 Vecd velocity_correction_;
279 SimTK::MultibodySystem &MBsystem,
280 SimTK::MobilizedBody &mobod,
281 SimTK::Force::DiscreteForces &force_on_bodies,
282 SimTK::RungeKuttaMersonIntegrator &integ);
287 SimTK::MultibodySystem &MBsystem_;
288 SimTK::MobilizedBody &mobod_;
289 SimTK::Force::DiscreteForces &force_on_bodies_;
290 SimTK::RungeKuttaMersonIntegrator &integ_;
291 const SimTK::State *simbody_state_;
292 Vec3d initial_mobod_origin_location_;
295 void virtual Update(
size_t index_i, Real dt = 0.0)
override;
310 SimTK::MultibodySystem &MBsystem,
311 SimTK::MobilizedBody &mobod,
312 SimTK::Force::DiscreteForces &force_on_bodies,
313 SimTK::RungeKuttaMersonIntegrator &integ);
319 SimTK::MultibodySystem &MBsystem_;
320 SimTK::MobilizedBody &mobod_;
321 SimTK::Force::DiscreteForces &force_on_bodies_;
322 SimTK::RungeKuttaMersonIntegrator &integ_;
323 const SimTK::State *simbody_state_;
324 Vec3d current_mobod_origin_location_;
326 virtual void SetupReduce()
override;
327 virtual SimTK::SpatialVec ReduceFunction(
size_t index_i, Real dt = 0.0)
override;
331 #endif // CONSTRAINT_DYNAMICS_H
Translates the body in a given time interval -translation driven boundary condition; only moving the ...
Definition: constraint_dynamics.h:175
prepare data for inner particle dynamics
Definition: base_particle_dynamics.h:216
Constrain a solid body part with prescribed motion and smoothing to mimic the clamping effect...
Definition: constraint_dynamics.h:234
Simple particle dynamics without considering particle interaction.
Definition: particle_dynamics_algorithms.h:48
A body part with a collection of particles.
Definition: base_body_part.h:64
This is the particle dynamics aplliable for all type bodies.
Declaration of solidbody which is used for Solid BCs and derived from RealBody.
Definition: solid_body.h:46
Moves the body into a defined position in a given time interval - position driven boundary condition...
Definition: constraint_dynamics.h:103
Abstract class for body part simple particle dynamics.
Definition: particle_dynamics_bodypart.h:70
virtual void setupDynamics(Real dt=0.0) override
Definition: constraint_dynamics.cpp:351
Constrain the mass center of a solid body.
Definition: constraint_dynamics.h:251
A SolidBodyPart for coupling with Simbody. The mass, origin, and unit inertial matrix are computed...
Definition: solid_body.h:60
Abstract class for particle interaction involving in a body part with an extra update step...
Definition: particle_dynamics_bodypart.h:106
Constrain a solid body part from the motion computed from Simbody.
Definition: constraint_dynamics.h:274
Constrain the velocity of a solid body part.
Definition: constraint_dynamics.h:190
virtual void exec(Real dt=0.0) override
Definition: constraint_dynamics.cpp:299
Soft the constrain of a solid body part.
Definition: constraint_dynamics.h:215
Translates the body in a given time interval -translation driven boundary condition; only moving the ...
Definition: constraint_dynamics.h:151
Constrain the surface particles of a solid body part with prescribed motion.
Definition: constraint_dynamics.h:82
Constrain a solid body part with prescribed motion.
Definition: constraint_dynamics.h:60
Scales the body in a given time interval - position driven boundary condition.
Definition: constraint_dynamics.h:127
virtual void Update(size_t index_i, Real dt=0.0) override
Definition: solid_dynamics_supplementary.cpp:41
virtual void setupDynamics(Real dt=0.0) override
Definition: constraint_dynamics.cpp:323
SPHBody is a base body with basic data and functions. Its derived class can be a real fluid body...
Definition: base_body.h:61
Compute the force acting on the solid body part for applying to simbody forces latter.
Definition: constraint_dynamics.h:303
reduce operation in a Lagrangian contrained region.
Definition: particle_dynamics_bodypart.h:227
This is the derived class of base particles.
The abstract relation within a SPH body.
Definition: base_body_relation.h:117
prepare data for simple particle dynamics.
Definition: base_particle_dynamics.h:185
This is the base classes of kernel functions. Implementation will be implemented in derived classes...
These are classes for define properties of elastic solid materials. These classes are based on isotro...
This is the class for bodies used for solid BCs or Elastic structure.
Definition: solid_body_supplementary.cpp:9
The base class for all particle dynamics This class contains the only two interface functions availab...
Definition: base_particle_dynamics.h:145