本文整理汇总了C++中Epetra_BlockMap::MaxAllGID方法的典型用法代码示例。如果您正苦于以下问题:C++ Epetra_BlockMap::MaxAllGID方法的具体用法?C++ Epetra_BlockMap::MaxAllGID怎么用?C++ Epetra_BlockMap::MaxAllGID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Epetra_BlockMap
的用法示例。
在下文中一共展示了Epetra_BlockMap::MaxAllGID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: roundRobinMapShared
ArrayRCP<zgno_t> roundRobinMap(const Epetra_BlockMap &emap)
{
const Epetra_Comm &comm = emap.Comm();
int proc = comm.MyPID();
int nprocs = comm.NumProc();
zgno_t basegid = emap.MinAllGID();
zgno_t maxgid = emap.MaxAllGID();
size_t nglobalrows = emap.NumGlobalElements();
return roundRobinMapShared(proc, nprocs, basegid, maxgid, nglobalrows);
}
示例2: checkmap
int checkmap(Epetra_BlockMap & Map, int NumGlobalElements, int NumMyElements,
int *MyGlobalElements, int ElementSize, int * ElementSizeList,
int NumGlobalPoints, int NumMyPoints,
int IndexBase, Epetra_Comm& Comm,
bool DistributedGlobal,
bool IsOneToOne)
{
int i, ierr=0, forierr=0;// forierr is used in for loops, then is tested
// after for loop completes to see if it is non zero - potentially prevents
// thousands of error messages
if (ElementSizeList==0)
{
EPETRA_TEST_ERR(!Map.ConstantElementSize(),ierr);
}
else
EPETRA_TEST_ERR(Map.ConstantElementSize(),ierr);
EPETRA_TEST_ERR(DistributedGlobal!=Map.DistributedGlobal(),ierr);
EPETRA_TEST_ERR(IsOneToOne!=Map.IsOneToOne(),ierr);
int *MyElementSizeList;
if (ElementSizeList==0)
{
EPETRA_TEST_ERR(Map.ElementSize()!=ElementSize,ierr);
MyElementSizeList = new int[NumMyElements];
EPETRA_TEST_ERR(Map.ElementSizeList(MyElementSizeList)!=0,ierr);
forierr = 0;
for (i=0; i<NumMyElements; i++)
forierr += MyElementSizeList[i]!=ElementSize;
EPETRA_TEST_ERR(forierr,ierr);
EPETRA_TEST_ERR(Map.MaxMyElementSize() != ElementSize,ierr);
EPETRA_TEST_ERR(Map.MinMyElementSize() != ElementSize,ierr);
}
else
{
MyElementSizeList = new int[NumMyElements];
EPETRA_TEST_ERR(Map.ElementSizeList(MyElementSizeList)!=0,ierr);
int MaxSize = MyElementSizeList[0];
int MinSize = MyElementSizeList[0];
forierr=0;
for (i=0; i<NumMyElements; i++) {
forierr += MyElementSizeList[i]!=ElementSizeList[i];
if (MyElementSizeList[i] > MaxSize)
MaxSize = MyElementSizeList[i];
if (MyElementSizeList[i] < MinSize)
MinSize = MyElementSizeList[i];
// Test ElementSize(int LID) method
forierr += Map.ElementSize(Map.LID(MyGlobalElements[i])) != ElementSizeList[i];
}
EPETRA_TEST_ERR(forierr,ierr);
EPETRA_TEST_ERR(MaxSize !=Map.MaxMyElementSize(),ierr);
EPETRA_TEST_ERR(MinSize !=Map.MinMyElementSize(),ierr);
}
const Epetra_Comm & Comm1 = Map.Comm();
EPETRA_TEST_ERR(Comm1.NumProc()!=Comm.NumProc(),ierr);
EPETRA_TEST_ERR(Comm1.MyPID()!=Comm.MyPID(),ierr);
EPETRA_TEST_ERR(Map.IndexBase()!=IndexBase,ierr);
EPETRA_TEST_ERR(!Map.LinearMap() && MyGlobalElements==0,ierr);
EPETRA_TEST_ERR(Map.LinearMap() && MyGlobalElements!=0,ierr);
EPETRA_TEST_ERR(Map.MaxAllGID()!=NumGlobalElements-1+IndexBase,ierr);
EPETRA_TEST_ERR(Map.MaxElementSize()!=ElementSize,ierr);
int MaxLID = Map.MaxLID();
EPETRA_TEST_ERR(MaxLID!=NumMyElements-1,ierr);
int MaxMyGID = (Comm.MyPID()+1)*NumMyElements-1+IndexBase;
if (Comm.MyPID()>2) MaxMyGID+=3;
if (!DistributedGlobal) MaxMyGID = NumMyElements-1+IndexBase;
EPETRA_TEST_ERR(Map.MaxMyGID()!=MaxMyGID,ierr);
EPETRA_TEST_ERR(Map.MinAllGID()!=IndexBase,ierr);
if (ElementSizeList==0)
{
EPETRA_TEST_ERR(Map.MinElementSize()!=ElementSize,ierr);
}
else EPETRA_TEST_ERR(Map.MinElementSize()!=2,ierr);
int MinLID = Map.MinLID();
EPETRA_TEST_ERR(MinLID!=0,ierr);
int MinMyGID = Comm.MyPID()*NumMyElements+IndexBase;
//.........这里部分代码省略.........