WaveBEM: Unsteady Nonlinear Potential Flow Solver for Ship-Wave Interaction.
surface_smoothing.h
Go to the documentation of this file.
1 #ifndef surface_smoothing_h
2 #define surface_smoothing_h
3 
4 #include <string>
5 
6 #include <deal.II/base/point.h>
7 #include <deal.II/grid/tria.h>
8 
9 #include <deal.II/fe/mapping.h>
10 
13 #include <deal.II/lac/vector.h>
14 
16 
17 using namespace dealii;
18 
20 {
21 public:
23  // euler_vector, by maintaining
24  // the boundary dofs at their
25  // position.
26  //
27  // The euler_vector is
28  // interpreted as a collection
29  // of triples associated with
30  // the displacement of the
31  // nodes of the mesh, like the
32  // one which is used in
33  // MappingQEulerian. Mapping
34  // should be parent of
35  // MappingQEulerian, in some
36  // sense. It is used to compute
37  // all integrals, which means
38  // it is required to return
39  // points in real space.
40  //
41  // Some vectors are stored
42  // internally to allow for
43  // faster computations between
44  // unchanged reference
45  // meshes. If you change the
46  // mesh, you should call
47  // update_reference() before
48  // attempting to call smooth().
49  //
50  // You should also call
51  // update_reference() the first
52  // time you use this class,
53  // otherwise exceptions will be
54  // thrown.
55  //
56  // By default, the smoothing is
57  // performed only on the euler
58  // vector. If you want the
59  // smoothing on the global
60  // position of the nodes, set
61  // on_euler to false.
62  SurfaceSmoothing(Vector<double> &euler_vector,
63  Vector<double> &curvature_vector,
64  const DoFHandler<2,3> &dh,
65  const Mapping<2,3> &mapping);
66 
68  // changes, you should call
69  // this function to update the
70  // internal vectors.
71  void update_reference();
72 
74  // the current value of the
75  // stored identity plus the
76  // given euler_vector.
77  void fix_boundary_values();
79  // Beltrami matrix, rhs and
80  // solution, ready to be
81  // solved. Boundary values are
82  // applied, so be sure to call
83  // fix_boundary_values, before
84  // you call this function.
85  void assemble_system();
86 
87  void assemble_system(const Vector<double> &curvature);
88 
90  void solve_system();
91 
93  // cycle of the given mesh.
94  void smooth();
95 
97  // mesh nodes (to be used before
98  // refinements)
99  void compute_curvatures(Vector<double> &curvatures);
101  // mesh nodes to obtain geometrically
102  // consistent mesh (to be used after
103  // refinements)
104  void apply_curvatures(const Vector<double> &curvatures, const std::vector<bool> &boundary_dofs);
105 
106 
107 
108 private:
113 
115  std::vector<bool> boundary_dofs;
116  std::map<unsigned int, double> boundary_values;
117 
120 
122 
126 };
127 
128 
129 #endif
SparseMatrix< double > matrix
Vector< double > & curvature_vector
SparseMatrix< double > mass_matrix
SparsityPattern sparsity
ConstraintMatrix constraints
const DoFHandler< 2, 3 > & dh
Vector< double > rhs
const Mapping< 2, 3 > & mapping
Vector< double > & euler_vector
std::vector< bool > boundary_dofs
Vector< double > reference_identity
Vector< double > solution
std::map< unsigned int, double > boundary_values