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


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

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


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

示例1: if

int 
LoadControl::newStep(void)
{
    AnalysisModel *theModel = this->getAnalysisModel();    
    if (theModel == 0) {
	opserr << "LoadControl::newStep() - no associated AnalysisModel\n";
	return -1;
    }

    // determine delta lambda for this step based on dLambda and #iter of last step
    double factor = specNumIncrStep/numIncrLastStep;
    deltaLambda *=factor;

    if (deltaLambda < dLambdaMin)
      deltaLambda = dLambdaMin;
    else if (deltaLambda > dLambdaMax)
      deltaLambda = dLambdaMax;
    
    double currentLambda = theModel->getCurrentDomainTime();

    currentLambda += deltaLambda;
    theModel->applyLoadDomain(currentLambda);

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

示例2: 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

示例3: commit

int CollocationHSIncrReduct::commit(void)
{
    AnalysisModel *theModel = this->getAnalysisModel();
    if (theModel == 0)  {
        opserr << "WARNING CollocationHSIncrReduct::commit() - no AnalysisModel set\n";
        return -1;
    }
    
    // determine response quantities at t+deltaT
    Udotdot->addVector(1.0/theta, *Utdotdot, (theta-1.0)/theta);
    
    (*Udot) = *Utdot;
    double a1 = deltaT*(1.0 - gamma);
    double a2 = deltaT*gamma;
    Udot->addVector(1.0, *Utdotdot, a1);
    Udot->addVector(1.0, *Udotdot, a2);
    
    (*U) = *Ut;
    U->addVector(1.0, *Utdot, deltaT);
    double a3 = deltaT*deltaT*(0.5 - beta);
    double a4 = deltaT*deltaT*beta;
    U->addVector(1.0, *Utdotdot, a3);
    U->addVector(1.0, *Udotdot, a4);
    
    // update the response at the DOFs
    theModel->setResponse(*U, *Udot, *Udotdot);
    
    // set the time to be t+deltaT
    double time = theModel->getCurrentDomainTime();
    time += (1.0-theta)*deltaT;
    theModel->setCurrentDomainTime(time);
    
    return theModel->commitDomain();
}
开发者ID:DBorello,项目名称:OpenSees,代码行数:34,代码来源:CollocationHSIncrReduct.cpp

示例4: 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

示例5:

void TRBDF2::Print(OPS_Stream &s, int flag)
{
    AnalysisModel *theModel = this->getAnalysisModel();
    if (theModel != 0) {
        double currentTime = theModel->getCurrentDomainTime();
        s << "\t TRBDF2 - currentTime: " << currentTime;
    } else 
        s << "\t TRBDF2 - no associated AnalysisModel\n";
}
开发者ID:lge88,项目名称:OpenSees,代码行数:9,代码来源:TRBDF2.cpp

示例6: 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

示例7: newStep

int NewmarkExplicit::newStep(double deltaT)
{
    updateCount = 0;
    
    if (gamma == 0)  {
        opserr << "NewmarkExplicit::newStep() - error in variable\n";
        opserr << "gamma = " << gamma << endln;
        return -1;
    }
    
    if (deltaT <= 0.0)  {
        opserr << "NewmarkExplicit::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 = gamma*deltaT;
    c3 = 1.0;
    
    if (U == 0)  {
        opserr << "NewmarkExplicit::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 response at time t+deltaT
    U->addVector(1.0, *Utdot, deltaT);
    double a1 = 0.5*deltaT*deltaT;
    U->addVector(1.0, *Utdotdot, a1);
    
    double a2 = deltaT*(1.0 - gamma);
    Udot->addVector(1.0, *Utdotdot, a2);
    
    Udotdot->Zero();
    
    // set the trial response quantities
    theModel->setResponse(*U, *Udot, *Udotdot);
    
    // increment the time to t+deltaT and apply the load
    double time = theModel->getCurrentDomainTime();
    time += deltaT;
    if (theModel->updateDomain(time, deltaT) < 0)  {
        opserr << "NewmarkExplicit::newStep() - failed to update the domain\n";
        return -4;
    }
    
    return 0;
}
开发者ID:DBorello,项目名称:OpenSees,代码行数:56,代码来源:NewmarkExplicit.cpp

示例8: Print

void PFEMIntegrator::Print(OPS_Stream &s, int flag)
{
    AnalysisModel *theModel = this->getAnalysisModel();
    if (theModel != 0) {
        double currentTime = theModel->getCurrentDomainTime();
        s << "\t PFEMIntegrator - currentTime: " << currentTime;
        s << "  c1: " << c1 << "  c2: " << c2 << "  c3: " << c3 << endln;
    } else 
        s << "\t PFEMIntegrator - no associated AnalysisModel\n";
}
开发者ID:aceskpark,项目名称:osfeo,代码行数:10,代码来源:PFEMIntegrator.cpp

示例9:

void
CentralDifferenceNoDamping::Print(OPS_Stream &s, int flag)
{
    AnalysisModel *theModel = this->getAnalysisModel();
    if (theModel != 0) {
	double currentTime = theModel->getCurrentDomainTime();
	s << "\t CentralDifferenceNoDamping - currentTime: " << currentTime;
    } else 
	s << "\t CentralDifferenceNoDamping - no associated AnalysisModel\n";
}
开发者ID:lge88,项目名称:OpenSees,代码行数:10,代码来源:CentralDifferenceNoDamping.cpp

示例10: Print

void CentralDifference::Print(OPS_Stream &s, int flag)
{
    AnalysisModel *theModel = this->getAnalysisModel();
    if (theModel != 0) {
        double currentTime = theModel->getCurrentDomainTime();
        s << "\t CentralDifference - currentTime: " << currentTime << endln;
        s << "  Rayleigh Damping - alphaM: " << alphaM << "  betaK: " << betaK;
        s << "  betaKi: " << betaKi << "  betaKc: " << betaKc << endln;	    
    } else 
        s << "\t CentralDifference - no associated AnalysisModel\n";
}
开发者ID:aceskpark,项目名称:osfeo,代码行数:11,代码来源:CentralDifference.cpp

示例11: Print

void HHTGeneralized_TP::Print(OPS_Stream &s, int flag)
{
    AnalysisModel *theModel = this->getAnalysisModel();
    if (theModel != 0)  {
        double currentTime = theModel->getCurrentDomainTime();
        s << "\t HHTGeneralized_TP - currentTime: " << currentTime << endln;
        s << "  alphaI: " << alphaI << "  alphaF: " << alphaF  << "  beta: " << beta  << "  gamma: " << gamma << endln;
        s << "  c1: " << c1 << "  c2: " << c2 << "  c3: " << c3 << endln;
    } else 
        s << "\t HHTGeneralized_TP - no associated AnalysisModel\n";
}
开发者ID:DBorello,项目名称:OpenSeesDev,代码行数:11,代码来源:HHTGeneralized_TP.cpp

示例12: commit

int CollocationHSFixedNumIter::commit(void)
{
    AnalysisModel *theModel = this->getAnalysisModel();
    if (theModel == 0)  {
        opserr << "WARNING CollocationHSFixedNumIter::commit() - no AnalysisModel set\n";
        return -1;
    }	  
    
    LinearSOE *theSOE = this->getLinearSOE();
    if (theSOE == 0)  {
        opserr << "WARNING CollocationHSFixedNumIter::commit() - no LinearSOE set\n";
        return -2;
    }
    
    if (theSOE->solve() < 0)  {
        opserr << "WARNING CollocationHSFixedNumIter::commit() - "
            << "the LinearSysOfEqn failed in solve()\n";
        return -3;
    }
    const Vector &deltaU = theSOE->getX();
    
    // determine the response at t+theta*deltaT
    U->addVector(1.0, deltaU, c1);
    
    Udot->addVector(1.0, deltaU, c2);
    
    Udotdot->addVector(1.0, deltaU, c3);
    
    // determine response quantities at t+deltaT
    Udotdot->addVector(1.0/theta, *Utdotdot, (theta-1.0)/theta);
    
    (*Udot) = *Utdot;
    double a1 = deltaT*(1.0 - gamma);
    double a2 = deltaT*gamma;
    Udot->addVector(1.0, *Utdotdot, a1);
    Udot->addVector(1.0, *Udotdot, a2);
    
    (*U) = *Ut;
    U->addVector(1.0, *Utdot, deltaT);
    double a3 = deltaT*deltaT*(0.5 - beta);
    double a4 = deltaT*deltaT*beta;
    U->addVector(1.0, *Utdotdot, a3);
    U->addVector(1.0, *Udotdot, a4);
    
    // update the response at the DOFs
    theModel->setResponse(*U,*Udot,*Udotdot);
    
    // set the time to be t+deltaT
    double time = theModel->getCurrentDomainTime();
    time += (1.0-theta)*deltaT;
    theModel->setCurrentDomainTime(time);
    
    return theModel->commitDomain();
}
开发者ID:lge88,项目名称:OpenSees,代码行数:54,代码来源:CollocationHSFixedNumIter.cpp

示例13: Print

void NewmarkExplicit::Print(OPS_Stream &s, int flag)
{
    AnalysisModel *theModel = this->getAnalysisModel();
    if (theModel != 0)  {
        double currentTime = theModel->getCurrentDomainTime();
        s << "NewmarkExplicit - currentTime: " << currentTime << endln;
        s << "  gamma: " << gamma << endln;
        s << "  c2: " << c2 << "  c3: " << c3 << endln;
    } else
        s << "NewmarkExplicit - no associated AnalysisModel\n";
}
开发者ID:DBorello,项目名称:OpenSees,代码行数:11,代码来源:NewmarkExplicit.cpp

示例14: Print

void KRAlphaExplicit::Print(OPS_Stream &s, int flag)
{
    AnalysisModel *theModel = this->getAnalysisModel();
    if (theModel != 0)  {
        double currentTime = theModel->getCurrentDomainTime();
        s << "KRAlphaExplicit - currentTime: " << currentTime << endln ;
        s << "  alphaM: " << alphaM << "  alphaF: " << alphaF  << "  beta: " << beta  << "  gamma: " << gamma << endln;
        s << "  c1: " << c1 << "  c2: " << c2 << "  c3: " << c3 << endln;
    } else 
        s << "KRAlphaExplicit - no associated AnalysisModel\n";
}
开发者ID:aceskpark,项目名称:osfeo,代码行数:11,代码来源:KRAlphaExplicit.cpp

示例15: 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


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