Fluid structure interaction suite
mapping_eulerian.cc
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2022 by Luca Heltai
4 //
5 // This file is part of the FSI-suite platform, based on the deal.II library.
6 //
7 // The FSI-suite platform is free software; you can use it, redistribute it,
8 // and/or modify it under the terms of the GNU Lesser General Public License as
9 // published by the Free Software Foundation; either version 3.0 of the License,
10 // or (at your option) any later version. The full text of the license can be
11 // found in the file LICENSE at the top level of the FSI-suite platform
12 // distribution.
13 //
14 // ---------------------------------------------------------------------
15 
17 
18 using namespace dealii;
19 
20 namespace ParsedTools
21 {
22  template <int dim, int spacedim>
24  const DoFHandler<dim, spacedim> &dh,
25  const std::string &section_name,
26  const std::string &initial_configuration_or_displacement,
27  const bool use_displacement,
28  const ComponentMask &mask)
29  : ParameterAcceptor(section_name)
30  , dof_handler(&dh)
31  , mask(mask)
32  , use_displacement(use_displacement)
33  , initial_configuration_or_displacement_expression(
34  initial_configuration_or_displacement)
35  {
37  spacedim ==
39  ExcMessage("The number of selected components in the "
40  "mask must be " +
41  std::to_string(spacedim)));
42  add_parameter("Initial configuration or displacement",
44  "The initial configuration of the mapping. If empty, the "
45  "identity configuration is used.");
46 
48  "Use displacement",
49  this->use_displacement,
50  "If true, the expression above is interpreted as a displacement, "
51  "otherwise it is interpreted as a configuration.");
52  }
53 
54 
55 
56  template <int dim, int spacedim>
58  const
59  {
60  AssertThrow(mapping,
61  ExcMessage("You must call initialize() before using "
62  "the mapping."));
63  return *mapping;
64  }
65 
66 
67 
68  template <int dim, int spacedim>
71  {
72  AssertThrow(mapping,
73  ExcMessage("You must call initialize() before using "
74  "the mapping."));
75  return *mapping;
76  }
77 
78  template class MappingEulerian<1, 1>;
79  template class MappingEulerian<1, 2>;
80  template class MappingEulerian<1, 3>;
81  template class MappingEulerian<2, 2>;
82  template class MappingEulerian<2, 3>;
83  template class MappingEulerian<3, 3>;
84 } // namespace ParsedTools
unsigned int n_selected_components(const unsigned int overall_number_of_components=numbers::invalid_unsigned_int) const
const FiniteElement< dim, spacedim > & get_fe(const types::fe_index index=0) const
unsigned int n_components() const
void add_parameter(const std::string &entry, ParameterType &parameter, const std::string &documentation="", ParameterHandler &prm_=prm, const Patterns::PatternBase &pattern=*Patterns::Tools::Convert< ParameterType >::to_pattern())
A wrapper class for MappingFEField or MappingQEulerian.
const ComponentMask mask
What components should be interpreted as the displacement.
const Mapping< dim, spacedim > & operator()() const
Return a reference to the actual mapping.
std::string initial_configuration_or_displacement_expression
What configuration to store when the mapping is initialized.
static ::ExceptionBase & ExcMessage(std::string arg1)
#define AssertThrow(cond, exc)
We collect in this namespace some wrappers around commonly used deal.II classes, derived from the Par...