From c9841240c5a7b893f0c27f83960d6972c4851ae6 Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Sat, 5 Aug 2023 11:50:05 +0200 Subject: [PATCH] Indend and no-warnings. --- include/constrained_matrix.h | 6 ++-- include/laplace_kernel.h | 9 ++--- include/local_expansion.h | 2 +- include/local_expansion_coeff.h | 4 +-- include/multipole_expansion.h | 4 +-- include/singular_kernel_integral.h | 4 +-- include/true_constrained_matrix.h | 10 +++--- source/bem_fma.cc | 34 +++++++++---------- source/local_expansion.cc | 2 +- source/local_expansion_coeff.cc | 2 +- source/multipole_expansion.cc | 4 +-- source/singular_kernel_integral.cc | 11 +++--- tests/local_expansion_copy.cc | 2 +- ...local_expansion_creation_and_evaluation.cc | 2 +- tests/local_expansion_translation.cc | 2 +- tests/multipole_expansion_copy.cc | 2 +- ...ipole_expansion_creation_and_evaluation.cc | 2 +- ..._creation_and_evaluation_neumann_kernel.cc | 2 +- tests/multipole_expansion_translation.cc | 2 +- 19 files changed, 54 insertions(+), 52 deletions(-) diff --git a/include/constrained_matrix.h b/include/constrained_matrix.h index 6bf2c06..8c79544 100644 --- a/include/constrained_matrix.h +++ b/include/constrained_matrix.h @@ -52,9 +52,9 @@ template class ConstrainedOperator { public: - ConstrainedOperator(const MATRIX &m, + ConstrainedOperator(const MATRIX & m, const AffineConstraints &c, - const IndexSet &c_cpu_set, + const IndexSet & c_cpu_set, MPI_Comm comm = MPI_COMM_WORLD) : constraints(c) , matrix(m) @@ -74,7 +74,7 @@ class ConstrainedOperator private: const AffineConstraints &constraints; - const MATRIX &matrix; + const MATRIX & matrix; const IndexSet constr_cpu_set; MPI_Comm mpi_communicator; unsigned int n_mpi_processes; diff --git a/include/laplace_kernel.h b/include/laplace_kernel.h index e03f9cd..bdb213f 100644 --- a/include/laplace_kernel.h +++ b/include/laplace_kernel.h @@ -65,7 +65,8 @@ namespace LaplaceKernel Hyper[1][0] = -2 * R[0] * R[1]; Hyper = Hyper / (-2 * numbers::PI * R.square() * R.square()); return Hyper; - case 3: { + case 3: + { for (unsigned int i = 0; i < dim; ++i) for (unsigned int j = 0; j < dim; ++j) if (i == j) @@ -111,9 +112,9 @@ namespace LaplaceKernel template // mio// void kernels(const Tensor<1, dim> &R, - Tensor<2, dim> &H, - Tensor<1, dim> &D, - double &d) + Tensor<2, dim> & H, + Tensor<1, dim> & D, + double & d) { double r = R.norm(); double r2 = r * r; diff --git a/include/local_expansion.h b/include/local_expansion.h index c27c927..23c205d 100644 --- a/include/local_expansion.h +++ b/include/local_expansion.h @@ -44,7 +44,7 @@ class LocalExpansion LocalExpansion(const unsigned int order, const dealii::Point<3> ¢er, - const AssLegFunction *assLegFunction); + const AssLegFunction * assLegFunction); LocalExpansion(const LocalExpansion &other); diff --git a/include/local_expansion_coeff.h b/include/local_expansion_coeff.h index 4d5499c..5864a64 100644 --- a/include/local_expansion_coeff.h +++ b/include/local_expansion_coeff.h @@ -31,7 +31,7 @@ class LocalExpansionCoeff const unsigned int &m, const unsigned int &nn, const unsigned int &mm, - const double &value); + const double & value); unsigned int getNumberOfElements(); unsigned int @@ -49,7 +49,7 @@ class LocalExpansionCoeff private: unsigned int _p; - double *_coeff; + double * _coeff; }; #endif /* LOCALEXPANSIONCOEFF_HPP */ diff --git a/include/multipole_expansion.h b/include/multipole_expansion.h index 43f49ad..dd96141 100644 --- a/include/multipole_expansion.h +++ b/include/multipole_expansion.h @@ -51,7 +51,7 @@ class MultipoleExpansion MultipoleExpansion(const unsigned int order, const dealii::Point<3> ¢er, - const AssLegFunction *assLegFunction); + const AssLegFunction * assLegFunction); MultipoleExpansion(const MultipoleExpansion &other); @@ -68,7 +68,7 @@ class MultipoleExpansion void AddNormDer(const double strength, - const dealii::Point<3> &point, + const dealii::Point<3> & point, const dealii::Tensor<1, 3> &normal); double diff --git a/include/singular_kernel_integral.h b/include/singular_kernel_integral.h index a645cce..5718afd 100644 --- a/include/singular_kernel_integral.h +++ b/include/singular_kernel_integral.h @@ -84,8 +84,8 @@ class SingularKernelIntegral const Mapping & mapping; const Point & eta; // to be read from input file - double rho_quadrature_order = 4; - double theta_quadrature_order = 20; + unsigned int rho_quadrature_order = 4; + unsigned int theta_quadrature_order = 20; }; #endif diff --git a/include/true_constrained_matrix.h b/include/true_constrained_matrix.h index cf26847..8cbd358 100644 --- a/include/true_constrained_matrix.h +++ b/include/true_constrained_matrix.h @@ -50,9 +50,9 @@ template class ConstrainedOperator { public: - ConstrainedOperator(const MATRIX &m, + ConstrainedOperator(const MATRIX & m, const AffineConstraints &c, - const IndexSet &c_cpu_set, + const IndexSet & c_cpu_set, MPI_Comm comm = MPI_COMM_WORLD) : cm(c) , matrix(m) @@ -82,7 +82,7 @@ class ConstrainedOperator private: const AffineConstraints &cm; - const MATRIX &matrix; + const MATRIX & matrix; const IndexSet constr_cpu_set; AffineConstraints cmt; MPI_Comm mpi_communicator; @@ -112,7 +112,7 @@ class ConstrainedOperator template void -ConstrainedOperator::constraint_vmult(VEC &dst, +ConstrainedOperator::constraint_vmult(VEC & dst, const VEC &src) const { VEC loc_src(src.locally_owned_elements(), constr_cpu_set, mpi_communicator); @@ -141,7 +141,7 @@ ConstrainedOperator::constraint_vmult(VEC &dst, template void -ConstrainedOperator::constraint_tvmult(VEC &dst, +ConstrainedOperator::constraint_tvmult(VEC & dst, const VEC &src) const { VEC loc_dst(constr_cpu_set); diff --git a/source/bem_fma.cc b/source/bem_fma.cc index cdf429f..83b3e9b 100644 --- a/source/bem_fma.cc +++ b/source/bem_fma.cc @@ -47,10 +47,10 @@ BEMFMA::~BEMFMA() template void BEMFMA::init_fma( - const DoFHandler &input_dh, + const DoFHandler & input_dh, const std::vector> &db_in, - const TrilinosWrappers::MPI::Vector &input_sn, - const Mapping &input_mapping, + const TrilinosWrappers::MPI::Vector & input_sn, + const Mapping & input_mapping, unsigned int quad_order, unsigned int sing_quad_order) { @@ -735,7 +735,7 @@ BEMFMA::direct_integrals() auto f_worker_direct_childless_non_int_list = [this](typename std::vector::iterator block_it, DirectScratchData &, - DirectCopyData ©_data, + DirectCopyData & copy_data, const std::vector> &support_points, std::vector> &sing_quadratures) { // pcout<<"processing block "<::direct_integrals() auto f_worker_direct_bigger_blocks = [this](typename std::vector::iterator block_it, DirectScratchData &, - DirectCopyData ©_data, + DirectCopyData & copy_data, const std::vector> &support_points, types::global_dof_index startBlockLevel) { copy_data.vec_local_dof_indices.resize(0); @@ -1124,7 +1124,7 @@ BEMFMA::direct_integrals() copy_data.vec_start_helper.resize(0); types::global_dof_index blockId = *block_it; - OctreeBlock *block1 = this->blocks[blockId]; + OctreeBlock * block1 = this->blocks[blockId]; const std::vector &nodesBlk1Ids = block1->GetBlockNodeList(); types::global_dof_index helper_index = 0; @@ -1824,7 +1824,7 @@ BEMFMA::multipole_integrals() MultipoleData ©_data) //, const unsigned int dofs_per_cell) { types::global_dof_index blockId = *blocky; - OctreeBlock *block = this->blocks[blockId]; + OctreeBlock * block = this->blocks[blockId]; double delta = block->GetDelta(); Point deltaHalf; for (unsigned int i = 0; i < dim; i++) @@ -2231,7 +2231,7 @@ BEMFMA::generate_multipole_expansions( // for each block we get the center and the quad points types::global_dof_index blockId = childlessList[kk]; - OctreeBlock *block = blocks[blockId]; + OctreeBlock * block = blocks[blockId]; double delta = blocks[blockId]->GetDelta(); Point deltaHalf; @@ -2447,7 +2447,7 @@ BEMFMA::generate_multipole_expansions( auto f_worker_ascend = [this](typename std::vector *>::iterator block_it, AscendScratchData &, - AscendCopyData ©_data, + AscendCopyData & copy_data, types::global_dof_index start) { types::global_dof_index kk = std::distance(this->blocks.begin(), block_it); @@ -2571,8 +2571,8 @@ void BEMFMA::multipole_matr_vect_products( const TrilinosWrappers::MPI::Vector &phi_values, const TrilinosWrappers::MPI::Vector &dphi_dn_values, - TrilinosWrappers::MPI::Vector &matrVectProdN, - TrilinosWrappers::MPI::Vector &matrVectProdD) const + TrilinosWrappers::MPI::Vector & matrVectProdN, + TrilinosWrappers::MPI::Vector & matrVectProdD) const { pcout << "Computing multipole matrix-vector products... " << std::endl; Teuchos::TimeMonitor LocalTimer(*MatrVec); @@ -2734,7 +2734,7 @@ BEMFMA::multipole_matr_vect_products( std::vector::const_iterator block_it_id, DescendScratchData &, - DescendCopyData ©_data, + DescendCopyData & copy_data, const types::global_dof_index start) { // types::global_dof_index kk = std::distance(this->blocks.begin(), // block_it); @@ -2743,7 +2743,7 @@ BEMFMA::multipole_matr_vect_products( copy_data.start = start; copy_data.blockId = *block_it_id; types::global_dof_index kk = *block_it_id; - OctreeBlock *block_it; + OctreeBlock * block_it; block_it = this->blocks[*block_it_id]; // copy_data.local_level_indices[kk] = start + kk; //*****************definire chi e' on_process qui @@ -3169,7 +3169,7 @@ BEMFMA::multipole_matr_vect_products( for (types::global_dof_index kk = r.begin(); kk < r.end(); ++kk) { types::global_dof_index block1Id = childlessList[kk]; - OctreeBlock *block1 = blocks[block1Id]; + OctreeBlock * block1 = blocks[block1Id]; std::vector nodesBlk1Ids = block1->GetBlockNodeList(); @@ -3291,7 +3291,7 @@ template TrilinosWrappers::PreconditionILU & BEMFMA::FMA_preconditioner( const TrilinosWrappers::MPI::Vector &alpha, - AffineConstraints &c) // TO BE CHANGED!!! + AffineConstraints & c) // TO BE CHANGED!!! { Teuchos::TimeMonitor LocalTimer(*PrecondTime); // the final preconditioner (with constraints) has a slightly different @@ -4476,7 +4476,7 @@ BEMFMA::generate_octree_blocking() numChildless += 1; childlessList.push_back(jj); quadPointsInChildless += blockNumQuadPoints; - nodesInChildless += (types::global_dof_index) blockNumNodes; + nodesInChildless += (types::global_dof_index)blockNumNodes; // if a block is childless, we must assign now the nodes and quad @@ -4635,7 +4635,7 @@ BEMFMA::generate_octree_blocking() // neigh: let's check { types::global_dof_index block2Id = *pos; - OctreeBlock *block2 = blocks[block2Id]; + OctreeBlock * block2 = blocks[block2Id]; double delta2 = block2->GetDelta(); Point PMin2 = block2->GetPMin(); Point Center2; diff --git a/source/local_expansion.cc b/source/local_expansion.cc index 815c24c..4c982c5 100644 --- a/source/local_expansion.cc +++ b/source/local_expansion.cc @@ -28,7 +28,7 @@ LocalExpansion::LocalExpansion() LocalExpansion::LocalExpansion(const unsigned int order, const dealii::Point<3> ¢er, - const AssLegFunction *assLegFunction) + const AssLegFunction * assLegFunction) { this->p = order; diff --git a/source/local_expansion_coeff.cc b/source/local_expansion_coeff.cc index c1eea65..d252569 100644 --- a/source/local_expansion_coeff.cc +++ b/source/local_expansion_coeff.cc @@ -58,7 +58,7 @@ LocalExpansionCoeff::set(const unsigned int &n, const unsigned int &m, const unsigned int &nn, const unsigned int &mm, - const double &value) + const double & value) { _coeff[(mm + nn) + getNNOffset(nn) + getMOffset(m) + getNOffset(n)] = value; } diff --git a/source/multipole_expansion.cc b/source/multipole_expansion.cc index fe25d27..fece5b8 100644 --- a/source/multipole_expansion.cc +++ b/source/multipole_expansion.cc @@ -22,7 +22,7 @@ MultipoleExpansion::MultipoleExpansion() MultipoleExpansion::MultipoleExpansion(const unsigned int order, const dealii::Point<3> ¢er, - const AssLegFunction *assLegFunction) + const AssLegFunction * assLegFunction) { this->p = order; @@ -121,7 +121,7 @@ MultipoleExpansion::Add(const double strength, const dealii::Point<3> &point) void MultipoleExpansion::AddNormDer(const double strength, - const dealii::Point<3> &point, + const dealii::Point<3> & point, const dealii::Tensor<1, 3> &normal) { diff --git a/source/singular_kernel_integral.cc b/source/singular_kernel_integral.cc index 2179bfb..64a4546 100644 --- a/source/singular_kernel_integral.cc +++ b/source/singular_kernel_integral.cc @@ -310,7 +310,7 @@ SingularKernelIntegral<3>::evaluate_VkNj_integrals() // we of course also create a dof handler finite element and mapping DoFHandler<1> theta_dof_handler(theta_triangulation); - const FE_Q<1> theta_finite_element(fmax(fe.degree, 1)); + const FE_Q<1> theta_finite_element(std::max(fe.degree, 1u)); theta_dof_handler.distribute_dofs(theta_finite_element); MappingQ<1> theta_mapping(theta_finite_element.degree); @@ -362,7 +362,7 @@ SingularKernelIntegral<3>::evaluate_VkNj_integrals() rho_subcelldata); // we of course also create a dof handler finite element and mapping DoFHandler<1> rho_dof_handler(rho_triangulation); - const FE_Q<1> rho_finite_element(fmax(fe.degree, 1)); + const FE_Q<1> rho_finite_element(std::max(fe.degree, 1u)); rho_dof_handler.distribute_dofs(rho_finite_element); MappingQ<1> rho_mapping(rho_finite_element.degree); // we create a 1D quadature with the user selected number of @@ -909,7 +909,7 @@ SingularKernelIntegral<3>::evaluate_WkNj_integrals() // we of course also create a dof handler finite element and mapping DoFHandler<1> theta_dof_handler(theta_triangulation); - const FE_Q<1> theta_finite_element(fmax(fe.degree, 1)); + const FE_Q<1> theta_finite_element(std::max(fe.degree, 1u)); theta_dof_handler.distribute_dofs(theta_finite_element); MappingQ<1> theta_mapping(theta_finite_element.degree); @@ -961,7 +961,7 @@ SingularKernelIntegral<3>::evaluate_WkNj_integrals() rho_subcelldata); // we of course also create a dof handler finite element and mapping DoFHandler<1> rho_dof_handler(rho_triangulation); - const FE_Q<1> rho_finite_element(fmax(fe.degree, 1)); + const FE_Q<1> rho_finite_element(std::max(fe.degree, 1u)); rho_dof_handler.distribute_dofs(rho_finite_element); MappingQ<1> rho_mapping(rho_finite_element.degree); // we create a 1D quadature with the user selected number of @@ -1387,6 +1387,7 @@ SingularKernelIntegral<3>::evaluate_free_term_b() Point<2> csi_0; Point<2> csi_1; double coeff = 0.0; + (void)coeff; switch (f) { case 0: @@ -1480,7 +1481,7 @@ SingularKernelIntegral<3>::evaluate_free_term_b() // we of course also create a dof handler finite element and mapping DoFHandler<1> theta_dof_handler(theta_triangulation); - const FE_Q<1> theta_finite_element(fmax(fe.degree, 1)); + const FE_Q<1> theta_finite_element(std::max(fe.degree, 1u)); theta_dof_handler.distribute_dofs(theta_finite_element); MappingQ<1> theta_mapping(theta_finite_element.degree); diff --git a/tests/local_expansion_copy.cc b/tests/local_expansion_copy.cc index 408d791..a0af360 100644 --- a/tests/local_expansion_copy.cc +++ b/tests/local_expansion_copy.cc @@ -58,7 +58,7 @@ main() // we define the center, order of truncation and associated laplace functions // needed to construct the MultipoleExpansion class object Point<3> center(3.0, 3.0, 3.0); - AssLegFunction *alf_ptr = new AssLegFunction(); + AssLegFunction * alf_ptr = new AssLegFunction(); unsigned int truncation_order = 6; MultipoleExpansion multipole(truncation_order, center, alf_ptr); diff --git a/tests/local_expansion_creation_and_evaluation.cc b/tests/local_expansion_creation_and_evaluation.cc index 36d0ce0..5eae09a 100644 --- a/tests/local_expansion_creation_and_evaluation.cc +++ b/tests/local_expansion_creation_and_evaluation.cc @@ -61,7 +61,7 @@ main() // we define the center, order of truncation and associated laplace functions // needed to construct the MultipoleExpansion class object Point<3> center(3.0, 3.0, 3.0); - AssLegFunction *alf_ptr = new AssLegFunction(); + AssLegFunction * alf_ptr = new AssLegFunction(); unsigned int truncation_order = 6; MultipoleExpansion multipole(truncation_order, center, alf_ptr); diff --git a/tests/local_expansion_translation.cc b/tests/local_expansion_translation.cc index b672925..035d80b 100644 --- a/tests/local_expansion_translation.cc +++ b/tests/local_expansion_translation.cc @@ -61,7 +61,7 @@ main() // we define the center, order of truncation and associated laplace functions // needed to construct the MultipoleExpansion class object Point<3> center(3.0, 3.0, 3.0); - AssLegFunction *alf_ptr = new AssLegFunction(); + AssLegFunction * alf_ptr = new AssLegFunction(); unsigned int truncation_order = 6; MultipoleExpansion multipole(truncation_order, center, alf_ptr); diff --git a/tests/multipole_expansion_copy.cc b/tests/multipole_expansion_copy.cc index 1221a3d..03a9dae 100644 --- a/tests/multipole_expansion_copy.cc +++ b/tests/multipole_expansion_copy.cc @@ -55,7 +55,7 @@ main() // we define the center, order of truncation and associated laplace functions // needed to construct the MultipoleExpansion class object Point<3> center(3.0, 3.0, 3.0); - AssLegFunction *alf_ptr = new AssLegFunction(); + AssLegFunction * alf_ptr = new AssLegFunction(); unsigned int truncation_order = 6; MultipoleExpansion multipole(truncation_order, center, alf_ptr); diff --git a/tests/multipole_expansion_creation_and_evaluation.cc b/tests/multipole_expansion_creation_and_evaluation.cc index 1560398..f9c7c1b 100644 --- a/tests/multipole_expansion_creation_and_evaluation.cc +++ b/tests/multipole_expansion_creation_and_evaluation.cc @@ -59,7 +59,7 @@ main() // we define the center, order of truncation and associated laplace functions // needed to construct the MultipoleExpansion class object Point<3> center(3.0, 3.0, 3.0); - AssLegFunction *alf_ptr = new AssLegFunction(); + AssLegFunction * alf_ptr = new AssLegFunction(); unsigned int truncation_order = 6; MultipoleExpansion multipole(truncation_order, center, alf_ptr); diff --git a/tests/multipole_expansion_creation_and_evaluation_neumann_kernel.cc b/tests/multipole_expansion_creation_and_evaluation_neumann_kernel.cc index 4cea74a..fb33be4 100644 --- a/tests/multipole_expansion_creation_and_evaluation_neumann_kernel.cc +++ b/tests/multipole_expansion_creation_and_evaluation_neumann_kernel.cc @@ -70,7 +70,7 @@ main() // we define the center, order of truncation and associated laplace functions // needed to construct the MultipoleExpansion class object Point<3> center(3.0, 3.0, 3.0); - AssLegFunction *alf_ptr = new AssLegFunction(); + AssLegFunction * alf_ptr = new AssLegFunction(); unsigned int truncation_order = 6; MultipoleExpansion multipole(truncation_order, center, alf_ptr); diff --git a/tests/multipole_expansion_translation.cc b/tests/multipole_expansion_translation.cc index a6513cf..c461089 100644 --- a/tests/multipole_expansion_translation.cc +++ b/tests/multipole_expansion_translation.cc @@ -59,7 +59,7 @@ main() // we define the center, order of truncation and associated laplace functions // needed to construct the MultipoleExpansion class object Point<3> center(3.0, 3.0, 3.0); - AssLegFunction *alf_ptr = new AssLegFunction(); + AssLegFunction * alf_ptr = new AssLegFunction(); unsigned int truncation_order = 6; MultipoleExpansion multipole(truncation_order, center, alf_ptr);