using quadrant = p4est_quadrant_t;
using topidx = p4est_topidx_t;
using locidx = p4est_locidx_t;
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
+ using gloidx = p4est_gloidx_t;
using balance_type = p4est_connect_type_t;
-# else
- using balance_type = p4est_balance_type_t;
-# endif
- using ghost = p4est_ghost_t;
+ using ghost = p4est_ghost_t;
};
template <>
using quadrant = p8est_quadrant_t;
using topidx = p4est_topidx_t;
using locidx = p4est_locidx_t;
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
+ using gloidx = p4est_gloidx_t;
using balance_type = p8est_connect_type_t;
-# else
- using balance_type = p8est_balance_type_t;
-# endif
- using ghost = p8est_ghost_t;
+ using ghost = p8est_ghost_t;
};
types<2>::balance_type btype,
p4est_init_t init_fn);
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
- static p4est_gloidx_t (&partition)(types<2>::forest *p4est,
- int partition_for_coarsening,
- p4est_weight_t weight_fn);
-# else
- static void (&partition)(types<2>::forest *p4est,
- int partition_for_coarsening,
- p4est_weight_t weight_fn);
-# endif
+ static types<2>::gloidx (&partition)(types<2>::forest *p4est,
+ int partition_for_coarsening,
+ p4est_weight_t weight_fn);
static void (&save)(const char * filename,
types<2>::forest *p4est,
int save_data);
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
static types<2>::forest *(&load_ext)(const char *filename,
MPI_Comm mpicomm,
size_t data_size,
int broadcasthead,
void * user_pointer,
types<2>::connectivity **p4est);
-# else
- static types<2>::forest *(&load)(const char * filename,
- MPI_Comm mpicomm,
- size_t data_size,
- int load_data,
- void * user_pointer,
- types<2>::connectivity **p4est);
-# endif
-
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
+
static int (&connectivity_save)(const char * filename,
types<2>::connectivity *connectivity);
-# else
- static void (&connectivity_save)(const char * filename,
- types<2>::connectivity *connectivity);
-# endif
static int (&connectivity_is_valid)(types<2>::connectivity *connectivity);
-# if DEAL_II_P4EST_VERSION_GTE(1, 0, 0, 0)
static types<2>::connectivity *(&connectivity_load)(const char *filename,
size_t * length);
-# elif DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
- static types<2>::connectivity *(
- &connectivity_load)(const char *filename, long unsigned *length);
-# else
- static types<2>::connectivity *(&connectivity_load)(const char *filename,
- long * length);
-# endif
static unsigned int (&checksum)(types<2>::forest *p4est);
dealii::internal::p4est::types<2>::ghost * parallel_ghost,
void * user_data);
- static const unsigned int max_level = P4EST_MAXLEVEL;
+ static constexpr unsigned int max_level = P4EST_MAXLEVEL;
};
types<3>::balance_type btype,
p8est_init_t init_fn);
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
- static p4est_gloidx_t (&partition)(types<3>::forest *p8est,
- int partition_for_coarsening,
- p8est_weight_t weight_fn);
-# else
- static void (&partition)(types<3>::forest *p8est,
- int partition_for_coarsening,
- p8est_weight_t weight_fn);
-# endif
+ static types<3>::gloidx (&partition)(types<3>::forest *p8est,
+ int partition_for_coarsening,
+ p8est_weight_t weight_fn);
static void (&save)(const char * filename,
types<3>::forest *p4est,
int save_data);
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
static types<3>::forest *(&load_ext)(const char *filename,
MPI_Comm mpicomm,
std::size_t data_size,
int broadcasthead,
void * user_pointer,
types<3>::connectivity **p4est);
-# else
- static types<3>::forest *(&load)(const char * filename,
- MPI_Comm mpicomm,
- std::size_t data_size,
- int load_data,
- void * user_pointer,
- types<3>::connectivity **p4est);
-# endif
-
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
+
static int (&connectivity_save)(const char * filename,
types<3>::connectivity *connectivity);
-# else
- static void (&connectivity_save)(const char * filename,
- types<3>::connectivity *connectivity);
-# endif
static int (&connectivity_is_valid)(types<3>::connectivity *connectivity);
-# if DEAL_II_P4EST_VERSION_GTE(1, 0, 0, 0)
static types<3>::connectivity *(&connectivity_load)(const char *filename,
size_t * length);
-# elif DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
- static types<3>::connectivity *(
- &connectivity_load)(const char *filename, long unsigned *length);
-# else
- static types<3>::connectivity *(&connectivity_load)(const char *filename,
- long * length);
-# endif
static unsigned int (&checksum)(types<3>::forest *p8est);
- static const unsigned int max_level = P8EST_MAXLEVEL;
+ static constexpr unsigned int max_level = P8EST_MAXLEVEL;
};
types<2>::topidx num_corners,
types<2>::topidx num_vtt) = p4est_connectivity_new;
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 1)
void (&functions<2>::connectivity_join_faces)(types<2>::connectivity *conn,
types<2>::topidx tree_left,
types<2>::topidx tree_right,
int face_right,
int orientation) =
p4est_connectivity_join_faces;
-# endif
void (&functions<2>::connectivity_destroy)(
p4est_connectivity_t *connectivity) = p4est_connectivity_destroy;
void (&functions<2>::balance)(types<2>::forest * p4est,
types<2>::balance_type btype,
p4est_init_t init_fn) = p4est_balance;
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
- p4est_gloidx_t (&functions<2>::partition)(types<2>::forest *p4est,
- int partition_for_coarsening,
- p4est_weight_t weight_fn) =
- p4est_partition_ext;
-# else
- void (&functions<2>::partition)(types<2>::forest *p4est,
- int partition_for_coarsening,
- p4est_weight_t weight_fn) =
+ types<2>::gloidx (&functions<2>::partition)(types<2>::forest *p4est,
+ int partition_for_coarsening,
+ p4est_weight_t weight_fn) =
p4est_partition_ext;
-# endif
void (&functions<2>::save)(const char * filename,
types<2>::forest *p4est,
int save_data) = p4est_save;
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
types<2>::forest *(&functions<2>::load_ext)(
const char * filename,
MPI_Comm mpicomm,
int broadcasthead,
void * user_pointer,
types<2>::connectivity **p4est) = p4est_load_ext;
-# else
- types<2>::forest *(&functions<2>::load)(const char *filename,
- MPI_Comm mpicomm,
- std::size_t data_size,
- int load_data,
- void * user_pointer,
- types<2>::connectivity **p4est) =
- p4est_load;
-# endif
-
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
+
int (&functions<2>::connectivity_save)(
const char * filename,
types<2>::connectivity *connectivity) = p4est_connectivity_save;
-# else
- void (&functions<2>::connectivity_save)(
- const char * filename,
- types<2>::connectivity *connectivity) = p4est_connectivity_save;
-# endif
int (&functions<2>::connectivity_is_valid)(
types<2>::connectivity *connectivity) = p4est_connectivity_is_valid;
-# if DEAL_II_P4EST_VERSION_GTE(1, 0, 0, 0)
+
types<2>::connectivity *(&functions<2>::connectivity_load)(
const char *filename,
size_t * length) = p4est_connectivity_load;
-# elif DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
- types<2>::connectivity *(&functions<2>::connectivity_load)(
- const char * filename,
- long unsigned *length) = p4est_connectivity_load;
-# else
- types<2>::connectivity *(&functions<2>::connectivity_load)(
- const char *filename,
- long * length) = p4est_connectivity_load;
-# endif
unsigned int (&functions<2>::checksum)(types<2>::forest *p4est) =
p4est_checksum;
return vertices_with_ghost_neighbors;
}
- const unsigned int functions<2>::max_level;
+ constexpr unsigned int functions<2>::max_level;
void (&functions<3>::connectivity_destroy)(
p8est_connectivity_t *connectivity) = p8est_connectivity_destroy;
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 1)
void (&functions<3>::connectivity_join_faces)(types<3>::connectivity *conn,
types<3>::topidx tree_left,
types<3>::topidx tree_right,
int face_right,
int orientation) =
p8est_connectivity_join_faces;
-# endif
types<3>::forest *(&functions<3>::new_forest)(
MPI_Comm mpicomm,
types<3>::balance_type btype,
p8est_init_t init_fn) = p8est_balance;
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
- p4est_gloidx_t (&functions<3>::partition)(types<3>::forest *p8est,
- int partition_for_coarsening,
- p8est_weight_t weight_fn) =
+ types<3>::gloidx (&functions<3>::partition)(types<3>::forest *p8est,
+ int partition_for_coarsening,
+ p8est_weight_t weight_fn) =
p8est_partition_ext;
-# else
- void (&functions<3>::partition)(types<3>::forest *p8est,
- int partition_for_coarsening,
- p8est_weight_t weight_fn) =
- p8est_partition_ext;
-# endif
void (&functions<3>::save)(const char * filename,
types<3>::forest *p4est,
int save_data) = p8est_save;
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
types<3>::forest *(&functions<3>::load_ext)(
const char * filename,
MPI_Comm mpicomm,
int broadcasthead,
void * user_pointer,
types<3>::connectivity **p4est) = p8est_load_ext;
-# else
- types<3>::forest *(&functions<3>::load)(const char *filename,
- MPI_Comm mpicomm,
- std::size_t data_size,
- int load_data,
- void * user_pointer,
- types<3>::connectivity **p4est) =
- p8est_load;
-# endif
-
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
+
int (&functions<3>::connectivity_save)(
const char * filename,
types<3>::connectivity *connectivity) = p8est_connectivity_save;
-# else
- void (&functions<3>::connectivity_save)(
- const char * filename,
- types<3>::connectivity *connectivity) = p8est_connectivity_save;
-# endif
int (&functions<3>::connectivity_is_valid)(
types<3>::connectivity *connectivity) = p8est_connectivity_is_valid;
-# if DEAL_II_P4EST_VERSION_GTE(1, 0, 0, 0)
types<3>::connectivity *(&functions<3>::connectivity_load)(
const char *filename,
size_t * length) = p8est_connectivity_load;
-# elif DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
- types<3>::connectivity *(&functions<3>::connectivity_load)(
- const char * filename,
- long unsigned *length) = p8est_connectivity_load;
-# else
- types<3>::connectivity *(&functions<3>::connectivity_load)(
- const char *filename,
- long * length) = p8est_connectivity_load;
-# endif
unsigned int (&functions<3>::checksum)(types<3>::forest *p8est) =
p8est_checksum;
size_t (&functions<3>::connectivity_memory_used)(
types<3>::connectivity *p4est) = p8est_connectivity_memory_used;
- const unsigned int functions<3>::max_level;
+ constexpr unsigned int functions<3>::max_level;
ExcMessage("Incompatible version found in .info file."));
Assert(this->n_cells(0) == n_coarse_cells,
ExcMessage("Number of coarse cells differ!"));
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
-# else
- AssertThrow(
- numcpus <= Utilities::MPI::n_mpi_processes(this->mpi_communicator),
- ExcMessage(
- "parallel::distributed::Triangulation::load() only supports loading "
- "saved data with a greater or equal number of processes than were used to "
- "save() when using p4est 0.3.4.2."));
-# endif
// clear all of the callback data, as explained in the documentation of
// register_data_attach()
cell_attached_data.n_attached_datas = 0;
cell_attached_data.n_attached_deserialize = attached_count;
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 3)
parallel_forest = dealii::internal::p4est::functions<dim>::load_ext(
filename,
this->mpi_communicator,
0,
this,
&connectivity);
-# else
- (void)autopartition;
- parallel_forest =
- dealii::internal::p4est::functions<dim>::load(filename,
- this->mpi_communicator,
- attached_size,
- attached_size > 0,
- this,
- &connectivity);
-# endif
+
if (numcpus != Utilities::MPI::n_mpi_processes(this->mpi_communicator))
// We are changing the number of CPUs so we need to repartition.
// Note that p4est actually distributes the cells between the changed
const std::vector<dealii::GridTools::PeriodicFacePair<cell_iterator>>
&periodicity_vector)
{
-# if DEAL_II_P4EST_VERSION_GTE(0, 3, 4, 1)
Assert(triangulation_has_content == true,
ExcMessage("The triangulation is empty!"));
Assert(this->n_levels() == 1,
// The range of ghost_owners might have changed so update that information
this->update_number_cache();
-# else
- Assert(false, ExcMessage("Need p4est version >= 0.3.4.1!"));
-# endif
}