mpacts.contact.models.misc. inspector

In order to be able to use this module import it like this:

import mpacts.contact.models.misc.inspector
#or assign it to a shorter name
import mpacts.contact.models.misc.inspector as ins

ContactModelInspector

Description: Tool to inspect the contactdata of any contactmodel right after execution, which can be usefull to debug. Example usage is as follows:

contactM = hertz.Hertz_Coulomb('hertz', A=0.1, k=1e7, c_t=1e4, mu=0.4, pc1=spheres, pc2=spheres)
def example(p1, p2, cmodel):
        if cmodel.get_property('overlap') > 0:
                print p1, p2, cmodel.get_property('overlap'), cmodel.get_property('F')

cmodeli = inspect.ContactModelInspector( cmodel=contactM, f=example)
mycd = cdb.SmartBruteForce('contactdetector', mysim, cmodel=cmodeli, repeat_frequency=50, keep_distance=0.001)

Note that the third argument given to the python function is not actually a contactmodel, but a BaseObject with properties that access the data of the contactmodel. Geometry combinations available:

PC2 | PC1 - any
any YES

ContactModelInspector (any any)

Tool to inspect the contactdata of any contactmodel right after execution, which can be usefull to debug. Example usage is as follows:

contactM = hertz.Hertz_Coulomb('hertz', A=0.1, k=1e7, c_t=1e4, mu=0.4, pc1=spheres, pc2=spheres)
def example(p1, p2, cmodel):
        if cmodel.get_property('overlap') > 0:
                print p1, p2, cmodel.get_property('overlap'), cmodel.get_property('F')

cmodeli = inspect.ContactModelInspector( cmodel=contactM, f=example)
mycd = cdb.SmartBruteForce('contactdetector', mysim, cmodel=cmodeli, repeat_frequency=50, keep_distance=0.001)

Note that the third argument given to the python function is not actually a contactmodel, but a BaseObject with properties that access the data of the contactmodel.

Parallel Compatible: No

Properties:

  • Required keywords:
    • f — Python function with signature f(p1, p2, cmodel) that is called after execution of the contactmodel.
    • pc1 — The first particle container in the binary contact detection.
    • pc2 — The second particle container in the binary contact detection. If contact detection within the same particle container is desired, and it is applicable for the contactmodel, pass the same pc to both pc1 and pc2.
  • Optional keywords:
    • p1 (default value = -1) — If given, only for particles with index == p1 the python function(s) will be called. By default it is called for all particles.
    • p2 (default value = -1) — If given, only for particles with index == p2 the python function(s) will be called. By default it is called for all particles.

This contact model is composed out of following pieces (click on the chain elements to get more information):

ContactMatrixDataBaseBoilerPlateConnector  <ParticleBase, ParticleBase, ResolveData, ForceData >
  ↓
DefaultBoilerPlateContactModelInspector  <DefaultBoilerPlateAccessor >
  ↓
NoFeedback

DefaultContactDataExtractor

Description: Tool to inspect contactmodels. Will write all contacts to particle container containing geometry data. To be used toghether with ContactWriters python support code. Geometry combinations available:

PC2 | PC1 - any
any YES

DefaultContactDataExtractor (any any)

Tool to inspect contactmodels. Will write all contacts to particle container containing geometry data. To be used toghether with ContactWriters python support code.

Parallel Compatible: No

Properties:

  • Required keywords:
    • pc1 — The first particle container in the binary contact detection.
    • pc2 — The second particle container in the binary contact detection. If contact detection within the same particle container is desired, and it is applicable for the contactmodel, pass the same pc to both pc1 and pc2.
  • Optional keywords:
    • info_rate (default value = 1) — The rate at which this chain will generate the array info.
  • Read only properties:
    • contact_info — Array manager containing the info generated by this functor chain.

This contact model is composed out of following pieces (click on the chain elements to get more information):

ContactMatrixDataBaseBoilerPlateConnector  <ParticleBase, ParticleBase, ResolveData, ForceData >
  ↓
DefaultBoilerPlateDefaultContactDataExtractorNoFeedback

FlatNGonContactDataExtractor

Description: Tool to inspect contactmodels. Will write all contacts to particle container containing geometry data. To be used toghether with ContactWriters python support code. Geometry combinations available:

PC2 | PC1 - any
any YES

FlatNGonContactDataExtractor (any any)

Tool to inspect contactmodels. Will write all contacts to particle container containing geometry data. To be used toghether with ContactWriters python support code.

Parallel Compatible: No

Properties:

  • Required keywords:
    • pc1 — The first particle container in the binary contact detection.
    • pc2 — The second particle container in the binary contact detection. If contact detection within the same particle container is desired, and it is applicable for the contactmodel, pass the same pc to both pc1 and pc2.
  • Optional keywords:
    • info_rate (default value = 1) — The rate at which this chain will generate the array info.
  • Read only properties:
    • contact_info — Array manager containing the info generated by this functor chain.

This contact model is composed out of following pieces (click on the chain elements to get more information):

ContactMatrixDataBaseBoilerPlateConnector  <ParticleBase, ParticleBase, FlatNGonResolveData, RoundedTriangleModelData >
  ↓
FlatNGonBoilerPlateFlatNGonContactDataExtractorNoFeedback