artisynth.core.mechmodels
Interface DeformableCollisionData

All Superinterfaces:
CollisionData
All Known Implementing Classes:
DeformableCollisionDataBase, EmbeddedCollisionData, FemCollisionData, MFreeCollisionData, SkinCollisionData

public interface DeformableCollisionData
extends CollisionData

Interface for handling collisions with a particular component


Method Summary
 int addBilateralConstraints(SparseBlockMatrix GT, VectorNd dg, int numb)
          Adds the matrix blocks associated with the bodies contact constraints to the constraint matrix transpose.
 void addContact(DeformableContactConstraint c)
          Add contact constraint to set of constraints
 int addFrictionConstraints(SparseBlockMatrix DT, MechSystem.FrictionInfo[] finfo, int numf)
           
 boolean allowCollision(ContactPenetratingPoint cpp, boolean isVertex, CollisionData otherData)
          Allow a collision between this object and the supplied 'other'.
 boolean allowCollision(EdgeEdgeContact eec, boolean isFirst, CollisionData otherData)
           
 void clearContactActivity()
          Deactivates all the current contact constraints.
 void clearContactData()
          Clears all the contact constraint data.
 boolean contactsHaveChanged()
          Returns true if the contact structure has changed such that the GT matrix will have a different structure and will have to be reanalyzed.
 DeformableContactConstraint createContact(Vertex3d... vtxs)
           
 void getAuxState(DataBuffer data, CollisionData otherData)
           
 int getBilateralImpulses(VectorNd lam, int idx)
           
 int getBilateralInfo(MechSystem.ConstraintInfo[] ginfo, int idx)
           
 void getBilateralSizes(VectorNi sizes)
           
 double getCollisionTol()
           
 DeformableContactConstraint getContact(ContactPenetratingPoint cpp, boolean isVertex)
          Gets a constraint for vertex-face contact.
 DeformableContactConstraint getContact(EdgeEdgeContact eec, boolean isFirst)
          Gets a constraint for an edge-edge contact.
 double getFriction()
           
 void getInitialAuxState(DataBuffer newData, DataBuffer oldData)
           
 int getVertexDependencies(Vertex3d vtx, java.util.ArrayList<Point> pointDeps, VectorNd pointWgts, java.util.ArrayList<Frame> frameDeps, VectorNd frameWgts)
          Determines the set of points that a vertex's position is dependent upon, along with their weights (assuming a linear relationship)
 boolean hasActiveContact(ContactPenetratingPoint cpp, boolean isVertex)
          Returns true if this FEM data set contains an active contact involving a specified vertex or pair of vertices.
 boolean hasActiveContact(EdgeEdgeContact eec, boolean isFirst)
           
 boolean hasActiveContacts()
          Determines whether or not any of the contact constraints are currently active
 int maxFrictionConstraintSets()
           
 void notifyContactsChanged()
          Notification that the components associated with a specific contact constraint has changed, and therefore the GT matrix will have a different structure for the next step.
 int numActiveContacts()
          Counts the number of contact constraints that are currently active
 int numActiveMasters(ContactPenetratingPoint cpp, boolean isVertex)
           
 int numActiveMasters(EdgeEdgeContact eec, boolean isFirst)
           
 void reduceConstraints(java.util.ArrayList<ContactPenetratingPoint> points, java.util.ArrayList<ContactPenetratingPoint> otherPoints, CollisionData otherData)
          Culls the set of constraints to a reduced set
 void removeInactiveContacts()
          Removes all contact contraints which are currently inactive.
 void setAuxState(DataBuffer data, CollisionData otherData)
           
 int setBilateralImpulses(VectorNd lam, int idx)
          Sets the impulses associated with the contact constraints.
 void setFriction(double mu)
           
 void setPenetrationTol(double tol)
           
 void skipAuxState(DataBuffer data)
           
 void updateFrictionConstraints()
           
 void zeroImpulses()
           
 
Methods inherited from interface artisynth.core.mechmodels.CollisionData
addConstraintInfo, getComponent, getMesh, markMasters, numActiveUnmarkedMasters
 

Method Detail

getBilateralSizes

void getBilateralSizes(VectorNi sizes)

getBilateralInfo

int getBilateralInfo(MechSystem.ConstraintInfo[] ginfo,
                     int idx)

addBilateralConstraints

int addBilateralConstraints(SparseBlockMatrix GT,
                            VectorNd dg,
                            int numb)
Adds the matrix blocks associated with the bodies contact constraints to the constraint matrix transpose. This method is used when building the constraint matrix structure. Blocks should be added starting at the block column indicated by numb. The block column number is then updated and returned by this method.

Deformable contact constraints are currently implemented as bilateral constraints to save computational effort. The unilateral nature of the constraint is handled by examining its impulse after the velocity solve. If the impulse is negative, that indicates that the constraint is trying to separate and constraint is removed.

Parameters:
GT - constraint matrix transpose
numb - block column number where the blocks should begin
Returns:
updated block column number

maxFrictionConstraintSets

int maxFrictionConstraintSets()

addFrictionConstraints

int addFrictionConstraints(SparseBlockMatrix DT,
                           MechSystem.FrictionInfo[] finfo,
                           int numf)

updateFrictionConstraints

void updateFrictionConstraints()

setBilateralImpulses

int setBilateralImpulses(VectorNd lam,
                         int idx)
Sets the impulses associated with the contact constraints. This is called by the solver after performing a solve. The resulting impulse information is then used by the constraint to compute friction and to decide when contact constraints should be broken.

Parameters:
lam - vector containing impulse values
idx - starting index for constraint impulses associated with this collision pair
Returns:
updated index value (i.e., idx plus the number of contact constraints).

zeroImpulses

void zeroImpulses()

getBilateralImpulses

int getBilateralImpulses(VectorNd lam,
                         int idx)

clearContactActivity

void clearContactActivity()
Deactivates all the current contact constraints. Constraints may be reactivated later if they are found in the next collision detection and are not separating.


getContact

DeformableContactConstraint getContact(ContactPenetratingPoint cpp,
                                       boolean isVertex)
Gets a constraint for vertex-face contact. If a matching constraint already exists and is not trying to separate, then that is returned; Otherwise, null is returned. Note that only the constraint container is found or allocated here; it's contents are set later.

Parameters:
cpp - the contact penetrating point, consisting of a vertex/face pair
isVertex - boolean indicating whether for this data, we own the vertex or the face
Returns:
constraint structure

getContact

DeformableContactConstraint getContact(EdgeEdgeContact eec,
                                       boolean isFirst)
Gets a constraint for an edge-edge contact. If a matching constraint already exists and is not trying to separate, then that is returned; Otherwise, null is returned. Note that only the constraint container is found or allocated here; it's contents are set later.

Parameters:
eec - Edge-Edge contact
isFirst - indicates whether this object owns the first edge or second
Returns:
constraint structure

addContact

void addContact(DeformableContactConstraint c)
Add contact constraint to set of constraints


createContact

DeformableContactConstraint createContact(Vertex3d... vtxs)

hasActiveContact

boolean hasActiveContact(ContactPenetratingPoint cpp,
                         boolean isVertex)
Returns true if this FEM data set contains an active contact involving a specified vertex or pair of vertices.


hasActiveContact

boolean hasActiveContact(EdgeEdgeContact eec,
                         boolean isFirst)

hasActiveContacts

boolean hasActiveContacts()
Determines whether or not any of the contact constraints are currently active


numActiveContacts

int numActiveContacts()
Counts the number of contact constraints that are currently active


removeInactiveContacts

void removeInactiveContacts()
Removes all contact contraints which are currently inactive. This is called after all new constraints have been determined.


notifyContactsChanged

void notifyContactsChanged()
Notification that the components associated with a specific contact constraint has changed, and therefore the GT matrix will have a different structure for the next step.


contactsHaveChanged

boolean contactsHaveChanged()
Returns true if the contact structure has changed such that the GT matrix will have a different structure and will have to be reanalyzed. Contact structure will change if contact constraints are added or removed, or if the components associated with a specific constraint have changed.

Returns:
true if contact structure has changed.

clearContactData

void clearContactData()
Clears all the contact constraint data. This is done whenever there is a change in component structure or activity, requiring that contact information be rebuilt from scratch.


skipAuxState

void skipAuxState(DataBuffer data)

getAuxState

void getAuxState(DataBuffer data,
                 CollisionData otherData)

setAuxState

void setAuxState(DataBuffer data,
                 CollisionData otherData)

getInitialAuxState

void getInitialAuxState(DataBuffer newData,
                        DataBuffer oldData)

setPenetrationTol

void setPenetrationTol(double tol)

getCollisionTol

double getCollisionTol()

setFriction

void setFriction(double mu)

getFriction

double getFriction()

allowCollision

boolean allowCollision(ContactPenetratingPoint cpp,
                       boolean isVertex,
                       CollisionData otherData)
Allow a collision between this object and the supplied 'other'. You should not allow if the objects are attached at any of the involved points.

Parameters:
cpp - the contact-penetrating point involved between the two.
isVertex - if true, checks if we can allow collision based on the vertex, otherwise if we are checking the face
otherData - the other collision object involved
Returns:
true if the collision is allowed, false otherwise

allowCollision

boolean allowCollision(EdgeEdgeContact eec,
                       boolean isFirst,
                       CollisionData otherData)

numActiveMasters

int numActiveMasters(ContactPenetratingPoint cpp,
                     boolean isVertex)

numActiveMasters

int numActiveMasters(EdgeEdgeContact eec,
                     boolean isFirst)

getVertexDependencies

int getVertexDependencies(Vertex3d vtx,
                          java.util.ArrayList<Point> pointDeps,
                          VectorNd pointWgts,
                          java.util.ArrayList<Frame> frameDeps,
                          VectorNd frameWgts)
Determines the set of points that a vertex's position is dependent upon, along with their weights (assuming a linear relationship)

Parameters:
vtx - the vertex belonging to this collision data
pointDeps - list of points that is filled
pointWgts - weights associated with the returned points
frameDeps - list of frames that is filled
frameWgts - weights associated with the returned frames
Returns:
the number of dependent points

reduceConstraints

void reduceConstraints(java.util.ArrayList<ContactPenetratingPoint> points,
                       java.util.ArrayList<ContactPenetratingPoint> otherPoints,
                       CollisionData otherData)
Culls the set of constraints to a reduced set

Parameters:
points - list of deformable penetrating points
otherData - collision data from the other object