Skip to content

Commit 04a6a38

Browse files
committed
Adjust comments: fix spelling and end-of-line punctuation.
1 parent fc9e97d commit 04a6a38

37 files changed

+171
-176
lines changed

palace/drivers/drivensolver.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ ErrorIndicator DrivenSolver::SweepUniform(SpaceOperator &space_op, int n_step, i
130130
// Switch paraview subfolders: one for each excitation, if nr_excitations > 1.
131131
post_op.InitializeParaviewDataCollection(excitation_idx);
132132

133-
// Frequency loop
133+
// Frequency loop.
134134
double omega = omega0;
135135
for (int step = step0; step < n_step; step++, omega += delta_omega)
136136
{
@@ -139,7 +139,7 @@ ErrorIndicator DrivenSolver::SweepUniform(SpaceOperator &space_op, int n_step, i
139139
iodata.units.Dimensionalize<Units::ValueType::FREQUENCY>(omega),
140140
Timer::Duration(Timer::Now() - t0).count());
141141

142-
// Assemble matrices: skip if already done (first excitation & first freq point)
142+
// Assemble matrices: skip if already done (first excitation & first freq point).
143143
if (!first_iter_set)
144144
{
145145
// Update frequency-dependent excitation and operators.
@@ -152,7 +152,7 @@ ErrorIndicator DrivenSolver::SweepUniform(SpaceOperator &space_op, int n_step, i
152152
ksp.SetOperators(*A, *P);
153153
}
154154
first_iter_set = false;
155-
// Solve linear system
155+
// Solve linear system.
156156
space_op.GetExcitationVector(excitation_idx, omega, RHS);
157157
Mpi::Print("\n");
158158
ksp.Mult(RHS, E);
@@ -181,7 +181,7 @@ ErrorIndicator DrivenSolver::SweepUniform(SpaceOperator &space_op, int n_step, i
181181
Mpi::Print(" Updating solution error estimates\n");
182182
estimator.AddErrorIndicator(E, B, total_domain_energy, indicator);
183183
}
184-
// Final postprocessing & printing
184+
// Final postprocessing & printing.
185185
BlockTimer bt0(Timer::POSTPRO);
186186
SaveMetadata(ksp);
187187
}
@@ -206,7 +206,7 @@ ErrorIndicator DrivenSolver::SweepAdaptive(SpaceOperator &space_op, int n_step,
206206
{
207207
max_size_per_excitation = 20; // Default value
208208
}
209-
// Maximum size — no more than nr steps needed
209+
// Maximum size — no more than nr steps needed.
210210
max_size_per_excitation = std::min(max_size_per_excitation, (n_step - step0));
211211

212212
// Allocate negative curl matrix for postprocessing the B-field and vectors for the
@@ -278,13 +278,13 @@ ErrorIndicator DrivenSolver::SweepAdaptive(SpaceOperator &space_op, int n_step,
278278
// B = -1/(iω) ∇ x E + 1/ω kp x E
279279
floquet_corr->AddMult(E, B, 1.0 / omega);
280280
}
281-
// Debug option to print prom samples fields to paraview file
281+
// Debug option to print prom samples fields to paraview file.
282282
std::optional<std::pair<int, double>> debug_print_paraview_opt = {};
283283
if constexpr (debug_prom_paraview)
284284
{
285285
// Paraview times are printed as excitation * padding + freq with padding gives enough
286286
// space for f_max + 1, e.g. if f_max = 102 GHz, then we get time n0fff where n is the
287-
// excitation index and fff is the frequency
287+
// excitation index and fff is the frequency.
288288
double excitation_padding =
289289
std::pow(10.0, 3.0 + static_cast<int>(std::log10(iodata.solver.driven.max_f)));
290290
auto freq = iodata.units.Dimensionalize<Units::ValueType::FREQUENCY>(omega);
@@ -299,7 +299,7 @@ ErrorIndicator DrivenSolver::SweepAdaptive(SpaceOperator &space_op, int n_step,
299299
estimator.AddErrorIndicator(E, B, total_domain_energy, indicator);
300300
};
301301

302-
// Loop excitations to add to PROM
302+
// Loop excitations to add to PROM.
303303
auto print_counter_excitation_prom = 0; // 1 based indexing; will increment at start
304304
for (const auto &[excitation_idx, spec] : excitation_helper.excitations)
305305
{
@@ -386,7 +386,7 @@ ErrorIndicator DrivenSolver::SweepAdaptive(SpaceOperator &space_op, int n_step,
386386
// Switch paraview subfolders: one for each excitation, if nr_excitations > 1.
387387
post_op.InitializeParaviewDataCollection(excitation_idx);
388388

389-
// Frequency loop
389+
// Frequency loop.
390390
double omega = omega0;
391391
for (int step = step0; step < n_step; step++, omega += delta_omega)
392392
{
@@ -414,7 +414,7 @@ ErrorIndicator DrivenSolver::SweepAdaptive(SpaceOperator &space_op, int n_step,
414414
}
415415
post_op.MeasureAndPrintAll(excitation_idx, step, E, B, omega);
416416
}
417-
// Final postprocessing & printing: no change to indicator since prom
417+
// Final postprocessing & printing: no change to indicator since these are in PROM.
418418
BlockTimer bt0(Timer::POSTPRO);
419419
SaveMetadata(prom_op.GetLinearSolver());
420420
}

palace/drivers/electrostaticsolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ void ElectrostaticSolver::PostprocessTerminals(
159159
for (const auto &[idx2, data2] : terminal_sources)
160160
{
161161
output.table.insert(format("i2{}", idx2), format("{}[i][{}] {}", name, idx2, unit));
162-
// Use the fact that iterator over i and j is the same span
162+
// Use the fact that iterator over i and j is the same span.
163163
output.table["i"] << idx2;
164164

165165
auto &col = output.table[format("i2{}", idx2)];

palace/drivers/magnetostaticsolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void MagnetostaticSolver::PostprocessTerminals(
164164
for (const auto &[idx2, data2] : surf_j_op)
165165
{
166166
output.table.insert(format("i2{}", idx2), format("{}[i][{}] {}", name, idx2, unit));
167-
// Use the fact that iterator over i and j is the same span
167+
// Use the fact that iterator over i and j is the same span.
168168
output.table["i"] << idx2;
169169

170170
auto &col = output.table[format("i2{}", idx2)];

palace/drivers/transientsolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ TransientSolver::Solve(const std::vector<std::unique_ptr<Mesh>> &mesh) const
9393
Mpi::Print(" Updating solution error estimates\n");
9494
estimator.AddErrorIndicator(E, B, total_domain_energy, indicator);
9595
}
96-
// Final postprocessing & printing
96+
// Final postprocessing & printing.
9797
BlockTimer bt1(Timer::POSTPRO);
9898
time_op.PrintStats();
9999
SaveMetadata(time_op.GetLinearSolver());

palace/fem/coefficient.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class BdrGridFunctionCoefficient
3333
{
3434
protected:
3535
// XX TODO: For thread-safety (multiple threads evaluating a coefficient simultaneously),
36-
// the FET, FET.Elem1, and FET.Elem2 objects cannot be shared
36+
// the FET, FET.Elem1, and FET.Elem2 objects cannot be shared.
3737
const mfem::ParMesh &mesh;
3838
mfem::FaceElementTransformations FET;
3939
mfem::IsoparametricTransformation T1, T2;

palace/fem/libceed/basis.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void InitCeedInterpolatorBasis(const mfem::FiniteElement &trial_fe,
9191
const mfem::FiniteElement &test_fe, CeedInt trial_num_comp,
9292
CeedInt test_num_comp, Ceed ceed, CeedBasis *basis)
9393
{
94-
// Basis projection operator using libCEED
94+
// Basis projection operator using libCEED.
9595
CeedBasis trial_basis, test_basis;
9696
const int P = std::max(trial_fe.GetDof(), test_fe.GetDof()), ir_order_max = 100;
9797
int ir_order = std::max(trial_fe.GetOrder(), test_fe.GetOrder());
@@ -128,25 +128,25 @@ void InitMfemInterpolatorBasis(const mfem::FiniteElement &trial_fe,
128128
dummy.SetIdentityTransformation(trial_fe.GetGeomType());
129129
if (trial_fe.GetMapType() == test_fe.GetMapType())
130130
{
131-
// Prolongation
131+
// Prolongation.
132132
test_fe.GetTransferMatrix(trial_fe, dummy, Bt);
133133
}
134134
else if (trial_fe.GetMapType() == mfem::FiniteElement::VALUE &&
135135
test_fe.GetMapType() == mfem::FiniteElement::H_CURL)
136136
{
137-
// Discrete gradient interpolator
137+
// Discrete gradient interpolator.
138138
test_fe.ProjectGrad(trial_fe, dummy, Bt);
139139
}
140140
else if (trial_fe.GetMapType() == mfem::FiniteElement::H_CURL &&
141141
test_fe.GetMapType() == mfem::FiniteElement::H_DIV)
142142
{
143-
// Discrete curl interpolator
143+
// Discrete curl interpolator.
144144
test_fe.ProjectCurl(trial_fe, dummy, Bt);
145145
}
146146
else if (trial_fe.GetMapType() == mfem::FiniteElement::H_DIV &&
147147
test_fe.GetMapType() == mfem::FiniteElement::INTEGRAL)
148148
{
149-
// Discrete divergence interpolator
149+
// Discrete divergence interpolator.
150150
test_fe.ProjectDiv(trial_fe, dummy, Bt);
151151
}
152152
else

palace/fem/libceed/restriction.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mfem::Array<int> GetFaceDofsFromAdjacentElement(const mfem::FiniteElementSpace &
2525
mfem::DofTransformation &dof_trans,
2626
const int P, const int e)
2727
{
28-
// Get coordinates of face dofs
28+
// Get coordinates of face dofs.
2929
int elem_id, face_info;
3030
fespace.GetMesh()->GetBdrElementAdjacentElement(e, elem_id, face_info);
3131
mfem::Geometry::Type face_geom = fespace.GetMesh()->GetBdrElementGeometry(e);
@@ -48,13 +48,13 @@ mfem::Array<int> GetFaceDofsFromAdjacentElement(const mfem::FiniteElementSpace &
4848
mfem::DenseMatrix face_pm;
4949
fespace.GetMesh()->GetNodes()->GetVectorValues(Loc1.Transf, face_ir, face_pm);
5050

51-
// Get coordinates of element dofs
51+
// Get coordinates of element dofs.
5252
mfem::DenseMatrix elem_pm;
5353
const mfem::FiniteElement *fe_elem = fespace.GetFE(elem_id);
5454
mfem::ElementTransformation *T = fespace.GetMesh()->GetElementTransformation(elem_id);
5555
T->Transform(fe_elem->GetNodes(), elem_pm);
5656

57-
// Find the dofs
57+
// Find the dofs.
5858
double tol = 1E-5;
5959
mfem::Array<int> elem_dofs, dofs(P);
6060
fespace.GetElementDofs(elem_id, elem_dofs, dof_trans);

palace/fem/multigrid.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ inline FiniteElementSpaceHierarchy ConstructFiniteElementSpaceHierarchy(
101101
dbc_tdof_lists->emplace_back());
102102
}
103103

104-
// h-refinement
104+
// h-refinement.
105105
for (std::size_t l = coarse_mesh_l + 1; l < mesh.size(); l++)
106106
{
107107
fespaces.AddLevel(std::make_unique<FiniteElementSpace>(*mesh[l], fecs[0].get()));
@@ -112,7 +112,7 @@ inline FiniteElementSpaceHierarchy ConstructFiniteElementSpaceHierarchy(
112112
}
113113
}
114114

115-
// p-refinement
115+
// p-refinement.
116116
for (std::size_t l = 1; l < fecs.size(); l++)
117117
{
118118
fespaces.AddLevel(std::make_unique<FiniteElementSpace>(*mesh.back(), fecs[l].get()));

palace/linalg/arpack.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void CheckInfoEUPD(a_int info)
157157
namespace palace::arpack
158158
{
159159

160-
// Base class methods
160+
// Base class methods.
161161

162162
ArpackEigenvalueSolver::ArpackEigenvalueSolver(MPI_Comm comm, int print)
163163
: comm(comm), print(print)
@@ -485,7 +485,7 @@ void ArpackEigenvalueSolver::RescaleEigenvectors(int num_eig)
485485
}
486486
}
487487

488-
// EPS specific methods
488+
// EPS specific methods.
489489

490490
ArpackEPSSolver::ArpackEPSSolver(MPI_Comm comm, int print)
491491
: ArpackEigenvalueSolver(comm, print)
@@ -637,7 +637,7 @@ double ArpackEPSSolver::GetBackwardScaling(std::complex<double> l) const
637637
return normK + std::abs(l) * normM;
638638
}
639639

640-
// PEP specific methods
640+
// PEP specific methods.
641641

642642
ArpackPEPSolver::ArpackPEPSolver(MPI_Comm comm, int print)
643643
: ArpackEigenvalueSolver(comm, print)

palace/linalg/ksp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ std::unique_ptr<IterativeSolver<OperType>> ConfigureKrylovSolver(const IoData &i
8181
gmres->SetPrecSide(GmresSolverBase::PrecSide::RIGHT);
8282
break;
8383
case config::LinearSolverData::SideType::DEFAULT:
84-
// Do nothing
84+
// Do nothing.
8585
break;
8686
}
8787
}

palace/linalg/slepc.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ PetscReal GetMaxSingularValue(MPI_Comm comm, const ComplexOperator &A, bool herm
313313
}
314314
}
315315

316-
// Eigensolver base class methods
316+
// Eigensolver base class methods.
317317

318318
SlepcEigenvalueSolver::SlepcEigenvalueSolver(int print) : print(print)
319319
{
@@ -498,7 +498,7 @@ void SlepcEigenvalueSolver::RescaleEigenvectors(int num_eig)
498498
}
499499
}
500500

501-
// EPS specific methods
501+
// EPS specific methods.
502502

503503
SlepcEPSSolverBase::SlepcEPSSolverBase(MPI_Comm comm, int print, const std::string &prefix)
504504
: SlepcEigenvalueSolver(print)
@@ -981,7 +981,7 @@ PetscReal SlepcPEPLinearSolver::GetBackwardScaling(PetscScalar l) const
981981
return normK + t * normC + t * t * normM;
982982
}
983983

984-
// PEP specific methods
984+
// PEP specific methods.
985985

986986
SlepcPEPSolverBase::SlepcPEPSolverBase(MPI_Comm comm, int print, const std::string &prefix)
987987
: SlepcEigenvalueSolver(print)

palace/linalg/slepc.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ class SlepcPEPSolverBase : public SlepcEigenvalueSolver
329329
// SLEPc eigensolver object.
330330
PEP pep;
331331

332-
// Shell matrices for the quadratic polynomial eigenvalue problem
332+
// Shell matrices for the quadratic polynomial eigenvalue problem.
333333
Mat A0, A1, A2;
334334

335335
void Customize() override;

palace/linalg/solver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ template <>
3232
void MfemWrapperSolver<ComplexOperator>::SetOperator(const ComplexOperator &op)
3333
{
3434
// Assemble the real and imaginary parts, then add.
35-
// XX TODO: Test complex matrix assembly if coarse solve supports it
35+
// XX TODO: Test complex matrix assembly if coarse solve supports it.
3636
const mfem::HypreParMatrix *hAr = dynamic_cast<const mfem::HypreParMatrix *>(op.Real());
3737
const mfem::HypreParMatrix *hAi = dynamic_cast<const mfem::HypreParMatrix *>(op.Imag());
3838
const ParOperator *PtAPr = nullptr, *PtAPi = nullptr;

palace/linalg/strumpack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ StrumpackSolverBase<StrumpackSolverType>::StrumpackSolverBase(
7474
this->SetReorderingStrategy(strumpack::ReorderingStrategy::RCM);
7575
case config::LinearSolverData::SymFactType::PORD:
7676
case config::LinearSolverData::SymFactType::DEFAULT:
77-
// Should have good default
77+
// Should have good default.
7878
break;
7979
}
8080
this->SetReorderingReuse(true); // Repeated calls use same sparsity pattern

palace/linalg/superlu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ SuperLUSolver::SuperLUSolver(MPI_Comm comm, config::LinearSolverData::SymFactTyp
7171
case config::LinearSolverData::SymFactType::PTSCOTCH:
7272
case config::LinearSolverData::SymFactType::PORD:
7373
case config::LinearSolverData::SymFactType::DEFAULT:
74-
// Should have good default
74+
// Should have good default.
7575
break;
7676
}
7777
// solver.SetRowPermutation(mfem::superlu::NOROWPERM);

palace/models/lumpedportoperator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class LumpedPortData
3737
// Reference to material property data (not owned).
3838
const MaterialOperator &mat_op;
3939

40-
// To accomodate multielement lumped ports, a port may be made up of elements with
40+
// To accommodate multielement lumped ports, a port may be made up of elements with
4141
// different attributes and directions which add in parallel.
4242
std::vector<std::unique_ptr<LumpedElementData>> elems;
4343

palace/models/materialoperator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ void MaterialOperator::SetUpFloquetWaveVector(const IoData &iodata,
342342
"Quasi-periodic Floquet periodic boundary conditions are only available "
343343
" in 3D!");
344344

345-
// Get mesh dimensions in x/y/z coordinates
345+
// Get mesh dimensions in x/y/z coordinates.
346346
mfem::Vector bbmin, bbmax;
347347
mesh::GetAxisAlignedBoundingBox(mesh, bbmin, bbmax);
348348
bbmax -= bbmin;

palace/models/portexcitationhelper.hpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class PortExcitationHelper
3333
std::vector<int> wave_port = {};
3434
std::vector<int> current_port = {};
3535

36-
// TODO: C++20 to replace this with iterator over joined range
36+
// TODO: C++20 to replace this with iterator over joined range.
3737
auto flatten_port_indices() const
3838
{
3939
std::vector<int> out;
@@ -43,7 +43,7 @@ class PortExcitationHelper
4343
return out;
4444
}
4545

46-
// Only a single port is excitated in the excitation
46+
// Only a single port is excited.
4747
std::tuple<bool, PortType, int> is_simple() const
4848
{
4949
auto n_lumped = lumped_port.size();
@@ -83,7 +83,7 @@ class PortExcitationHelper
8383
for (const auto &[idx, port] : lumped_port_op)
8484
{
8585
if (port.excitation ==
86-
ExcitationIdx(0)) // LumpedPortData does not have HasExcitaiton
86+
ExcitationIdx(0)) // LumpedPortData does not have a HasExcitation() function
8787
{
8888
continue;
8989
}
@@ -92,7 +92,8 @@ class PortExcitationHelper
9292
}
9393
for (const auto &[idx, port] : wave_port_op)
9494
{
95-
if (port.excitation == ExcitationIdx(0)) // WavePortData does not have HasExcitaiton
95+
if (port.excitation ==
96+
ExcitationIdx(0)) // WavePortData does not have a HasExcitation() function
9697
{
9798
continue;
9899
}
@@ -122,15 +123,15 @@ class PortExcitationHelper
122123
{
123124
return ExcitationIdx(0);
124125
}
125-
// Map is stored order by key so max key is last item
126+
// Map is stored order by key so max key is last item.
126127
return std::next(std::rend(excitations))->first;
127128
}
128129
[[nodiscard]] auto Size() const { return excitations.size(); }
129130
[[nodiscard]] auto Empty() const { return excitations.empty(); }
130131

131132
[[nodiscard]] std::string FmtLog() const;
132133

133-
// Single Simple (only 1 port per excitation) Excitation
134+
// Single Simple (only 1 port per excitation) Excitation.
134135
[[nodiscard]] std::tuple<bool, ExcitationIdx, PortType, int> IsSingleSimple() const
135136
{
136137
if (Size() == 1)
@@ -145,7 +146,7 @@ class PortExcitationHelper
145146
return std::make_tuple(false, ExcitationIdx(0), PortType::Undefined, 0);
146147
}
147148

148-
// Multiple Simple (only 1 port per excitation) Excitation
149+
// Multiple Simple (only 1 port per excitation) Excitation.
149150
[[nodiscard]] bool IsMultipleSimple() const
150151
{
151152
return std::all_of(excitations.begin(), excitations.end(),

0 commit comments

Comments
 (0)