44#ifndef EPETRA_BLOCKMAP_H
45#define EPETRA_BLOCKMAP_H
224#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
227#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
262#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
266#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
310#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
315#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
362#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
368#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
379#if defined(EPETRA_NO_32BIT_GLOBAL_INDICES) && defined(EPETRA_NO_64BIT_GLOBAL_INDICES)
387#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
389 const long long * myGlobalElements,
390 int ElementSize,
int indexBase,
392 bool UserIsDistributedGlobal,
393 long long UserMinAllGID,
long long UserMaxAllGID);
395 const long long * myGlobalElements,
396 int ElementSize,
long long indexBase,
398 bool UserIsDistributedGlobal,
399 long long UserMinAllGID,
long long UserMaxAllGID);
402#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
404 const int * myGlobalElements,
405 int ElementSize,
int indexBase,
407 bool UserIsDistributedGlobal,
408 int UserMinAllGID,
int UserMaxAllGID);
429#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
430 int RemoteIDList(
int NumIDs,
const int * GIDList,
int * PIDList,
int * LIDList)
const {
431 return(
RemoteIDList(NumIDs, GIDList, PIDList, LIDList, 0));
434#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
435 int RemoteIDList(
int NumIDs,
const long long * GIDList,
int * PIDList,
int * LIDList)
const {
436 return(
RemoteIDList(NumIDs, GIDList, PIDList, LIDList, 0));
446#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
447 int RemoteIDList(
int NumIDs,
const int * GIDList,
int * PIDList,
int * LIDList,
int * SizeList)
const;
449#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
450 int RemoteIDList(
int NumIDs,
const long long * GIDList,
int * PIDList,
int * LIDList,
int * SizeList)
const;
454#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
455 int LID(
int GID)
const;
457#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
458 int LID(
long long GID)
const;
461#if defined(EPETRA_NO_32BIT_GLOBAL_INDICES) && defined(EPETRA_NO_64BIT_GLOBAL_INDICES)
464 int LID(
long long GID)
const {
return -1; }
465 bool MyGID(
long long GID_in)
const {
return false; }
469#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
470 int GID(
int LID)
const;
472 long long GID64(
int LID)
const;
475 int FindLocalElementID(
int PointID,
int & ElementID,
int & ElementOffset)
const;
478#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
479 bool MyGID(
int GID_in)
const {
return(
LID(GID_in)!=-1);};
481#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
482 bool MyGID(
long long GID_in)
const {
return(
LID(GID_in)!=-1);};
489 (lid < BlockMapData_->MinLID_) || (lid >
BlockMapData_->MaxLID_)) {
496#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
500 throw "Epetra_BlockMap::MinAllGID: GlobalIndices not int.";
506#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
510 throw "Epetra_BlockMap::MaxAllGID: GlobalIndices not int.";
516#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
520 throw "Epetra_BlockMap::MinMyGID: GlobalIndices not int.";
526#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
530 throw "Epetra_BlockMap::MaxMyGID: GlobalIndices not int.";
545#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
549 throw "Epetra_BlockMap::NumGlobalElements: GlobalIndices not int.";
558#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
559 int MyGlobalElements(
int * MyGlobalElementList)
const;
561#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
562 int MyGlobalElements(
long long * MyGlobalElementList)
const;
565#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
566 int MyGlobalElementsPtr(
int *& MyGlobalElementList)
const;
568#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
569 int MyGlobalElementsPtr(
long long *& MyGlobalElementList)
const;
576 int ElementSize(
int LID)
const;
582 int FirstPointInElement(
int LID)
const;
584#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
589 throw "Epetra_BlockMap::IndexBase: GlobalIndices not int and IndexBase cannot fit an int.";
595#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
599 throw "Epetra_BlockMap::NumGlobalPoints: GlobalIndices not int.";
643 bool GlobalIndicesInt() const { return BlockMapData_->GlobalIndicesInt_; }
645#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
647 bool GlobalIndicesLongLong() const { return BlockMapData_->GlobalIndicesLongLong_; }
649*******************************************************************************
657 template<
typename int_type>
665#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
668#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
701#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
702 int * MyGlobalElements()
const;
704#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
705 long long * MyGlobalElements64()
const;
710#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
716#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
726#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
732#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
744 int * FirstPointInElementList()
const;
747 int * ElementSizeList()
const;
750 int * PointToElementList()
const;
753 int ElementSizeList(
int * ElementSizeList)
const;
756 int FirstPointInElementList(
int * FirstPointInElementList)
const;
759 int PointToElementList(
int * PointToElementList)
const;
767 virtual void Print(std::ostream & os)
const;
772 bool IsOneToOne()
const;
868 void GlobalToLocalSetup();
869 bool DetermineIsOneToOne()
const;
870 bool IsDistributedGlobal(
long long NumGlobalElements,
int NumMyElements)
const;
871 void CheckValidNGE(
long long NumGlobalElements);
872 void EndOfConstructorOps();
883 long long Index_Base,
const Epetra_Comm& comm,
bool IsLongLong);
886 int Element_Size,
long long Index_Base,
const Epetra_Comm& comm,
bool IsLongLong);
888 template<
typename int_type>
890 const int_type * myGlobalElements,
891 int Element_Size, int_type indexBase,
894 template<
typename int_type>
896 const int_type * myGlobalElements,
897 const int *elementSizeList, int_type indexBase,
900 template<
typename int_type>
902 const int_type * myGlobalElements,
905 bool UserIsDistributedGlobal,
906 int_type UserMinAllGID, int_type UserMaxAllGID);
908 template<
typename int_type>
911 template<
typename int_type>
914 template<
typename int_type>
917 template<
typename int_type>
921#ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
928#ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
Epetra_BlockMapData: The Epetra BlockMap Data Class.
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
long long IndexBase64() const
int MinAllGID() const
Returns the minimum global ID across the entire map.
int SizeMyGlobalElement(int n)
int_type & MyGlobalElementVal(int i)
int RemoteIDList(int NumIDs, const int *GIDList, int *PIDList, int *LIDList) const
Returns the processor IDs and corresponding local index value for a given list of global indices.
void ConstructUserLinear(long long NumGlobal_Elements, int NumMy_Elements, int Element_Size, long long Index_Base, const Epetra_Comm &comm, bool IsLongLong)
int MaxElementSize() const
Maximum element size across all processors.
int MyGlobalElements(int *MyGlobalElementList) const
Puts list of global elements on this processor into the user-provided array.
long long * MyGlobalElements64() const
bool GlobalIndicesIsType() const
int MinMyElementSize() const
Minimum element size on the calling processor.
int_type MyGlobalElementValGet(int i)
long long MaxAllGID64() const
int MinMyGID() const
Returns the minimum global ID owned by this processor.
long long MaxMyGID64() const
bool GlobalIndicesTypeMatch(const Epetra_BlockMap &other) const
bool GlobalIndicesTypeValid() const
void ConstructAutoUniform(long long NumGlobal_Elements, int Element_Size, long long Index_Base, const Epetra_Comm &comm, bool IsLongLong)
int * ElementSizeList() const
List of the element sizes corresponding to the array MyGlobalElements().
Epetra_BlockMap(int NumGlobalElements, int ElementSize, int IndexBase, const Epetra_Comm &Comm)
Epetra_BlockMap constructor for a Epetra-defined uniform linear distribution of constant size element...
void ConstructUserVariable(int_type NumGlobal_Elements, int NumMy_Elements, const int_type *myGlobalElements, const int *elementSizeList, int_type indexBase, const Epetra_Comm &comm, bool IsLongLong)
bool MyGID(long long GID_in) const
bool DistributedGlobal() const
Returns true if map is defined across more than one processor.
void TGlobalToLocalSetup()
int NumMyPoints() const
Number of local points for this map; equals the sum of all element sizes on the calling processor.
int ReferenceCount() const
Returns the reference count of BlockMapData.
int LID(int GID) const
Returns local ID of global ID, return -1 if not found on this processor.
bool LinearMap() const
Returns true if the global ID space is contiguously divided (but not necessarily uniformly) across al...
int IndexBase() const
Index base for this map.
Epetra_BlockMapData * BlockMapData_
int RemoteIDList(int NumIDs, const long long *GIDList, int *PIDList, int *LIDList) const
int MaxAllGID() const
Returns the maximum global ID across the entire map.
friend class Epetra_LocalMap
int ElementSize() const
Returns the size of elements in the map; only valid if map has constant element size.
void MyGlobalElements(int *&IntGIDs, long long *&LLGIDs)
int MaxMyElementSize() const
Maximum element size on the calling processor.
int MinLID() const
The minimum local index value on the calling processor.
bool UniqueGIDs() const
Returns true if map GIDs are 1-to-1.
long long NumGlobalElements64() const
void MyGlobalElements(const int *&IntGIDs, const long long *&LLGIDs) const
bool GlobalIndicesInt() const
Returns true if map create with int NumGlobalElements.
int MinElementSize() const
Minimum element size across all processors.
int NumGlobalElements() const
Number of elements across all processors.
const Epetra_Comm & Comm() const
Access function for Epetra_Comm communicator.
bool ConstantElementSize() const
Returns true if map has constant element size.
const Epetra_BlockMapData * DataPtr() const
Returns a pointer to the BlockMapData instance this BlockMap uses.
friend class Epetra_Directory
long long MinAllGID64() const
long long MinMyGID64() const
int NumMyElements() const
Number of elements on the calling processor.
bool MyLID(int lid) const
Returns true if the LID passed in belongs to the calling processor in this map, otherwise returns fal...
long long NumGlobalPoints64() const
void ConstructUserConstantNoComm(int_type NumGlobal_Elements, int NumMy_Elements, const int_type *myGlobalElements, int ElementSize, int_type indexBase, const Epetra_Comm &comm, bool IsLongLong, bool UserIsDistributedGlobal, int_type UserMinAllGID, int_type UserMaxAllGID)
int MaxLID() const
The maximum local index value on the calling processor.
int NumGlobalPoints() const
Number of global points for this map; equals the sum of all element sizes across all processors.
void ConstructUserConstant(int_type NumGlobal_Elements, int NumMy_Elements, const int_type *myGlobalElements, int Element_Size, int_type indexBase, const Epetra_Comm &comm, bool IsLongLong)
bool MyGID(int GID_in) const
Returns true if the GID passed in belongs to the calling processor in this map, otherwise returns fal...
bool GlobalIndicesLongLong() const
Returns true if map create with long long NumGlobalElements.
int MaxMyGID() const
Returns the maximum global ID owned by this processor.
Epetra_Comm: The Epetra Communication Abstract Base Class.
virtual void Print(std::ostream &os) const
Print object to an output stream Print method.
Epetra_Object(int TracebackModeIn=-1, bool set_label=true)
Epetra_Object Constructor.
Epetra_Object & operator=(const Epetra_Object &src)