Fluid structure interaction suite
reduced_lagrange.h
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 
16 #ifndef pdes_serial_reduced_lagrange_h
17 #define pdes_serial_reduced_lagrange_h
18 
19 #include <deal.II/base/config.h>
20 
23 #include <deal.II/base/timer.h>
24 #include <deal.II/base/utilities.h>
25 
26 #include <deal.II/fe/mapping_fe.h>
27 
29 #include <deal.II/grid/tria.h>
30 
34 #include <deal.II/lac/vector.h>
35 
36 #include "parsed_lac/amg.h"
39 #include "parsed_tools/constants.h"
41 #include "parsed_tools/data_out.h"
43 #include "parsed_tools/function.h"
47 using namespace dealii;
48 namespace PDEs
49 {
50  namespace Serial
51  {
52  template <int dim, int spacedim = dim>
53  class ReducedLagrange : public dealii::ParameterAcceptor
54  {
55  public:
57  void
58  run();
59 
60  private:
61  void
62  generate_grids_and_fes();
63  void
64  adjust_grid_refinements(const bool apply_delta_refinement = true);
65  void
66  update_basis_functions();
67  void
68  setup_dofs();
69  void
70  setup_coupling();
71  void
72  assemble_system();
73  void
74  solve();
75  void
76  output_results(const unsigned int cycle);
77 
78  // Const members go first
79  const std::string component_names = "u";
80 
81  unsigned int coupling_quadrature_order = 3;
82  unsigned int delta_refinement = 0;
83  unsigned int console_level = 1;
84  bool use_direct_solver = true;
85  unsigned int n_basis = 1;
86 
88  std::unique_ptr<FiniteElement<spacedim>> space_fe;
89  std::unique_ptr<MappingFE<spacedim>> space_mapping;
90  std::unique_ptr<GridTools::Cache<spacedim, spacedim>>
93 
95  std::unique_ptr<FiniteElement<dim, spacedim>> embedded_fe;
97  std::unique_ptr<GridTools::Cache<dim, spacedim>>
99 
100 
101  std::unique_ptr<FiniteElement<dim, spacedim>> embedded_configuration_fe;
104 
107 
110 
114 
116  {
117  identity,
118  M,
119  Minv,
120  K,
121  Minv_K_Minv
122  };
123  SchurPreconditioner schur_preconditioner = SchurPreconditioner::identity;
124 
127 
131 
135 
138 
142 
143  std::vector<Vector<double>> basis_functions;
144 
146 
147  // Parameter members
148  unsigned int finite_element_degree = 1;
149  unsigned int embedded_space_finite_element_degree = 1;
150  unsigned int embedded_configuration_finite_element_degree = 1;
151 
152  // Then all parsed classes
155 
158 
164 
168 
170 
175  };
176  } // namespace Serial
177 
178 } // namespace PDEs
179 
180 #endif
ParsedTools::Constants constants
Vector< double > embedded_configuration
SparseMatrix< double > embedded_mass_matrix
std::unique_ptr< FiniteElement< dim, spacedim > > embedded_configuration_fe
ParsedLAC::AMGPreconditioner stiffness_preconditioner
AffineConstraints< double > constraints
DoFHandler< spacedim > space_dh
ParsedTools::Function< spacedim > forcing_term
DoFHandler< dim, spacedim > embedded_dh
std::vector< Vector< double > > basis_functions
AffineConstraints< double > embedded_constraints
SparseMatrix< double > coupling_matrix
Triangulation< dim, spacedim > embedded_grid
SparseMatrix< double > embedded_stiffness_matrix
SparseMatrix< double > stiffness_matrix
std::unique_ptr< MappingFE< spacedim > > space_mapping
std::unique_ptr< FiniteElement< dim, spacedim > > embedded_fe
ParsedTools::ConvergenceTable error_table_embedded
ParsedLAC::InverseOperator schur_inverse_operator
std::unique_ptr< GridTools::Cache< dim, spacedim > > embedded_grid_tools_cache
ParsedTools::ConvergenceTable error_table_space
ParsedTools::GridGenerator< spacedim > grid_generator
ParsedTools::DataOut< spacedim > data_out
Triangulation< spacedim > space_grid
ParsedLAC::InverseOperator stiffness_inverse_operator
std::unique_ptr< GridTools::Cache< spacedim, spacedim > > space_grid_tools_cache
DoFHandler< dim, spacedim > embedded_configuration_dh
ParsedTools::GridRefinement grid_refinement
ParsedTools::MappingEulerian< dim, spacedim > embedded_mapping
ParsedTools::Function< spacedim > exact_solution
std::unique_ptr< FiniteElement< spacedim > > space_fe
ParsedTools::BoundaryConditions< spacedim > boundary_conditions
Vector< double > reduced_embedded_value
ParsedLAC::AMGPreconditioner mass_preconditioner
ParsedTools::Function< spacedim > embedded_value_function
ParsedTools::GridGenerator< dim, spacedim > embedded_grid_generator
ParsedTools::DataOut< dim, spacedim > embedded_data_out
A parsed AMG preconditioner which uses parameter files to choose between different options.
Definition: amg.h:37
A factory that can generate inverse operators according to parameter files.
A wrapper for boundary conditions.
A wrapper for physical constants to be shared among functions and classes.
Definition: constants.h:44
A wrapper for the FunctionParser class.
Definition: function.h:30
GridGenerator class.
A wrapper for refinement strategies.
A wrapper class for MappingFEField or MappingQEulerian.
A proxy ParameterAcceptor wrapper for classes that have a member function add_parameters,...
Definition: proxy.h:33
We collect in this namespace all PDEs that are relevant to Fluid Structure Interaction Problems.
void run(char **argv, const std::string &input_parameter_file, const std::string &output_parameter_file)
Setup parameters from the command line, and call the Class::run() method.
Definition: runner.h:219