]> https://gitweb.dealii.org/ - dealii.git/commitdiff
provide access to p4est_t
authorTimo Heister <timo.heister@gmail.com>
Mon, 6 May 2019 22:08:05 +0000 (18:08 -0400)
committerTimo Heister <timo.heister@gmail.com>
Tue, 7 May 2019 13:53:06 +0000 (09:53 -0400)
I need access for the p4est object inside a distributed Triangulation.
Provide an accessor function for this.

include/deal.II/distributed/tria.h
source/distributed/tria.cc

index f373f7145f7ce29889faa5298cb44e2283d364e6..eac6147b04f86618a065d8355117f713fa853c3e 100644 (file)
@@ -815,6 +815,16 @@ namespace parallel
       const std::vector<types::global_dof_index> &
       get_coarse_cell_to_p4est_tree_permutation() const;
 
+      /**
+       * This returns a pointer to the internally stored p4est object (of type
+       * p4est_t or p8est_t depending on @p dim).
+       *
+       * @warning: If you modify the p4est object, internal data structures
+       * can become inconsistent.
+       */
+      typename dealii::internal::p4est::types<dim>::forest *
+      get_p4est() const;
+
       /**
        * In addition to the action in the base class Triangulation, this
        * function joins faces in the p4est forest for periodic boundary
index f814270c31a8e49d0ce50d3b92e198bd30d4e0a1..ddbfa0fa3f01f84605e89e2d52564ac7a9847844 100644 (file)
@@ -2887,6 +2887,17 @@ namespace parallel
 
 
 
+    template <int dim, int spacedim>
+    typename dealii::internal::p4est::types<dim>::forest *
+    Triangulation<dim, spacedim>::get_p4est() const
+    {
+      Assert(parallel_forest != nullptr,
+             ExcMessage("The forest has not been allocated yet."));
+      return parallel_forest;
+    }
+
+
+
     template <int dim, int spacedim>
     void
     Triangulation<dim, spacedim>::update_number_cache()

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.