2323
2424#include < deal.II/base/conditional_ostream.h>
2525#include < deal.II/base/convergence_table.h>
26+ #include < deal.II/base/parameter_acceptor.h>
2627#include < deal.II/base/parsed_function.h>
2728#include < deal.II/base/quadrature_lib.h>
2829#include < deal.II/base/quadrature_selector.h>
5960#include < deal.II/dofs/dof_renumbering.h>
6061#include < deal.II/dofs/dof_tools.h>
6162
63+ #include < deal.II/fe/fe_dgq.h>
6264#include < deal.II/fe/fe_q.h>
6365#include < deal.II/fe/fe_system.h>
6466#include < deal.II/fe/fe_values.h>
6971#include < deal.II/grid/grid_generator.h>
7072#include < deal.II/grid/grid_in.h>
7173#include < deal.II/grid/grid_out.h>
74+ #include < deal.II/grid/grid_refinement.h>
7275#include < deal.II/grid/manifold_lib.h>
7376#include < deal.II/grid/tria.h>
7477#include < deal.II/grid/tria_accessor.h>
8285
8386// And here are a few C++ standard header
8487// 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+
8989#include < mpi.h>
9090
9191#include < cmath>
104104#include " ../include/octree_block.h"
105105
106106using namespace dealii ;
107- using namespace deal2lkit ;
108107
109108// using namespace TrilinosWrappers;
110109// using namespace TrilinosWrappers::MPI;
@@ -118,7 +117,7 @@ using namespace deal2lkit;
118117 * - it eventually interacts with the FMM accelerator.
119118 */
120119template <int dim>
121- class BEMProblem : public deal2lkit :: ParameterAcceptor
120+ class BEMProblem : public ParameterAcceptor
122121{
123122public:
124123 typedef typename DoFHandler<dim - 1 , dim>::active_cell_iterator cell_it;
@@ -127,8 +126,8 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
127126 const MPI_Comm comm = MPI_COMM_WORLD);
128127
129128 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,
132131 const TrilinosWrappers::MPI::Vector &tmp_rhs);
133132
134133 // / This function takes care of the proper initialization of all the elements
@@ -152,8 +151,8 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
152151 // / have kept this function serial. We stress that it needs to be called only
153152 // / once.
154153 void
155- compute_constraints (IndexSet & c_cpu_set,
156- AffineConstraints<double > & constraints,
154+ compute_constraints (IndexSet & c_cpu_set,
155+ AffineConstraints<double > & constraints,
157156 const TrilinosWrappers::MPI::Vector &tmp_rhs);
158157
159158 // private:
@@ -170,6 +169,10 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
170169 virtual void
171170 parse_parameters (ParameterHandler &prm);
172171
172+ // / This function computes the free coefficients appearing in the
173+ // / hypersingular BIE.
174+ void
175+ compute_hypersingular_free_coeffs ();
173176
174177 // / This function computes the fraction of solid angles seen by our domain. We
175178 // / use the Double Layer Operator (through the Neumann matrix) to determine
@@ -195,15 +198,15 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
195198 // / vector src. The result is stored
196199 // / in the vector dst.
197200 void
198- vmult (TrilinosWrappers::MPI::Vector & dst,
201+ vmult (TrilinosWrappers::MPI::Vector & dst,
199202 const TrilinosWrappers::MPI::Vector &src) const ;
200203
201204 // / The second method computes the
202205 // / right hand side vector of the
203206 // / system.
204207
205208 void
206- compute_rhs (TrilinosWrappers::MPI::Vector & dst,
209+ compute_rhs (TrilinosWrappers::MPI::Vector & dst,
207210 const TrilinosWrappers::MPI::Vector &src) const ;
208211
209212 // / The third method computes the
@@ -220,8 +223,8 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
220223 // / Depending on the resolution stategy we go whether for the direct or fma
221224 // / strategy.
222225 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,
225228 const TrilinosWrappers::MPI::Vector &tmp_rhs);
226229
227230
@@ -247,6 +250,14 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
247250 compute_gradients (const TrilinosWrappers::MPI::Vector &phi,
248251 const TrilinosWrappers::MPI::Vector &dphi_dn);
249252
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+
250261 // / We have parallelised the computation of the L2 projection of the normal
251262 // / vector. We need a solution vector that has also ghost cells. for this
252263 // / reason we made use of a ghosted IndexSet that we have computed in the
@@ -286,9 +297,8 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
286297 ConditionalOStream pcout;
287298 ComputationalDomain<dim> &comp_dom;
288299
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;
292302 std::unique_ptr<FiniteElement<dim - 1 , dim>> fe;
293303 std::unique_ptr<FiniteElement<dim - 1 , dim>> gradient_fe;
294304 DoFHandler<dim - 1 , dim> dh;
@@ -297,16 +307,16 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
297307 // FE_Q<dim-1,dim> fe;
298308 // FESystem<dim-1,dim> gradient_fe;
299309
300- ParsedGridRefinement pgr ;
310+ double refinement_threshold, coarsening_threshold ;
301311
302312 // / An Eulerian Mapping is created to deal
303313 // / with the free surface and boat mesh
304314 // / deformation
305315
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;
310320
311321
312322 // / these are the std::vectors of std::sets
@@ -338,8 +348,18 @@ class BEMProblem : public deal2lkit::ParameterAcceptor
338348
339349 TrilinosWrappers::MPI::Vector system_rhs;
340350
351+ // / solution and alpha vectors
341352 TrilinosWrappers::MPI::Vector sol;
342353 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;
343363
344364 mutable TrilinosWrappers::MPI::Vector serv_phi;
345365 mutable TrilinosWrappers::MPI::Vector serv_dphi_dn;
0 commit comments