Skip to content

Commit

Permalink
Indend and no-warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-heltai committed Aug 5, 2023
1 parent c985a2d commit c984124
Show file tree
Hide file tree
Showing 19 changed files with 54 additions and 52 deletions.
6 changes: 3 additions & 3 deletions include/constrained_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ template <class VEC, class MATRIX>
class ConstrainedOperator
{
public:
ConstrainedOperator(const MATRIX &m,
ConstrainedOperator(const MATRIX & m,
const AffineConstraints<double> &c,
const IndexSet &c_cpu_set,
const IndexSet & c_cpu_set,
MPI_Comm comm = MPI_COMM_WORLD)
: constraints(c)
, matrix(m)
Expand All @@ -74,7 +74,7 @@ class ConstrainedOperator

private:
const AffineConstraints<double> &constraints;
const MATRIX &matrix;
const MATRIX & matrix;
const IndexSet constr_cpu_set;
MPI_Comm mpi_communicator;
unsigned int n_mpi_processes;
Expand Down
9 changes: 5 additions & 4 deletions include/laplace_kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -111,9 +112,9 @@ namespace LaplaceKernel
template <int dim> // 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;
Expand Down
2 changes: 1 addition & 1 deletion include/local_expansion.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class LocalExpansion

LocalExpansion(const unsigned int order,
const dealii::Point<3> &center,
const AssLegFunction *assLegFunction);
const AssLegFunction * assLegFunction);

LocalExpansion(const LocalExpansion &other);

Expand Down
4 changes: 2 additions & 2 deletions include/local_expansion_coeff.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -49,7 +49,7 @@ class LocalExpansionCoeff

private:
unsigned int _p;
double *_coeff;
double * _coeff;
};

#endif /* LOCALEXPANSIONCOEFF_HPP */
4 changes: 2 additions & 2 deletions include/multipole_expansion.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class MultipoleExpansion

MultipoleExpansion(const unsigned int order,
const dealii::Point<3> &center,
const AssLegFunction *assLegFunction);
const AssLegFunction * assLegFunction);

MultipoleExpansion(const MultipoleExpansion &other);

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/singular_kernel_integral.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ class SingularKernelIntegral
const Mapping<dim - 1, dim> & mapping;
const Point<dim - 1> & 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
10 changes: 5 additions & 5 deletions include/true_constrained_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ template <class VEC, class MATRIX>
class ConstrainedOperator
{
public:
ConstrainedOperator(const MATRIX &m,
ConstrainedOperator(const MATRIX & m,
const AffineConstraints<double> &c,
const IndexSet &c_cpu_set,
const IndexSet & c_cpu_set,
MPI_Comm comm = MPI_COMM_WORLD)
: cm(c)
, matrix(m)
Expand Down Expand Up @@ -82,7 +82,7 @@ class ConstrainedOperator

private:
const AffineConstraints<double> &cm;
const MATRIX &matrix;
const MATRIX & matrix;
const IndexSet constr_cpu_set;
AffineConstraints<double> cmt;
MPI_Comm mpi_communicator;
Expand Down Expand Up @@ -112,7 +112,7 @@ class ConstrainedOperator

template <class VEC, class MATRIX>
void
ConstrainedOperator<VEC, MATRIX>::constraint_vmult(VEC &dst,
ConstrainedOperator<VEC, MATRIX>::constraint_vmult(VEC & dst,
const VEC &src) const
{
VEC loc_src(src.locally_owned_elements(), constr_cpu_set, mpi_communicator);
Expand Down Expand Up @@ -141,7 +141,7 @@ ConstrainedOperator<VEC, MATRIX>::constraint_vmult(VEC &dst,

template <class VEC, class MATRIX>
void
ConstrainedOperator<VEC, MATRIX>::constraint_tvmult(VEC &dst,
ConstrainedOperator<VEC, MATRIX>::constraint_tvmult(VEC & dst,
const VEC &src) const
{
VEC loc_dst(constr_cpu_set);
Expand Down
34 changes: 17 additions & 17 deletions source/bem_fma.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ BEMFMA<dim>::~BEMFMA()
template <int dim>
void
BEMFMA<dim>::init_fma(
const DoFHandler<dim - 1, dim> &input_dh,
const DoFHandler<dim - 1, dim> & input_dh,
const std::vector<std::set<types::global_dof_index>> &db_in,
const TrilinosWrappers::MPI::Vector &input_sn,
const Mapping<dim - 1, dim> &input_mapping,
const TrilinosWrappers::MPI::Vector & input_sn,
const Mapping<dim - 1, dim> & input_mapping,
unsigned int quad_order,
unsigned int sing_quad_order)
{
Expand Down Expand Up @@ -735,7 +735,7 @@ BEMFMA<dim>::direct_integrals()
auto f_worker_direct_childless_non_int_list =
[this](typename std::vector<types::global_dof_index>::iterator block_it,
DirectScratchData &,
DirectCopyData &copy_data,
DirectCopyData & copy_data,
const std::vector<Point<dim>> &support_points,
std::vector<QTelles<dim - 1>> &sing_quadratures) {
// pcout<<"processing block "<<kk <<" of
Expand Down Expand Up @@ -1114,7 +1114,7 @@ BEMFMA<dim>::direct_integrals()
auto f_worker_direct_bigger_blocks =
[this](typename std::vector<types::global_dof_index>::iterator block_it,
DirectScratchData &,
DirectCopyData &copy_data,
DirectCopyData & copy_data,
const std::vector<Point<dim>> &support_points,
types::global_dof_index startBlockLevel) {
copy_data.vec_local_dof_indices.resize(0);
Expand All @@ -1124,7 +1124,7 @@ BEMFMA<dim>::direct_integrals()
copy_data.vec_start_helper.resize(0);

types::global_dof_index blockId = *block_it;
OctreeBlock<dim> *block1 = this->blocks[blockId];
OctreeBlock<dim> * block1 = this->blocks[blockId];
const std::vector<types::global_dof_index> &nodesBlk1Ids =
block1->GetBlockNodeList();
types::global_dof_index helper_index = 0;
Expand Down Expand Up @@ -1824,7 +1824,7 @@ BEMFMA<dim>::multipole_integrals()
MultipoleData &copy_data) //, const unsigned int dofs_per_cell)
{
types::global_dof_index blockId = *blocky;
OctreeBlock<dim> *block = this->blocks[blockId];
OctreeBlock<dim> * block = this->blocks[blockId];
double delta = block->GetDelta();
Point<dim> deltaHalf;
for (unsigned int i = 0; i < dim; i++)
Expand Down Expand Up @@ -2231,7 +2231,7 @@ BEMFMA<dim>::generate_multipole_expansions(
// for each block we get the center and the quad points

types::global_dof_index blockId = childlessList[kk];
OctreeBlock<dim> *block = blocks[blockId];
OctreeBlock<dim> * block = blocks[blockId];

double delta = blocks[blockId]->GetDelta();
Point<dim> deltaHalf;
Expand Down Expand Up @@ -2447,7 +2447,7 @@ BEMFMA<dim>::generate_multipole_expansions(
auto f_worker_ascend =
[this](typename std::vector<OctreeBlock<dim> *>::iterator block_it,
AscendScratchData &,
AscendCopyData &copy_data,
AscendCopyData & copy_data,
types::global_dof_index start) {
types::global_dof_index kk =
std::distance(this->blocks.begin(), block_it);
Expand Down Expand Up @@ -2571,8 +2571,8 @@ void
BEMFMA<dim>::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);
Expand Down Expand Up @@ -2734,7 +2734,7 @@ BEMFMA<dim>::multipole_matr_vect_products(
std::vector<types::global_dof_index>::const_iterator
block_it_id,
DescendScratchData &,
DescendCopyData &copy_data,
DescendCopyData & copy_data,
const types::global_dof_index start) {
// types::global_dof_index kk = std::distance(this->blocks.begin(),
// block_it);
Expand All @@ -2743,7 +2743,7 @@ BEMFMA<dim>::multipole_matr_vect_products(
copy_data.start = start;
copy_data.blockId = *block_it_id;
types::global_dof_index kk = *block_it_id;
OctreeBlock<dim> *block_it;
OctreeBlock<dim> * block_it;
block_it = this->blocks[*block_it_id];
// copy_data.local_level_indices[kk] = start + kk;
//*****************definire chi e' on_process qui
Expand Down Expand Up @@ -3169,7 +3169,7 @@ BEMFMA<dim>::multipole_matr_vect_products(
for (types::global_dof_index kk = r.begin(); kk < r.end(); ++kk)
{
types::global_dof_index block1Id = childlessList[kk];
OctreeBlock<dim> *block1 = blocks[block1Id];
OctreeBlock<dim> * block1 = blocks[block1Id];
std::vector<types::global_dof_index> nodesBlk1Ids =
block1->GetBlockNodeList();

Expand Down Expand Up @@ -3291,7 +3291,7 @@ template <int dim>
TrilinosWrappers::PreconditionILU &
BEMFMA<dim>::FMA_preconditioner(
const TrilinosWrappers::MPI::Vector &alpha,
AffineConstraints<double> &c) // TO BE CHANGED!!!
AffineConstraints<double> & c) // TO BE CHANGED!!!
{
Teuchos::TimeMonitor LocalTimer(*PrecondTime);
// the final preconditioner (with constraints) has a slightly different
Expand Down Expand Up @@ -4476,7 +4476,7 @@ BEMFMA<dim>::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
Expand Down Expand Up @@ -4635,7 +4635,7 @@ BEMFMA<dim>::generate_octree_blocking()
// neigh: let's check
{
types::global_dof_index block2Id = *pos;
OctreeBlock<dim> *block2 = blocks[block2Id];
OctreeBlock<dim> * block2 = blocks[block2Id];
double delta2 = block2->GetDelta();
Point<dim> PMin2 = block2->GetPMin();
Point<dim> Center2;
Expand Down
2 changes: 1 addition & 1 deletion source/local_expansion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ LocalExpansion::LocalExpansion()

LocalExpansion::LocalExpansion(const unsigned int order,
const dealii::Point<3> &center,
const AssLegFunction *assLegFunction)
const AssLegFunction * assLegFunction)

{
this->p = order;
Expand Down
2 changes: 1 addition & 1 deletion source/local_expansion_coeff.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions source/multipole_expansion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ MultipoleExpansion::MultipoleExpansion()

MultipoleExpansion::MultipoleExpansion(const unsigned int order,
const dealii::Point<3> &center,
const AssLegFunction *assLegFunction)
const AssLegFunction * assLegFunction)

{
this->p = order;
Expand Down Expand Up @@ -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)

{
Expand Down
11 changes: 6 additions & 5 deletions source/singular_kernel_integral.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion tests/local_expansion_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion tests/local_expansion_creation_and_evaluation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion tests/local_expansion_translation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion tests/multipole_expansion_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Loading

0 comments on commit c984124

Please sign in to comment.