api/aspherix_contact_model_external.h
This is the header file used to derive a new contact model which must be derived from this class. The member functions are:
ContactModelExternal
Constructor. Call connectToAspherix at the end of it.
addHistoryValues
This function in which addHistoryValue and addHistoryVector should be called can be overwritten by the user (virtual function) to set the history values of the contact model.
registerGlobalProperties
This function in which the register* functions should be called can be overwritten by the user (virtual function) to request global properties from the simulation.
maximumParticleDistance
This function is used to specify the maximum distance between two particle centers for which a non-zero force is expected. This is used to set the contact distance factor which determines how the neighbor lists are built. The global minimum of this value is twice the maximum particle radius. If your contact model requires force calculation (using surfacesClose) of non-touching particles then this value needs to be calculated accordingly. The value of this parameter is inversely proportional to the simulation efficiency, i.e. large values result in slow simulations.
surfacesIntersect
The function that determines what happens when two particles are in contact with each other and it can be overwritten by the user (virtual function). This function should calculate the force that acts between two particles in contact.
surfacesClose
The function that determines what happens when two particles are close to each other (not touching) and it can be overwritten by the user (virtual function). This function should calculate the force that acts between two particles in the vicinity of each other.
beginPass
This function is called before the loop over all particle pairs and can be used to set some general member variables, it can be overwritten by the user (virtual function).
endPass
This function is called after the loop over all particle pairs and can be used to finalize some calculation (e.g. sum) during the neighbor calculation, it can be overwritten by the user (virtual function).
registerOnOff
Registers a setting that can be passed to the contact model that is of bool type.
registerDouble
Registers a setting that can be passed to the contact model that is of double type.
registerString
Registers a setting that can be passed to the contact model that is of string type.
getRegisterOnOff
Gets the value of a boolean that was set via the contact model settings.
getRegisterDouble
Gets the value of a double that was set via the contact model settings.
getRegisterString
Gets the value of a string that was set via the contact model settings.
addHistoryValue
Adds a scalar history value for each particle interaction. If the newtonflag argument is true then the sign will be switched when the internal particle ordering changes from i->j to j->i.
addHistoryVector
Adds a vector history value for each particle interaction. If the newtonflag argument is true then the sign will be switched when the internal particle ordering changes from i->j to j->i (example: shear vector).
connectToAspherix
This function must be called in the constructor to connect the contact model to Aspherix®.
registerScalarProperty
Registers a scalar Property (see global_scalar command)
registerTypeProperty
Register a material property (see material_properties command). Note, the type integer refers to the material with that index (starting at 1) of the materials command list. This function returns an index which can be used for fast access of the properties using the getTypeProperty function.
registerPairProperty
Registers a material interaction property (see material_interaction_properties command). Note, the type integers refer to the material with those indices (starting at 1) of the materials command list. This function returns an index which can be used for fast access of the properties using the getPairProperty function.
getScalarProperty
Gets the value of a previously registered scalar property.
getTypeProperty
Gets the value of a previously registered type property. This function can be called either with the property name as string or with the index provided by the registerTypeProperty function. Note that the latter is significantly faster and should be used if this function is called within the inner loops (i.e. surfacesIntersect and surfacesClose).
getPairProperty
Gets the value of a previously registered interaction pair property. This function can be called either with the property name as string or with the index provided by the registerPairProperty function. Note that the latter is significantly faster and should be used if this function is called within the inner loops (i.e. surfacesIntersect and surfacesClose).