16 #ifndef parsed_tools_components_h
17 #define parsed_tools_components_h
66 template <
int dim,
int spacedim>
67 std::unique_ptr<dealii::FiniteElement<dim, spacedim>>
69 const dealii::Triangulation<dim, spacedim> &tria,
70 const unsigned int degree = 1,
71 const int continuity = 0);
82 template <
int dim,
int spacedim>
83 dealii::Quadrature<dim>
85 const unsigned int degree);
96 template <
int dim,
int spacedim>
97 dealii::Quadrature<dim - 1>
99 const unsigned int degree);
105 template <
typename Container>
107 join(
const Container &strings,
const std::string &separator);
121 n_blocks(
const std::string &component_names);
129 const std::vector<unsigned int> &multiplicities);
134 std::pair<std::vector<std::string>, std::vector<unsigned int>>
163 std::vector<unsigned int>
165 const std::string &selected_components);
197 std::vector<unsigned int>
199 const std::string &selected_components);
233 std::pair<unsigned int, unsigned int>
235 const std::string &selected_component);
263 const std::string &selected_component);
294 const std::string &selected_component);
300 dealii::ComponentMask
301 mask(
const std::string &component_names,
302 const std::string &selected_component);
308 template <
typename Container>
310 join(
const Container &strings,
const std::string &separator)
313 std::string sep =
"";
314 for (
const auto &s : strings)
324 template <
int dim,
int spacedim>
325 std::unique_ptr<dealii::FiniteElement<dim, spacedim>>
327 const dealii::Triangulation<dim, spacedim> &tria,
328 const unsigned int degree,
329 const int continuity)
331 const auto ref_cells = tria.get_reference_cells();
333 ref_cells.size() == 1,
335 "This function does nots support mixed simplx/hex grid types."));
338 "only -1 and 0 are supported for continuity"));
339 std::unique_ptr<dealii::FiniteElement<dim, spacedim>> result;
340 if (ref_cells[0].is_simplex())
343 result.reset(
new dealii::FE_SimplexP<dim, spacedim>(degree));
345 result.reset(
new dealii::FE_SimplexDGP<dim, spacedim>(degree));
349 Assert(ref_cells[0].is_hyper_cube(),
351 "Only simplex and hex cells are supported"));
353 result.reset(
new dealii::FE_Q<dim, spacedim>(degree));
355 result.reset(
new dealii::FE_DGQ<dim, spacedim>(degree));
362 template <
int dim,
int spacedim>
363 dealii::Quadrature<dim>
365 const unsigned int degree)
367 const auto ref_cells = tria.get_reference_cells();
370 ref_cells.size() == 1,
372 "This function does nots support mixed simplx/hex grid types."));
373 return ref_cells[0].template get_gauss_type_quadrature<dim>(degree);
378 template <
int dim,
int spacedim>
379 dealii::Quadrature<dim - 1>
381 const unsigned int degree)
383 if constexpr (dim == 1)
385 return dealii::QGauss<dim - 1>(degree);
389 const auto ref_cells = tria.get_reference_cells();
392 ref_cells.size() == 1,
394 "This function does nots support mixed simplx/hex grid types."));
396 const dealii::ReferenceCell face_type =
397 ref_cells[0].face_reference_cell(0);
398 return face_type.template get_gauss_type_quadrature<dim - 1>(degree);
#define Assert(cond, exc)
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)