int BeamEndContact3Dp::update(void) // this function updates variables for an incremental step n to n+1 { Vector disp_a(6); Vector rot_a(BEC3p_NUM_DIM); Vector omega(BEC3p_NUM_DIM); Matrix eMap(BEC3p_NUM_DIM,BEC3p_NUM_DIM); // update beam node coordinates and rotations disp_a = theNodes[0]->getTrialDisp(); for (int i = 0; i < 3; i++) { mDcrd_a(i) = mIcrd_a(i) + disp_a(i); rot_a(i) = disp_a(i+3); } // update slave node coordinates mDcrd_s = mIcrd_s + theNodes[1]->getTrialDisp(); // update the normal vector omega = rot_a - ((mNormal^rot_a)*mNormal); // compute exponential map of skew(omega) eMap = ExpMap(omega); // compute the current normal vector mNormal = eMap*mIniNormal; // update penetration function mGap = (mDcrd_s - mDcrd_a)^mNormal; double tol = 0.000001*mRadius; if (mGap < tol && in_bounds) { inContact = true; } else { mGap = 0.0; inContact = false; } // update normal contact force if (was_inContact) { mLambda = mPenalty*mGap; } else { mLambda = 0.0; } // update projection coordinate mx_p = mDcrd_s - (mGap*mNormal); return 0; }
int BeamEndContact3D::update(void) // this function updates variables for an incremental step n to n+1 { Vector disp_L(3); Vector disp_a(6); Vector rot_a(BEC3_NUM_DIM); Vector omega(BEC3_NUM_DIM); Matrix eMap(BEC3_NUM_DIM,BEC3_NUM_DIM); // update beam node coordinates and rotations disp_a = theNodes[0]->getTrialDisp(); for (int i = 0; i < 3; i++) { mDcrd_a(i) = mIcrd_a(i) + disp_a(i); rot_a(i) = disp_a(i+3); } // update slave node coordinates mDcrd_s = mIcrd_s + theNodes[1]->getTrialDisp(); // update Lagrange multiplier value disp_L = theNodes[2]->getTrialDisp(); mLambda = disp_L(0); // update the normal vector omega = rot_a - ((mNormal^rot_a)*mNormal); // compute exponential map of skew(omega) eMap = ExpMap(omega); // compute the current normal vector mNormal = eMap*mIniNormal; // update gap mGap = (mDcrd_s - mDcrd_a)^mNormal; // update projection coordinate mx_p = mDcrd_s - (mGap*mNormal); // set the boolean release condition should_be_released = (mLambda <= -mForceTol); return 0; }