本文整理汇总了C++中AnalysisModel::setResponse方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisModel::setResponse方法的具体用法?C++ AnalysisModel::setResponse怎么用?C++ AnalysisModel::setResponse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisModel
的用法示例。
在下文中一共展示了AnalysisModel::setResponse方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例2: update
int NewmarkHSFixedNumIter::update(const Vector &deltaU)
{
AnalysisModel *theModel = this->getAnalysisModel();
if (theModel == 0) {
opserr << "WARNING NewmarkHSFixedNumIter::update() - no AnalysisModel set\n";
return -1;
}
ConvergenceTest *theTest = this->getConvergenceTest();
if (theTest == 0) {
opserr << "WARNING NewmarkHSFixedNumIter::update() - no ConvergenceTest set\n";
return -2;
}
// check domainChanged() has been called, i.e. Ut will not be zero
if (Ut == 0) {
opserr << "WARNING NewmarkHSFixedNumIter::update() - domainChange() failed or not called\n";
return -3;
}
// check deltaU is of correct size
if (deltaU.Size() != U->Size()) {
opserr << "WARNING NewmarkHSFixedNumIter::update() - Vectors of incompatible size";
opserr << " expecting " << U->Size() << " obtained " << deltaU.Size() << endln;
return -4;
}
// get interpolation location and scale displacement increment
x = (double) theTest->getNumTests()/theTest->getMaxNumTests();
if (polyOrder == 1) {
(*scaledDeltaU) = x*((*U)+deltaU) - (x-1.0)*(*Ut) - (*U);
}
else if (polyOrder == 2) {
(*scaledDeltaU) = x*(x+1.0)/2.0*((*U)+deltaU) - (x-1.0)*(x+1.0)*(*Ut)
+ (x-1.0)*x/2.0*(*Utm1) - (*U);
}
else if (polyOrder == 3) {
(*scaledDeltaU) = x*(x+1.0)*(x+2.0)/6.0*((*U)+deltaU) - (x-1.0)*(x+1.0)*(x+2.0)/2.0*(*Ut)
+ (x-1.0)*x*(x+2.0)/2.0*(*Utm1) - (x-1.0)*x*(x+1.0)/6.0*(*Utm2) - (*U);
}
else {
opserr << "WARNING NewmarkHSFixedNumIter::update() - polyOrder > 3 not supported\n";
}
// determine the response at t+deltaT
U->addVector(1.0, *scaledDeltaU, c1);
Udot->addVector(1.0, *scaledDeltaU, c2);
Udotdot->addVector(1.0, *scaledDeltaU, c3);
// update the response at the DOFs
theModel->setResponse(*U,*Udot,*Udotdot);
if (theModel->updateDomain() < 0) {
opserr << "NewmarkHSFixedNumIter::update() - failed to update the domain\n";
return -5;
}
return 0;
}
示例3: 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;
}
示例4: 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();
}
示例5: update
int CentralDifference::update(const Vector &U)
{
updateCount++;
if (updateCount > 1) {
opserr << "WARNING CentralDifference::update() - called more than once -";
opserr << " CentralDifference integration scheme requires a LINEAR solution algorithm\n";
return -1;
}
AnalysisModel *theModel = this->getAnalysisModel();
if (theModel == 0) {
opserr << "WARNING CentralDifference::update() - no AnalysisModel set\n";
return -1;
}
// check domainChanged() has been called, i.e. Ut will not be zero
if (Ut == 0) {
opserr << "WARNING CentralDifference::update() - domainChange() failed or not called\n";
return -2;
}
// check U is of correct size
if (U.Size() != Ut->Size()) {
opserr << "WARNING CentralDifference::update() - Vectors of incompatible size ";
opserr << " expecting " << Ut->Size() << " obtained " << U.Size() << endln;
return -3;
}
// determine the response at t+deltaT
Udot->addVector(0.0, U, 3.0);
Udot->addVector(1.0, *Ut, -4.0);
Udot->addVector(1.0, *Utm1, 1.0);
(*Udot) *= c2;
Udotdot->addVector(0.0, *Udot, 1.0);
Udotdot->addVector(1.0, *Utdot, -1.0);
(*Udotdot) /= deltaT;
// update the response at the DOFs
theModel->setResponse(U, *Udot, *Udotdot);
if (theModel->updateDomain() < 0) {
opserr << "CentralDifference::update() - failed to update the domain\n";
return -4;
}
// set response at t to be that at t+deltaT of previous step
(*Utm1) = *Ut;
(*Ut) = U;
return 0;
}
示例6: domainChange
int XC::HHTHybridSimulation::update(const XC::Vector &deltaU)
{
AnalysisModel *theModel = this->getAnalysisModelPtr();
if (theModel == 0) {
std::cerr << "WARNING XC::HHTHybridSimulation::update() - no XC::AnalysisModel set\n";
return -1;
}
// check domainChanged() has been called, i.e. Ut will not be zero
if (Ut.get().Size() == 0) {
std::cerr << "WARNING XC::HHTHybridSimulation::update() - domainChange() failed or not called\n";
return -2;
}
// check deltaU is of correct size
if (deltaU.Size() != U.get().Size()) {
std::cerr << "WARNING XC::HHTHybridSimulation::update() - Vectors of incompatible size ";
std::cerr << " expecting " << U.get().Size() << " obtained " << deltaU.Size() << std::endl;
return -3;
}
// determine the displacement increment reduction factor
rFact = 1.0/(theTest->getMaxNumTests() - theTest->getNumTests() + 1.0);
// determine the response at t+deltaT
(U.get()) += rFact*deltaU;
U.getDot().addVector(1.0, deltaU, rFact*c2);
U.getDotDot().addVector(1.0, deltaU, rFact*c3);
// determine displacement and velocity at t+alpha*deltaT
(Ualpha.get()) = Ut.get();
Ualpha.get().addVector((1.0-alphaF), U.get(), alphaF);
(Ualpha.getDot()) = Ut.getDot();
Ualpha.get().addVector((1.0-alphaF), U.getDot(), alphaF);
(Ualpha.getDotDot()) = Ut.getDotDot();
Ualpha.getDotDot().addVector((1.0-alphaI()), U.getDotDot(), alphaI());
// update the response at the DOFs
theModel->setResponse(Ualpha.get(),Ualpha.getDot(),Ualpha.getDotDot());
if(updateModel() < 0)
{
std::cerr << "XC::HHTHybridSimulation::update() - failed to update the domain\n";
return -4;
}
return 0;
}
示例7: update
int AlphaOSGeneralized::update(const Vector &deltaU)
{
updateCount++;
if (updateCount > 1) {
opserr << "WARNING AlphaOSGeneralized::update() - called more than once -";
opserr << " AlphaOSGeneralized integration scheme requires a LINEAR solution algorithm\n";
return -1;
}
AnalysisModel *theModel = this->getAnalysisModel();
if (theModel == 0) {
opserr << "WARNING AlphaOSGeneralized::update() - no AnalysisModel set\n";
return -2;
}
// check domainChanged() has been called, i.e. Ut will not be zero
if (Ut == 0) {
opserr << "WARNING AlphaOSGeneralized::update() - domainChange() failed or not called\n";
return -3;
}
// check deltaU is of correct size
if (deltaU.Size() != U->Size()) {
opserr << "WARNING AlphaOSGeneralized::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->setResponse(*U, *Udot, *Udotdot);
if (updDomFlag == true) {
if (theModel->updateDomain() < 0) {
opserr << "AlphaOSGeneralized::update() - failed to update the domain\n";
return -5;
}
}
return 0;
}
示例8:
int
HHT1::commit(void)
{
AnalysisModel *theModel = this->getAnalysisModel();
if (theModel == 0) {
opserr << "WARNING HHT1::commit() - no AnalysisModel set\n";
return -1;
}
// update the responses at the DOFs
theModel->setResponse(*U,*Udot,*Udotdot);
theModel->updateDomain();
return theModel->commitDomain();
}
示例9: update
int GeneralizedAlpha::update(const Vector &deltaU)
{
AnalysisModel *theModel = this->getAnalysisModel();
if (theModel == 0) {
opserr << "WARNING GeneralizedAlpha::update() - no AnalysisModel set\n";
return -1;
}
// check domainChanged() has been called, i.e. Ut will not be zero
if (Ut == 0) {
opserr << "WARNING GeneralizedAlpha::update() - domainChange() failed or not called\n";
return -2;
}
// check deltaU is of correct size
if (deltaU.Size() != U->Size()) {
opserr << "WARNING GeneralizedAlpha::update() - Vectors of incompatible size ";
opserr << " expecting " << U->Size() << " obtained " << deltaU.Size() << endln;
return -3;
}
// determine the response at t+deltaT
(*U) += deltaU;
Udot->addVector(1.0, deltaU, c2);
Udotdot->addVector(1.0, deltaU, c3);
// determine displacement and velocity at t+alphaF*deltaT
(*Ualpha) = *Ut;
Ualpha->addVector((1.0-alphaF), *U, alphaF);
(*Ualphadot) = *Utdot;
Ualphadot->addVector((1.0-alphaF), *Udot, alphaF);
// determine the velocities at t+alphaM*deltaT
(*Ualphadotdot) = *Utdotdot;
Ualphadotdot->addVector((1.0-alphaM), *Udotdot, alphaM);
// update the response at the DOFs
theModel->setResponse(*Ualpha,*Ualphadot,*Udotdot);
if (theModel->updateDomain() < 0) {
opserr << "GeneralizedAlpha::update() - failed to update the domain\n";
return -4;
}
return 0;
}
示例10: update
int KRAlphaExplicit::update(const Vector &aiPlusOne)
{
updateCount++;
if (updateCount > 1) {
opserr << "WARNING KRAlphaExplicit::update() - called more than once -";
opserr << " KRAlphaExplicit integration scheme requires a LINEAR solution algorithm\n";
return -1;
}
AnalysisModel *theModel = this->getAnalysisModel();
if (theModel == 0) {
opserr << "WARNING KRAlphaExplicit::update() - no AnalysisModel set\n";
return -1;
}
// check domainChanged() has been called, i.e. Ut will not be zero
if (Ut == 0) {
opserr << "WARNING KRAlphaExplicit::update() - domainChange() failed or not called\n";
return -2;
}
// check aiPlusOne is of correct size
if (aiPlusOne.Size() != U->Size()) {
opserr << "WARNING KRAlphaExplicit::update() - Vectors of incompatible size ";
opserr << " expecting " << U->Size() << " obtained " << aiPlusOne.Size() << endln;
return -3;
}
// determine the response at t+deltaT
//U->addVector(1.0, aiPlusOne, c1); // c1 = 0.0
//Udot->addVector(1.0, aiPlusOne, c2); // c2 = 0.0
Udotdot->addVector(0.0, aiPlusOne, 1.0);
// update the response at the DOFs
theModel->setResponse(*U, *Udot, *Udotdot);
if (updDomFlag == true) {
if (theModel->updateDomain() < 0) {
opserr << "WARNING KRAlphaExplicit::update() - failed to update the domain\n";
return -4;
}
}
return 0;
}
示例11: update
int Newmark::update(const Vector &deltaU)
{
AnalysisModel *theModel = this->getAnalysisModel();
if (theModel == 0) {
opserr << "WARNING Newmark::update() - no AnalysisModel set\n";
return -1;
}
// check domainChanged() has been called, i.e. Ut will not be zero
if (Ut == 0) {
opserr << "WARNING Newmark::update() - domainChange() failed or not called\n";
return -2;
}
// check deltaU is of correct size
if (deltaU.Size() != U->Size()) {
opserr << "WARNING Newmark::update() - Vectors of incompatible size ";
opserr << " expecting " << U->Size() << " obtained " << deltaU.Size() << endln;
return -3;
}
// determine the response at t+deltaT
if (displ == true) {
(*U) += deltaU;
Udot->addVector(1.0, deltaU, c2);
Udotdot->addVector(1.0, deltaU, c3);
} else {
U->addVector(1.0, deltaU, c1);
Udot->addVector(1.0, deltaU, c2);
(*Udotdot) += deltaU;
}
// update the response at the DOFs
theModel->setResponse(*U,*Udot,*Udotdot);
if (theModel->updateDomain() < 0) {
opserr << "Newmark::update() - failed to update the domain\n";
return -4;
}
return 0;
}
示例12: commit
int HHTHSFixedNumIter::commit(void)
{
AnalysisModel *theModel = this->getAnalysisModel();
if (theModel == 0) {
opserr << "WARNING HHTHSFixedNumIter::commit() - no AnalysisModel set\n";
return -1;
}
LinearSOE *theSOE = this->getLinearSOE();
if (theSOE == 0) {
opserr << "WARNING HHTHSFixedNumIter::commit() - no LinearSOE set\n";
return -2;
}
if (this->formTangent(statusFlag) < 0) {
opserr << "WARNING HHTHSFixedNumIter::commit() - "
<< "the Integrator failed in formTangent()\n";
return -3;
}
if (theSOE->solve() < 0) {
opserr << "WARNING HHTHSFixedNumIter::commit() - "
<< "the LinearSysOfEqn failed in solve()\n";
return -4;
}
const Vector &deltaU = theSOE->getX();
// determine the response at t+deltaT
U->addVector(1.0, deltaU, c1);
Udot->addVector(1.0, deltaU, c2);
Udotdot->addVector(1.0, deltaU, c3);
// 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-alphaF)*deltaT;
theModel->setCurrentDomainTime(time);
return theModel->commitDomain();
}
示例13: update
int CollocationHSIncrLimit::update(const Vector &deltaU)
{
AnalysisModel *theModel = this->getAnalysisModel();
if (theModel == 0) {
opserr << "WARNING CollocationHSIncrLimit::update() - no AnalysisModel set\n";
return -1;
}
// check domainChanged() has been called, i.e. Ut will not be zero
if (Ut == 0) {
opserr << "WARNING CollocationHSIncrLimit::update() - domainChange() failed or not called\n";
return -3;
}
// check deltaU is of correct size
if (deltaU.Size() != U->Size()) {
opserr << "WARNING CollocationHSIncrLimit::update() - Vectors of incompatible size ";
opserr << " expecting " << U->Size() << " obtained " << deltaU.Size() << endln;
return -4;
}
// get scaled increment
double scale = limit/deltaU.pNorm(normType);
if (scale >= 1.0)
(*scaledDeltaU) = deltaU;
else
(*scaledDeltaU) = scale*deltaU;
// determine the response at t+theta*deltaT
U->addVector(1.0, *scaledDeltaU, c1);
Udot->addVector(1.0, *scaledDeltaU, c2);
Udotdot->addVector(1.0, *scaledDeltaU, c3);
// update the response at the DOFs
theModel->setResponse(*U,*Udot,*Udotdot);
if (theModel->updateDomain() < 0) {
opserr << "CollocationHSIncrLimit::update() - failed to update the domain\n";
return -5;
}
return 0;
}
示例14: commit
int GeneralizedAlpha::commit(void)
{
AnalysisModel *theModel = this->getAnalysisModel();
if (theModel == 0) {
opserr << "WARNING GeneralizedAlpha::commit() - no AnalysisModel set\n";
return -1;
}
// update the response at the DOFs
theModel->setResponse(*U,*Udot,*Udotdot);
if (theModel->updateDomain() < 0) {
opserr << "GeneralizedAlpha::commit() - failed to update the domain\n";
return -4;
}
// set the time to be t+deltaT
double time = theModel->getCurrentDomainTime();
time += (1.0-alphaF)*deltaT;
theModel->setCurrentDomainTime(time);
return theModel->commitDomain();
}
示例15: commitModel
int XC::Collocation::commit(void)
{
AnalysisModel *theModel = this->getAnalysisModelPtr();
if (theModel == 0) {
std::cerr << "WARNING XC::Collocation::commit() - no XC::AnalysisModel set\n";
return -1;
}
// determine response quantities at t+deltaT
U.getDotDot().addVector(1.0/theta, Ut.getDotDot(), (theta-1.0)/theta);
(U.getDot()) = Ut.getDot();
double a1 = deltaT*(1.0 - gamma);
double a2 = deltaT*gamma;
U.getDot().addVector(1.0, Ut.getDotDot(), a1);
U.getDot().addVector(1.0, U.getDotDot(), a2);
U.get()= Ut.get();
U.get().addVector(1.0, Ut.getDot(), deltaT);
double a3 = deltaT*deltaT*(0.5 - beta);
double a4 = deltaT*deltaT*beta;
U.get().addVector(1.0, Ut.getDotDot(), a3);
U.get().addVector(1.0, U.getDotDot(), a4);
// update the response at the DOFs
theModel->setResponse(U.get(),U.getDot(),U.getDotDot());
// if (theModel->updateDomain() < 0) {
// std::cerr << "XC::Collocation::commit() - failed to update the domain\n";
// return -4;
// }
// set the time to be t+delta t
double time= getCurrentModelTime();
time += (1.0-theta)*deltaT;
setCurrentModelTime(time);
return commitModel();
}