ASPECT
assembly.h
Go to the documentation of this file.
1 // ------------------------------------------------------
2 //
3 // SPDX-License-Identifier: GPL-2.0-or-later
4 //
5 // SPDX-FileCopyrightText: Copyright (C) 2016-2025 by the ASPECT authors.
6 //
7 // This file is part of ASPECT.
8 //
9 // Detailed license information governing the source code and
10 // contributions can be found in the folder LICENSES and in
11 // LICENSE and CONTRIBUTING.md at the top level directory.
12 //
13 // ------------------------------------------------------
14 
15 #ifndef _aspect_volume_of_fluid_assembly_h
16 #define _aspect_volume_of_fluid_assembly_h
17 
18 #include <aspect/global.h>
20 
21 #include <deal.II/fe/fe_values.h>
22 
23 namespace aspect
24 {
25  template <int dim>
26  class Simulator;
27 
28  template <int dim>
30 
31  namespace internal
32  {
33  namespace Assembly
34  {
35  namespace Scratch
36  {
40  template <int dim>
42  {
43  VolumeOfFluidSystem (const FiniteElement<dim> &finite_element,
44  const FiniteElement<dim> &volume_of_fluid_element,
45  const Mapping<dim> &mapping,
46  const Quadrature<dim> &quadrature,
47  const Quadrature<dim-1> &face_quadrature);
48 
50 
56 
62 
63  std::vector<types::global_dof_index> local_dof_indices;
64 
65  // Field for exact cell volume (needed in some of the face flux calculations)
66  double volume;
67 
76  std::vector<double> phi_field;
77  std::vector<double> face_phi_field;
78 
79  std::vector<double> old_field_values;
80  /* Vector for interface normal in the unit cell */
81  std::vector<Tensor<1,dim>> cell_i_n_values;
82  /* "Distance" from cell center to interface as d value for the interface in the form @f$\vec{n}\cdot\vec{x}=d@f$ */
83  std::vector<double> cell_i_d_values;
84 
85  std::vector<Tensor<1,dim>> face_current_velocity_values;
86  std::vector<Tensor<1,dim>> face_old_velocity_values;
87  std::vector<Tensor<1,dim>> face_old_old_velocity_values;
88 
89  std::vector<double> neighbor_old_values;
90  /* Vector for interface normal in the unit cell */
91  std::vector<Tensor<1,dim>> neighbor_i_n_values;
92  /* "Distance" from cell center to interface as d value for the interface in the form @f$\vec{n}\cdot\vec{x}=d@f$ */
93  std::vector<double> neighbor_i_d_values;
94  };
95  }
96 
97  namespace CopyData
98  {
102  template <int dim>
104  {
111  VolumeOfFluidSystem(const FiniteElement<dim> &finite_element);
113 
119 
126 
134  std::vector<Vector<double>> local_face_rhs;
135  std::vector<FullMatrix<double>> local_face_matrices_ext_ext;
136 
146  std::vector<bool> face_contributions_mask;
147 
157  std::vector<types::global_dof_index> local_dof_indices;
158 
167  std::vector<std::vector<types::global_dof_index>> neighbor_dof_indices;
168  };
169  }
170  }
171  }
172 
173  namespace Assemblers
174  {
175 
179  template <int dim>
181  {
182  public:
187  void local_assemble_volume_of_fluid_system (const VolumeOfFluidField<dim> &field,
188  const unsigned int calc_dir,
189  const bool update_from_old,
190  const typename DoFHandler<dim>::active_cell_iterator &cell,
193 
197  void local_assemble_boundary_face_volume_of_fluid_system (const VolumeOfFluidField<dim> &field,
198  const bool update_from_old,
199  const typename DoFHandler<dim>::active_cell_iterator &cell,
200  const unsigned int face_no,
203 
207  void local_assemble_internal_face_volume_of_fluid_system (const VolumeOfFluidField<dim> &field,
208  const bool update_from_old,
209  const typename DoFHandler<dim>::active_cell_iterator &cell,
210  const unsigned int face_no,
213 
217  void set_volume_fraction_threshold(const double value);
218  };
219  }
220 }
221 
222 
223 #endif
std::vector< std::vector< types::global_dof_index > > neighbor_dof_indices
Definition: assembly.h:167
VolumeOfFluidSystem & operator=(const VolumeOfFluidSystem &)=default
std::vector< index_type > data
std::vector< Vector< double > > local_face_rhs
Definition: assembly.h:134
std::vector< Tensor< 1, dim > > cell_i_n_values
Definition: assembly.h:81
std::vector< Tensor< 1, dim > > neighbor_i_n_values
Definition: assembly.h:91
std::vector< Tensor< 1, dim > > face_current_velocity_values
Definition: assembly.h:85
std::vector< FullMatrix< double > > local_face_matrices_ext_ext
Definition: assembly.h:135
std::vector< Tensor< 1, dim > > face_old_old_velocity_values
Definition: assembly.h:87
std::vector< Tensor< 1, dim > > face_old_velocity_values
Definition: assembly.h:86
VolumeOfFluidSystem(const FiniteElement< dim > &finite_element, const FiniteElement< dim > &volume_of_fluid_element, const Mapping< dim > &mapping, const Quadrature< dim > &quadrature, const Quadrature< dim-1 > &face_quadrature)
std::vector< types::global_dof_index > local_dof_indices
Definition: assembly.h:157
std::vector< types::global_dof_index > local_dof_indices
Definition: assembly.h:63