Skip to content

Commit

Permalink
Introduce types::global_cell_index.
Browse files Browse the repository at this point in the history
While there, also clean up a bit of the documentation around that point
in the file.
  • Loading branch information
bangerth committed Mar 4, 2020
1 parent 406c3be commit 0ec6aa6
Showing 1 changed file with 39 additions and 16 deletions.
55 changes: 39 additions & 16 deletions include/deal.II/base/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,17 @@ namespace types

#ifdef DEAL_II_WITH_64BIT_INDICES
/**
* The type used for global indices of degrees of freedom. While in
* sequential computations the 4 billion indices of 32-bit unsigned integers
* is plenty, parallel computations using the
* The type used to denote the global index of degrees of freedom. This
* type is then also used for querying the global *number* of degrees
* of freedom, since the number is simply the largest index plus one.
*
* While in sequential computations the 4 billion indices of 32-bit unsigned
* integers is plenty, parallel computations using (for example) the
* parallel::distributed::Triangulation class can overflow this number and
* we need a bigger index space.
* consequently, deal.II chooses a larger integer type when
* configured to use 64-bit indices.
*
* The data type always indicates an unsigned integer type.
* The data type always corresponds to an unsigned integer type.
*
* See the
* @ref GlobalDoFIndex
Expand All @@ -78,13 +82,21 @@ namespace types

#else
/**
* The type used for global indices of degrees of freedom. While in
* sequential computations the 4 billion indices of 32-bit unsigned integers
* is plenty, parallel computations using the
* The type used to denote the global index of degrees of freedom. This
* type is then also used for querying the global *number* of degrees
* of freedom, since the number is simply the largest index plus one.
*
* While in sequential computations the 4 billion indices of 32-bit unsigned
* integers is plenty, parallel computations using (for example) the
* parallel::distributed::Triangulation class can overflow this number and
* we need a bigger index space.
* consequently, deal.II chooses a larger integer type when
* configured to use 64-bit indices.
*
* The data type always indicates an unsigned integer type.
* The data type always corresponds to an unsigned integer type.
*
* See the
* @ref GlobalDoFIndex
* page for guidance on when this type should or should not be used.
*/
using global_dof_index = unsigned int;

Expand All @@ -95,19 +107,30 @@ namespace types
# define DEAL_II_DOF_INDEX_MPI_TYPE MPI_UNSIGNED
#endif

#ifdef DEAL_II_WITH_64BIT_INDICES
/**
* The type used for coarse-cell ids. See the glossary
* entry on @ref GlossCoarseCellId "coarse cell IDs" for more information.
* The type used to denote the global index of a cell. This type
* is then also used for querying the global *number* of cells in
* a triangulation since the number is simply the largest index plus one.
*
* While in sequential computations the 4 billion indices of 32-bit unsigned
* integers is plenty, parallel computations using (for example) the
* parallel::distributed::Triangulation class can overflow this number and
* consequently, deal.II chooses a larger integer type when
* configured to use 64-bit indices.
*
* The data type always corresponds to an unsigned integer type.
*/
using coarse_cell_id = uint64_t;
#ifdef DEAL_II_WITH_64BIT_INDICES
using global_cell_index = uint64_t;
#else
using global_cell_index = unsigned int;
#endif

/**
* The type used for coarse-cell ids. See the glossary
* entry on @ref GlossCoarseCellId "coarse cell IDs" for more information.
*/
using coarse_cell_id = unsigned int;
#endif
using coarse_cell_id = global_cell_index;

/**
* The type used to denote boundary indicators associated with every piece
Expand Down

0 comments on commit 0ec6aa6

Please sign in to comment.