Skip to content

Commit

Permalink
[clang-tidy] fix cppcoreguidelines-prefer-member-initializer check
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaraslaut committed Jul 19, 2024
1 parent 09e1529 commit 5e62b99
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 25 deletions.
16 changes: 5 additions & 11 deletions palace/linalg/arpack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,21 +160,15 @@ namespace palace::arpack
// Base class methods

ArpackEigenvalueSolver::ArpackEigenvalueSolver(MPI_Comm comm, int print)
: comm(comm), print(print)
: comm(comm), print(print), info(0), rtol(0.0), arpack_it(0),
which_type(WhichType::LARGEST_MAGNITUDE), sinvert(false), sigma(0.0), opInv(nullptr),
opProj(nullptr), opB(nullptr)
{
// Initialization.
info = 0;

nev = ncv = n = 0;
rtol = 0.0;
arpack_it = 0;
which_type = WhichType::LARGEST_MAGNITUDE;
gamma = delta = 1.0;
sinvert = false;
sigma = 0.0;

opInv = nullptr;
opProj = nullptr;
opB = nullptr;
gamma = delta = 1.0;

// Configure debugging output.
a_int logfill = 6, ndigit = -6, mgetv0 = 0;
Expand Down
2 changes: 1 addition & 1 deletion palace/linalg/divfree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ DivFreeSolver<VecType>::DivFreeSolver(
FiniteElementSpaceHierarchy &h1_fespaces,
const std::vector<mfem::Array<int>> &h1_bdr_tdof_lists, double tol, int max_it,
int print)
: Grad(&nd_fespace.GetDiscreteInterpolator(h1_fespaces.GetFinestFESpace()))
{
BlockTimer bt(Timer::DIV_FREE);

Expand Down Expand Up @@ -114,7 +115,6 @@ DivFreeSolver<VecType>::DivFreeSolver(
WeakDiv = std::make_unique<ParOperator>(weakdiv.PartialAssemble(), nd_fespace,
h1_fespaces.GetFinestFESpace(), false);
}
Grad = &nd_fespace.GetDiscreteInterpolator(h1_fespaces.GetFinestFESpace());

// The system matrix for the projection is real and SPD.
auto amg = std::make_unique<MfemWrapperSolver<OperType>>(
Expand Down
2 changes: 1 addition & 1 deletion palace/linalg/errorestimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ FluxProjector<VecType>::FluxProjector(const MaterialPropertyCoefficient &coeff,
const FiniteElementSpaceHierarchy &smooth_fespaces,
const FiniteElementSpace &rhs_fespace, double tol,
int max_it, int print, bool use_mg)
: ksp{ConfigureLinearSolver<OperType>(smooth_fespaces, tol, max_it, print, use_mg)}
{
BlockTimer bt(Timer::CONSTRUCT_ESTIMATOR);
const auto &smooth_fespace = smooth_fespaces.GetFinestFESpace();
Expand Down Expand Up @@ -139,7 +140,6 @@ FluxProjector<VecType>::FluxProjector(const MaterialPropertyCoefficient &coeff,
Flux = BuildLevelParOperator<OperType>(flux.PartialAssemble(), rhs_fespace,
smooth_fespace);
}
ksp = ConfigureLinearSolver<OperType>(smooth_fespaces, tol, max_it, print, use_mg);
ksp->SetOperators(*M, *M);
rhs.SetSize(smooth_fespace.GetTrueVSize());
rhs.UseDevice(true);
Expand Down
4 changes: 2 additions & 2 deletions palace/linalg/hypre.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ void HypreVector::Update(const Vector &x)
}

HypreCSRMatrix::HypreCSRMatrix(int h, int w, int nnz)
: palace::Operator(h, w), hypre_own_I(true)
: palace::Operator(h, w), mat(hypre_CSRMatrixCreate(h, w, nnz)), hypre_own_I(true)
{
mat = hypre_CSRMatrixCreate(h, w, nnz);

hypre_CSRMatrixInitialize(mat);
}

Expand Down
3 changes: 2 additions & 1 deletion palace/linalg/ksp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ BaseKspSolver<OperType>::BaseKspSolver(const IoData &iodata,
ConfigurePreconditionerSolver<OperType>(fespaces.GetFinestFESpace().GetComm(),
iodata, fespaces, aux_fespaces))
{
use_timer = true;

use_timer = true; //NOLINT
}

template <typename OperType>
Expand Down
4 changes: 2 additions & 2 deletions palace/models/timeoperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ class TimeDependentCurlCurlOperator : public mfem::SecondOrderTimeDependentOpera

TimeOperator::TimeOperator(const IoData &iodata, SpaceOperator &space_op,
std::function<double(double)> &dJ_coef)
{
// Construct discrete curl matrix for B-field time integration.
Curl = &space_op.GetCurlMatrix();
: Curl(&space_op.GetCurlMatrix())
{

// Allocate space for solution vectors.
E.SetSize(Curl->Width());
Expand Down
9 changes: 2 additions & 7 deletions palace/models/waveportoperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,14 +521,9 @@ WavePortData::WavePortData(const config::WavePortData &data,
mfem::ParFiniteElementSpace &nd_fespace,
mfem::ParFiniteElementSpace &h1_fespace,
const mfem::Array<int> &dbc_attr)
: mat_op(mat_op)
: mat_op(mat_op), mode_idx(data.mode_idx), d_offset(data.d_offset), excitation(data.excitation),
active(data.active), kn0(0.0), omega0(0.0)
{
mode_idx = data.mode_idx;
d_offset = data.d_offset;
excitation = data.excitation;
active = data.active;
kn0 = 0.0;
omega0 = 0.0;

// Construct the SubMesh.
MFEM_VERIFY(!data.attributes.empty(), "Wave port boundary found with no attributes!");
Expand Down

0 comments on commit 5e62b99

Please sign in to comment.