23
23
24
24
#include < deal.II/base/conditional_ostream.h>
25
25
#include < deal.II/base/convergence_table.h>
26
+ #include < deal.II/base/parameter_acceptor.h>
26
27
#include < deal.II/base/parsed_function.h>
27
28
#include < deal.II/base/quadrature_lib.h>
28
29
#include < deal.II/base/quadrature_selector.h>
59
60
#include < deal.II/dofs/dof_renumbering.h>
60
61
#include < deal.II/dofs/dof_tools.h>
61
62
63
+ #include < deal.II/fe/fe_dgq.h>
62
64
#include < deal.II/fe/fe_q.h>
63
65
#include < deal.II/fe/fe_system.h>
64
66
#include < deal.II/fe/fe_values.h>
69
71
#include < deal.II/grid/grid_generator.h>
70
72
#include < deal.II/grid/grid_in.h>
71
73
#include < deal.II/grid/grid_out.h>
74
+ #include < deal.II/grid/grid_refinement.h>
72
75
#include < deal.II/grid/manifold_lib.h>
73
76
#include < deal.II/grid/tria.h>
74
77
#include < deal.II/grid/tria_accessor.h>
82
85
83
86
// And here are a few C++ standard header
84
87
// files that we will need:
85
- #include < deal2lkit/parameter_acceptor.h>
86
- #include < deal2lkit/parsed_finite_element.h>
87
- #include < deal2lkit/parsed_grid_refinement.h>
88
- #include < deal2lkit/utilities.h>
88
+
89
89
#include < mpi.h>
90
90
91
91
#include < cmath>
104
104
#include " ../include/octree_block.h"
105
105
106
106
using namespace dealii ;
107
- using namespace deal2lkit ;
108
107
109
108
// using namespace TrilinosWrappers;
110
109
// using namespace TrilinosWrappers::MPI;
@@ -118,7 +117,7 @@ using namespace deal2lkit;
118
117
* - it eventually interacts with the FMM accelerator.
119
118
*/
120
119
template <int dim>
121
- class BEMProblem : public deal2lkit :: ParameterAcceptor
120
+ class BEMProblem : public ParameterAcceptor
122
121
{
123
122
public:
124
123
typedef typename DoFHandler<dim - 1 , dim>::active_cell_iterator cell_it;
@@ -127,8 +126,8 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
127
126
const MPI_Comm comm = MPI_COMM_WORLD);
128
127
129
128
void
130
- solve (TrilinosWrappers::MPI::Vector & phi,
131
- TrilinosWrappers::MPI::Vector & dphi_dn,
129
+ solve (TrilinosWrappers::MPI::Vector & phi,
130
+ TrilinosWrappers::MPI::Vector & dphi_dn,
132
131
const TrilinosWrappers::MPI::Vector &tmp_rhs);
133
132
134
133
// / This function takes care of the proper initialization of all the elements
@@ -152,8 +151,8 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
152
151
// / have kept this function serial. We stress that it needs to be called only
153
152
// / once.
154
153
void
155
- compute_constraints (IndexSet & c_cpu_set,
156
- AffineConstraints<double > & constraints,
154
+ compute_constraints (IndexSet & c_cpu_set,
155
+ AffineConstraints<double > & constraints,
157
156
const TrilinosWrappers::MPI::Vector &tmp_rhs);
158
157
159
158
// private:
@@ -170,6 +169,10 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
170
169
virtual void
171
170
parse_parameters (ParameterHandler &prm);
172
171
172
+ // / This function computes the free coefficients appearing in the
173
+ // / hypersingular BIE.
174
+ void
175
+ compute_hypersingular_free_coeffs ();
173
176
174
177
// / This function computes the fraction of solid angles seen by our domain. We
175
178
// / use the Double Layer Operator (through the Neumann matrix) to determine
@@ -195,15 +198,15 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
195
198
// / vector src. The result is stored
196
199
// / in the vector dst.
197
200
void
198
- vmult (TrilinosWrappers::MPI::Vector & dst,
201
+ vmult (TrilinosWrappers::MPI::Vector & dst,
199
202
const TrilinosWrappers::MPI::Vector &src) const ;
200
203
201
204
// / The second method computes the
202
205
// / right hand side vector of the
203
206
// / system.
204
207
205
208
void
206
- compute_rhs (TrilinosWrappers::MPI::Vector & dst,
209
+ compute_rhs (TrilinosWrappers::MPI::Vector & dst,
207
210
const TrilinosWrappers::MPI::Vector &src) const ;
208
211
209
212
// / The third method computes the
@@ -220,8 +223,8 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
220
223
// / Depending on the resolution stategy we go whether for the direct or fma
221
224
// / strategy.
222
225
void
223
- solve_system (TrilinosWrappers::MPI::Vector & phi,
224
- TrilinosWrappers::MPI::Vector & dphi_dn,
226
+ solve_system (TrilinosWrappers::MPI::Vector & phi,
227
+ TrilinosWrappers::MPI::Vector & dphi_dn,
225
228
const TrilinosWrappers::MPI::Vector &tmp_rhs);
226
229
227
230
@@ -247,6 +250,14 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
247
250
compute_gradients (const TrilinosWrappers::MPI::Vector &phi,
248
251
const TrilinosWrappers::MPI::Vector &dphi_dn);
249
252
253
+
254
+ // / We compute the potential gradients also in an alternative way.
255
+ // / Here we make use of the hypersingular integrals computed with the
256
+ // / SingularKernelIntegral class
257
+ void
258
+ compute_gradients_hypersingular (const TrilinosWrappers::MPI::Vector &phi,
259
+ const TrilinosWrappers::MPI::Vector &dphi_dn);
260
+
250
261
// / We have parallelised the computation of the L2 projection of the normal
251
262
// / vector. We need a solution vector that has also ghost cells. for this
252
263
// / reason we made use of a ghosted IndexSet that we have computed in the
@@ -286,9 +297,8 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
286
297
ConditionalOStream pcout;
287
298
ComputationalDomain<dim> &comp_dom;
288
299
289
-
290
- ParsedFiniteElement<dim - 1 , dim> parsed_fe;
291
- ParsedFiniteElement<dim - 1 , dim> parsed_gradient_fe;
300
+ std::string scalar_fe_type, vector_fe_type;
301
+ unsigned int scalar_fe_order, vector_fe_order;
292
302
std::unique_ptr<FiniteElement<dim - 1 , dim>> fe;
293
303
std::unique_ptr<FiniteElement<dim - 1 , dim>> gradient_fe;
294
304
DoFHandler<dim - 1 , dim> dh;
@@ -297,16 +307,16 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
297
307
// FE_Q<dim-1,dim> fe;
298
308
// FESystem<dim-1,dim> gradient_fe;
299
309
300
- ParsedGridRefinement pgr ;
310
+ double refinement_threshold, coarsening_threshold ;
301
311
302
312
// / An Eulerian Mapping is created to deal
303
313
// / with the free surface and boat mesh
304
314
// / deformation
305
315
306
- Vector<double > map_vector;
307
- shared_ptr<Mapping<dim - 1 , dim>> mapping;
308
- unsigned int mapping_degree;
309
- Vector<double > map_points;
316
+ Vector<double > map_vector;
317
+ std:: shared_ptr<Mapping<dim - 1 , dim>> mapping;
318
+ unsigned int mapping_degree;
319
+ Vector<double > map_points;
310
320
311
321
312
322
// / these are the std::vectors of std::sets
@@ -338,8 +348,18 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
338
348
339
349
TrilinosWrappers::MPI::Vector system_rhs;
340
350
351
+ // / solution and alpha vectors
341
352
TrilinosWrappers::MPI::Vector sol;
342
353
TrilinosWrappers::MPI::Vector alpha;
354
+ // / an alternatively computed alpha vector (obtained with geometric
355
+ // / computations)
356
+ TrilinosWrappers::MPI::Vector hyp_alpha;
357
+ // / a set of distributed vectors which contain all the entries of the
358
+ // / C_ij tensor appearing in the hypersingular BIE
359
+ std::vector<TrilinosWrappers::MPI::Vector> C_ij;
360
+ // / a set of distributed vectors which contain all the entries of the
361
+ // / b_i vector appearing in the hypersingular BIE
362
+ std::vector<TrilinosWrappers::MPI::Vector> b_i;
343
363
344
364
mutable TrilinosWrappers::MPI::Vector serv_phi;
345
365
mutable TrilinosWrappers::MPI::Vector serv_dphi_dn;
0 commit comments