Exemplo n.º 1
0
 /// Copy constructor
 public ChConstraintTwoBodies(ChConstraintTwoBodies other) : base(other)
 {
     Cq_a = other.Cq_a;
     Cq_b = other.Cq_b;
     Eq_a = other.Eq_a;
     Eq_b = other.Eq_b;
 }
Exemplo n.º 2
0
        /// Build a link mask with a default array of mnconstr constraints
        /// of class ChConstraintTwoBodies().
        public ChLinkMask(int mnconstr)
        {
            nconstr = mnconstr;

            constraints.Resize(nconstr);
            for (int i = 0; i < nconstr; i++)
            {
                constraints[i] = new ChConstraintTwoBodies();
            }
        }
Exemplo n.º 3
0
        /// Utility: to change the size of the mask, reallocating constraints
        /// (all of type ChConstraintTwo).
        /// No action if newnconstr == nconstr
        public void ResetNconstr(int newnconstr)
        {
            if (nconstr != newnconstr)
            {
                int i;
                for (i = 0; i < nconstr; i++)
                {
                    if (constraints[i] == null)
                    {
                        constraints[i] = null;
                    }
                }

                nconstr = newnconstr;

                constraints.Resize(nconstr);

                for (i = 0; i < nconstr; i++)
                {
                    constraints[i] = new ChConstraintTwoBodies();
                }
            }
        }
Exemplo n.º 4
0
 /// Add a ChConstraintTwoBodies to mask (NOTE: later, the constraint will
 /// be automatically deleted when the mask will be deleted)
 public void AddConstraint(ChConstraintTwoBodies aconstr)
 {
     nconstr++;
     constraints.Add(aconstr);
 }
Exemplo n.º 5
0
        public int nconstr;                                                                      //< number of scalar eq.of constraint.

        /// Build a link mask with a single constraint of class ChConstraintTwoBodies().
        public ChLinkMask()
        {
            nconstr = 1;
            constraints.Resize(1);
            constraints[0] = new ChConstraintTwoBodies();
        }