// constructors
BeamEndContact3Dp::BeamEndContact3Dp(int tag, int Nd1, int Nd2, int NdS, double rad, double pen, int cSwitch)
  :Element(tag,ELE_TAG_BeamEndContact3Dp),
	mExternalNodes(BEC3p_NUM_NODE),
	mTangentStiffness(BEC3p_NUM_DOF, BEC3p_NUM_DOF),
	mInternalForces(BEC3p_NUM_DOF),
	mEye1(BEC3p_NUM_DIM, BEC3p_NUM_DIM),
	mIniNormal(BEC3p_NUM_DIM),
	mNormal(BEC3p_NUM_DIM),
	mIcrd_a(BEC3p_NUM_DIM),
	mIcrd_s(BEC3p_NUM_DIM),
    mDcrd_a(BEC3p_NUM_DIM),
	mDcrd_s(BEC3p_NUM_DIM)
{
    mExternalNodes(0) = Nd1;
	mExternalNodes(1) = NdS;
	mBeamNode = Nd2;

    mRadius = rad;
	mPenalty = pen;
	mIniContact = cSwitch;

	mGap    = 0.0;
	mLambda = 0.0;

	// set the initial contact state
	if (mIniContact == 0) {
		inContact          = true;
		was_inContact      = true;
		in_bounds          = true;
	} else {
		inContact          = false;
		was_inContact      = false;
		in_bounds          = true;
	}
}
Exemple #2
0
// full constructor
SSPquad::SSPquad(int tag, int Nd1, int Nd2, int Nd3, int Nd4, NDMaterial &theMat,
                 const char *type, double thick, double b1, double b2)
    :Element(tag,ELE_TAG_SSPquad),
     theMaterial(0),
     mExternalNodes(SSPQ_NUM_NODE),
     mTangentStiffness(SSPQ_NUM_DOF,SSPQ_NUM_DOF),
     mInternalForces(SSPQ_NUM_DOF),
     Q(SSPQ_NUM_DOF),
     mMass(SSPQ_NUM_DOF,SSPQ_NUM_DOF),
     mNodeCrd(2,4),
     mStrain(3),
     mStress(3),
     Mmem(3,SSPQ_NUM_DOF),
     Kmem(SSPQ_NUM_DOF,SSPQ_NUM_DOF),
     Kstab(SSPQ_NUM_DOF,SSPQ_NUM_DOF),
     mThickness(thick),
     applyLoad(0)
{
    mExternalNodes(0) = Nd1;
    mExternalNodes(1) = Nd2;
    mExternalNodes(2) = Nd3;
    mExternalNodes(3) = Nd4;

    mThickness = thick;

    b[0] = b1;
    b[1] = b2;

    appliedB[0] = 0.0;
    appliedB[1] = 0.0;

    // get copy of the material object
    NDMaterial *theMatCopy = theMat.getCopy(type);
    if (theMatCopy != 0) {
        theMaterial = (NDMaterial *)theMatCopy;
    } else {
        opserr << "SSPquad::SSPquad - failed to get copy of material model\n";;
    }

    // check material
    if (theMaterial == 0) {
        opserr << "SSPquad::SSPquad - failed to allocate material model pointer\n";
        exit(-1);
    }

    // check the type
    if (strcmp(type,"PlaneStrain") != 0 && strcmp(type,"PlaneStress") != 0) {
        opserr << "SSPquad::SSPquad - improper material type: " << type << "for SSPquad\n";
        exit(-1);
    }
}
Exemple #3
0
void
SSPquadUP::setDomain(Domain *theDomain)
{
	theNodes[0] = theDomain->getNode(mExternalNodes(0));
	theNodes[1] = theDomain->getNode(mExternalNodes(1));
	theNodes[2] = theDomain->getNode(mExternalNodes(2));
	theNodes[3] = theDomain->getNode(mExternalNodes(3));

	for (int i = 0; i < 4; i++) {
		if (theNodes[i] == 0) {
			return;  // don't go any further - otherwise segmentation fault
		}
	}

	// initialize coordinate vectors
	const Vector &mIcrd_1 = theNodes[0]->getCrds();
	const Vector &mIcrd_2 = theNodes[1]->getCrds();
	const Vector &mIcrd_3 = theNodes[2]->getCrds();
	const Vector &mIcrd_4 = theNodes[3]->getCrds();

	// coordinate matrix
	mNodeCrd(0,0) = mIcrd_1(0);
	mNodeCrd(1,0) = mIcrd_1(1);
	mNodeCrd(0,1) = mIcrd_2(0);
	mNodeCrd(1,1) = mIcrd_2(1);
	mNodeCrd(0,2) = mIcrd_3(0);
	mNodeCrd(1,2) = mIcrd_3(1);
	mNodeCrd(0,3) = mIcrd_4(0);
	mNodeCrd(1,3) = mIcrd_4(1);

	// establish jacobian terms 
	J0 = ((mNodeCrd(0,1)-mNodeCrd(0,3))*(mNodeCrd(1,2)-mNodeCrd(1,0))+(mNodeCrd(0,2)-mNodeCrd(0,0))*(mNodeCrd(1,3)-mNodeCrd(1,1)))/8;
	J1 = ((mNodeCrd(0,1)-mNodeCrd(0,0))*(mNodeCrd(1,2)-mNodeCrd(1,3))+(mNodeCrd(0,2)-mNodeCrd(0,3))*(mNodeCrd(1,0)-mNodeCrd(1,1)))/24;
	J2 = ((mNodeCrd(0,0)-mNodeCrd(0,3))*(mNodeCrd(1,2)-mNodeCrd(1,1))+(mNodeCrd(0,2)-mNodeCrd(0,1))*(mNodeCrd(1,3)-mNodeCrd(1,0)))/24;

	// establish stabilization terms (based on initial material tangent, only need to compute once)
	GetStab();

	// establish mass matrix for solid phase (constant, only need to compute once)
	GetSolidMass();

	// establish permeability matrix (constant, only need to compute once)
	GetPermeabilityMatrix();

	// call the base-class method
	this->DomainComponent::setDomain(theDomain);
}
void
BeamEndContact3D::setDomain(Domain *theDomain)
{
	double r;
	Vector a1(BEC3_NUM_DIM);
	
	mEye1.Zero();
	mEye1(0,0) = 1.0;
	mEye1(1,1) = 1.0;
	mEye1(2,2) = 1.0;

	theNodes[0] = theDomain->getNode(mExternalNodes(0));
	theNodes[1] = theDomain->getNode(mExternalNodes(1));
	theNodes[2] = theDomain->getNode(mExternalNodes(2));

	for (int i = 0; i < 3; i++) {
        if (theNodes[i] == 0)
            return;  // don't go any further - otherwise segmentation fault
    }

	// initialize coordinate vectors
	mIcrd_a = theNodes[0]->getCrds();
	mIcrd_s = theNodes[1]->getCrds();
	mDcrd_a = mIcrd_a;
	mDcrd_s = mIcrd_s;
	x_b = theDomain->getNode(mBeamNode);
	mIcrd_b = x_b->getCrds();

	// initialize the normal vector
	mIniNormal = -1*(mIcrd_b - mIcrd_a)/(mIcrd_b - mIcrd_a).Norm();
	mNormal = mIniNormal;

	// determine initial gap
	mGap = (mDcrd_s - mDcrd_a)^mIniNormal;

	// determine initial projection
	mx_p = mDcrd_s - (mGap*mIniNormal);

	// initialize contact state based on projection
	r = (mx_p - mIcrd_a).Norm();
	in_bounds = (r <= mRadius);
	inContact = (was_inContact && in_bounds);

	// call the base class method
	this->DomainComponent::setDomain(theDomain);
}
Exemple #5
0
void
SSPquad::Print(OPS_Stream &s, int flag)
{
    opserr << "SSPquad, element id:  " << this->getTag() << endln;
    opserr << "   Connected external nodes:  ";
    for (int i = 0; i < SSPQ_NUM_NODE; i++) {
        opserr << mExternalNodes(i) << " ";
    }
    return;
}
// constructors
BeamEndContact3D::BeamEndContact3D(int tag, int Nd1, int Nd2, int NdS, int NdL,
                                   double rad, double tolG, double tolF, int cSwitch)
  :Element(tag,ELE_TAG_BeamEndContact3D),
	mExternalNodes(BEC3_NUM_NODE),
	mTangentStiffness(BEC3_NUM_DOF, BEC3_NUM_DOF),
	mInternalForces(BEC3_NUM_DOF),
	mEye1(BEC3_NUM_DIM, BEC3_NUM_DIM),
	mIniNormal(BEC3_NUM_DIM),
	mNormal(BEC3_NUM_DIM),
	mIcrd_a(BEC3_NUM_DIM),
	mIcrd_s(BEC3_NUM_DIM),
    mDcrd_a(BEC3_NUM_DIM),
	mDcrd_s(BEC3_NUM_DIM)
{
    mExternalNodes(0) = Nd1;
	mExternalNodes(1) = NdS;
	mExternalNodes(2) = NdL;
	mBeamNode = Nd2;

    mRadius = rad;
	mGapTol = tolG;
	mForceTol = tolF;
	mIniContact = cSwitch;

	// set the initial contact state
	if (mIniContact == 0) {
		inContact          = true;
		was_inContact      = true;
		to_be_released     = false;
		should_be_released = false;
		in_bounds          = true;
	} else {
		inContact          = false;
		was_inContact      = false;
		to_be_released     = false;
		should_be_released = false;
		in_bounds          = true;
	}

	mGap    = 0.0;
	mLambda = 0.0;
}
void
BeamEndContact3D::Print(OPS_Stream &s, int flag)
{
	opserr << "BeamEndContact3D, element id:  " << this->getTag() << endln;
	opserr << "   Connected external nodes:  ";
	for (int i = 0; i<BEC3_NUM_NODE; i++)
	{
		opserr << mExternalNodes(i) << " ";
	}
	return;
}
Exemple #8
0
void
SSPquad::Print(OPS_Stream &s, int flag)
{
    if (flag == OPS_PRINT_CURRENTSTATE) {
        opserr << "SSPquad, element id:  " << this->getTag() << endln;
        opserr << "   Connected external nodes:  ";
        for (int i = 0; i < SSPQ_NUM_NODE; i++) {
            opserr << mExternalNodes(i) << " ";
        }
    }
    
    if (flag == OPS_PRINT_PRINTMODEL_JSON) {
        s << "\t\t\t{";
        s << "\"name\": " << this->getTag() << ", ";
        s << "\"type\": \"SSPquad\", ";
        s << "\"nodes\": [" << mExternalNodes(0) << ", ";
        s << mExternalNodes(1) << ", ";
        s << mExternalNodes(2) << ", ";
        s << mExternalNodes(3) << "], ";
        s << "\"thickness\": " << mThickness << ", ";
        s << "\"bodyForces\": [" << b[0] << ", " << b[1] << "], ";
        s << "\"material\": \"" << theMaterial->getTag() << "\"}";
    }
}
Exemple #9
0
void
BeamContact2Dp::setDomain(Domain *theDomain)
{
	Vector x_c(BC2D_NUM_DIM);
	
	mEye1.Zero();
	mEye1(0,0) = 1.0;
	mEye1(1,1) = 1.0;

	mEyeS.Zero();
	mEyeS(0,1) = -1.0;
	mEyeS(1,0) = 1.0;

	theNodes[0] = theDomain->getNode(mExternalNodes(0));
	theNodes[1] = theDomain->getNode(mExternalNodes(1));
	theNodes[2] = theDomain->getNode(mExternalNodes(2));

	for (int i = 0; i < 3; i++) {
        if (theNodes[i] == 0)
            return;  // don't go any further - otherwise segmentation fault
    }

	// initialize coordinate vectors
	mIcrd_a = theNodes[0]->getCrds();
	mIcrd_b = theNodes[1]->getCrds();
	mIcrd_s = theNodes[2]->getCrds();
	mDcrd_a = mIcrd_a;
	mDcrd_b = mIcrd_b;
	mDcrd_s = mIcrd_s;
	mDisp_a_n.Zero();
	mDisp_b_n.Zero();

    // length of beam element
	mLength = (mDcrd_b - mDcrd_a).Norm();

	// initialize tangent vectors at beam nodes
	ma_1 = (mDcrd_b - mDcrd_a)/mLength;
	mb_1 = ma_1;

	// perform projection of slave node to beam centerline
	mXi = ((mDcrd_b - mDcrd_s)^(mDcrd_b - mDcrd_a))/mLength;  // initial assumption
	mXi = Project(mXi);                                       // actual location

	// update contact state based on projection
	in_bounds = ((mXi > 0.000) && (mXi < 1.000));
	inContact = (was_inContact && in_bounds);

	// centerline projection coordinate
	x_c = mDcrd_a*mShape(0) + ma_1*mLength*mShape(1) + mDcrd_b*mShape(2) + mb_1*mLength*mShape(3);

	// update surface tangent vector, g_xi
	UpdateBase(mXi);

	// adjust cohesion force
	theMaterial->ScaleCohesion(mLength);
	theMaterial->ScaleTensileStrength(mLength);

	// compute vectors Bn and Bs
	ComputeB();

	// call the base class method
	this->DomainComponent::setDomain(theDomain);
}
Exemple #10
0
// constructors
BeamContact2Dp::BeamContact2Dp(int tag, int Nd1, int Nd2, int NdS, NDMaterial &theMat, double width, double pen, int cSwitch)
  :Element(tag,ELE_TAG_BeamContact2Dp),
    theMaterial(0),
	mExternalNodes(BC2D_NUM_NODE),
	mTangentStiffness(BC2D_NUM_DOF, BC2D_NUM_DOF),
	mInternalForces(BC2D_NUM_DOF),
	mEye1(BC2D_NUM_DIM, BC2D_NUM_DIM),
	mEyeS(BC2D_NUM_DIM, BC2D_NUM_DIM),
	mg_xi(BC2D_NUM_DIM),
	mNormal(BC2D_NUM_DIM),
	mShape(4),
	mDshape(4),
	mBn(BC2D_NUM_DOF),
	mBs(BC2D_NUM_DOF),
	ma_1(BC2D_NUM_DIM),
	mb_1(BC2D_NUM_DIM),
	mc_1(BC2D_NUM_DIM),
	mIcrd_a(BC2D_NUM_DIM),
	mIcrd_b(BC2D_NUM_DIM),
	mIcrd_s(BC2D_NUM_DIM),
    mDcrd_a(BC2D_NUM_DIM),
	mDcrd_b(BC2D_NUM_DIM),
	mDcrd_s(BC2D_NUM_DIM),
	mDisp_a_n(3),
	mDisp_b_n(3)
{
    mExternalNodes(0) = Nd1;
	mExternalNodes(1) = Nd2;
	mExternalNodes(2) = NdS;
	
	// input parameters
	mRadius     = width/2.0;
	mPenalty    = pen;
	mIniContact = cSwitch;

	// initialize contact state
	if (mIniContact == 0) {
		inContact          = true;
		was_inContact      = true;
		in_bounds          = true;
	} else {
		inContact          = false;
		was_inContact      = false;
		in_bounds          = true;
	}

	// initialize penetration function and contact force
	mGap    = 0.0;
	mLambda = 0.0;

	// get copy of the material object
	NDMaterial *theMatCopy = theMat.getCopy("ContactMaterial2D");
	if (theMatCopy != 0) {
	  theMaterial = (ContactMaterial2D *)theMatCopy;
	} else {
	  opserr << "BeamContact2Dp::BeamContact2Dp - material needs to be of type ContactMaterial2D for ele: " << this->getTag() << endln;
	}

	// check material
	if (theMaterial == 0) {
	  opserr << "BeamContact2Dp::BeamContact2Dp - failed allocate material model pointer\n";
	  exit(-1);
	}
}
// constructors
BeamContact2D::BeamContact2D(int tag, int Nd1, int Nd2, int NdS, int NdL, NDMaterial &theMat,
                             double width, double tolG, double tolF, int cSwitch)
  :Element(tag,ELE_TAG_BeamContact2D),
    theMaterial(0),
	mExternalNodes(BC2D_NUM_NODE),
	mTangentStiffness(BC2D_NUM_DOF, BC2D_NUM_DOF),
	mInternalForces(BC2D_NUM_DOF),
	mEye1(BC2D_NUM_DIM, BC2D_NUM_DIM),
	mEyeS(BC2D_NUM_DIM, BC2D_NUM_DIM),
	mg_xi(BC2D_NUM_DIM),
	mNormal(BC2D_NUM_DIM),
	mShape(4),
	mDshape(4),
	mBn(BC2D_NUM_DOF-2),
	mBs(BC2D_NUM_DOF-2),
	ma_1(BC2D_NUM_DIM),
	mb_1(BC2D_NUM_DIM),
	mc_1(BC2D_NUM_DIM),
	mIcrd_a(BC2D_NUM_DIM),
	mIcrd_b(BC2D_NUM_DIM),
	mIcrd_s(BC2D_NUM_DIM),
    mDcrd_a(BC2D_NUM_DIM),
	mDcrd_b(BC2D_NUM_DIM),
	mDcrd_s(BC2D_NUM_DIM),
	mDisp_a_n(3),
	mDisp_b_n(3),
	mIniContact(cSwitch)
{
    mExternalNodes(0) = Nd1;
	mExternalNodes(1) = Nd2;
	mExternalNodes(2) = NdS;
	mExternalNodes(3) = NdL;

	mRadius = width/2;
	mGapTol = tolG;
	mForceTol = tolF;
	mIniContact = cSwitch;

	if (mIniContact == 0) {
		inContact          = true;
		was_inContact      = true;
		to_be_released     = false;
		should_be_released = false;
		in_bounds          = true;
	} else {
		inContact          = false;
		was_inContact      = false;
		to_be_released     = false;
		should_be_released = false;
		in_bounds          = true;
	}

	mGap    = 0.0;
	mLambda = 0.0;

	// get copy of the material object
	NDMaterial *theMatCopy = theMat.getCopy("ContactMaterial2D");
	if (theMatCopy != 0) {
	  theMaterial = (ContactMaterial2D *)theMatCopy;
	} else {
	  opserr << "BeamContact2D::BeamContact2D - material needs to be of type ContactMaterial2D for ele: " << this->getTag() << endln;
	}

	// check material
	if (theMaterial == 0) {
	  opserr << "BeamContact2D::BeamContact2D - failed allocate material model pointer\n";
	  exit(-1);
	}
}
Exemple #12
0
// full constructor
SSPquadUP::SSPquadUP(int tag, int Nd1, int Nd2, int Nd3, int Nd4, NDMaterial &theMat, 
                              double thick, double Kf, double Rf, double k1, double k2,
							  double eVoid, double alpha, double b1, double b2)
  :Element(tag,ELE_TAG_SSPquadUP),
  	theMaterial(0),
	mExternalNodes(SQUP_NUM_NODE),
	mTangentStiffness(SQUP_NUM_DOF,SQUP_NUM_DOF),
	mInternalForces(SQUP_NUM_DOF),
	Q(SQUP_NUM_DOF),
	mMass(SQUP_NUM_DOF,SQUP_NUM_DOF),
	mDamp(SQUP_NUM_DOF,SQUP_NUM_DOF),
	mNodeCrd(2,4),
	dN(4,2),
	Mmem(3,8),
	Kstab(8,8),
	mSolidK(8,8),
	mSolidM(8,8),
	mPerm(4,4),
	mThickness(thick),
	fBulk(Kf),
	fDens(Rf),
	mAlpha(alpha),
	mPorosity(0),
	applyLoad(0)
{
	mExternalNodes(0) = Nd1;
	mExternalNodes(1) = Nd2;
	mExternalNodes(2) = Nd3;
	mExternalNodes(3) = Nd4;
		
	mThickness = thick;
	fBulk      = Kf;
	fDens      = Rf;
	mAlpha     = alpha;

	b[0] = b1;
	b[1] = b2;
	
	appliedB[0] = 0.0;
	appliedB[1] = 0.0;

	perm[0] = k1;
	perm[1] = k2;

	mPorosity = eVoid/(1.0 + eVoid);

	const char *type = "PlaneStrain";

	// get copy of the material object
	NDMaterial *theMatCopy = theMat.getCopy(type);
	if (theMatCopy != 0) {
		theMaterial = (NDMaterial *)theMatCopy;
	} else {
		opserr << "SSPquadUP::SSPquadUP - failed to get copy of material model\n";;
	}

	// check material
	if (theMaterial == 0) {
		opserr << "SSPquadUP::SSPquadUP - failed to allocate material model pointer\n";
		exit(-1);
	}
}