Skip to content

Commit 43376bc

Browse files
authored
Merge pull request #52 from mathLab/andrea_new
Andrea new
2 parents f027015 + fc880f8 commit 43376bc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3575
-329
lines changed

CMakeLists.txt

+7-19
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ENDIF()
3838

3939
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8)
4040

41-
FIND_PACKAGE(deal.II 8.3 REQUIRED
41+
FIND_PACKAGE(deal.II 9.5 REQUIRED
4242
HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
4343
)
4444

@@ -62,10 +62,6 @@ set(CMAKE_MACOSX_RPATH 1)
6262
endif()
6363

6464

65-
FIND_PACKAGE(deal2lkit 1.0 REQUIRED
66-
HINTS ${D2K_DIR} $ENV{D2K_DIR} $ENV{DEAL2LKIT_DIR}
67-
)
68-
D2K_INITIALIZE_CACHED_VARIABLES()
6965

7066
# We one library and one target for each type of deal.II library
7167
# we found. If you compiled deal.II with both Release and Debug
@@ -80,10 +76,8 @@ FOREACH(_build_type ${_d2_build_types})
8076
SET(_p "${${_build_type}_postfix}")
8177
# Only build this type, if deal.II was compiled with it.
8278
IF(CMAKE_BUILD_TYPE MATCHES "${_build_type}" AND
83-
DEAL_II_BUILD_TYPE MATCHES "${_build_type}" AND
84-
D2K_BUILD_TYPE MATCHES "${_build_type}")
79+
DEAL_II_BUILD_TYPE MATCHES "${_build_type}")
8580
MESSAGE("-- Found ${_build_type} version of deal.II.")
86-
MESSAGE("-- Found ${_build_type} version of deal2lkit.")
8781

8882
SET(_lib "${TARGET}-lib${_p}")
8983
MESSAGE("-- Configuring library ${_lib}")
@@ -98,24 +92,16 @@ FOREACH(_build_type ${_d2_build_types})
9892
ADD_EXECUTABLE(${_exe} ${_main})
9993
target_compile_definitions(${_exe} PUBLIC DEAL_II_DIMENSION=${_dim})
10094
TARGET_LINK_LIBRARIES(${_exe} ${_lib})
101-
D2K_SETUP_TARGET(${_exe} ${_BUILD_TYPE})
95+
DEAL_II_SETUP_TARGET(${_exe} ${_BUILD_TYPE})
10296
ENDFOREACH()
10397

104-
# Compile an executable only if required by the user
105-
#IF(NOT "${_main}" STREQUAL "")
106-
# SET(_exe "${TARGET}${${_build_type}_postfix}")
107-
# MESSAGE("-- Configuring executable ${_exe}")
108-
# ADD_EXECUTABLE(${_exe} ${_main})
109-
# TARGET_LINK_LIBRARIES(${_exe} ${_lib})
110-
# D2K_SETUP_TARGET(${_exe} ${_BUILD_TYPE})
111-
#ENDIF()
11298

113-
D2K_SETUP_TARGET(${_lib} ${_BUILD_TYPE})
99+
100+
DEAL_II_SETUP_TARGET(${_lib} ${_BUILD_TYPE})
114101
SET(TEST_LIBRARIES_${_BUILD_TYPE} ${_lib})
115102
ENDIF()
116103
ENDFOREACH()
117104

118-
INCLUDE_DIRECTORIES(${D2K_DIR}/include)
119105
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
120106

121107
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tests AND BEM_ENABLE_TESTING)
@@ -138,6 +124,8 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
138124
endif()
139125

140126

127+
message(STATUS "DEAL_II_INCLUDE_DIRECTORIES=${deal.II_INCLUDE_DIRECTORIES}")
128+
141129
ADD_CUSTOM_TARGET(indent
142130
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
143131
COMMAND ./scripts/indent

Doxyfile.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
3232
# title of most generated pages and in a few other places.
3333
# The default value is: My Project.
3434

35-
PROJECT_NAME = "pi-BEM: a parallel BEM solver for deal.II"
35+
PROJECT_NAME = "Heat Shell: a heat transmission model for shells in deal.II"
3636

3737
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
3838
# could be handy for archiving the generated documentation or if some version

grids/coarse_straight_cube.inp

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
24 6 0 0 0
2+
1 0 0 0
3+
2 0 1 0
4+
3 1 1 0
5+
4 1 0 0
6+
5 0 0 1
7+
6 0 1 1
8+
7 1 1 1
9+
8 1 0 1
10+
9 0 0 0
11+
10 1 0 0
12+
11 1 0 1
13+
12 0 0 1
14+
13 0 1 0
15+
14 1 1 0
16+
15 1 1 1
17+
16 0 1 1
18+
17 0 0 0
19+
18 0 0 1
20+
19 0 1 1
21+
20 0 1 0
22+
21 1 0 0
23+
22 1 0 1
24+
23 1 1 1
25+
24 1 1 0
26+
27+
1 1 quad 1 2 3 4
28+
2 0 quad 5 8 7 6
29+
3 1 quad 9 10 11 12
30+
4 1 quad 13 16 15 14
31+
5 1 quad 17 18 19 20
32+
6 1 quad 21 24 23 22

include/ass_leg_function.h

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <deal.II/lac/precondition.h>
2121
#include <deal.II/lac/solver_control.h>
2222
#include <deal.II/lac/solver_gmres.h>
23-
#include <deal.II/lac/sparse_matrix.h>
2423
#include <deal.II/lac/vector.h>
2524
// #include <deal.II/grid/tria_boundary_lib.h>
2625

include/bem_fma.h

+11-13
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#ifndef bem_fma_h
2525
#define bem_fma_h
2626

27-
#include <deal.II/base/std_cxx11/bind.h>
27+
#include <deal.II/base/parameter_acceptor.h>
2828
#include <deal.II/base/types.h>
2929
#include <deal.II/base/work_stream.h>
3030

@@ -33,14 +33,13 @@
3333
#include <deal.II/lac/trilinos_sparse_matrix.h>
3434
#include <deal.II/lac/trilinos_vector.h>
3535

36-
#include <deal2lkit/parameter_acceptor.h>
37-
#include <deal2lkit/utilities.h>
3836
#include <mpi.h>
3937

4038
#include <cmath>
4139
#include <fstream>
4240
#include <iostream>
4341
#include <map>
42+
#include <memory>
4443
#include <set>
4544
#include <string>
4645

@@ -57,7 +56,6 @@ namespace Operator
5756
}
5857

5958
using namespace dealii;
60-
using namespace deal2lkit;
6159

6260
/**
6361
* A class for the handling of the Fast Multiple Method coupled with the Bundary
@@ -70,7 +68,7 @@ range interactions
7068
7169
*/
7270
template <int dim> //, Type V>
73-
class BEMFMA : public deal2lkit::ParameterAcceptor
71+
class BEMFMA : public ParameterAcceptor
7472
{
7573
public:
7674
/// Function to be used in the tests, it can access everything inside bemfma
@@ -100,10 +98,10 @@ class BEMFMA : public deal2lkit::ParameterAcceptor
10098
/// Mapping in the BEMFMA class. It also sets up some useful vector for,
10199
/// mixed boundary conditions and double nodes handling.
102100
void
103-
init_fma(const DoFHandler<dim - 1, dim> & input_dh,
101+
init_fma(const DoFHandler<dim - 1, dim> &input_dh,
104102
const std::vector<std::set<types::global_dof_index>> &db_in,
105-
const TrilinosWrappers::MPI::Vector & input_sn,
106-
const Mapping<dim - 1, dim> & input_mapping =
103+
const TrilinosWrappers::MPI::Vector &input_sn,
104+
const Mapping<dim - 1, dim> &input_mapping =
107105
StaticMappingQ1<dim - 1, dim>::mapping,
108106
unsigned int quad_order = 4,
109107
unsigned int sing_quad_order = 5);
@@ -175,8 +173,8 @@ class BEMFMA : public deal2lkit::ParameterAcceptor
175173
multipole_matr_vect_products(
176174
const TrilinosWrappers::MPI::Vector &phi_values,
177175
const TrilinosWrappers::MPI::Vector &dphi_dn_values,
178-
TrilinosWrappers::MPI::Vector & matrVectProdN,
179-
TrilinosWrappers::MPI::Vector & matrVectProdD) const;
176+
TrilinosWrappers::MPI::Vector &matrVectProdN,
177+
TrilinosWrappers::MPI::Vector &matrVectProdD) const;
180178

181179

182180
// void compute_m2l_flags();
@@ -211,7 +209,7 @@ class BEMFMA : public deal2lkit::ParameterAcceptor
211209
/// architectures.
212210
TrilinosWrappers::PreconditionILU &
213211
FMA_preconditioner(const TrilinosWrappers::MPI::Vector &alpha,
214-
AffineConstraints<double> & c);
212+
AffineConstraints<double> &c);
215213

216214
protected:
217215
/// Three pointers to the problem parameters to be set equal to
@@ -449,8 +447,8 @@ class BEMFMA : public deal2lkit::ParameterAcceptor
449447

450448

451449
/// TODO parsed quadrature?
452-
shared_ptr<Quadrature<dim - 1>> quadrature;
453-
SmartPointer<const Vector<double>> dirichlet_nodes;
450+
std::shared_ptr<Quadrature<dim - 1>> quadrature;
451+
SmartPointer<const Vector<double>> dirichlet_nodes;
454452
/// This should be erased by the usage of the constraint matrix.
455453
const std::vector<std::set<types::global_dof_index>> *double_nodes_set;
456454

include/bem_problem.h

+42-22
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
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>
@@ -59,6 +60,7 @@
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>
@@ -69,6 +71,7 @@
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>
@@ -82,10 +85,7 @@
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>
@@ -104,7 +104,6 @@
104104
#include "../include/octree_block.h"
105105

106106
using 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
*/
120119
template <int dim>
121-
class BEMProblem : public deal2lkit::ParameterAcceptor
120+
class BEMProblem : public ParameterAcceptor
122121
{
123122
public:
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

Comments
 (0)