17#ifndef AGX_WIRE_CONTACT_SOLVER_H
18#define AGX_WIRE_CONTACT_SOLVER_H
27#define NUM_CONTACTS_AT_END 2
33 : m_position(position),
35 m_edgeStart(edgeStart),
39 m_normalForce(normalForce),
41 m_frictionCoeff(frictionCoeff)
43 m_edge = m_edgeEnd-m_edgeStart;
68 m_position = m_position + m_edge*velocity*timestep;
73 m_velocity = m_velocity + m_externalForce*timestep*m_invMass;
78 m_externalForce = externalForce*m_edge;
101 Real m_externalForce;
102 Real m_frictionCoeff;
113 :m_youngsModulus(youngsModulus),m_compliance(compliance),m_restlength(restlength),m_density(density),m_radius(radius),m_tension(tension)
128 Real m_youngsModulus;
217 m_rhs = -4*gamma*violation*invTimestep + gamma*GV;
238 size_t particleIndex = i + indexOffset;
260 if ( globalIndex < m_firstParticleGlobalIndex || globalIndex - m_firstParticleGlobalIndex >=
m_jacobianVector.
size() )
269 m_lowerBounds = bounds.
lower();
270 m_upperBounds = bounds.
upper();
305 bool m_reachedBounds;
318 m_beginParticle(nullptr),
319 m_endParticle(nullptr),
320 m_beginParticleVelocity( beginVelocity ),
321 m_endParticleVelocity( endVelocity ),
322 m_restlength(restlength)
341 Vec3 m_beginParticleVelocity;
342 Vec3 m_endParticleVelocity;
353 m_beginParticle(bwp),
354 m_middleParticle(mwp),
369 m_compliance = std::max(
Real(400) *( l1 + l2 ) / ( A * radius * radius * youngsModulus ),
Real(1E-4));
468 m_createSpringConstraints(false),
470 m_outsideTimestep(outsideTimestep),
472 m_beginMass(beginMass),
507 m_constraints.clear();
520 void setTimestep(
Real timestep ) { m_timestep = timestep; }
522 Real calculateTimestep( Real dist1,Real dist2, Real mass, Real tension );
525 WireContactConstraintRefVector m_constraints;
527 ParticleContactWireRef m_wire;
528 WireParticleRefVector m_particles;
529 bool m_createSpringConstraints;
531 Real m_outsideTimestep;
#define AGXPHYSICS_EXPORT
virtual ~ParticleContactWire()
Real getRestlength() const
Real getYoungsModulus() const
Real getCompliance() const
ParticleContactWire(Real restlength, Real density, Real youngsModulus, Real compliance, Real radius, Real tension, bool)
Base class providing referencing counted objects.
Real normalize()
Normalize the vector so that it has length unity.
Real length() const
Length of the vector = sqrt( vec .
Real distance(const Vec3T &v2) const
Distance to another vector.
void push_back(const T &value)
void push_back(const T2 &value)
void updatePosition(Real timestep, Real maxVelocity=agx::Infinity)
void applyVelocityDamping()
void setPosition(Vec3 pos)
WireParticle(Vec3 position, Vec3 edgeStart, Vec3 edgeEnd, Real mass, Real velocity=Real(0), Real normalForce=0, Real frictionCoeff=0)
void addToTotalForce(Real constraintForce)
Real getFrictionCoefficient()
void setVelocity(Real velocity)
void integrateExternalForce(Real timestep)
Real getNormalForce() const
void setFrictionCoefficient(Real frictionCoeff)
void setNormalForce(Real normalForce)
Real getExternalForce() const
void setExternalForce(Vec3 externalForce)
Smart pointer for handling referenced counted objects.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
ref_ptr< ParticleContactWire > ParticleContactWireRef
ref_ptr< WireContactSpringConstraint > WireContactSpringConstraintRef
T1 clamp(T1 v, T2 minimum, T3 maximum)
agx::Vector< WireContactConstraintRef > WireContactConstraintRefVector
ref_ptr< WireContactConstraint > WireContactConstraintRef
ref_ptr< WireContactBendConstraint > WireContactBendConstraintRef
Vec3T< T > max(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
ref_ptr< WireContactDistanceConstraint > WireContactDistanceConstraintRef
ref_ptr< WireContactFrictionConstraint > WireContactFrictionConstraintRef
ref_ptr< WireParticle > WireParticleRef
agx::Vector< WireParticleRef > WireParticleRefVector
ref_ptr< WireContactSolver > WireContactSolverRef