Esempio n. 1
0
int ElastomericBearing2d::recvSelf(int commitTag, Channel &rChannel,
    FEM_ObjectBroker &theBroker)
{
    // delete material memory
    for (int i=0; i<2; i++)
        if (theMaterials[i] != 0)
            delete theMaterials[i];
    
    // receive element parameters
    static Vector data(9);
    rChannel.recvVector(0, commitTag, data);
    this->setTag((int)data(0));
    k0 = data(1);
    qYield = data(2);
    k2 = data(3);
    shearDistI = data(4);
    addRayleigh = (int)data(5);
    mass = data(6);
    double ke = k0 + k2;
    
    // receive the two end nodes
    rChannel.recvID(0, commitTag, connectedExternalNodes);
    
    // receive the material class tags
    ID matClassTags(2);
    rChannel.recvID(0, commitTag, matClassTags);
    
    // receive the material models
    for (int i=0; i<2; i++)  {
        theMaterials[i] = theBroker.getNewUniaxialMaterial(matClassTags(i));
        if (theMaterials[i] == 0) {
            opserr << "ElastomericBearing2d::recvSelf() - "
                << "failed to get blank uniaxial material.\n";
            return -2;
        }
        theMaterials[i]->recvSelf(commitTag, rChannel, theBroker);
    }
    
    // receive remaining data
    if ((int)data(7) == 3)  {
        x.resize(3);
        rChannel.recvVector(0, commitTag, x);
    }
    if ((int)data(8) == 3)  {
        y.resize(3);
        rChannel.recvVector(0, commitTag, y);
    }
    
    // initialize initial stiffness matrix
    kbInit.Zero();
    kbInit(0,0) = theMaterials[0]->getInitialTangent();
    kbInit(1,1) = ke;
    kbInit(2,2) = theMaterials[1]->getInitialTangent();
    
    // initialize other variables
    this->revertToStart();
    
    return 0;
}
Esempio n. 2
0
int SingleFPSimple2d::sendSelf(int commitTag, Channel &sChannel)
{
    // send element parameters
    static Vector data(15);
    data(0) = this->getTag();
    data(1) = Reff;
    data(2) = kInit;
    data(3) = shearDistI;
    data(4) = addRayleigh;
    data(5) = mass;
    data(6) = maxIter;
    data(7) = tol;
    data(8) = kFactUplift;
    data(9) = x.Size();
    data(10) = y.Size();
    data(11) = alphaM;
    data(12) = betaK;
    data(13) = betaK0;
    data(14) = betaKc;
    sChannel.sendVector(0, commitTag, data);

    // send the two end nodes
    sChannel.sendID(0, commitTag, connectedExternalNodes);

    // send the friction model class tag
    ID frnClassTag(1);
    frnClassTag(0) = theFrnMdl->getClassTag();
    sChannel.sendID(0, commitTag, frnClassTag);

    // send the friction model
    theFrnMdl->sendSelf(commitTag, sChannel);

    // send the material class tags
    ID matClassTags(2);
    for (int i=0; i<2; i++)
        matClassTags(i) = theMaterials[i]->getClassTag();
    sChannel.sendID(0, commitTag, matClassTags);

    // send the material models
    for (int i=0; i<2; i++)
        theMaterials[i]->sendSelf(commitTag, sChannel);

    // send remaining data
    if (x.Size() == 3)
        sChannel.sendVector(0, commitTag, x);
    if (y.Size() == 3)
        sChannel.sendVector(0, commitTag, y);

    return 0;
}
int ElastomericBearingBoucWen2d::sendSelf(int commitTag, Channel &sChannel)
{
    // send element parameters
    static Vector data(21);
    data(0) = this->getTag();
    data(1) = k0;
    data(2) = qYield;
    data(3) = k2;
    data(4) = k3;
    data(5) = mu;
    data(6) = eta;
    data(7) = beta;
    data(8) = gamma;
    data(9) = A;
    data(10) = shearDistI;
    data(11) = addRayleigh;
    data(12) = mass;
    data(13) = maxIter;
    data(14) = tol;
    data(15) = x.Size();
    data(16) = y.Size();
    data(17) = alphaM;
    data(18) = betaK;
    data(19) = betaK0;
    data(20) = betaKc;
    sChannel.sendVector(0, commitTag, data);
    
    // send the two end nodes
    sChannel.sendID(0, commitTag, connectedExternalNodes);
    
    // send the material class tags
    ID matClassTags(2);
    for (int i=0; i<2; i++)
        matClassTags(i) = theMaterials[i]->getClassTag();
    sChannel.sendID(0, commitTag, matClassTags);
    
    // send the material models
    for (int i=0; i<2; i++)
        theMaterials[i]->sendSelf(commitTag, sChannel);
    
    // send remaining data
    if (x.Size() == 3)
        sChannel.sendVector(0, commitTag, x);
    if (y.Size() == 3)
        sChannel.sendVector(0, commitTag, y);
    
    return 0;
}
Esempio n. 4
0
int TwoNodeLink::sendSelf(int commitTag, Channel &sChannel)
{
    // send element parameters
    static Vector data(14);
    data(0) = this->getTag();
    data(1) = numDIM;
    data(2) = numDOF;
    data(3) = numDir;
    data(4) = x.Size();
    data(5) = y.Size();
    data(6) = Mratio.Size();
    data(7) = shearDistI.Size();
    data(8) = addRayleigh;
    data(9) = mass;
    data(10) = alphaM;
    data(11) = betaK;
    data(12) = betaK0;
    data(13) = betaKc;
    sChannel.sendVector(0, commitTag, data);
    
    // send the two end nodes
    sChannel.sendID(0, commitTag, connectedExternalNodes);

    // send the direction array
    sChannel.sendID(0, commitTag, *dir);
    
    // send the material class tags
    ID matClassTags(numDir);
    for (int i=0; i<numDir; i++)
        matClassTags(i) = theMaterials[i]->getClassTag();
    sChannel.sendID(0, commitTag, matClassTags);
    
    // send the material models
    for (int i=0; i<numDir; i++)
        theMaterials[i]->sendSelf(commitTag, sChannel);
    
    // send remaining data
    if (x.Size() == 3)
        sChannel.sendVector(0, commitTag, x);
    if (y.Size() == 3)
        sChannel.sendVector(0, commitTag, y);
    if (Mratio.Size() == 4)
        sChannel.sendVector(0, commitTag, Mratio);
    if (shearDistI.Size() == 2)
        sChannel.sendVector(0, commitTag, shearDistI);
    
    return 0;
}
Esempio n. 5
0
int SingleFPSimple2d::recvSelf(int commitTag, Channel &rChannel,
    FEM_ObjectBroker &theBroker)
{
    // delete material memory
    for (int i=0; i<2; i++)
        if (theMaterials[i] != 0)
            delete theMaterials[i];
    
    // receive element parameters
    static Vector data(11);
    rChannel.recvVector(0, commitTag, data);
    this->setTag((int)data(0));
    R = data(1);
    h = data(2);
    uy = data(3);
    shearDistI = data(4);
    addRayleigh = (int)data(5);
    mass = data(6);
    maxIter = (int)data(7);
    tol = data(8);
    
    // receive the two end nodes
    rChannel.recvID(0, commitTag, connectedExternalNodes);
    
    // receive the friction model class tag
    ID frnClassTag(1);
    rChannel.recvID(0, commitTag, frnClassTag);
    
    // receive the friction model
    theFrnMdl = theBroker.getNewFrictionModel(frnClassTag(0));
    if (theFrnMdl == 0) {
        opserr << "SingleFPSimple2d::recvSelf() - "
            << "failed to get blank friction model.\n";
        return -1;
    }
    theFrnMdl->recvSelf(commitTag, rChannel, theBroker);
    
    // receive the material class tags
    ID matClassTags(2);
    rChannel.recvID(0, commitTag, matClassTags);
    
    // receive the material models
    for (int i=0; i<2; i++)  {
        theMaterials[i] = theBroker.getNewUniaxialMaterial(matClassTags(i));
        if (theMaterials[i] == 0) {
            opserr << "SingleFPSimple2d::recvSelf() - "
                << "failed to get blank uniaxial material.\n";
            return -2;
        }
        theMaterials[i]->recvSelf(commitTag, rChannel, theBroker);
    }
    
    // receive remaining data
    if ((int)data(9) == 3)  {
        x.resize(3);
        rChannel.recvVector(0, commitTag, x);
    }
    if ((int)data(10) == 3)  {
        y.resize(3);
        rChannel.recvVector(0, commitTag, y);
    }
    
    // initialize initial stiffness matrix
    kbInit.Zero();
    kbInit(0,0) = theMaterials[0]->getInitialTangent();
    kbInit(1,1) = kbInit(0,0)*DBL_EPSILON;
    kbInit(2,2) = theMaterials[1]->getInitialTangent();
    
    // initialize other variables
    this->revertToStart();
    
    return 0;
}
Esempio n. 6
0
int TwoNodeLink::recvSelf(int commitTag, Channel &rChannel,
    FEM_ObjectBroker &theBroker)
{
    // delete dynamic memory
    if (dir != 0)
        delete dir;
    if (theMaterials != 0)  {
        for (int i=0; i<numDir; i++)
            if (theMaterials[i] != 0)
                delete theMaterials[i];
        delete [] theMaterials;
    }
    
    // receive element parameters
    static Vector data(14);
    rChannel.recvVector(0, commitTag, data);
    this->setTag((int)data(0));
    numDIM = (int)data(1);
    numDOF = (int)data(2);
    numDir = (int)data(3);
    addRayleigh = (int)data(8);
    mass = data(9);
    alphaM = data(10);
    betaK = data(11);
    betaK0 = data(12);
    betaKc = data(13);
   
    // receive the two end nodes
    rChannel.recvID(0, commitTag, connectedExternalNodes);
    
    // allocate memory for direction array and receive it
    dir = new ID(numDir);
    if (dir == 0)  {
        opserr << "TwoNodeLink::recvSelf() - "
            << "failed to creat direction array\n";
        return -1;
    }
    rChannel.recvID(0, commitTag, *dir);
    
    // receive the material class tags
    ID matClassTags(numDir);
    rChannel.recvID(0, commitTag, matClassTags);
    
    // allocate memory for the uniaxial materials
    theMaterials = new UniaxialMaterial* [numDir];
    if (theMaterials == 0)  {
        opserr << "TwoNodeLink::recvSelf() - "
            << "failed to allocate pointers for uniaxial materials.\n";
        return -2;
    }
    // receive the material models
    for (int i=0; i<numDir; i++)  {
        theMaterials[i] = theBroker.getNewUniaxialMaterial(matClassTags(i));
        if (theMaterials[i] == 0) {
            opserr << "TwoNodeLink::recvSelf() - "
                << "failed to get blank uniaxial material.\n";
            return -3;
        }
        theMaterials[i]->recvSelf(commitTag, rChannel, theBroker);
    }
    
    // receive remaining data
    if ((int)data(4) == 3)  {
        x.resize(3);
        rChannel.recvVector(0, commitTag, x);
    }
    if ((int)data(5) == 3)  {
        y.resize(3);
        rChannel.recvVector(0, commitTag, y);
    }
    if ((int)data(6) == 4)  {
        Mratio.resize(4);
        rChannel.recvVector(0, commitTag, Mratio);
        // check p-delta moment distribution ratios
        if (Mratio(0)+Mratio(1) > 1.0)  {
            opserr << "TwoNodeLink::recvSelf() - "
                << "incorrect p-delta moment ratios:\nrMy1 + rMy2 = "
                << Mratio(0)+Mratio(1) << " > 1.0\n";
            return -4;
        }
        if (Mratio(2)+Mratio(3) > 1.0)  {
            opserr << "TwoNodeLink::recvSelf() - "
                << "incorrect p-delta moment ratios:\nrMz1 + rMz2 = "
                << Mratio(2)+Mratio(3) << " > 1.0\n";
            return -4;
        }
    }
    if ((int)data(7) == 2)  {
        shearDistI.resize(2);
        rChannel.recvVector(0, commitTag, shearDistI);
        // check shear distance ratios
        if (shearDistI(0) < 0.0 || shearDistI(0) > 1.0)  {
            opserr << "TwoNodeLink::recvSelf() - "
                << "incorrect shear distance ratio:\n shearDistIy = "
                << shearDistI(0) << " < 0.0 or > 1.0\n";
            return -5;
        }
        if (shearDistI(1) < 0.0 || shearDistI(1) > 1.0)  {
            opserr << "TwoNodeLink::recvSelf() - "
                << "incorrect shear distance ratio:\n shearDistIz = "
                << shearDistI(1) << " < 0.0 or > 1.0\n";
            return -5;
        }
    } else  {
        // initialize shear distance ratios
        shearDistI.resize(2);
        shearDistI(0) = 0.5;
        shearDistI(1) = 0.5;
    }
    onP0 = false;
    
    // initialize response vectors in basic system
    ub.resize(numDir);
    ubdot.resize(numDir);
    qb.resize(numDir);
    this->revertToStart();
    
    return 0;
}