WaveBEM: Unsteady Nonlinear Potential Flow Solver for Ship-Wave Interaction.
bem_problem.h
Go to the documentation of this file.
1 //---------------------------- step-34.cc ---------------------------
2 // $Id: step-34.cc 18734 2009-04-25 13:36:48Z heltai $
3 // Version: $Name$
4 //
5 // Copyright (C) 2009, 2011 by the deal.II authors
6 //
7 // This file is subject to QPL and may not be distributed
8 // without copyright and license information. Please refer
9 // to the file deal.II/doc/license.html for the text and
10 // further information on this license.
11 //
12 // Authors: Luca Heltai, Cataldo Manigrasso
13 //
14 //---------------------------- step-34.cc ---------------------------
15 
16 #ifndef bem_problem_h
17 #define bem_problem_h
18 // @sect3{Include files}
19 
20 // The program starts with including a bunch
21 // of include files that we will use in the
22 // various parts of the program.
23 
24 
30 #include <deal.II/base/utilities.h>
31 
35 #include <deal.II/lac/matrix_lib.h>
36 #include <deal.II/lac/vector.h>
42 
43 #include <deal.II/grid/tria.h>
47 #include <deal.II/grid/grid_in.h>
48 #include <deal.II/grid/grid_out.h>
50 
53 #include <deal.II/dofs/dof_tools.h>
55 #include <deal.II/fe/fe_q.h>
56 #include <deal.II/fe/fe_values.h>
57 #include <deal.II/fe/fe_system.h>
59 #include <deal.II/fe/mapping_q1.h>
60 
64 
65 // And here are a few C++ standard header
66 // files that we will need:
67 #include <cmath>
68 #include <iostream>
69 #include <fstream>
70 #include <string>
71 #include <set>
72 #include <map>
73 
74 #include "../include/octree_block.h"
75 #include "../include/local_expansion.h"
76 #include "../include/multipole_expansion.h"
77 #include "../include/ass_leg_function.h"
78 #include "../include/computational_domain.h"
79 #include "../include/bem_fma.h"
80 #include "../include/constrained_matrix.h"
81 
82 
83 
84 using namespace dealii;
85 
86 
87 template <int dim>
89 {
90 public:
91 
92  typedef typename DoFHandler<dim-1,dim>::active_cell_iterator cell_it;
93 
95 
96  void solve(Vector<double> &phi, Vector<double> &dphi_dn,
97  const Vector<double> &tmp_rhs);
98 
99  void reinit();
100 
101  void compute_constraints(ConstraintMatrix &constraints, const Vector<double> &tmp_rhs);
102 
103  // private:
104 
105  void declare_parameters(ParameterHandler &prm);
106 
107  void parse_parameters(ParameterHandler &prm);
108 
109  // To be commented
110 
111  void compute_alpha();
112 
113  void assemble_system();
114 
115  // The next three methods are
116  // needed by the GMRES solver:
117  // the first provides result of
118  // the product of the system
119  // matrix (a combination of Neumann
120  // and Dirichlet matrices) by the
121  // vector src. The result is stored
122  // in the vector dst.
123 
124  void vmult(Vector<double> &dst, const Vector<double> &src) const;
125 
126  // The second method computes the
127  // right hand side vector of the
128  // system.
129 
130  void compute_rhs(Vector<double> &dst, const Vector<double> &src) const;
131 
132  // The third method computes the
133  // product between the solution vector
134  // and the (fully populated) sytstem
135  // matrix.
136 
137  void assemble_preconditioner();
138 
139  void compute_surface_gradients(const Vector<double> &tmp_rhs);
140 
141  void solve_system(Vector<double> &phi, Vector<double> &dphi_dn,
142  const Vector<double> &tmp_rhs);
143 
144  void residual(Vector<double> &res, const Vector<double> &phi,
145  const Vector<double> &dphi_dn);
146 
147  void output_results(const std::string);
148 
150 
152 
156 
159 
163 
165 
166  std::string solution_method;
167 
169 
171 
173 
175 
177 
178  std::vector<Point<dim> > node_surface_gradients;
179 
180 };
181 
182 #endif
ComputationalDomain< dim > & comp_dom
Definition: bem_problem.h:149
Vector< double > serv_tmp_rhs
Definition: bem_problem.h:162
Vector< double > serv_dphi_dn
Definition: bem_problem.h:161
SolverControl solver_control
Definition: bem_problem.h:168
FullMatrix< double > neumann_matrix
Definition: bem_problem.h:153
BEMFMA< dim > & fma
Definition: bem_problem.h:151
bool is_preconditioner_initialized
Definition: bem_problem.h:176
DoFHandler< dim-1, dim >::active_cell_iterator cell_it
Definition: bem_problem.h:92
ConstraintMatrix constraints
Definition: bem_problem.h:164
Vector< double > system_rhs
Definition: bem_problem.h:155
SparsityPattern preconditioner_sparsity_pattern
Definition: bem_problem.h:172
Vector< double > alpha
Definition: bem_problem.h:158
std::vector< Point< dim > > node_surface_gradients
Definition: bem_problem.h:178
FullMatrix< double > dirichlet_matrix
Definition: bem_problem.h:154
SparseDirectUMFPACK preconditioner
Definition: bem_problem.h:170
int preconditioner_band
Definition: bem_problem.h:174
Vector< double > sol
Definition: bem_problem.h:157
Vector< double > serv_phi
Definition: bem_problem.h:160
std::string solution_method
Definition: bem_problem.h:166
Definition: bem_fma.h:45