 |
AGXDynamics
2.35.0.2
|
Go to the documentation of this file.
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),
468 m_createSpringConstraints(false),
470 m_outsideTimestep(outsideTimestep),
472 m_beginMass(beginMass),
480 void createWire(
const Real radius,
const Real density,
const Real restlength,
const Real youngsModulus,
const Real compliance,
const Real tension,
bool useBend);
482 void createConstraints(
bool distanceBounds =
false );
484 bool iterateConstraints(
bool onlyOneStep =
false,
bool updatePositionsAndVelocities =
true );
486 void updateParticleForces(
Real timestep );
507 m_constraints.clear();
520 void setTimestep(
Real timestep ) { m_timestep = timestep; }
529 bool m_createSpringConstraints;
531 Real m_outsideTimestep;
Real distance(const Vec3T &v2) const
Distance to another vector.
void setPosition(Vec3 pos)
void setExternalForce(Vec3 externalForce)
agx::Vector< WireParticleRef > WireParticleRefVector
virtual ~ParticleContactWire()
void setVelocity(Real velocity)
Real length() const
Length of the vector = sqrt( vec .
void applyVelocityDamping()
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
#define AGXPHYSICS_EXPORT
Real getFrictionCoefficient()
agx::Vector< WireContactConstraintRef > WireContactConstraintRefVector
T1 clamp(T1 v, T2 minimum, T3 maximum)
void updatePosition(Real timestep, Real maxVelocity=agx::Infinity)
ref_ptr< WireParticle > WireParticleRef
Real getYoungsModulus() const
ref_ptr< WireContactSolver > WireContactSolverRef
const AGXCORE_EXPORT Real Infinity
void integrateExternalForce(Real timestep)
ref_ptr< WireContactBendConstraint > WireContactBendConstraintRef
ParticleContactWire(Real restlength, Real density, Real youngsModulus, Real compliance, Real radius, Real tension, bool)
Real getExternalForce() const
void setFrictionCoefficient(Real frictionCoeff)
void addToTotalForce(Real constraintForce)
Base class providing referencing counted objects.
void push_back(const T &value)
ref_ptr< WireContactDistanceConstraint > WireContactDistanceConstraintRef
WireParticle(Vec3 position, Vec3 edgeStart, Vec3 edgeEnd, Real mass, Real velocity=Real(0), Real normalForce=0, Real frictionCoeff=0)
Real getRestlength() const
ref_ptr< ParticleContactWire > ParticleContactWireRef
void setNormalForce(Real normalForce)
Real normalize()
Normalize the vector so that it has length unity.
Vec3T< T > max(const Vec3T< T > &lhs, const Vec3T< T > &rhs)
ref_ptr< WireContactConstraint > WireContactConstraintRef
Real getNormalForce() const
ref_ptr< WireContactFrictionConstraint > WireContactFrictionConstraintRef
ref_ptr< WireContactSpringConstraint > WireContactSpringConstraintRef
Real getCompliance() const
void push_back(const T2 &value)