本文整理汇总了C++中AnalysisModel::createDOF_Group方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisModel::createDOF_Group方法的具体用法?C++ AnalysisModel::createDOF_Group怎么用?C++ AnalysisModel::createDOF_Group使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisModel
的用法示例。
在下文中一共展示了AnalysisModel::createDOF_Group方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getClassName
//! @brief Handle the constraints.
//!
//! Determines the number of FE\_Elements and DOF\_Groups needed from the
//! Domain (a one to one mapping between Elements and FE\_Elements and
//! Nodes and DOF\_Groups) Creates two arrays of pointers to store the
//! FE\_elements and DOF\_Groups, returning a warning message and a \f$-2\f$
//! or \f$-3\f$ if not enough memory is available for these arrays. Then the
//! object will iterate through the Nodes of the Domain, creating a
//! DOF\_Group for each node and setting the initial id for each dof to
//! \f$-2\f$ if no SFreedom\_Constraint exists for the dof, or \f$-1\f$ if a
//! SFreedom\_Constraint exists or \f$-3\f$ if the node identifier is in {\em
//! nodesToBeNumberedLast}. The object then iterates through the Elements
//! of the Domain creating a FE\_Element for each Element, if the Element
//! is a Subdomain setFE\_ElementPtr() is invoked on the Subdomain
//! with the new FE\_Element as the argument. If not enough memory is
//! available for any DOF\_Group or FE\_element a warning message is
//! printed and a \f$-4\f$ or \f$-5\f$ is returned. If any MFreedom\_Constraint
//! objects exist in the Domain a warning message is printed and \f$-6\f$ is
//! returned. If all is successful, the method returns the number of
//! degrees-of-freedom associated with the DOF\_Groups in {\em
//! nodesToBeNumberedLast}.
int XC::PlainHandler::handle(const ID *nodesLast)
{
// first check links exist to a Domain and an AnalysisModel object
Domain *theDomain = this->getDomainPtr();
AnalysisModel *theModel = this->getAnalysisModelPtr();
Integrator *theIntegrator = this->getIntegratorPtr();
if((!theDomain) || (!theModel) || (!theIntegrator))
{
std::cerr << getClassName() << "::" << __FUNCTION__
<< "; domain, model or integrator was not set.\n";
return -1;
}
// initialse the DOF_Groups and add them to the AnalysisModel.
// : must of course set the initial IDs
NodeIter &theNod= theDomain->getNodes();
Node *nodPtr= nullptr;
SFreedom_Constraint *spPtr= nullptr;
DOF_Group *dofPtr= nullptr;
int numDOF = 0;
int count3 = 0;
int countDOF =0;
while((nodPtr = theNod()) != nullptr)
{
dofPtr= theModel->createDOF_Group(numDOF++, nodPtr);
// initially set all the ID value to -2
countDOF+= dofPtr->inicID(-2);
// loop through the SFreedom_Constraints to see if any of the
// DOFs are constrained, if so set initial XC::ID value to -1
int nodeID = nodPtr->getTag();
SFreedom_ConstraintIter &theSPs = theDomain->getConstraints().getDomainAndLoadPatternSPs();
while((spPtr = theSPs()) != 0)
if(spPtr->getNodeTag() == nodeID)
{
if(spPtr->isHomogeneous() == false)
std::cerr << getClassName() << "::" << __FUNCTION__
<< "; non-homogeneos constraint"
<< " for node " << spPtr->getNodeTag()
<< " homo assumed\n";
const ID &id = dofPtr->getID();
int dof = spPtr->getDOF_Number();
if(id(dof) == -2)
{
dofPtr->setID(spPtr->getDOF_Number(),-1);
countDOF--;
}
else
std::cerr << getClassName() << "::" << __FUNCTION__
<< "; multiple single pointconstraints at DOF "
<< dof << " for node " << spPtr->getNodeTag()
<< std::endl;
}
// loop through the MFreedom_Constraints to see if any of the
// DOFs are constrained, note constraint matrix must be diagonal
// with 1's on the diagonal
MFreedom_ConstraintIter &theMPs = theDomain->getConstraints().getMPs();
MFreedom_Constraint *mpPtr;
while((mpPtr = theMPs()) != 0)
{
if(mpPtr->getNodeConstrained() == nodeID)
{
if(mpPtr->isTimeVarying() == true)
std::cerr << getClassName() << "::" << __FUNCTION__
<< "; time-varying constraint"
<< " for node " << nodeID
<< " non-varying assumed\n";
const Matrix &C = mpPtr->getConstraint();
int numRows = C.noRows();
int numCols = C.noCols();
if(numRows != numCols)
std::cerr << getClassName() << "::" << __FUNCTION__
<< " constraint matrix not diagonal,"
<< " ignoring constraint for node "
<< nodeID << std::endl;
else
//.........这里部分代码省略.........