Skip to content

Commit ca4f804

Browse files
author
sohail-GLADOS
committed
Code linting from automated moose patch
1 parent 062e5a0 commit ca4f804

File tree

8 files changed

+42
-40
lines changed

8 files changed

+42
-40
lines changed

framework/include/mfem/bcs/MFEMIntegratedBC.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class MFEMIntegratedBC : public MFEMBoundaryCondition
2525
virtual mfem::LinearFormIntegrator * createLFIntegrator() = 0;
2626

2727
/// Create MFEM integrator to apply non-linear residual form. Ownership managed by the caller.
28-
virtual mfem::LinearFormIntegrator * createNLAIntegrator(){return nullptr;};
28+
virtual mfem::LinearFormIntegrator * createNLAIntegrator() { return nullptr; };
2929

3030
/// Create MFEM integrator to apply to the LHS of the weak form. Ownership managed by the caller.
3131
virtual mfem::BilinearFormIntegrator * createBFIntegrator() = 0;

framework/include/mfem/equation_systems/EquationSystem.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class EquationSystem : public mfem::Operator
9797
virtual void BuildMixedBilinearForms();
9898
/// Build all forms comprising this EquationSystem
9999
virtual void BuildEquationSystem();
100-
//Reassemble the Jacobian matrix/Operator (Assuming Gridfunction dependant Operator)
100+
// Reassemble the Jacobian matrix/Operator (Assuming Gridfunction dependant Operator)
101101
virtual void ReassembleJacobian(mfem::BlockVector & x, mfem::BlockVector & rhs);
102102
virtual void UpdateJacobian() const;
103103

@@ -182,8 +182,8 @@ class EquationSystem : public mfem::Operator
182182
NamedFieldsMap<mfem::ParBilinearForm> _blfs;
183183
NamedFieldsMap<mfem::ParLinearForm> _lfs;
184184
NamedFieldsMap<mfem::ParNonlinearForm> _nlfs;
185-
NamedFieldsMap<mfem::ParLinearForm> _nlAs;
186-
NamedFieldsMap<NamedFieldsMap<mfem::ParMixedBilinearForm>> _mblfs; //named according to trial var
185+
NamedFieldsMap<mfem::ParLinearForm> _nlAs;
186+
NamedFieldsMap<NamedFieldsMap<mfem::ParMixedBilinearForm>> _mblfs; // named according to trial var
187187

188188
/// Gridfunctions holding essential constraints from Dirichlet BCs
189189
std::vector<std::unique_ptr<mfem::ParGridFunction>> _var_ess_constraints;
@@ -200,19 +200,18 @@ class EquationSystem : public mfem::Operator
200200
/// Named according to test variable.
201201
NamedFieldsMap<std::vector<std::shared_ptr<MFEMEssentialBC>>> _essential_bc_map;
202202

203-
//Operator handle for the jacobian matrix
203+
// Operator handle for the jacobian matrix
204204
mutable mfem::OperatorHandle _jacobian;
205205
mfem::AssemblyLevel _assembly_level;
206206

207-
//Temporary vectors used for non-linear action
208-
//assembly process
207+
// Temporary vectors used for non-linear action
208+
// assembly process
209209
mutable mfem::BlockVector _trueBlockSol, _blockForces, _blockResidual;
210210
Moose::MFEM::GridFunctions * _gfuncs;
211-
mfem::Array<int> *_block_true_offsets=NULL;
211+
mfem::Array<int> * _block_true_offsets = NULL;
212212
mfem::Array<int> empty_tdof;
213213
bool _non_linear = false;
214214

215-
216215
private:
217216
friend class EquationSystemProblemOperator;
218217
/// Disallowed inherited method
@@ -284,7 +283,7 @@ EquationSystem::ApplyDomainNLAFIntegrators(
284283
mfem::LinearFormIntegrator * integ = kernel->createNLAIntegrator();
285284
if (integ)
286285
{
287-
_non_linear=true;
286+
_non_linear = true;
288287
kernel->isSubdomainRestricted()
289288
? form->AddDomainIntegrator(std::move(integ), kernel->getSubdomainMarkers())
290289
: form->AddDomainIntegrator(std::move(integ));
@@ -348,7 +347,6 @@ EquationSystem::ApplyBoundaryLFIntegrators(
348347
}
349348
}
350349

351-
352350
inline void
353351
EquationSystem::ApplyBoundaryNLAFIntegrators(
354352
const std::string & test_var_name,

framework/include/mfem/kernels/MFEMKernel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class MFEMKernel : public MFEMGeneralUserObject, public MFEMBlockRestrictable
3030
/// Create a new MFEM integrator to apply to the weak form. Ownership managed by the caller.
3131
virtual mfem::LinearFormIntegrator * createLFIntegrator() { return nullptr; }
3232
virtual mfem::BilinearFormIntegrator * createBFIntegrator() { return nullptr; }
33-
virtual mfem::LinearFormIntegrator * createNLAIntegrator(){return nullptr; }
33+
virtual mfem::LinearFormIntegrator * createNLAIntegrator() { return nullptr; }
3434

3535
/// Get name of the test variable labelling the weak form this kernel is added to
3636
const VariableName & getTestVariableName() const { return _test_var_name; }

framework/include/mfem/kernels/MFEMNLDiffusionKernel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ class MFEMNLDiffusionKernel : public MFEMKernel
2525
MFEMNLDiffusionKernel(const InputParameters & parameters);
2626

2727
virtual mfem::BilinearFormIntegrator * createBFIntegrator() override;
28-
virtual mfem::LinearFormIntegrator * createNLAIntegrator() override;
28+
virtual mfem::LinearFormIntegrator * createNLAIntegrator() override;
2929

3030
protected:
3131
mfem::Coefficient & _coef;
3232
mfem::ScalarVectorProductCoefficient * _product_coef_res;
3333
mfem::ScalarVectorProductCoefficient * _product_coef_jac;
34-
mfem::SumIntegrator * _sum;
34+
mfem::SumIntegrator * _sum;
3535
mfem::ConstantCoefficient * _one;
3636
};
3737

framework/src/mfem/equation_systems/ComplexEquationSystem.C

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ ComplexEquationSystem::FormSystemMatrix(mfem::OperatorHandle & op,
269269
op.Reset(mfem::HypreParMatrixFromBlocks(_h_blocks));
270270
}
271271

272-
//Equation system Mult
272+
// Equation system Mult
273273
void
274274
ComplexEquationSystem::Mult(const mfem::Vector & x, mfem::Vector & residual) const
275275
{
@@ -278,7 +278,6 @@ ComplexEquationSystem::Mult(const mfem::Vector & x, mfem::Vector & residual) con
278278
residual.HostRead();
279279
}
280280

281-
282281
void
283282
ComplexEquationSystem::RecoverComplexFEMSolution(
284283
mfem::BlockVector & trueX,

framework/src/mfem/equation_systems/EquationSystem.C

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ namespace Moose::MFEM
1717

1818
EquationSystem::~EquationSystem()
1919
{
20-
if(_gfuncs != NULL) delete _gfuncs;
21-
if(_block_true_offsets != NULL) delete _block_true_offsets;
20+
if (_gfuncs != NULL)
21+
delete _gfuncs;
22+
if (_block_true_offsets != NULL)
23+
delete _block_true_offsets;
2224
DeleteAllBlocks();
2325
}
2426

@@ -165,15 +167,16 @@ EquationSystem::Init(Moose::MFEM::GridFunctions & gridfunctions,
165167
_eliminated_variables.Register(eliminated_var_name,
166168
gridfunctions.GetShared(eliminated_var_name));
167169

168-
//Get a reference to the GridFunctions
170+
// Get a reference to the GridFunctions
169171
_gfuncs = new Moose::MFEM::GridFunctions(gridfunctions);
170172

171-
//Build the temporary BlockVectors
172-
_block_true_offsets = new mfem::Array<int>(_trial_var_names.size()+1);
173+
// Build the temporary BlockVectors
174+
_block_true_offsets = new mfem::Array<int>(_trial_var_names.size() + 1);
173175
(*_block_true_offsets)[0] = 0;
174176

175-
for(unsigned I=0; I<_trial_var_names.size(); I++){
176-
(*_block_true_offsets)[I+1] = _gfuncs->Get(_trial_var_names.at(I))->ParFESpace()->TrueVSize();
177+
for (unsigned I = 0; I < _trial_var_names.size(); I++)
178+
{
179+
(*_block_true_offsets)[I + 1] = _gfuncs->Get(_trial_var_names.at(I))->ParFESpace()->TrueVSize();
177180
}
178181
_block_true_offsets->PartialSum();
179182
_trueBlockSol.Update(*_block_true_offsets);
@@ -342,15 +345,17 @@ EquationSystem::FormSystemMatrix(mfem::OperatorHandle & op,
342345
op.Reset(mfem::HypreParMatrixFromBlocks(_h_blocks));
343346
}
344347

345-
void EquationSystem::ReassembleJacobian(mfem::BlockVector & x, mfem::BlockVector & rhs)
348+
void
349+
EquationSystem::ReassembleJacobian(mfem::BlockVector & x, mfem::BlockVector & rhs)
346350
{
347-
//Reassemble all the Forms
351+
// Reassemble all the Forms
348352
for (const auto I : index_range(_test_var_names))
349353
{
350354
auto test_var_name = _test_var_names.at(I);
351355
_blfs.GetShared(test_var_name)->Update();
352356
_blfs.GetShared(test_var_name)->Assemble();
353-
if (_mblfs.Has(test_var_name)){
357+
if (_mblfs.Has(test_var_name))
358+
{
354359
for (const auto J : index_range(_coupled_var_names))
355360
{
356361
auto coupled_var_name = _coupled_var_names.at(J);
@@ -363,9 +368,9 @@ void EquationSystem::ReassembleJacobian(mfem::BlockVector & x, mfem::BlockVector
363368
}
364369
}
365370

366-
//Form the system matrix
367-
//This uses dummy arguments
368-
//for the vectors
371+
// Form the system matrix
372+
// This uses dummy arguments
373+
// for the vectors
369374
FormLinearSystem(_jacobian, x, rhs);
370375
};
371376

@@ -406,7 +411,11 @@ EquationSystem::UpdateJacobian() const
406411
}
407412
}
408413

409-
void CopyVec(const mfem::Vector & x, mfem::Vector & y){y = x;};
414+
void
415+
CopyVec(const mfem::Vector & x, mfem::Vector & y)
416+
{
417+
y = x;
418+
};
410419

411420
void
412421
EquationSystem::Mult(const mfem::Vector & sol, mfem::Vector & residual) const
@@ -460,8 +469,6 @@ EquationSystem::Mult(const mfem::Vector & sol, mfem::Vector & residual) const
460469
residual.HostRead();
461470
}
462471

463-
464-
465472
mfem::Operator &
466473
EquationSystem::GetGradient(const mfem::Vector & x) const
467474
{

framework/src/mfem/kernels/MFEMNLDiffusionKernel.C

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ MFEMNLDiffusionKernel::validParams()
2727
return params;
2828
}
2929

30-
MFEMNLDiffusionKernel::MFEMNLDiffusionKernel(
31-
const InputParameters & parameters)
30+
MFEMNLDiffusionKernel::MFEMNLDiffusionKernel(const InputParameters & parameters)
3231
: MFEMKernel(parameters), _coef(getScalarCoefficient("coefficient"))
3332
// FIXME: The MFEM bilinear form can also handle vector and matrix
3433
// coefficients, so ideally we'd handle all three too.

framework/src/mfem/problem_operators/EquationSystemProblemOperator.C

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ EquationSystemProblemOperator::Solve()
3737
_problem_data.jacobian_solver->updateSolver(
3838
*GetEquationSystem()->_blfs.Get(GetEquationSystem()->GetTestVarNames().at(0)),
3939
GetEquationSystem()->_ess_tdof_lists.at(0));
40-
/*
41-
_problem_data.nonlinear_solver->SetSolver(_problem_data.jacobian_solver->getSolver());
42-
_problem_data.nonlinear_solver->SetOperator(*GetEquationSystem());
43-
_problem_data.nonlinear_solver->Mult(_true_rhs, _true_x);
44-
*/
40+
/*
41+
_problem_data.nonlinear_solver->SetSolver(_problem_data.jacobian_solver->getSolver());
42+
_problem_data.nonlinear_solver->SetOperator(*GetEquationSystem());
43+
_problem_data.nonlinear_solver->Mult(_true_rhs, _true_x);
44+
*/
4545
mfem::Vector zero_vec(_true_rhs.Size());
4646
zero_vec = 0.0;
4747
_problem_data.nonlinear_solver->SetSolver(_problem_data.jacobian_solver->getSolver());
@@ -52,7 +52,6 @@ EquationSystemProblemOperator::Solve()
5252
else
5353
_problem_data.nonlinear_solver->Mult(zero_vec, _true_x);
5454

55-
5655
GetEquationSystem()->RecoverFEMSolution(
5756
_true_x, _problem_data.gridfunctions, _problem_data.cmplx_gridfunctions);
5857
}

0 commit comments

Comments
 (0)