本文整理汇总了C++中DOF_Group::getAccSensitivity方法的典型用法代码示例。如果您正苦于以下问题:C++ DOF_Group::getAccSensitivity方法的具体用法?C++ DOF_Group::getAccSensitivity怎么用?C++ DOF_Group::getAccSensitivity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOF_Group
的用法示例。
在下文中一共展示了DOF_Group::getAccSensitivity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: V
int
NewmarkSensitivityIntegrator::formEleResidual(FE_Element *theEle)
{
if (sensitivityFlag == 0) { // NO SENSITIVITY ANALYSIS
this->Newmark::formEleResidual(theEle);
}
else { // (ASSEMBLE ALL TERMS)
theEle->zeroResidual();
// Compute the time-stepping parameters on the form
// udotdot = a1*ui+1 + a2*ui + a3*udoti + a4*udotdoti
// udot = a5*ui+1 + a6*ui + a7*udoti + a8*udotdoti
// (see p. 166 of Chopra)
// The constants are:
// a1 = 1.0/(beta*dt*dt)
// a2 = -1.0/(beta*dt*dt)
// a3 = -1.0/beta*dt
// a4 = 1.0 - 1.0/(2.0*beta)
// a5 = gamma/(beta*dt)
// a6 = -gamma/(beta*dt)
// a7 = 1.0 - gamma/beta
// a8 = 1.0 - gamma/(2.0*beta)
// We can make use of the data members c2 and c3 of this class.
// As long as disp==true, they are defined as:
// c2 = gamma/(beta*dt)
// c3 = 1.0/(beta*dt*dt)
// So, the constants can be computed as follows:
if (displ==false) {
opserr << "ERROR: Newmark::formEleResidual() -- the implemented"
<< " scheme only works if the displ variable is set to true." << endln;
}
double a2 = -c3;
double a3 = -c2/gamma;
double a4 = 1.0 - 1.0/(2.0*beta);
double a6 = -c2;
double a7 = 1.0 - gamma/beta;
double dt = gamma/(beta*c2);
double a8 = dt*(1.0 - gamma/(2.0*beta));
// Obtain sensitivity vectors from previous step
int vectorSize = U->Size();
Vector V(vectorSize);
Vector Vdot(vectorSize);
Vector Vdotdot(vectorSize);
int i, loc;
AnalysisModel *myModel = this->getAnalysisModel();
DOF_GrpIter &theDOFs = myModel->getDOFs();
DOF_Group *dofPtr;
while ((dofPtr = theDOFs()) != 0) {
const ID &id = dofPtr->getID();
int idSize = id.Size();
const Vector &dispSens = dofPtr->getDispSensitivity(gradNumber);
for (i=0; i < idSize; i++) {
loc = id(i);
if (loc >= 0) {
V(loc) = dispSens(i);
}
}
const Vector &velSens = dofPtr->getVelSensitivity(gradNumber);
for (i=0; i < idSize; i++) {
loc = id(i);
if (loc >= 0) {
Vdot(loc) = velSens(i);
}
}
const Vector &accelSens = dofPtr->getAccSensitivity(gradNumber);
for (i=0; i < idSize; i++) {
loc = id(i);
if (loc >= 0) {
Vdotdot(loc) = accelSens(i);
}
}
}
// Pre-compute the vectors involving a2, a3, etc.
//Vector tmp1 = V*a2 + Vdot*a3 + Vdotdot*a4;
Vector tmp1(vectorSize);
tmp1.addVector(0.0, V, a2);
tmp1.addVector(1.0, Vdot, a3);
tmp1.addVector(1.0, Vdotdot, a4);
//Vector tmp2 = V*a6 + Vdot*a7 + Vdotdot*a8;
Vector tmp2(vectorSize);
tmp2.addVector(0.0, V, a6);
tmp2.addVector(1.0, Vdot, a7);
tmp2.addVector(1.0, Vdotdot, a8);
if (massMatrixMultiplicator == 0)
//.........这里部分代码省略.........