mpacts.predicates. predicates

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

import mpacts.predicates.predicates
#or assign it to a shorter name
import mpacts.predicates.predicates as pre

InitParticleInTubeFlow

class mpacts.predicates.predicates.InitParticleInTubeFlow

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

When activated, initializes new points in tube flow, very basic atm. Based on article
Has no default location.
  • Required keywords:
    • V_mean (m . s^-1) — Mean |velocity| in tube
    • cylinderP1 — point1 of the cylinder.
    • cylinderP2 — point2 of the cylinder.
    • cylinder_radius (m) — radius of the cylinder.
    • nu — Kinematic viscosity of the fluid
  • Optional keywords:
    • Offcenter (default value = 0 0 0) — Create offset from tube center, optional
    • STD (m) (default value = -1) — Standard diviation on position, optional standard value R_{cyl}/10
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: cylinderP1, cylinderP2, cylinder_radius, V_mean, nu, [child_predicate, allow_manager_change, STD, Offcenter]
InitParticleInTubeFlow(name, parent, **kwargs)

PointInCylinderGen

class mpacts.predicates.predicates.PointInCylinderGen

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

When activated, initializes new points in cylinder, option to use uniform or poisseuille distribution.
Has no default location.
  • Required keywords:
    • cylinderP1 — point1 of the cylinder.
    • cylinderP2 — point2 of the cylinder.
    • cylinder_radius (m) — radius of the cylinder.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • poiseuille_profile (default value = 0) — Uniform or poiseuille profile
object __init__(tuple args, dict kwds) :
args: name, parent kwds: cylinderP1, cylinderP2, cylinder_radius, [child_predicate, allow_manager_change, poiseuille_profile]
PointInCylinderGen(name, parent, **kwargs)

PointOnSphereGen

class mpacts.predicates.predicates.PointOnSphereGen

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

When activated, initializes new points on a sphere
Has no default location.
  • Required keywords:
    • sphere_center — center of the sphere.
    • sphere_radius — radius of the sphere.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: sphere_center, sphere_radius, [child_predicate, allow_manager_change]
PointOnSphereGen(name, parent, **kwargs)

PredicateActionChainer

class mpacts.predicates.predicates.PredicateActionChainer

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that will chain the action of its both child predicates. The check always returns True.
Has no default location.
  • Required keywords:
    • predicate1 — First predicate
    • predicate2 — Second predicate
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: predicate1, predicate2, [child_predicate, allow_manager_change]
PredicateActionChainer(name, parent, **kwargs)

PredicateAction_StoreElement

class mpacts.predicates.predicates.PredicateAction_StoreElement

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that only has an action (check returns true). The action will copy the corresponding value of the predicated element to a target arraymanager ‘target’.
Has no default location.
  • Required keywords:
    • target — the target arraymanager to which the element is copied.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • modeled_mgr (default value = 0) — Indicates if the target has been modeled to the predicates mgr. Mainly exposed for serialization persistence
object __init__(tuple args, dict kwds) :
args: name, parent kwds: target, [child_predicate, allow_manager_change, modeled_mgr]
PredicateAction_StoreElement(name, parent, **kwargs)
clear((PredicateAction_StoreElement)arg1) → None :

clears the ‘target’ manager

PredicateAction_StoreParticleElements

class mpacts.predicates.predicates.PredicateAction_StoreParticleElements

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that only has an action (check returns true). The action will copy all corrosponding elements from a particle if one or more elements from the particle satisfies the condition. All the elements are copied to a target arraymanager ‘target’.
Has no default location.
  • Required keywords:
    • target — the target arraymanager to which the element is copied.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • modeled_mgr (default value = 0) — Indicates if the target has been modeled to the predicates mgr. Mainly exposed for serialization persistence
object __init__(tuple args, dict kwds) :
args: name, parent kwds: target, [child_predicate, allow_manager_change, modeled_mgr]
PredicateAction_StoreParticleElements(name, parent, **kwargs)
clear((PredicateAction_StoreParticleElements)arg1) → None :

clears the ‘target’ manager

PredicateBase

class mpacts.predicates.predicates.PredicateBase

Bases: mpacts.core.baseobject.BaseObject

Abstract Base Class for all predicates. Cannot be instatiated directly

Raises an exception This class cannot be instantiated from Python

PredicateBase(name, parent, **kwargs)
check((PredicateBase)arg1, (ArrayManager)arg2, (int)arg3) → bool :

Checks if the predicate is fullfilled for the given arguments

get_child_predicate((PredicateBase)arg1) → PredicateBase :

Returns the child predicate of this predicate

set_child_predicate((PredicateBase)arg1, (PredicateBase)arg2) → None :

Sets the child predicate of this predicate

Predicate_AND

class mpacts.predicates.predicates.Predicate_AND

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks whether one predicate (property ‘predicate1’) is true And another predicate (property ‘predicate2’) is true.
Has no default location.
  • Required keywords:
    • predicate1 — First predicate
    • predicate2 — Second predicate
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: predicate1, predicate2, [child_predicate, allow_manager_change]
Predicate_AND(name, parent, **kwargs)

Predicate_AbovePlane

class mpacts.predicates.predicates.Predicate_AbovePlane

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that will return true when the points are above a given plane.
Has no default location.
  • Required keywords:
    • plane_normal — normal to the plane. Note: points in the direction of the normal are considered ‘above’.
    • point_on_plane — A point on the plane, toghether with the direction, fully qualifying the plane
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: plane_normal, point_on_plane, [child_predicate, allow_manager_change]
Predicate_AbovePlane(name, parent, **kwargs)

Predicate_AlwaysTrue

class mpacts.predicates.predicates.Predicate_AlwaysTrue

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that will return true, always.
Has no default location.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: [child_predicate, allow_manager_change]
Predicate_AlwaysTrue(name, parent, **kwargs)

Predicate_BelowPlane

class mpacts.predicates.predicates.Predicate_BelowPlane

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that will return true when the points are below a given plane.
Has no default location.
  • Required keywords:
    • plane_normal — normal to the plane. Note: points in the direction of the normal are considered ‘above’.
    • point_on_plane — A point on the plane, toghether with the direction, fully qualifying the plane
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: plane_normal, point_on_plane, [child_predicate, allow_manager_change]
Predicate_BelowPlane(name, parent, **kwargs)

Predicate_Debug

class mpacts.predicates.predicates.Predicate_Debug

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that wraps another predicate and offers the opportunity to execute python code before and after.
Has no default location.
  • Required keywords:
    • predicate — other predicate that is being wrapped by this predicate.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • onFalse (default value = boost::python::api::object cannot be printed.) — Function that will be executed when the predicate we wrap returns false. Signature expected to be f(idx)
    • onTrue (default value = boost::python::api::object cannot be printed.) — Function that will be executed when the predicate we wrap returns true. Signature expected to be f(idx)
object __init__(tuple args, dict kwds) :
args: name, parent kwds: predicate, [child_predicate, allow_manager_change, onTrue, onFalse]
Predicate_Debug(name, parent, **kwargs)

Predicate_InBox

class mpacts.predicates.predicates.Predicate_InBox

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks whether a ‘Point’ array of a particle is within a given rectangular box defined by two points.
Has no default location.
  • Required keywords:
    • array — Array on which the predicate acts
    • max — Upper limit of the box (xmax,ymax,zmax).
    • min — Lower limit of the box (xmin,ymin,zmin).
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array, min, max, [child_predicate, allow_manager_change]
Predicate_InBox(name, parent, **kwargs)

Predicate_InCylinder

class mpacts.predicates.predicates.Predicate_InCylinder

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks whether a ‘Point’ array of a particle is within (ON is also IN) a given cylinder defined by begin point, end point and radius (P1, P2 and radius)
Has no default location.
  • Required keywords:
    • P1 — Begin point of the cylinder
    • P2 — End point of the cylinder
    • array — Array on which the predicate acts
    • radius — radius of the cylinder
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • is_infinite (default value = 0) — If True, the cylinder will be considered of infinite length.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array, P1, P2, radius, [child_predicate, allow_manager_change, is_infinite]
Predicate_InCylinder(name, parent, **kwargs)

Predicate_InEllipse2D

class mpacts.predicates.predicates.Predicate_InEllipse2D

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks whether a ‘Point’ array of a particle is within (ON is also IN) a given ellipse (2D, xy-plane) defined by center point, half length of the long axis (a) and short axis (b)
Has no default location.
  • Required keywords:
    • a — half length of the long axis
    • array — Array on which the predicate acts
    • b — half length of the short axis
    • center — center point of the ellipse in xy-plane
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array, center, a, b, [child_predicate, allow_manager_change]
Predicate_InEllipse2D(name, parent, **kwargs)

Predicate_InSphere

class mpacts.predicates.predicates.Predicate_InSphere

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that will return true when the points are (strictly) within a sphere.
Has no default location.
  • Required keywords:
    • sphere_center — center of the sphere.
    • sphere_radius — radius of the sphere.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: sphere_center, sphere_radius, [child_predicate, allow_manager_change]
Predicate_InSphere(name, parent, **kwargs)

Predicate_IndexArray

class mpacts.predicates.predicates.Predicate_IndexArray

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks whether value of a given Index array of a particle is below an upper threshold and above a lower threshold.
Has no default location.
  • Required keywords:
    • array — Array keeping an index, on which the predicate acts
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • max_value (default value = 4294967295) — Maximum index value for activation of this predicate
    • min_value (default value = 0) — Minimum index value for activation of this predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array, [child_predicate, allow_manager_change, min_value, max_value]
Predicate_IndexArray(name, parent, **kwargs)

Predicate_IndexArray_Alive

class mpacts.predicates.predicates.Predicate_IndexArray_Alive

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks the Alive status of certain particles in a given pc (first argument). Which particles are checked is determined by the array with indices given as a second argument.
Has no default location.
  • Required keywords:
    • array — Array conatining indices refering to eval pc for which the Alive status should be checked.
    • eval_pc — Particle container for which for each particle is checked whether it is still alive
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: eval_pc, array, [child_predicate, allow_manager_change]
Predicate_IndexArray_Alive(name, parent, **kwargs)

Predicate_IndexArraysEqual

class mpacts.predicates.predicates.Predicate_IndexArraysEqual

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks whether indices in two given arrays are equal for a (given) particle.
Has no default location.
  • Required keywords:
    • array1 — Array 1, keeping an index, on which the predicate acts
    • array2 — Array 2, keeping an index, on which the predicate acts
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array1, array2, [child_predicate, allow_manager_change]
Predicate_IndexArraysEqual(name, parent, **kwargs)

Predicate_Indices

class mpacts.predicates.predicates.Predicate_Indices

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that is true for the given python iterable (e.g. list) of indices.
Has no default location.
  • Required keywords:
    • indices — python object which (only!) contains indices for which predicate will return ‘true’.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: indices, [child_predicate, allow_manager_change]
Predicate_Indices(name, parent, **kwargs)

Predicate_IntArray_Alive

class mpacts.predicates.predicates.Predicate_IntArray_Alive

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks the Alive status of certain particles in a given pc (first argument). Which particles are checked is determined by the array with int-type indices given as a second argument. For negative indices the predicate returns False.
Has no default location.
  • Required keywords:
    • array — Array conatining int type indices refering to eval pc for which the Alive status should be checked.
    • eval_pc — Particle container for which for each particle is checked whether it is still alive
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: eval_pc, array, [child_predicate, allow_manager_change]
Predicate_IntArray_Alive(name, parent, **kwargs)

Predicate_IntegerArray

class mpacts.predicates.predicates.Predicate_IntegerArray

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks whether value of a given Integer array of a particle is below an upper threshold and above a lower threshold.
Has no default location.
  • Required keywords:
    • array — Array on which the predicate acts
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • max_value (default value = 2147483647) — Maximum integer value for activation of this predicate
    • min_value (default value = -2147483647) — Minimum integer value for activation of this predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array, [child_predicate, allow_manager_change, min_value, max_value]
Predicate_IntegerArray(name, parent, **kwargs)

Predicate_NOT

class mpacts.predicates.predicates.Predicate_NOT

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks whether a predicate (property ‘predicate’) is Not true.
Has no default location.
  • Required keywords:
    • predicate — predicate of which the result is inverted
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: predicate, [child_predicate, allow_manager_change]
Predicate_NOT(name, parent, **kwargs)

Predicate_OR

class mpacts.predicates.predicates.Predicate_OR

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks whether one predicate (property ‘predicate1’) is true OR another predicate (property ‘predicate2’) is true.
Has no default location.
  • Required keywords:
    • predicate1 — First predicate
    • predicate2 — Second predicate
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: predicate1, predicate2, [child_predicate, allow_manager_change]
Predicate_OR(name, parent, **kwargs)

Predicate_ParentScalarArray

class mpacts.predicates.predicates.Predicate_ParentScalarArray

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks whether value of a given Scalar array of the parent particle is below an upper threshold and above a lower threshold.
Has no default location.
  • Required keywords:
    • array — Parent array
    • ppidx — parent particle index array
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • max_value (default value = 1.7976931348623157e+308) — Maximum scalar value for activation of this predicate
    • min_value (default value = -1.7976931348623157e+308) — Minimum scalar value for activation of this predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array, ppidx, [child_predicate, allow_manager_change, min_value, max_value]
Predicate_ParentScalarArray(name, parent, **kwargs)

Predicate_ParticleIndex

class mpacts.predicates.predicates.Predicate_ParticleIndex

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks whether the particle index is below an upper threshold and above a lower threshold.
Has no default location.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • max_value (default value = 4294967295) — Maximum particle index for activation of this predicate
    • min_value (default value = 0) — Minimum particle index for activation of this predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: [child_predicate, allow_manager_change, min_value, max_value]
Predicate_ParticleIndex(name, parent, **kwargs)

Predicate_PointArray

class mpacts.predicates.predicates.Predicate_PointArray

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks whether a component (or norm if component is -1) of a Point array of a particle is below an upper threshold and above a lower threshold.
Has no default location.
  • Required keywords:
    • array — Array on which the predicate acts
    • component — Component of the Point to be compared against. If ‘-1’, the -always positive - Point norm will be used.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • max_value (default value = 1.7976931348623157e+308) — Maximum scalar value for activation of this predicate
    • min_value (default value = -1.7976931348623157e+308) — Minimum scalar value for activation of this predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array, component, [child_predicate, allow_manager_change, min_value, max_value]
Predicate_PointArray(name, parent, **kwargs)

Predicate_Point_IsInf

class mpacts.predicates.predicates.Predicate_Point_IsInf

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

Checks whether the value in the Point array given is Inf; returns true when Inf
Has no default location.
  • Required keywords:
    • array — Array on which the predicate acts
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • component (default value = -1) — In case the given array contains vectors, the component idx given determines which component is checked for Inf. If ‘-1’, the norm will be used.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array, [child_predicate, allow_manager_change, component]
Predicate_Point_IsInf(name, parent, **kwargs)

Predicate_Point_IsNaN

class mpacts.predicates.predicates.Predicate_Point_IsNaN

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

Checks whether the value in the Point array given is NaN; returns true when NaN
Has no default location.
  • Required keywords:
    • array — Array on which the predicate acts
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • component (default value = -1) — In case the given array contains vectors, the component idx given determines which component is checked for Nan. If ‘-1’, the norm will be used.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array, [child_predicate, allow_manager_change, component]
Predicate_Point_IsNaN(name, parent, **kwargs)

Predicate_Random

class mpacts.predicates.predicates.Predicate_Random

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that will randomly return true with a given probability p, either per unit of time if sim is given, or per timestep otherwise - the latter being computationally cheaper.
Has no default location.
  • Required keywords:
    • p — Probability of activating the predicate (Must be between [0,1])
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • sim (default value = None) — Simulation. If given, the probability will be per unit of time. If not, per timestep.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: p, [child_predicate, allow_manager_change, sim]
Predicate_Random(name, parent, **kwargs)

Predicate_ScalarArray

class mpacts.predicates.predicates.Predicate_ScalarArray

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks whether value of a given Scalar array of a particle is below an upper threshold and above a lower threshold.
Has no default location.
  • Required keywords:
    • array — Array on which the predicate acts
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • max_value (default value = 1.7976931348623157e+308) — Maximum scalar for a ‘True’ evaluation of this predicate
    • min_value (default value = -1.7976931348623157e+308) — Minimum scalar value for a ‘True’ evaluation of this predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array, [child_predicate, allow_manager_change, min_value, max_value]
Predicate_ScalarArray(name, parent, **kwargs)

Predicate_Scalar_IsInf

class mpacts.predicates.predicates.Predicate_Scalar_IsInf

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

Checks whether the value in the scalar array given is Inf returns; true when Inf
Has no default location.
  • Required keywords:
    • array — Array on which the predicate acts
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • component (default value = -1) — In case the given array contains vectors, the component idx given determines which component is checked for Inf. If ‘-1’, the norm will be used.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array, [child_predicate, allow_manager_change, component]
Predicate_Scalar_IsInf(name, parent, **kwargs)

Predicate_Scalar_IsNaN

class mpacts.predicates.predicates.Predicate_Scalar_IsNaN

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

Checks whether the value in the scalar array given is NaN returns; true when NaN
Has no default location.
  • Required keywords:
    • array — Array on which the predicate acts
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • component (default value = -1) — In case the given array contains vectors, the component idx given determines which component is checked for Nan. If ‘-1’, the norm will be used.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array, [child_predicate, allow_manager_change, component]
Predicate_Scalar_IsNaN(name, parent, **kwargs)

Predicate_SetIndex

class mpacts.predicates.predicates.Predicate_SetIndex

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that will set the value of an array with name ‘array_name’ to a given ‘value’.
Has no default location.
  • Required keywords:
    • array_name — Name of the array in the manager/pc.
    • value — Value with which to set the array.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • setIfTrue (default value = 1) — Sets the associated array with the associated value if this flag is ‘True’ (default), or ‘False’, if so set.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array_name, value, [child_predicate, allow_manager_change, setIfTrue]
Predicate_SetIndex(name, parent, **kwargs)

Predicate_SetInt

class mpacts.predicates.predicates.Predicate_SetInt

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that will set the value of an array with name ‘array_name’ to a given ‘value’.
Has no default location.
  • Required keywords:
    • array_name — Name of the array in the manager/pc.
    • value — Value with which to set the array.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • setIfTrue (default value = 1) — Sets the associated array with the associated value if this flag is ‘True’ (default), or ‘False’, if so set.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array_name, value, [child_predicate, allow_manager_change, setIfTrue]
Predicate_SetInt(name, parent, **kwargs)

Predicate_SetPoint

class mpacts.predicates.predicates.Predicate_SetPoint

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that will set the value of an array with name ‘array_name’ to a given ‘value’.
Has no default location.
  • Required keywords:
    • array_name — Name of the array in the manager/pc.
    • value — Value with which to set the array.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • setIfTrue (default value = 1) — Sets the associated array with the associated value if this flag is ‘True’ (default), or ‘False’, if so set.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array_name, value, [child_predicate, allow_manager_change, setIfTrue]
Predicate_SetPoint(name, parent, **kwargs)

Predicate_SetScalar

class mpacts.predicates.predicates.Predicate_SetScalar

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that will set the value of an array with name ‘array_name’ to a given ‘value’.
Has no default location.
  • Required keywords:
    • array_name — Name of the array in the manager/pc.
    • value — Value with which to set the array.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • setIfTrue (default value = 1) — Sets the associated array with the associated value if this flag is ‘True’ (default), or ‘False’, if so set.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array_name, value, [child_predicate, allow_manager_change, setIfTrue]
Predicate_SetScalar(name, parent, **kwargs)

Predicate_SetVector

class mpacts.predicates.predicates.Predicate_SetVector

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that will set the value of an array with name ‘array_name’ to a given ‘value’.
Has no default location.
  • Required keywords:
    • array_name — Name of the array in the manager/pc.
    • value — Value with which to set the array.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • setIfTrue (default value = 1) — Sets the associated array with the associated value if this flag is ‘True’ (default), or ‘False’, if so set.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array_name, value, [child_predicate, allow_manager_change, setIfTrue]
Predicate_SetVector(name, parent, **kwargs)

Predicate_StateSaver

class mpacts.predicates.predicates.Predicate_StateSaver

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks if the ‘state’ array corresponds to the Predicate’s unique index. action sets the state with the unique index. Useful for state-machine like functionalities.
Has no default location.
  • Optional keywords:
    • allow_manager_change (default value = 1) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • state_idx (default value = 0) — State index associated with activation of this predicate.
    • stored_class_idx (default value = -1) — Directly sets the next state integer. This will ignore the current counter and is therefore dangerous. Changing this value is not recommended.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: [child_predicate, allow_manager_change, state_idx, stored_class_idx]
Predicate_StateSaver(name, parent, **kwargs)

Predicate_StochasticSwitch

class mpacts.predicates.predicates.Predicate_StochasticSwitch

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that will stochastically evaluate to ‘True’ or ‘False’ based on a given Scalar modulating array which will vary the probability between p_min and p_max using a sigmoidal function (or a step if steepness=-1). If a simulation object is given, the probability will be expressed per unit of time instead of per timestep, the latter being computationally cheaper
Has no default location.
  • Required keywords:
    • array — Array which will be used to modulate the stochastic switch.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • invert (default value = 0) — If ‘True’, a down-stepping function will be used instead of an up-stepping function to modulate the function. Default = False
    • p_max (default value = 1) — upper probability of the stochastic switch. Must be between [p_min,1]. Default=1.
    • p_min (default value = 0) — lower probability of the stochastic switch. Must be between [0,p_max]. Default=0.
    • sim (default value = None) — Simulation. If given, the probability will be per unit of time. If not, per timestep.
    • steepness (default value = -1) — Steepness of the sigmoidal modulating the switch. If ‘-1’, a step function (infinite steepness) will be used. Default=-1
    • threshold (default value = 0) — Inflection point of the sigmoidal curve (or location of the step) for modulating the stochastic switch. Default=0.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array, [child_predicate, allow_manager_change, p_min, p_max, steepness, threshold, sim, invert]
Predicate_StochasticSwitch(name, parent, **kwargs)

Predicate_Stress

class mpacts.predicates.predicates.Predicate_Stress

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks whether the principal stress (stored in Vector ‘principal_stress’) of a particle is below an upper threshold and above a lower threshold.
Has no default location.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • component (default value = -1) — Selects which componont of the stress tensor to use. If ‘-1’, we will the mean of the three components
    • max_stress (default value = 1.7976931348623157e+308) — Array manager (or pc) for which the predicate will be used.
    • min_stress (default value = -1.7976931348623157e+308) — Array manager (or pc) for which the predicate will be used.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: [child_predicate, allow_manager_change, max_stress, min_stress, component]
Predicate_Stress(name, parent, **kwargs)

Predicate_VectorArray

class mpacts.predicates.predicates.Predicate_VectorArray

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that checks whether a component (or norm if component is -1) of a Vector array of a particle is below an upper threshold and above a lower threshold.
Has no default location.
  • Required keywords:
    • array — Array on which the predicate acts
    • component — Component of the vector to be compared against. If ‘-1’, the -always positive - Vector norm will be used. If ‘-2’, the slightly cheaper abssum will be used.
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • max_value (default value = 1.7976931348623157e+308) — Maximum scalar value for activation of this predicate
    • min_value (default value = -1.7976931348623157e+308) — Minimum scalar value for activation of this predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array, component, [child_predicate, allow_manager_change, min_value, max_value]
Predicate_VectorArray(name, parent, **kwargs)

Predicate_Vector_IsInf

class mpacts.predicates.predicates.Predicate_Vector_IsInf

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

Checks whether the value in the Vector array given is Inf; returns true when Inf
Has no default location.
  • Required keywords:
    • array — Array on which the predicate acts
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • component (default value = -1) — In case the given array contains vectors, the component idx given determines which component is checked for Inf. If ‘-1’, the norm will be used.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array, [child_predicate, allow_manager_change, component]
Predicate_Vector_IsInf(name, parent, **kwargs)

Predicate_Vector_IsNaN

class mpacts.predicates.predicates.Predicate_Vector_IsNaN

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

Checks whether the value in the Vector array given is NaN; returns true when NaN
Has no default location.
  • Required keywords:
    • array — Array on which the predicate acts
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
    • component (default value = -1) — In case the given array contains vectors, the component idx given determines which component is checked for Nan. If ‘-1’, the norm will be used.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: array, [child_predicate, allow_manager_change, component]
Predicate_Vector_IsNaN(name, parent, **kwargs)

Predicate_XOR

class mpacts.predicates.predicates.Predicate_XOR

Bases: mpacts.predicates.predicates.PredicateBase, mpacts.core.baseobject.BaseObject

A predicate that returns the logical XOR between the check of ‘predicate1’ and ‘predicate2’.
Has no default location.
  • Required keywords:
    • predicate1 — First predicate
    • predicate2 — Second predicate
  • Optional keywords:
    • allow_manager_change (default value = 0) — Boolean that decides whether or not a predicate will allow you to change the manager it is currently working on.This is a safety check, disable only when you know what you are doing.
    • child_predicate (default value = None) — child predicate
object __init__(tuple args, dict kwds) :
args: name, parent kwds: predicate1, predicate2, [child_predicate, allow_manager_change]
Predicate_XOR(name, parent, **kwargs)