mpacts.contact.models.misc. contactcounter

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

import mpacts.contact.models.misc.contactcounter
#or assign it to a shorter name
import mpacts.contact.models.misc.contactcounter as con

ContactCounter

Description: A test model that counts the number of contacts, and the number of effective contacts per particle. This information is stored in two arrays (‘number_of_contacts’ and ‘number_of_effective_contacts’)that need to be present.Can be used for testing and debugging purposes. Note that the count is not reset automatically. Geometry combinations available:

PC2 | PC1 - Sphere SPH Rigid_Triangle Rigid_RoundedTriangle Rigid_Quad Deformable_Capsule
Sphere YES   YES   YES YES
SPH   YES        
Rigid_RoundedTriangle       YES    

ContactCounter (Deformable_Capsule Sphere)

A test model that counts the number of contacts, and the number of effective contacts per particle. This information is stored in two arrays (‘number_of_contacts’ and ‘number_of_effective_contacts’)that need to be present.Can be used for testing and debugging purposes. Note that the count is not reset automatically.

Parallel Compatible: Yes

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.

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

DefaultBoilerPlateSphere0_2_DataDeformable_Cylinder_1_DataCapsule_SphereCountContactsFeedback

ContactCounter (Rigid_Quad Sphere)

A test model that counts the number of contacts, and the number of effective contacts per particle. This information is stored in two arrays (‘number_of_contacts’ and ‘number_of_effective_contacts’)that need to be present.Can be used for testing and debugging purposes. Note that the count is not reset automatically.

Parallel Compatible: Yes

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:
    • flip_normals (default value = 0) — Optionally flip normals if sphere is more than its radius submerged. In most cases, we recommend that you leave this option to its default ‘false’.
    • reject_large_overlap (default value = 1) — Optionally reject overlaps reject_overlap_r times larger than the radius. Unless you have a fully concave ‘container’ geometry, we recommend that you leave this value to its default ‘true’.
    • reject_overlap_r (default value = 1) — If reject_large_overlap is True, this specifies the number of sphere radii of overlap that should be rejected (Default=1).

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

DefaultBoilerPlateSphere0_2_DataRigid_NGon_1_Data  <4 >
  ↓
NGon_SphereCountContactsFeedback

ContactCounter (Rigid_RoundedTriangle Rigid_RoundedTriangle)

A test model that counts the number of contacts, and the number of effective contacts per particle. This information is stored in two arrays (‘number_of_contacts’ and ‘number_of_effective_contacts’)that need to be present.Can be used for testing and debugging purposes. Note that the count is not reset automatically.

Parallel Compatible: Yes

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.

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

RoundedTriangleBoilerPlateRoundedTriangle_1_DataRoundedTriangle_2_DataRigid_NGon_1_Data  <3 >
  ↓
Rigid_NGon_2_Data  <3 >
  ↓
FitSphereToTriangle_1FitSphereToTriangle_2RoundedTriangle_RoundedTriangleCountContactsFeedback

ContactCounter (Rigid_Triangle Sphere)

A test model that counts the number of contacts, and the number of effective contacts per particle. This information is stored in two arrays (‘number_of_contacts’ and ‘number_of_effective_contacts’)that need to be present.Can be used for testing and debugging purposes. Note that the count is not reset automatically.

Parallel Compatible: Yes

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:
    • flip_normals (default value = 0) — Optionally flip normals if sphere is more than its radius submerged. In most cases, we recommend that you leave this option to its default ‘false’.
    • reject_large_overlap (default value = 1) — Optionally reject overlaps reject_overlap_r times larger than the radius. Unless you have a fully concave ‘container’ geometry, we recommend that you leave this value to its default ‘true’.
    • reject_overlap_r (default value = 1) — If reject_large_overlap is True, this specifies the number of sphere radii of overlap that should be rejected (Default=1).

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

DefaultBoilerPlateSphere0_2_DataRigid_NGon_1_Data  <3 >
  ↓
NGon_SphereCountContactsFeedback

ContactCounter (SPH SPH)

A test model that counts the number of contacts, and the number of effective contacts per particle. This information is stored in two arrays (‘number_of_contacts’ and ‘number_of_effective_contacts’)that need to be present.Can be used for testing and debugging purposes. Note that the count is not reset automatically.

Parallel Compatible: Yes

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.

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

DefaultBoilerPlateSPH_2_DataSPH_1_DataSPH_SPHCountContactsFeedback

ContactCounter (Sphere Sphere)

A test model that counts the number of contacts, and the number of effective contacts per particle. This information is stored in two arrays (‘number_of_contacts’ and ‘number_of_effective_contacts’)that need to be present.Can be used for testing and debugging purposes. Note that the count is not reset automatically.

Parallel Compatible: Yes

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.

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

DefaultBoilerPlateSphere0_2_DataSphere0_1_DataSphere_SphereCountContactsFeedback

ContactCounter_NGon_NGon

Description: A test Geometry combinations available:

PC2 | PC1 - Rigid_Triangle Rigid_Quad
Rigid_Triangle YES YES
Rigid_Quad   YES

ContactCounter_NGon_NGon (Rigid_Quad Rigid_Quad)

A test

Parallel Compatible: Yes

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:
    • PABB_margin (default value = -1) — Margin used by the Particle-Aligned Bounding Boxes (PABBs). This margin is added in all Particle-aligned axes of the bounding boxes in each direction. If specified as a value between 0 and half the calling contact detector’s ‘keep_distance’, the PABBs are considered as a pre-contact resolution step, and executed every timestep. Hence, the ‘margin’ can be interpreted as half the maximal overlap distance that should still be detected in the extreme case of two parallel N-gons. If ‘margin’ is not specified (or < 0), the PABBs are considered as a post-contact detection filtering step. The margin is then computed automatically based on the contact detector’s ‘keep_distance’ property, and the PABBs are only used to filter contacts whenever contact detection takes place, i.e. every ‘update_every’ steps. If unsure, leave this parameter as its default which is as safe as a Grid-Based contact detector and induces little overhead in general. However, for simulations with relatively ‘stiff’ and ‘fast’ particles, setting this to a non-zero value might significantly boost the simulation speed.
    • abort_if_different (default value = 0) — If ‘True’, inverts the regular function of ‘AbortIfSameParent’, and makes the contact model early abort if the particles’ parents are different. Please do not change this ‘Property’ if you are not sure what you are doing.
    • enable_PABB (default value = 1) — If ‘True’, the contacts will be pre-filtered using Particle-Aligned Bounding Boxes (PABBs). The usage strategy of the PABBs depends on the simulation, and can be configured using the property ‘PABB_margin’

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

FlatNGonBoilerPlateRigid_NGon_1_Data  <4 >
  ↓
Rigid_NGon_2_Data  <4 >
  ↓
FlatLayer_NGon_1_Data  <4 >
  ↓
FlatLayer_NGon_2_Data  <4 >
  ↓
PABB_NGon_NGonCountContactsAbortIfSameParentFeedback

ContactCounter_NGon_NGon (Rigid_Quad Rigid_Triangle)

A test

Parallel Compatible: Yes

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:
    • PABB_margin (default value = -1) — Margin used by the Particle-Aligned Bounding Boxes (PABBs). This margin is added in all Particle-aligned axes of the bounding boxes in each direction. If specified as a value between 0 and half the calling contact detector’s ‘keep_distance’, the PABBs are considered as a pre-contact resolution step, and executed every timestep. Hence, the ‘margin’ can be interpreted as half the maximal overlap distance that should still be detected in the extreme case of two parallel N-gons. If ‘margin’ is not specified (or < 0), the PABBs are considered as a post-contact detection filtering step. The margin is then computed automatically based on the contact detector’s ‘keep_distance’ property, and the PABBs are only used to filter contacts whenever contact detection takes place, i.e. every ‘update_every’ steps. If unsure, leave this parameter as its default which is as safe as a Grid-Based contact detector and induces little overhead in general. However, for simulations with relatively ‘stiff’ and ‘fast’ particles, setting this to a non-zero value might significantly boost the simulation speed.
    • enable_PABB (default value = 1) — If ‘True’, the contacts will be pre-filtered using Particle-Aligned Bounding Boxes (PABBs). The usage strategy of the PABBs depends on the simulation, and can be configured using the property ‘PABB_margin’

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

FlatNGonBoilerPlateRigid_NGon_1_Data  <4 >
  ↓
Rigid_NGon_2_Data  <3 >
  ↓
FlatLayer_NGon_1_Data  <4 >
  ↓
FlatLayer_NGon_2_Data  <3 >
  ↓
PABB_NGon_NGonCountContactsFeedback

ContactCounter_NGon_NGon (Rigid_Triangle Rigid_Triangle)

A test

Parallel Compatible: Yes

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:
    • PABB_margin (default value = -1) — Margin used by the Particle-Aligned Bounding Boxes (PABBs). This margin is added in all Particle-aligned axes of the bounding boxes in each direction. If specified as a value between 0 and half the calling contact detector’s ‘keep_distance’, the PABBs are considered as a pre-contact resolution step, and executed every timestep. Hence, the ‘margin’ can be interpreted as half the maximal overlap distance that should still be detected in the extreme case of two parallel N-gons. If ‘margin’ is not specified (or < 0), the PABBs are considered as a post-contact detection filtering step. The margin is then computed automatically based on the contact detector’s ‘keep_distance’ property, and the PABBs are only used to filter contacts whenever contact detection takes place, i.e. every ‘update_every’ steps. If unsure, leave this parameter as its default which is as safe as a Grid-Based contact detector and induces little overhead in general. However, for simulations with relatively ‘stiff’ and ‘fast’ particles, setting this to a non-zero value might significantly boost the simulation speed.
    • abort_if_different (default value = 0) — If ‘True’, inverts the regular function of ‘AbortIfSameParent’, and makes the contact model early abort if the particles’ parents are different. Please do not change this ‘Property’ if you are not sure what you are doing.
    • enable_PABB (default value = 1) — If ‘True’, the contacts will be pre-filtered using Particle-Aligned Bounding Boxes (PABBs). The usage strategy of the PABBs depends on the simulation, and can be configured using the property ‘PABB_margin’

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

FlatNGonBoilerPlateRigid_NGon_1_Data  <3 >
  ↓
Rigid_NGon_2_Data  <3 >
  ↓
FlatLayer_NGon_1_Data  <3 >
  ↓
FlatLayer_NGon_2_Data  <3 >
  ↓
PABB_NGon_NGonCountContactsAbortIfSameParentFeedback

ContactIndexKeeper

Description: A model that counts the number of effective contacts, and also stores for each particle the highest index of its effective contact partners. If no contact is present, its array ‘contact_index’ will remain untouched. Hence, it is a good idea to reset it to ‘-1’ at the start of an iteration. Geometry combinations available:

PC2 | PC1 - Sphere SPH Rigid_Triangle Rigid_RoundedTriangle Rigid_Quad Deformable_Capsule
Sphere YES   YES   YES YES
SPH   YES        
Rigid_RoundedTriangle       YES    

ContactIndexKeeper (Deformable_Capsule Sphere)

A model that counts the number of effective contacts, and also stores for each particle the highest index of its effective contact partners. If no contact is present, its array ‘contact_index’ will remain untouched. Hence, it is a good idea to reset it to ‘-1’ at the start of an iteration.

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.

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

DefaultBoilerPlateSphere0_2_DataDeformable_Cylinder_1_DataCapsule_SphereCountEffectiveContactsStoreMaximalContactIndexFeedback

ContactIndexKeeper (Rigid_Quad Sphere)

A model that counts the number of effective contacts, and also stores for each particle the highest index of its effective contact partners. If no contact is present, its array ‘contact_index’ will remain untouched. Hence, it is a good idea to reset it to ‘-1’ at the start of an iteration.

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:
    • flip_normals (default value = 0) — Optionally flip normals if sphere is more than its radius submerged. In most cases, we recommend that you leave this option to its default ‘false’.
    • reject_large_overlap (default value = 1) — Optionally reject overlaps reject_overlap_r times larger than the radius. Unless you have a fully concave ‘container’ geometry, we recommend that you leave this value to its default ‘true’.
    • reject_overlap_r (default value = 1) — If reject_large_overlap is True, this specifies the number of sphere radii of overlap that should be rejected (Default=1).

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

DefaultBoilerPlateSphere0_2_DataRigid_NGon_1_Data  <4 >
  ↓
NGon_SphereCountEffectiveContactsStoreMaximalContactIndexFeedback

ContactIndexKeeper (Rigid_RoundedTriangle Rigid_RoundedTriangle)

A model that counts the number of effective contacts, and also stores for each particle the highest index of its effective contact partners. If no contact is present, its array ‘contact_index’ will remain untouched. Hence, it is a good idea to reset it to ‘-1’ at the start of an iteration.

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.

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

RoundedTriangleBoilerPlateRoundedTriangle_1_DataRoundedTriangle_2_DataRigid_NGon_1_Data  <3 >
  ↓
Rigid_NGon_2_Data  <3 >
  ↓
FitSphereToTriangle_1FitSphereToTriangle_2RoundedTriangle_RoundedTriangleCountEffectiveContactsStoreMaximalContactIndexFeedback

ContactIndexKeeper (Rigid_Triangle Sphere)

A model that counts the number of effective contacts, and also stores for each particle the highest index of its effective contact partners. If no contact is present, its array ‘contact_index’ will remain untouched. Hence, it is a good idea to reset it to ‘-1’ at the start of an iteration.

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:
    • flip_normals (default value = 0) — Optionally flip normals if sphere is more than its radius submerged. In most cases, we recommend that you leave this option to its default ‘false’.
    • reject_large_overlap (default value = 1) — Optionally reject overlaps reject_overlap_r times larger than the radius. Unless you have a fully concave ‘container’ geometry, we recommend that you leave this value to its default ‘true’.
    • reject_overlap_r (default value = 1) — If reject_large_overlap is True, this specifies the number of sphere radii of overlap that should be rejected (Default=1).

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

DefaultBoilerPlateSphere0_2_DataRigid_NGon_1_Data  <3 >
  ↓
NGon_SphereCountEffectiveContactsStoreMaximalContactIndexFeedback

ContactIndexKeeper (SPH SPH)

A model that counts the number of effective contacts, and also stores for each particle the highest index of its effective contact partners. If no contact is present, its array ‘contact_index’ will remain untouched. Hence, it is a good idea to reset it to ‘-1’ at the start of an iteration.

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.

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

DefaultBoilerPlateSPH_2_DataSPH_1_DataSPH_SPHCountEffectiveContactsStoreMaximalContactIndexFeedback

ContactIndexKeeper (Sphere Sphere)

A model that counts the number of effective contacts, and also stores for each particle the highest index of its effective contact partners. If no contact is present, its array ‘contact_index’ will remain untouched. Hence, it is a good idea to reset it to ‘-1’ at the start of an iteration.

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.

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

DefaultBoilerPlateSphere0_2_DataSphere0_1_DataSphere_SphereCountEffectiveContactsStoreMaximalContactIndexFeedback

TriangleCrossingCounter

Description: Counting diffusive particles that cross triangle boundaries, by constructing a ‘line’ between their current and previous position Geometry combinations available:

PC2 | PC1 - Rigid_Triangle
Ray YES

TriangleCrossingCounter (Rigid_Triangle Ray)

Counting diffusive particles that cross triangle boundaries, by constructing a ‘line’ between their current and previous position

Parallel Compatible: Yes

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.
    • x_prev — Array with previous positions

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

DefaultBoilerPlateSphere0_2_DataRigid_NGon_1_Data  <3 >
  ↓
NGon_PointPcLineCountContactsFeedback

UniqueContactChecker

Description: A contact model that checks whether or not a contactdetector has given the same contact pair twice. This should never happen, unless the user requested a reuse of the contactdetector. Geometry combinations available:

PC2 | PC1 - any
any YES

UniqueContactChecker (any any)

A contact model that checks whether or not a contactdetector has given the same contact pair twice. This should never happen, unless the user requested a reuse of the contactdetector.

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:
    • print_all (default value = 0) — Sets whether or not to print all violating contacts, or just the first
    • throw_immediatly (default value = 1) — Sets whether or not to throw when a duplicated contact is found

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

DefaultBoilerPlateUniqueContactCheckerNoFeedback