mpacts.contact.models.misc. predicatedcontactmodel

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

import mpacts.contact.models.misc.predicatedcontactmodel
#or assign it to a shorter name
import mpacts.contact.models.misc.predicatedcontactmodel as pre

PredicatedContactModel

class mpacts.contact.models.misc.predicatedcontactmodel.PredicatedContactModel

Bases: mpacts.contact.models.contactmodelbase.ContactModelBase, mpacts.core.baseobject.BaseObject

ContactModel that can accept any contactmodel and up to two predicates (one for each PC in the contact) and only execute the contact when all predicates are true.
Has no default location.
  • Required keywords:
    • cmodel — The contactmodel for which the contactdata will be executed when the predicate(s) are true.
    • 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:
    • predicate_pc1 (default value = None) — If given, the predicate is checked on p1 and the model is only executed when the predicate is true. (in case pc1 = pc2, the predicate is checked for both particles)
    • predicate_pc2 (default value = None) — If given, the predicate is checked on p2 and the model is only executed when the preciate is true.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc1, pc2, cmodel, [predicate_pc1, predicate_pc2]
PredicatedContactModel(name, parent, **kwargs)