# D. Constraint Enforcement Hierarchy

When a node has multiple constraints, they are enforced in a specific order. Table 2 shows the order of enforcement of the various types of constraints.

Table 2 Constraint Enforcement Order
1 | Contact
2 | MPC
3 | Kinematic
4 | Rigid Body

If any of the constraints are in conflict, the last constraint enforced will override previously enforced constraints. For example, if a kinematic boundary condition and a MPC are both active on a node and conflict with each other, the MPC will be enforced first, followed by the kinematic boundary condition. As a result, the kinematic boundary condition will be enforced and will override the MPC.

Additionally, a node may have multiple instances of one type of constraint. For example a node could have multiple conflicting kinematic constraints. For such cases generally the last constraint defined in the input deck will be enforced overriding any conflicting earlier constraints. Only the part of previous constraints orthogonal to the last constraint will be enforced.

Example 1:

    BEGIN INITIAL VELOCITY
      NODE SET = nodelist_1
      COMPONENT = X
      MAGNITUDE = 0.1
    END
    BEGIN INITIAL VELOCITY
      NODE SET = nodelist_1
      COMPONENT = Y
      MAGNITUDE = 0.2
    END

The two velocity boundary conditions are orthogonal thus combine normally, each node in nodelist_1 will be given a velocity of (0.1, 0.2. 0.0).

Example 2:

    DEFINE DIRECTION angle WITH VECTOR 1 1 0
    BEGIN INITIAL VELOCITY
      NODE SET = nodelist_1
      DIRECTION = angle
      MAGNITUDE = 1.0
    END
    BEGIN INITIAL VELOCITY
      NODE SET = nodelist_1
      COMPONENT = X
      MAGNITUDE = 0.5
    END

The two velocity boundary conditions are not orthogonal. In evaluating the first boundary condition the nodes will be given a velocity of (0.707107, 0.707107, 0.0). Next the second boundary condition is evaluating overriding the non-orthogonal portion first resulting in a final nodal velocity of (0.5, 0.707107, 0.0).