本文整理汇总了C++中AnalysisModel::getDOFGroupGraph方法的典型用法代码示例。如果您正苦于以下问题:C++ AnalysisModel::getDOFGroupGraph方法的具体用法?C++ AnalysisModel::getDOFGroupGraph怎么用?C++ AnalysisModel::getDOFGroupGraph使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AnalysisModel
的用法示例。
在下文中一共展示了AnalysisModel::getDOFGroupGraph方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cp
int XC::ParallelNumberer::numberDOF(int lastDOF)
{
int result = 0;
// get a pointer to the model & check its not null
AnalysisModel *theModel = this->getAnalysisModelPtr();
Domain *theDomain = 0;
if(theModel) theDomain = theModel->getDomainPtr();
if(theModel == 0 || theDomain == 0)
{
std::cerr << "WARNING XC::ParallelNumberer::numberDOF(int) -";
std::cerr << " - no AnalysisModel.\n";
return -1;
}
if(lastDOF != -1)
{
std::cerr << "WARNING XC::ParallelNumberer::numberDOF(int lastDOF):";
std::cerr << " does not use the lastDOF as requested\n";
}
Graph &theGraph= theModel->getDOFGroupGraph();
// if subdomain, collect graph, send it off, get
// ID back containing dof tags & start id numbers.
if(processID != 0)
{
CommParameters cp(0,*theChannels[0]);
const int numVertex = theGraph.getNumVertex();
/*
static XC::ID test(2); test(0) = processID; test(1) = 25;
theChannel->recvID(0, 0, test);
*/
cp.sendMovable(theGraph,DistributedObj::getDbTagData(),CommMetaData(1));
// recv iD
ID theID(2*numVertex);
cp.receiveID(theID,DistributedObj::getDbTagData(),CommMetaData(2));
// set vertex numbering based on ID received
for(int i=0; i<numVertex; i ++)
{
const int vertexTag= theID(i);
int startID= theID(i+numVertex);
//Vertex *vertexPtr = theGraph.getVertexPtr(vertexTag);
const int dofTag= vertexTag;
DOF_Group *dofPtr= theModel->getDOF_GroupPtr(dofTag);
if(!dofPtr)
{
std::cerr << "WARNING ParallelNumberer::numberDOF - ";
std::cerr << "DOF_Group " << dofTag << "not in XC::AnalysisModel!\n";
result= -4;
}
else
{
const ID &theDOFID= dofPtr->getID();
//std::cerr << "P: " << processID << " dofTag: " << dofTag << " " << "start: " << startID << " " << theDOFID;
const int idSize= theDOFID.Size();
for(int j=0; j<idSize; j++)
if(theDOFID(j) == -2 || theDOFID(j) == -3) dofPtr->setID(j, startID++);
}
//const ID &theDOFID= dofPtr->getID();
}
cp.sendID(theID,DistributedObj::getDbTagData(),CommMetaData(2));
}
else
{
// if XC::main domain, collect graphs from all subdomains,
// merge into 1, number this one, send to subdomains the
// id containing dof tags & start id's.
// for P0 domain determine original vertex and ref tags
const int numVertex= theGraph.getNumVertex();
const int numVertexP0= numVertex;
ID vertexTags(numVertex);
ID vertexRefs(numVertex);
Vertex *vertexPtr;
int loc= 0;
VertexIter &theVertices= theGraph.getVertices();
while((vertexPtr= theVertices()) != 0)
{
vertexTags[loc]= vertexPtr->getTag();
vertexRefs[loc]= vertexPtr->getRef();
loc++;
}
const int numChannels= theChannels.size();
std::vector<ID> theSubdomainIDs(numChannels);
FEM_ObjectBroker theBroker;
// for each subdomain we receive graph, create an XC::ID (to store
// subdomain graph to merged graph vertex mapping and the final
// subdoain graph vertex to startDOF mapping) and finally merge the
// subdomain graph
for(int j=0; j<numChannels; j++)
//.........这里部分代码省略.........