本文整理汇总了C++中Domain::giveElementPlaceInArray方法的典型用法代码示例。如果您正苦于以下问题:C++ Domain::giveElementPlaceInArray方法的具体用法?C++ Domain::giveElementPlaceInArray怎么用?C++ Domain::giveElementPlaceInArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Domain
的用法示例。
在下文中一共展示了Domain::giveElementPlaceInArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateNodeEnrichmentItemMap
void XfemManager :: updateNodeEnrichmentItemMap()
{
Domain *domain = giveDomain();
int nDMan = domain->giveNumberOfDofManagers();
mNodeEnrichmentItemIndices.clear();
mNodeEnrichmentItemIndices.resize(nDMan);
int nElem = domain->giveNumberOfElements();
mElementEnrichmentItemIndices.clear();
for ( int i = 1; i <= nElem; i++ ) {
int elIndex = domain->giveElement(i)->giveGlobalNumber();
int elPlaceInArray = domain->giveElementPlaceInArray(elIndex);
if ( i != elPlaceInArray ) {
printf("i != elPlaceInArray.\n");
exit(0);
}
mElementEnrichmentItemIndices [ elPlaceInArray ].clear();
}
int nEI = giveNumberOfEnrichmentItems();
for ( int eiIndex = 1; eiIndex <= nEI; eiIndex++ ) {
EnrichmentItem *ei = giveEnrichmentItem(eiIndex);
const std :: unordered_map< int, NodeEnrichmentType > &enrNodeInd = ei->giveEnrNodeMap();
//for(size_t i = 0; i < enrNodeInd.size(); i++) {
for ( auto &nodeEiPair: enrNodeInd ) {
mNodeEnrichmentItemIndices [ nodeEiPair.first - 1 ].push_back(eiIndex);
ConnectivityTable *ct = domain->giveConnectivityTable();
//const IntArray *nodeElements = ct->giveDofManConnectivityArray(nodeEiPair.first);
IntArray nodeElements;
IntArray nodeList = {
nodeEiPair.first
};
ct->giveNodeNeighbourList(nodeElements, nodeList);
for ( int i = 1; i <= nodeElements.giveSize(); i++ ) {
int elInd = nodeElements.at(i);
bool found = false;
for ( size_t j = 0; j < mElementEnrichmentItemIndices [ elInd ].size(); j++ ) {
if ( mElementEnrichmentItemIndices [ elInd ] [ j ] == eiIndex ) {
found = true;
break;
}
}
if ( !found ) {
mElementEnrichmentItemIndices [ elInd ].push_back(eiIndex);
}
}
}
}
mMaterialModifyingEnrItemIndices.clear();
for ( int eiIndex = 1; eiIndex <= nEI; eiIndex++ ) {
EnrichmentItem *ei = giveEnrichmentItem(eiIndex);
if ( ei->canModifyMaterial() ) {
mMaterialModifyingEnrItemIndices.push_back(eiIndex);
}
}
}