本文整理汇总了C++中AnalysisModel::setCurrentDomainTime方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisModel::setCurrentDomainTime方法的具体用法?C++ AnalysisModel::setCurrentDomainTime怎么用?C++ AnalysisModel::setCurrentDomainTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisModel
的用法示例。
在下文中一共展示了AnalysisModel::setCurrentDomainTime方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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();
}
示例3: commit
int AlphaOSGeneralized::commit(void)
{
AnalysisModel *theModel = this->getAnalysisModel();
if (theModel == 0) {
opserr << "WARNING AlphaOSGeneralized::commit() - no AnalysisModel set\n";
return -1;
}
// set the time to be t+deltaT
double time = theModel->getCurrentDomainTime();
time += (1.0-alphaF)*deltaT;
theModel->setCurrentDomainTime(time);
return theModel->commitDomain();
}
示例4: commit
int CentralDifference::commit(void)
{
AnalysisModel *theModel = this->getAnalysisModel();
if (theModel == 0) {
opserr << "WARNING CentralDifference::commit() - no AnalysisModel set\n";
return -1;
}
// set the time to be t+deltaT
double time = theModel->getCurrentDomainTime();
time += deltaT;
theModel->setCurrentDomainTime(time);
return theModel->commitDomain();
}
示例5:
int
CentralDifferenceNoDamping::commit(void)
{
AnalysisModel *theModel = this->getAnalysisModel();
if (theModel == 0) {
opserr << "WARNING CentralDifferenceNoDamping::commit() - no AnalysisModel set\n";
return -1;
}
// update time in Domain to T + deltaT & commit the domain
double time = theModel->getCurrentDomainTime() + deltaT;
theModel->setCurrentDomainTime(time);
return theModel->commitDomain();
return 0;
}
示例6: 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();
}
示例7: commit
int AlphaOS::commit(void)
{
AnalysisModel *theModel = this->getAnalysisModel();
if (theModel == 0) {
opserr << "WARNING AlphaOS::commit() - no AnalysisModel set\n";
return -1;
}
// set the time to be t+deltaT
double time = theModel->getCurrentDomainTime();
time += (1.0-alpha)*deltaT;
theModel->setCurrentDomainTime(time);
// update the displacements in the elements
if (updElemDisp == true)
theModel->updateDomain();
return theModel->commitDomain();
}
示例8: 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();
}
示例9: Vector
int
ArcLength::domainChanged(void)
{
// we first create the Vectors needed
AnalysisModel *theModel = this->getAnalysisModel();
LinearSOE *theLinSOE = this->getLinearSOE();
if (theModel == 0 || theLinSOE == 0) {
opserr << "WARNING ArcLength::update() ";
opserr << "No AnalysisModel or LinearSOE has been set\n";
return -1;
}
int size = theModel->getNumEqn(); // ask model in case N+1 space
if (deltaUhat == 0 || deltaUhat->Size() != size) { // create new Vector
if (deltaUhat != 0)
delete deltaUhat; // delete the old
deltaUhat = new Vector(size);
if (deltaUhat == 0 || deltaUhat->Size() != size) { // check got it
opserr << "FATAL ArcLength::domainChanged() - ran out of memory for";
opserr << " deltaUhat Vector of size " << size << endln;
exit(-1);
}
}
if (deltaUbar == 0 || deltaUbar->Size() != size) { // create new Vector
if (deltaUbar != 0)
delete deltaUbar; // delete the old
deltaUbar = new Vector(size);
if (deltaUbar == 0 || deltaUbar->Size() != size) { // check got it
opserr << "FATAL ArcLength::domainChanged() - ran out of memory for";
opserr << " deltaUbar Vector of size " << size << endln;
exit(-1);
}
}
if (deltaU == 0 || deltaU->Size() != size) { // create new Vector
if (deltaU != 0)
delete deltaU; // delete the old
deltaU = new Vector(size);
if (deltaU == 0 || deltaU->Size() != size) { // check got it
opserr << "FATAL ArcLength::domainChanged() - ran out of memory for";
opserr << " deltaU Vector of size " << size << endln;
exit(-1);
}
}
if (deltaUstep == 0 || deltaUstep->Size() != size) {
if (deltaUstep != 0)
delete deltaUstep;
deltaUstep = new Vector(size);
if (deltaUstep == 0 || deltaUstep->Size() != size) {
opserr << "FATAL ArcLength::domainChanged() - ran out of memory for";
opserr << " deltaUstep Vector of size " << size << endln;
exit(-1);
}
}
if (phat == 0 || phat->Size() != size) {
if (phat != 0)
delete phat;
phat = new Vector(size);
if (phat == 0 || phat->Size() != size) {
opserr << "FATAL ArcLength::domainChanged() - ran out of memory for";
opserr << " phat Vector of size " << size << endln;
exit(-1);
}
}
// now we have to determine phat
// do this by incrementing lambda by 1, applying load
// and getting phat from unbalance.
currentLambda = theModel->getCurrentDomainTime();
currentLambda += 1.0;
theModel->applyLoadDomain(currentLambda);
this->formUnbalance(); // NOTE: this assumes unbalance at last was 0
(*phat) = theLinSOE->getB();
currentLambda -= 1.0;
theModel->setCurrentDomainTime(currentLambda);
// check there is a reference load
int haveLoad = 0;
for (int i=0; i<size; i++)
if ( (*phat)(i) != 0.0 ) {
haveLoad = 1;
i = size;
}
if (haveLoad == 0) {
opserr << "WARNING ArcLength::domainChanged() - zero reference load";
return -1;
}
return 0;
}
示例10: Vector
int
DisplacementControl::domainChanged(void)
{
// we first create the Vectors needed
AnalysisModel *theModel = this->getAnalysisModel();
LinearSOE *theLinSOE = this->getLinearSOE();
if (theModel == 0 || theLinSOE == 0) {
opserr << "WARNING DisplacementControl::update() ";
opserr << "No AnalysisModel or LinearSOE has been set\n";
return -1;
}
int size = theModel->getNumEqn(); // ask model in case N+1 space
if (deltaUhat == 0 || deltaUhat->Size() != size) { // create new Vector
if (deltaUhat != 0)
delete deltaUhat; // delete the old
deltaUhat = new Vector(size);
if (deltaUhat == 0 || deltaUhat->Size() != size) { // check got it
opserr << "FATAL DisplacementControl::domainChanged() - ran out of memory for";
opserr << " deltaUhat Vector of size " << size << endln;
exit(-1);
}
}
if (deltaUbar == 0 || deltaUbar->Size() != size) { // create new Vector
if (deltaUbar != 0)
delete deltaUbar; // delete the old
deltaUbar = new Vector(size);
if (deltaUbar == 0 || deltaUbar->Size() != size) { // check got it
opserr << "FATAL DisplacementControl::domainChanged() - ran out of memory for";
opserr << " deltaUbar Vector of size " << size << endln;
exit(-1);
}
}
if (deltaU == 0 || deltaU->Size() != size) { // create new Vector
if (deltaU != 0)
delete deltaU; // delete the old
deltaU = new Vector(size);
if (deltaU == 0 || deltaU->Size() != size) { // check got it
opserr << "FATAL DisplacementControl::domainChanged() - ran out of memory for";
opserr << " deltaU Vector of size " << size << endln;
exit(-1);
}
}
if (deltaUstep == 0 || deltaUstep->Size() != size) {
if (deltaUstep != 0)
delete deltaUstep;
deltaUstep = new Vector(size);
if (deltaUstep == 0 || deltaUstep->Size() != size) {
opserr << "FATAL DisplacementControl::domainChanged() - ran out of memory for";
opserr << " deltaUstep Vector of size " << size << endln;
exit(-1);
}
}
if (phat == 0 || phat->Size() != size) {
if (phat != 0)
delete phat;
phat = new Vector(size);
if (phat == 0 || phat->Size() != size) {
opserr << "FATAL DisplacementControl::domainChanged() - ran out of memory for";
opserr << " phat Vector of size " << size << endln;
exit(-1);
}
}
// now we have to determine phat
// do this by incrementing lambda by 1, applying load
// and getting phat from unbalance.
currentLambda = theModel->getCurrentDomainTime();
currentLambda += 1.0;
theModel->applyLoadDomain(currentLambda);
this->formUnbalance(); // NOTE: this assumes unbalance at last was 0
(*phat) = theLinSOE->getB();
currentLambda -= 1.0;
theModel->setCurrentDomainTime(currentLambda);
// check there is a reference load
int haveLoad = 0;
for (int i=0; i<size; i++)
if ( (*phat)(i) != 0.0 ) {
haveLoad = 1;
i = size;
}
if (haveLoad == 0) {
opserr << "WARNING DisplacementControl::domainChanged() - zero reference load";
return -1;
}
// lastly we determine the id of the nodal dof
// EXTRA CODE TO DO SOME ERROR CHECKING REQUIRED
Node *theNodePtr = theDomain->getNode(theNode);
if (theNodePtr == 0) {
opserr << "DisplacementControl::domainChanged - no node\n";
return -1;
//.........这里部分代码省略.........