当前位置: 首页>>代码示例>>C++>>正文


C++ AnalysisModel::setAccel方法代码示例

本文整理汇总了C++中AnalysisModel::setAccel方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisModel::setAccel方法的具体用法?C++ AnalysisModel::setAccel怎么用?C++ AnalysisModel::setAccel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AnalysisModel的用法示例。


在下文中一共展示了AnalysisModel::setAccel方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: newStep

int PFEMIntegrator::newStep(double deltaT)
{

    if (deltaT <= 0.0)  {
        opserr << "PFEMIntegrator::newStep() - error in variable\n";
        opserr << "dT = " << deltaT << endln;
        return -2;	
    }

    // get a pointer to the AnalysisModel and Domain
    AnalysisModel *theModel = this->getAnalysisModel();
    if(theModel == 0) {
        opserr << "Analysis model has not been linked - PFEMIntegrator::newStep()\n";
        return -1;
    }
    Domain* theDomain = theModel->getDomainPtr();
    if(theDomain == 0) {
        opserr<<"WARNING: no domain is set for the model";
        opserr<<" -- PFEMIntegrator::newStep()\n";
        return -1;
    }
    
    // set the constants
    c1 = deltaT;
    c2 = 1.0;
    c3 = 1.0/deltaT;

    c4 = deltaT*deltaT;
    c5 = deltaT;
    c6 = 1.0;

    // check if domainchange() is called
    if (U == 0)  {
        opserr << "PFEMIntegrator::newStep() - domainChange() failed or hasn't been called\n";
        return -3;	
    }
    
    // set response at t to be that at t+deltaT of previous step
    (*Ut) = *U;        
    (*Utdot) = *Udot;  
    (*Utdotdot) = *Udotdot;
    
    // determinte new disps and accels
    U->addVector(1.0, *Utdot, deltaT);
    Udotdot->Zero();

    // set states
    theModel->setDisp(*U);
    theModel->setAccel(*Udotdot);
    
    // increment the time to t+deltaT and apply the load
    double time = theModel->getCurrentDomainTime();
    time += deltaT;
    if (theModel->updateDomain(time, deltaT) < 0)  {
        opserr << "PFEMIntegrator::newStep() - failed to update the domain\n";
        return -4;
    }
    
    return 0;
}
开发者ID:aceskpark,项目名称:osfeo,代码行数:60,代码来源:PFEMIntegrator.cpp

示例2: newStep

int HHT::newStep(double _deltaT)
{
    deltaT = _deltaT;
    if (beta == 0 || gamma == 0 )  {
        opserr << "HHT::newStep() - error in variable\n";
        opserr << "gamma = " << gamma << " beta = " << beta << endln;
        return -1;
    }
    
    if (deltaT <= 0.0)  {
        opserr << "HHT::newStep() - error in variable\n";
        opserr << "dT = " << deltaT << endln;
        return -2;
    }
    
    // get a pointer to the AnalysisModel
    AnalysisModel *theModel = this->getAnalysisModel();
    
    // set the constants
    c1 = 1.0;
    c2 = gamma/(beta*deltaT);
    c3 = 1.0/(beta*deltaT*deltaT);
    
    if (U == 0)  {
        opserr << "HHT::newStep() - domainChange() failed or hasn't been called\n";
        return -3;
    }
    
    // set response at t to be that at t+deltaT of previous step
    (*Ut) = *U;
    (*Utdot) = *Udot;
    (*Utdotdot) = *Udotdot;
    
    // determine new velocities and accelerations at t+deltaT
    double a1 = (1.0 - gamma/beta);
    double a2 = deltaT*(1.0 - 0.5*gamma/beta);
    Udot->addVector(a1, *Utdotdot, a2);
    
    double a3 = -1.0/(beta*deltaT);
    double a4 = 1.0 - 0.5/beta;
    Udotdot->addVector(a4, *Utdot, a3);
    
    // determine the velocities at t+alpha*deltaT
    (*Ualphadot) = *Utdot;
    Ualphadot->addVector((1.0-alpha), *Udot, alpha);
    
    // set the trial response quantities
    theModel->setVel(*Ualphadot);
    theModel->setAccel(*Udotdot);
    
    // increment the time to t+alpha*deltaT and apply the load
    double time = theModel->getCurrentDomainTime();
    time += alpha*deltaT;
    if (theModel->updateDomain(time, deltaT) < 0)  {
        opserr << "HHT::newStep() - failed to update the domain\n";
        return -4;
    }
    
    return 0;
}
开发者ID:fmckenna,项目名称:OpenSees,代码行数:60,代码来源:HHT.cpp

示例3: newStep

int NewmarkHSFixedNumIter::newStep(double deltaT)
{
    if (beta == 0 || gamma == 0)  {
        opserr << "NewmarkHSFixedNumIter::newStep() - error in variable\n";
        opserr << "gamma = " << gamma << " beta = " << beta << endln;
        return -1;
    }

    if (deltaT <= 0.0)  {
        opserr << "NewmarkHSFixedNumIter::newStep() - error in variable\n";
        opserr << "dT = " << deltaT << endln;
        return -2;
    }

    // get a pointer to the AnalysisModel
    AnalysisModel *theModel = this->getAnalysisModel();

    // set the constants
    c1 = 1.0;
    c2 = gamma/(beta*deltaT);
    c3 = 1.0/(beta*deltaT*deltaT);

    if (U == 0)  {
        opserr << "NewmarkHSFixedNumIter::newStep() - domainChange() failed or hasn't been called\n";
        return -3;
    }

    // set response at t to be that at t+deltaT of previous step
    (*Utm2) = *Utm1;
    (*Utm1) = *Ut;
    (*Ut) = *U;
    (*Utdot) = *Udot;
    (*Utdotdot) = *Udotdot;

    // determine new velocities and accelerations at t+deltaT
    double a1 = (1.0 - gamma/beta);
    double a2 = deltaT*(1.0 - 0.5*gamma/beta);
    Udot->addVector(a1, *Utdotdot, a2);

    double a3 = -1.0/(beta*deltaT);
    double a4 = 1.0 - 0.5/beta;
    Udotdot->addVector(a4, *Utdot, a3);

    // set the trial response quantities
    theModel->setVel(*Udot);
    theModel->setAccel(*Udotdot);

    // increment the time to t+deltaT and apply the load
    double time = theModel->getCurrentDomainTime();
    time += deltaT;
    theModel->applyLoadDomain(time);

    //correctForce = true;

    return 0;
}
开发者ID:lge88,项目名称:OpenSees,代码行数:56,代码来源:NewmarkHSFixedNumIter.cpp

示例4: domainChange

int XC::Collocation::newStep(double _deltaT)
{
    deltaT = _deltaT;
    if (theta <= 0.0 )  {
        std::cerr << "XC::Collocation::newStep() - error in variable\n";
        std::cerr << "theta: " << theta << " <= 0.0\n";
        return -1;
    }
    
    if (deltaT <= 0.0)  {
        std::cerr << "XC::Collocation::newStep() - error in variable\n";
        std::cerr << "dT = " << deltaT << std::endl;
        return -2;
    }
    
    // get a pointer to the XC::AnalysisModel
    AnalysisModel *theModel = this->getAnalysisModelPtr();

    // set the constants
    c1 = 1.0;
    c2 = gamma/(beta*theta*deltaT);
    c3 = 1.0/(beta*theta*theta*deltaT*deltaT);
    
    if (U.get().Size() == 0)  {
        std::cerr << "XC::Collocation::newStep() - domainChange() failed or hasn't been called\n"; 
        return -3;	
    }
    
    // set response at t to be that at t+deltaT of previous step
    Ut= U;

    // increment the time to t+theta*deltaT and apply the load
    double time = getCurrentModelTime();
    time += theta*deltaT;
//    theModel->applyLoadDomain(time);
    if(updateModel(time, deltaT) < 0)
      {
        std::cerr << "XC::Collocation::newStep() - failed to update the domain\n";
        return -4;
      }
    
    // determine new_ velocities and accelerations at t+theta*deltaT
    double a1 = (1.0 - gamma/beta); 
    double a2 = theta*deltaT*(1.0 - 0.5*gamma/beta);
    U.getDot().addVector(a1, Ut.getDotDot(), a2);
      
    double a3 = -1.0/(beta*theta*deltaT);
    double a4 = 1.0 - 0.5/beta;
    U.getDotDot().addVector(a4, Ut.getDot(), a3);
    
    // set the trial response quantities for the nodes
    theModel->setVel(U.getDot());
    theModel->setAccel(U.getDotDot());
    
    return 0;
}
开发者ID:lcpt,项目名称:xc,代码行数:56,代码来源:Collocation.cpp

示例5: newStep

int CollocationHSIncrReduct::newStep(double _deltaT)
{
    if (theta <= 0.0 )  {
        opserr << "CollocationHSIncrReduct::newStep() - error in variable\n";
        opserr << "theta: " << theta << " <= 0.0\n";
        return -1;
    }
    
    deltaT = _deltaT;
    if (deltaT <= 0.0)  {
        opserr << "CollocationHSIncrReduct::newStep() - error in variable\n";
        opserr << "dT = " << deltaT << endln;
        return -2;
    }
    
    // get a pointer to the AnalysisModel
    AnalysisModel *theModel = this->getAnalysisModel();
    
    // set the constants
    c1 = 1.0;
    c2 = gamma/(beta*theta*deltaT);
    c3 = 1.0/(beta*theta*theta*deltaT*deltaT);
    
    if (U == 0)  {
        opserr << "CollocationHSIncrReduct::newStep() - domainChange() failed or hasn't been called\n"; 
        return -3;
    }
    
    // set response at t to be that at t+deltaT of previous step
    (*Ut) = *U;
    (*Utdot) = *Udot;
    (*Utdotdot) = *Udotdot;
    
    // determine new velocities and accelerations at t+theta*deltaT
    double a1 = (1.0 - gamma/beta);
    double a2 = theta*deltaT*(1.0 - 0.5*gamma/beta);
    Udot->addVector(a1, *Utdotdot, a2);
    
    double a3 = -1.0/(beta*theta*deltaT);
    double a4 = 1.0 - 0.5/beta;
    Udotdot->addVector(a4, *Utdot, a3);
    
    // set the trial response quantities
    theModel->setVel(*Udot);
    theModel->setAccel(*Udotdot);
    
    // increment the time to t+theta*deltaT and apply the load
    double time = theModel->getCurrentDomainTime();
    time += theta*deltaT;
    theModel->applyLoadDomain(time);
    
    return 0;
}
开发者ID:DBorello,项目名称:OpenSees,代码行数:53,代码来源:CollocationHSIncrReduct.cpp

示例6: update

int AlphaOS::update(const Vector &deltaU)
{
    updateCount++;
    if (updateCount > 1)  {
        opserr << "WARNING AlphaOS::update() - called more than once -";
        opserr << " AlphaOS integration scheme requires a LINEAR solution algorithm\n";
        return -1;
    }
    
    AnalysisModel *theModel = this->getAnalysisModel();
    if (theModel == 0)  {
        opserr << "WARNING AlphaOS::update() - no AnalysisModel set\n";
        return -2;
    }
    
    // check domainChanged() has been called, i.e. Ut will not be zero
    if (Ut == 0)  {
        opserr << "WARNING AlphaOS::update() - domainChange() failed or not called\n";
        return -3;
    }
    
    // check deltaU is of correct size
    if (deltaU.Size() != U->Size())  {
        opserr << "WARNING AlphaOS::update() - Vectors of incompatible size ";
        opserr << " expecting " << U->Size() << " obtained " << deltaU.Size() << "\n";
        return -4;
    }
    
    // save the predictor displacements
    (*Upt) = *U;
    
    //  determine the response at t+deltaT
    U->addVector(1.0, deltaU, c1);
    
    Udot->addVector(1.0, deltaU, c2);
    
    Udotdot->addVector(0.0, deltaU, c3);
    
    // update the response at the DOFs
    theModel->setVel(*Udot);
    theModel->setAccel(*Udotdot);
    if (theModel->updateDomain() < 0)  {
        opserr << "AlphaOS::update() - failed to update the domain\n";
        return -5;
    }
    // do not update displacements in elements only at nodes
    theModel->setDisp(*U);
    
    return 0;
}
开发者ID:DBorello,项目名称:OpenSees,代码行数:50,代码来源:AlphaOS.cpp

示例7: newStep

int CentralDifference::newStep(double _deltaT)
{
    updateCount = 0;
    
    deltaT = _deltaT;
    if (deltaT <= 0.0)  {
        opserr << "CentralDifference::newStep() - error in variable\n";
        opserr << "dT = " << deltaT << endln;
        return -2;	
    }
    
    // get a pointer to the AnalysisModel
    AnalysisModel *theModel = this->getAnalysisModel();
    
    // set the constants
    c2 = 0.5/deltaT;
    c3 = 1.0/(deltaT*deltaT);
    
    if (Ut == 0)  {
        opserr << "CentralDifference::newStep() - domainChange() failed or hasn't been called\n";
        return -3;	
    }
        
    // determine the garbage velocities and accelerations at t
    Utdot->addVector(0.0, *Utm1, -c2);
    
    Utdotdot->addVector(0.0, *Ut, -2.0*c3);
    Utdotdot->addVector(1.0, *Utm1, c3);
    
    // set the garbage response quantities for the nodes
    theModel->setVel(*Utdot);
    theModel->setAccel(*Utdotdot);

    // increment the time to t and apply the load
    double time = theModel->getCurrentDomainTime();
    if (theModel->updateDomain(time, deltaT) < 0)  {
        opserr << "CentralDifference::newStep() - failed to update the domain\n";
        return -4;
    }
    
    // set response at t to be that at t+deltaT of previous step
    (*Utdot) = *Udot;
    (*Utdotdot) = *Udotdot;
    
    return 0;
}
开发者ID:aceskpark,项目名称:osfeo,代码行数:46,代码来源:CentralDifference.cpp

示例8: update

int NewmarkExplicit::update(const Vector &aiPlusOne)
{
    updateCount++;
    if (updateCount > 1)  {
        opserr << "WARNING NewmarkExplicit::update() - called more than once -";
        opserr << " NewmarkExplicit integration scheme requires a LINEAR solution algorithm\n";
        return -1;
    }
    
    AnalysisModel *theModel = this->getAnalysisModel();
    if (theModel == 0)  {
        opserr << "WARNING NewmarkExplicit::update() - no AnalysisModel set\n";
        return -1;
    }	
    
    // check domainChanged() has been called, i.e. Ut will not be zero
    if (Ut == 0)  {
        opserr << "WARNING NewmarkExplicit::update() - domainChange() failed or not called\n";
        return -2;
    }	
    
    // check aiPlusOne is of correct size
    if (aiPlusOne.Size() != U->Size())  {
        opserr << "WARNING NewmarkExplicit::update() - Vectors of incompatible size ";
        opserr << " expecting " << U->Size() << " obtained " << aiPlusOne.Size() << endln;
        return -3;
    }
    
    //  determine the response at t+deltaT
    Udot->addVector(1.0, aiPlusOne, c2);

    (*Udotdot) = aiPlusOne;
    
    // update the response at the DOFs
    theModel->setVel(*Udot);
    theModel->setAccel(*Udotdot);
    if (updDomFlag == true)  {
        if (theModel->updateDomain() < 0)  {
            opserr << "NewmarkExplicit::update() - failed to update the domain\n";
            return -4;
        }
    }
    
    return 0;
}    
开发者ID:aceskpark,项目名称:osfeo,代码行数:45,代码来源:NewmarkExplicit.cpp

示例9: domainChange

int TRBDF2::newStep(double deltaT)
{
  // check the vectors have been created
  if (U == 0)  {
    opserr << "TRBDF2::newStep() - domainChange() failed or hasn't been called\n";
    return -3;	
  }

  // mark step as Trapezoidal (=0) or Backward Euler (=1)

  if (deltaT != dt || step == 1) {
    step = 0;
  } else
    step = 1;

  // get a pointer to the AnalysisModel
  AnalysisModel *theModel = this->getAnalysisModel();

  // set response at t to be that at t+deltaT of previous step
  dt = deltaT;

  (*Utm1) = *Ut;
  (*Utm1dot) = *Utdot;

  (*Ut) = *U;        
  (*Utdot) = *Udot;  
  (*Utdotdot) = *Udotdot;

  // set the constants
  if (step == 0)  { // trapezoidal
    c1 = 1.0;
    c2 = 2.0/deltaT;
    c3 = 4.0/(deltaT*deltaT);

    (*Udot) *= -1.0;

    double a3 = -4.0/deltaT;
    double a4 = -1;
    Udotdot->addVector(a4, *Utdot, a3);
    
    // set the trial response quantities
    theModel->setVel(*Udot);
    theModel->setAccel(*Udotdot);    

  } else  {  // backward euler
    c1 = 1.0;
    c2 = 1.5/deltaT;
    c3 = 2.25/(deltaT*deltaT);

    (*Udot) = *Utm1;
    Udot->addVector(0.5/deltaT, *Ut, -1/(2.0*deltaT));

    (*Udotdot) = *Utm1dot;
    Udotdot->addVector(0.5/deltaT, *Utdot, -4.0/(2.0*deltaT));    
    Udotdot->addVector(1.0, *Udot, 3.0/(2.0*deltaT));    

    // set the trial response quantities
    theModel->setVel(*Udot);
    theModel->setAccel(*Udotdot);    
  }

  // increment the time to t+deltaT and apply the load
  double time = theModel->getCurrentDomainTime();
  time += deltaT;
  if (theModel->updateDomain(time, deltaT) < 0)  {
    opserr << "TRBDF2::newStep() - failed to update the domain\n";
    return -4;
  }
  
  return 0;
}
开发者ID:lge88,项目名称:OpenSees,代码行数:71,代码来源:TRBDF2.cpp

示例10: newStep

int HHTGeneralized_TP::newStep(double _deltaT)
{
    if (beta == 0 || gamma == 0 )  {
        opserr << "HHTGeneralized_TP::newStep() - error in variable\n";
        opserr << "gamma = " << gamma << " beta = " << beta << endln;
        return -1;
    }
    
    deltaT = _deltaT;
    if (deltaT <= 0.0)  {
        opserr << "HHTGeneralized_TP::newStep() - error in variable\n";
        opserr << "dT = " << deltaT << endln;
        return -2;
    }
    
    // get a pointer to the LinearSOE and the AnalysisModel
    LinearSOE *theLinSOE = this->getLinearSOE();
    AnalysisModel *theModel = this->getAnalysisModel();
    if (theLinSOE == 0 || theModel == 0)  {
        opserr << "WARNING HHT_TP::newStep() - ";
        opserr << "no LinearSOE or AnalysisModel has been set\n";
        return -3;
    }
    
    // set the constants
    c1 = 1.0;
    c2 = gamma/(beta*deltaT);
    c3 = 1.0/(beta*deltaT*deltaT);
       
    if (U == 0)  {
        opserr << "HHTGeneralized_TP::newStep() - domainChange() failed or hasn't been called\n";
        return -4;
    }
    
    // set response at t to be that at t+deltaT of previous step
    (*Ut) = *U;
    (*Utdot) = *Udot;
    (*Utdotdot) = *Udotdot;
    
    // get unbalance at t and store it
    alphaM = (1.0 - alphaI);
    alphaD = alphaR = alphaP = (1.0 - alphaF);
    this->TransientIntegrator::formUnbalance();
    (*Put) = theLinSOE->getB();
    
    // determine new velocities and accelerations at t+deltaT
    double a1 = (1.0 - gamma/beta);
    double a2 = deltaT*(1.0 - 0.5*gamma/beta);
    Udot->addVector(a1, *Utdotdot, a2);
    
    double a3 = -1.0/(beta*deltaT);
    double a4 = 1.0 - 0.5/beta;  
    Udotdot->addVector(a4, *Utdot, a3);
    
    // set the trial response quantities
    theModel->setVel(*Udot);
    theModel->setAccel(*Udotdot);
    
    // increment the time to t+deltaT and apply the load
    double time = theModel->getCurrentDomainTime();
    time += deltaT;
    if (theModel->updateDomain(time, deltaT) < 0)  {
        opserr << "HHTGeneralized_TP::newStep() - failed to update the domain\n";
        return -5;
    }
    
    // modify constants for subsequent iterations
    alphaM = alphaI;
    alphaD = alphaR = alphaP = alphaF;
    
    return 0;
}
开发者ID:DBorello,项目名称:OpenSeesDev,代码行数:72,代码来源:HHTGeneralized_TP.cpp


注:本文中的AnalysisModel::setAccel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。