当前位置: 首页>>代码示例>>C++>>正文


C++ AnalysisModel::getNumDOF_Groups方法代码示例

本文整理汇总了C++中AnalysisModel::getNumDOF_Groups方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisModel::getNumDOF_Groups方法的具体用法?C++ AnalysisModel::getNumDOF_Groups怎么用?C++ AnalysisModel::getNumDOF_Groups使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AnalysisModel的用法示例。


在下文中一共展示了AnalysisModel::getNumDOF_Groups方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: vrt

//! @brief Constructor.
//!
//! The constructor is responsible for constructing the graph given {\em
//! theModel}. It creates the vertices of the graph, one for every
//! equation  (each DOF that has not been constrained out by the
//! constraint handler)  in the model and adds all edges based on the
//! FE\_Element connectivity. For this reason the model must be fully
//! populated with the DOF\_Group and FE\_Element objects before
// the constructor is called.
XC::DOF_GroupGraph::DOF_GroupGraph(const AnalysisModel &theModel)
  :ModelGraph(theModel.getNumDOF_Groups()+START_VERTEX_NUM,theModel)
  {
    assert(myModel);
    const int numVertex= myModel->getNumDOF_Groups();

    if(numVertex>0)
      {
	
        const DOF_Group *dofGroupPtr= nullptr;

        // now create the vertices with a reference equal to the DOF_Group number.
        // and a tag which ranges from 0 through numVertex-1
        DOF_GrpConstIter &dofIter2 = myModel->getConstDOFs();
        while((dofGroupPtr = dofIter2()) != 0)
          {
	    const int DOF_GroupTag = dofGroupPtr->getTag();
            const int DOF_GroupNodeTag = dofGroupPtr->getNodeTag();
	    const int numDOF = dofGroupPtr->getNumFreeDOF();
            Vertex vrt(DOF_GroupTag, DOF_GroupNodeTag, 0, numDOF);
            this->addVertex(vrt);
          }


        // now add the edges, by looping over the Elements, getting their
        // IDs and adding edges between DOFs for equation numbers >= START_EQN_NUM
    
        const FE_Element *elePtr= nullptr;
        FE_EleConstIter &eleIter = myModel->getConstFEs();
        while((elePtr = eleIter()) != 0)
          {
	    const ID &id= elePtr->getDOFtags();
	    const 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)
                    {
		      const int dof2 = id(j);
		      this->addEdge(dof1,dof2);
		    }
	      }
          }
      }
  }
开发者ID:lcpt,项目名称:xc,代码行数:55,代码来源:DOF_GroupGraph.cpp


注:本文中的AnalysisModel::getNumDOF_Groups方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。