]> https://gitweb.dealii.org/ - code-gallery.git/commitdiff
Update the Maxwell-hp example. 158/head
authorDavid Wells <drwells@email.unc.edu>
Tue, 8 Aug 2023 12:46:53 +0000 (08:46 -0400)
committerDavid Wells <drwells@email.unc.edu>
Tue, 8 Aug 2023 12:46:53 +0000 (08:46 -0400)
We made some breaking changes right after the 9.5 release. Lets keep things
working both with the most recent release and the present prerelease.

Maxwell-Eigenvalue-hp-Refinement/maxwell-hp.cc

index 1d59cb5b2a32194de13a1bcb68c1c315ff032884..8134ead90c041c8eaca90cb731ee6bfdae15db9d 100644 (file)
@@ -1679,7 +1679,11 @@ namespace ErrorIndicators
     void
     prune_eigenpairs(const double &TOL);
 
+#if DEAL_II_VERSION_GTE(9, 6, 0)
+    std::vector<const ReadVector<PetscScalar> *>    eigenfunction_ptrs;
+#else
     std::vector<const PETScWrappers::MPI::Vector *> eigenfunction_ptrs;
+#endif
     std::vector<const double *>                     eigenvalue_ptrs;
 
     std::vector<std::shared_ptr<Vector<float>>> errors;
@@ -1810,11 +1814,21 @@ namespace ErrorIndicators
         estimated_error_per_cell[i] = errors[i].get();
       }
 
+#if DEAL_II_VERSION_GTE(9, 6, 0)
+    const auto solution_view = make_array_view(eigenfunction_ptrs);
+    auto error_view = make_array_view(estimated_error_per_cell);
+    KellyErrorEstimator<dim>::estimate(this->dof_handler,
+                                       *this->face_quadrature_collection,
+                                       {},
+                                       solution_view,
+                                       error_view);
+#else
     KellyErrorEstimator<dim>::estimate(this->dof_handler,
                                        *this->face_quadrature_collection,
                                        {},
                                        eigenfunction_ptrs,
                                        estimated_error_per_cell);
+#endif
 
     for (auto &error_vec : errors)
       {

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.