本文整理汇总了C++中Epetra_BlockMap::MaxAllGID64方法的典型用法代码示例。如果您正苦于以下问题:C++ Epetra_BlockMap::MaxAllGID64方法的具体用法?C++ Epetra_BlockMap::MaxAllGID64怎么用?C++ Epetra_BlockMap::MaxAllGID64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Epetra_BlockMap
的用法示例。
在下文中一共展示了Epetra_BlockMap::MaxAllGID64方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TCalculateOffset
int_type BlockUtility::TCalculateOffset(const Epetra_BlockMap & BaseMap)
{
int_type MaxGID = (int_type) BaseMap.MaxAllGID64();
// int Offset = 1;
// while( Offset <= MaxGID ) Offset *= 10;
// return Offset;
return MaxGID+1;
}
示例2: SameAs
//==============================================================================
bool Epetra_BlockMap::SameAs(const Epetra_BlockMap & Map) const {
// Quickest test: See if both maps share an inner data class
if (this->BlockMapData_ == Map.BlockMapData_)
return(true);
if(!GlobalIndicesTypeMatch(Map))
return(false);
// Next check other global properties that are easy global attributes
if (BlockMapData_->MinAllGID_ != Map.MinAllGID64() ||
BlockMapData_->MaxAllGID_ != Map.MaxAllGID64() ||
BlockMapData_->NumGlobalElements_ != Map.NumGlobalElements64() ||
BlockMapData_->IndexBase_ != Map.IndexBase())
return(false);
// Last possible global check for constant element sizes
if (BlockMapData_->ConstantElementSize_ && BlockMapData_->ElementSize_!=Map.ElementSize())
return(false);
// If we get this far, we need to check local properties and then check across
// all processors to see if local properties are all true
int numMyElements = BlockMapData_->NumMyElements_;
int MySameMap = 1; // Assume not needed
// First check if number of element is the same in each map
if (numMyElements != Map.NumMyElements()) MySameMap = 0;
// If numMyElements is the same, check to see that list of GIDs is the same
if (MySameMap==1) {
if (LinearMap() && Map.LinearMap() ) {
// For linear maps, just need to check whether lower bound is the same
if (MinMyGID64() != Map.MinMyGID64() )
MySameMap = 0;
}
else {
for (int i = 0; i < numMyElements; i++) {
if (GID64(i) != Map.GID64(i)) {
MySameMap = 0;
break;
}
}
}
}
// for (int i = 0; i < numMyElements; i++)
// if (GID64(i) != Map.GID64(i)) MySameMap = 0;
// If GIDs are the same, check to see element sizes are the same
if (MySameMap==1 && !BlockMapData_->ConstantElementSize_) {
int * sizeList1 = ElementSizeList();
int * sizeList2 = Map.ElementSizeList();
for (int i = 0; i < numMyElements; i++) if (sizeList1[i] != sizeList2[i]) MySameMap=0;
}
// Now get min of MySameMap across all processors
int GlobalSameMap = 0;
int err = Comm().MinAll(&MySameMap, &GlobalSameMap, 1);
assert(err==0);
return(GlobalSameMap==1);
}