本文整理汇总了C++中DOF_Group::getNumFreeDOF方法的典型用法代码示例。如果您正苦于以下问题:C++ DOF_Group::getNumFreeDOF方法的具体用法?C++ DOF_Group::getNumFreeDOF怎么用?C++ DOF_Group::getNumFreeDOF使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DOF_Group
的用法示例。
在下文中一共展示了DOF_Group::getNumFreeDOF方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MapOfTaggedObjects
Graph &
AnalysisModel::getDOFGroupGraph(void)
{
if (myGroupGraph == 0) {
int numVertex = this->getNumDOF_Groups();
if (numVertex == 0) {
opserr << "WARNING AnalysisMode::getGroupGraph";
opserr << " - 0 vertices, has the Domain been populated?\n";
exit(-1);
}
// myGroupGraph = new Graph(numVertex);
MapOfTaggedObjects *graphStorage = new MapOfTaggedObjects();
myGroupGraph = new Graph(*graphStorage);
if (numVertex == 0) {
opserr << "WARNING AnalysisMode::getGroupGraph";
opserr << " - out of memory\n";
exit(-1);
}
DOF_Group *dofPtr;
// now create the vertices with a reference equal to the DOF_Group number.
// and a tag which ranges from 0 through numVertex-1
DOF_GrpIter &dofIter2 = this->getDOFs();
int count = START_VERTEX_NUM;
while ((dofPtr = dofIter2()) != 0) {
int DOF_GroupTag = dofPtr->getTag();
int DOF_GroupNodeTag = dofPtr->getNodeTag();
int numDOF = dofPtr->getNumFreeDOF();
Vertex *vertexPtr = new Vertex(DOF_GroupTag, DOF_GroupNodeTag, 0, numDOF);
if (vertexPtr == 0) {
opserr << "WARNING DOF_GroupGraph::DOF_GroupGraph";
opserr << " - Not Enough Memory to create ";
opserr << count << "th Vertex\n";
return *myGroupGraph;
}
myGroupGraph->addVertex(vertexPtr);
}
// now add the edges, by looping over the Elements, getting their
// IDs and adding edges between DOFs for equation numbers >= START_EQN_NUM
FE_Element *elePtr;
FE_EleIter &eleIter = this->getFEs();
while((elePtr = eleIter()) != 0) {
const ID &id = elePtr->getDOFtags();
int size = id.Size();
for (int i=0; i<size; i++) {
int dof1 = id(i);
for (int j=0; j<size; j++)
if (i != j) {
int dof2 = id(j);
myGroupGraph->addEdge(dof1,dof2);
}
}
}
}
return *myGroupGraph;
}