]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Merge pull request #11572 from peterrum/simplex_get_position_vector
authorDavid Wells <drwells@email.unc.edu>
Tue, 19 Jan 2021 13:05:27 +0000 (08:05 -0500)
committerGitHub <noreply@github.com>
Tue, 19 Jan 2021 13:05:27 +0000 (08:05 -0500)
Generalize VectorTools::get_position_vector for simplex meshes

1  2 
include/deal.II/grid/reference_cell.h
source/grid/reference_cell.cc

Simple merge
index 54ee83ba0a09283b34d91e204bd79c0977c94c32,68a599be18909b7d15905d02411b48887394dae0..8ae0afa4f4d0af99b1ed8084962d4f0581e9240a
@@@ -105,7 -102,32 +105,33 @@@ namespace ReferenceCel
    }
  
  
 +
+   template <int dim, int spacedim>
+   std::unique_ptr<Mapping<dim, spacedim>>
+   get_default_mapping(const Type &reference_cell, const unsigned int degree)
+   {
+     AssertDimension(dim, get_dimension(reference_cell));
+     if (reference_cell == get_hypercube(dim))
+       return std::make_unique<MappingQGeneric<dim, spacedim>>(degree);
+     else if (reference_cell == Type::Tri || reference_cell == Type::Tet)
+       return std::make_unique<MappingFE<dim, spacedim>>(
+         Simplex::FE_P<dim, spacedim>(degree));
+     else if (reference_cell == Type::Pyramid)
+       return std::make_unique<MappingFE<dim, spacedim>>(
+         Simplex::FE_PyramidP<dim, spacedim>(degree));
+     else if (reference_cell == Type::Wedge)
+       return std::make_unique<MappingFE<dim, spacedim>>(
+         Simplex::FE_WedgeP<dim, spacedim>(degree));
+     else
+       {
+         Assert(false, ExcNotImplemented());
+       }
+     return std::make_unique<MappingQGeneric<dim, spacedim>>(degree);
+   }
    template <int dim, int spacedim>
    const Mapping<dim, spacedim> &
    get_default_linear_mapping(const Type &reference_cell)

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.