本文整理汇总了C++中AnalysisModel::getDOFGroups方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisModel::getDOFGroups方法的具体用法?C++ AnalysisModel::getDOFGroups怎么用?C++ AnalysisModel::getDOFGroups使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisModel
的用法示例。
在下文中一共展示了AnalysisModel::getDOFGroups方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setRayleighDampingFactors
int XC::Collocation::domainChanged()
{
AnalysisModel *myModel = this->getAnalysisModelPtr();
LinearSOE *theLinSOE = this->getLinearSOEPtr();
const Vector &x = theLinSOE->getX();
int size = x.Size();
setRayleighDampingFactors();
if(Ut.get().Size() != size)
{
// create the new
Ut.resize(size);
U.resize(size);
}
// now go through and populate U, by iterating through
// the DOF_Groups and getting the last committed velocity and accel
DOF_GrpIter &theDOFGroups = myModel->getDOFGroups();
DOF_Group *dofGroupPtr= nullptr;
while((dofGroupPtr = theDOFGroups()) != 0)
{
const XC::ID &id = dofGroupPtr->getID();
const Vector &disp = dofGroupPtr->getCommittedDisp();
U.setDisp(id,disp);
const Vector &vel = dofGroupPtr->getCommittedVel();
U.setVel(id,vel);
const Vector &accel = dofGroupPtr->getCommittedAccel();
U.setAccel(id,accel);
// NOTE WE CAN't DO TOGETHER BECAUSE DOF_GROUPS USING SINGLE VECTOR
}
return 0;
}
示例2: setRayleighDampingFactors
//! If the size of the LinearSOE has changed, the object deletes any old Vectors
//! created and then creates \f$6\f$ new Vector objects of size equal to {\em
//! theLinearSOE-\f$>\f$getNumEqn()}. There is a Vector object created to store
//! the current displacement, velocity and accelerations at times \f$t\f$ and
//! \f$t + \Delta t\f$. The response quantities at time \f$t + \Delta t\f$ are
//! then set by iterating over the DOF\_Group objects in the model and
//! obtaining their committed values.
//! Returns \f$0\f$ if successful, otherwise a warning message and a negative
//! number is returned: \f$-1\f$ if no memory was available for constructing
//! the Vectors.
int XC::CentralDifference::domainChanged(void)
{
AnalysisModel *myModel = this->getAnalysisModelPtr();
LinearSOE *theLinSOE = this->getLinearSOEPtr();
const XC::Vector &x = theLinSOE->getX();
int size = x.Size();
setRayleighDampingFactors();
if(Ut.get().Size() != size)
{
Utm1.resize(size);
Ut.resize(size);
U.resize(size);
}
// now go through and populate U, Udot and Udotdot by iterating through
// the DOF_Groups and getting the last committed velocity and accel
DOF_GrpIter &theDOFGroups = myModel->getDOFGroups();
DOF_Group *dofGroupPtr= nullptr;
while((dofGroupPtr = theDOFGroups()) != 0)
{
const ID &id = dofGroupPtr->getID();
const int idSize = id.Size();
const Vector &disp = dofGroupPtr->getCommittedDisp();
for(int i=0;i<idSize;i++)
{
const int loc = id(i);
if(loc >= 0)
{ Utm1(loc) = disp(i); }
}
Ut.setDisp(id,disp);
const Vector &vel = dofGroupPtr->getCommittedVel();
U.setVel(id,vel);
const XC::Vector &accel = dofGroupPtr->getCommittedAccel();
U.setAccel(id,accel);
/** NOTE WE CAN't DO TOGETHER BECAUSE DOF_GROUPS USING SINGLE VECTOR ******
for (int i=0; i < id.Size(); i++) {
int loc = id(i);
if (loc >= 0) {
(*U)(loc) = disp(i);
(U.getDot())(loc) = vel(i);
(U.getDotDot())(loc) = accel(i);
}
}
***/
}
std::cerr << getClassName() << "::" << __FUNCTION__
<< "; WARNING: assuming Ut-1 = Ut\n";
return 0;
}