ASPECT
handler.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2021 by the authors of the ASPECT code.
3 
4  This file is part of ASPECT.
5 
6  ASPECT is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2, or (at your option)
9  any later version.
10 
11  ASPECT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with ASPECT; see the file doc/COPYING. If not see
18  <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef _aspect_volume_of_fluid_handler_h
22 #define _aspect_volume_of_fluid_handler_h
23 
24 #include <aspect/simulator.h>
28 
29 #include <boost/serialization/map.hpp>
30 
31 using namespace dealii;
32 
33 namespace aspect
34 {
41  template <int dim>
42  class VolumeOfFluidHandler : public SimulatorAccess<dim>
43  {
44  public:
48  VolumeOfFluidHandler(Simulator<dim> &simulator, ParameterHandler &prm);
49 
54  void edit_finite_element_variables (std::vector<VariableDeclaration<dim>> &vars);
55 
59  static
60  void declare_parameters (ParameterHandler &prm);
61 
65  void parse_parameters (ParameterHandler &prm);
66 
70  unsigned int get_n_fields() const;
71 
75  const std::string name_for_field_index(unsigned int i) const;
76 
81  const VolumeOfFluidField<dim> &field_struct_for_field_index(unsigned int i) const;
82 
86  double get_volume_fraction_threshold() const;
87 
91  unsigned int field_index_for_name(const std::string &fieldname) const;
92 
97  void initialize (ParameterHandler &prm);
98 
102  void set_initial_volume_fractions ();
103 
107  void initialize_from_composition_field (const VolumeOfFluidField<dim> &field);
108 
112  void initialize_from_level_set (const VolumeOfFluidField<dim> &field);
113 
117  void update_volume_of_fluid_normals (const VolumeOfFluidField<dim> &field,
118  LinearAlgebra::BlockVector &solution);
119 
125  void update_volume_of_fluid_composition (const typename Simulator<dim>::AdvectionField &composition_field,
126  const VolumeOfFluidField<dim> &volume_of_fluid_field,
127  LinearAlgebra::BlockVector &solution);
128 
132  void do_volume_of_fluid_update (const typename Simulator<dim>::AdvectionField &advection_field);
133 
142  void assemble_volume_of_fluid_system (const VolumeOfFluidField<dim> &field,
143  const unsigned int calculation_dim,
144  const bool update_from_old_solution);
145 
150  void solve_volume_of_fluid_system (const VolumeOfFluidField<dim> &field);
151 
152 
153  private:
158 
163  void copy_local_to_global_volume_of_fluid_system (const internal::Assembly::CopyData::VolumeOfFluidSystem<dim> &data);
164 
169 
174 
179  std::vector<VolumeOfFluidField<dim>> data;
180 
186 
190  static constexpr double volume_of_fluid_reconstruct_epsilon = 1e-13;
191 
196 
201  unsigned int n_init_samples;
202 
207  std::vector<std::string> volume_of_fluid_field_names;
208 
212  std::map<unsigned int, unsigned int> volume_of_fluid_composition_map_index;
213 
219  std::vector<VolumeOfFluid::VolumeOfFluidInputType::Kind> initialization_data_type;
220 
221  friend class Simulator<dim>;
222  };
223 
224 }
225 
226 #endif
std::vector< std::string > volume_of_fluid_field_names
Definition: handler.h:207
::TrilinosWrappers::MPI::BlockVector BlockVector
Definition: global.h:239
std::vector< VolumeOfFluidField< dim > > data
Definition: handler.h:179
Assemblers::VolumeOfFluidAssembler< dim > assembler
Definition: handler.h:168
std::vector< VolumeOfFluid::VolumeOfFluidInputType::Kind > initialization_data_type
Definition: handler.h:219
void declare_parameters(ParameterHandler &prm)
Simulator< dim > & sim
Definition: handler.h:157
double volume_of_fluid_solver_tolerance
Definition: handler.h:195
unsigned int n_volume_of_fluid_fields
Definition: handler.h:173
std::map< unsigned int, unsigned int > volume_of_fluid_composition_map_index
Definition: handler.h:212
unsigned int n_init_samples
Definition: handler.h:201
Definition: compat.h:42