Skip to content

Commit ae2cc3e

Browse files
committed
Apply clang format
1 parent 04f8b0d commit ae2cc3e

File tree

10 files changed

+53
-37
lines changed

10 files changed

+53
-37
lines changed

framework/include/mfem/bcs/MFEMDGBoundaryCondition.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class MFEMDGBoundaryCondition : public MFEMBoundaryCondition
3030
/// Get name of the trial variable (gridfunction) the kernel acts on.
3131
/// Defaults to the name of the test variable labelling the weak form.
3232
virtual const std::string & getTrialVariableName() const { return _test_var_name; }
33+
3334
protected:
3435
/// Name of (the test variable associated with) the weak form that the kernel is applied to.
3536
int _fe_order;

framework/include/mfem/dgkernels/MFEMDGKernel.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class MFEMDGKernel : public MFEMGeneralUserObject, public MFEMBlockRestrictable
4040
mfem::ConstantCoefficient _zero;
4141
mfem::real_t _sigma;
4242
mfem::real_t _kappa;
43-
4443
};
4544

4645
#endif

framework/include/mfem/equation_systems/EquationSystem.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,18 +162,20 @@ class EquationSystem : public mfem::Operator
162162
const std::string & trial_var_name,
163163
const std::string & test_var_name,
164164
std::shared_ptr<FormType> form,
165-
NamedFieldsMap<NamedFieldsMap<std::vector<std::shared_ptr<MFEMDGBoundaryCondition>>>> & bc_map,
165+
NamedFieldsMap<NamedFieldsMap<std::vector<std::shared_ptr<MFEMDGBoundaryCondition>>>> &
166+
bc_map,
166167
std::optional<mfem::real_t> scale_factor = std::nullopt);
167-
168+
168169
void ApplyDomainDGLFIntegrators(
169170
const std::string & test_var_name,
170171
std::shared_ptr<mfem::ParLinearForm> form,
171172
NamedFieldsMap<NamedFieldsMap<std::vector<std::shared_ptr<MFEMDGKernel>>>> & kernels_map);
172-
173+
173174
void ApplyBoundaryDGLFIntegrators(
174175
const std::string & test_var_name,
175176
std::shared_ptr<mfem::ParLinearForm> form,
176-
NamedFieldsMap<NamedFieldsMap<std::vector<std::shared_ptr<MFEMDGBoundaryCondition>>>> & bc_map);
177+
NamedFieldsMap<NamedFieldsMap<std::vector<std::shared_ptr<MFEMDGBoundaryCondition>>>> &
178+
bc_map);
177179

178180
/// Names of all trial variables of kernels and boundary conditions
179181
/// added to this EquationSystem.
@@ -350,7 +352,8 @@ EquationSystem::ApplyDomainDGBLFIntegrators(
350352
mfem::BilinearFormIntegrator * integ = kernel->createBFIntegrator();
351353
if (integ != nullptr)
352354
{
353-
mooseAssert( !kernel->isSubdomainRestricted(), "AddInteriorFaceIntegrator doesn't have an overload for this case " );
355+
mooseAssert(!kernel->isSubdomainRestricted(),
356+
"AddInteriorFaceIntegrator doesn't have an overload for this case ");
354357
form->AddInteriorFaceIntegrator(std::move(integ));
355358
}
356359
}
@@ -417,14 +420,14 @@ EquationSystem::ApplyDomainDGLFIntegrators(
417420
mfem::LinearFormIntegrator * integ = kernel->createLFIntegrator();
418421
if (integ != nullptr)
419422
{
420-
mooseAssert( !kernel->isSubdomainRestricted(), "AddInteriorFaceIntegrator doesn't have an overload for this case " );
423+
mooseAssert(!kernel->isSubdomainRestricted(),
424+
"AddInteriorFaceIntegrator doesn't have an overload for this case ");
421425
form->AddInteriorFaceIntegrator(std::move(integ));
422426
}
423427
}
424428
}
425429
}
426430

427-
428431
} // namespace Moose::MFEM
429432

430433
#endif

framework/include/mfem/problem/MFEMProblem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ class MFEMProblem : public ExternalProblem
119119
* Same as addKernel, but this time for DGKernels
120120
*/
121121
void addDGKernel(const std::string & kernel_name,
122-
const std::string & name,
123-
InputParameters & parameters) override;
122+
const std::string & name,
123+
InputParameters & parameters) override;
124124

125125
void addDGBoundaryCondition(const std::string & kernel_name,
126126
const std::string & name,

framework/src/mfem/actions/AddMFEMDGBoundaryConditions.C

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ InputParameters
1717
AddMFEMDGBoundaryConditions::validParams()
1818
{
1919
InputParameters params = MooseObjectAction::validParams();
20-
params.addClassDescription(
21-
"Add in DG Kernel on the boundary");
20+
params.addClassDescription("Add in DG Kernel on the boundary");
2221
return params;
2322
}
2423

framework/src/mfem/bcs/MFEMDGBoundaryCondition.C

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,24 @@ MFEMDGBoundaryCondition::validParams()
1919
params.addParam<VariableName>("variable",
2020
"Variable labelling the weak form this kernel is added to");
2121
params.addParam<mfem::real_t>("sigma", -1.0, "One of the DG penalty params. Typically +/- 1.0");
22-
params.addParam<mfem::real_t>("kappa", "One of the DG penalty params. Should be positive. Will default to (order+1)^2");
22+
params.addParam<mfem::real_t>(
23+
"kappa", "One of the DG penalty params. Should be positive. Will default to (order+1)^2");
2324
return params;
2425
}
2526

2627
MFEMDGBoundaryCondition::MFEMDGBoundaryCondition(const InputParameters & parameters)
2728
: MFEMBoundaryCondition(parameters),
28-
_fe_order(getMFEMProblem().getProblemData().gridfunctions.Get(_test_var_name)->ParFESpace()->FEColl()->GetOrder())
29-
, _one(1.0), _zero(0.0),
30-
_sigma(getParam<mfem::real_t>("sigma")),
31-
_kappa( (isParamSetByUser("kappa")) ? getParam<mfem::real_t>("kappa") : (_fe_order+1)*(_fe_order+1) )
29+
_fe_order(getMFEMProblem()
30+
.getProblemData()
31+
.gridfunctions.Get(_test_var_name)
32+
->ParFESpace()
33+
->FEColl()
34+
->GetOrder()),
35+
_one(1.0),
36+
_zero(0.0),
37+
_sigma(getParam<mfem::real_t>("sigma")),
38+
_kappa((isParamSetByUser("kappa")) ? getParam<mfem::real_t>("kappa")
39+
: (_fe_order + 1) * (_fe_order + 1))
3240
{
3341
}
3442

framework/src/mfem/dgkernels/MFEMDGKernel.C

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,28 @@ MFEMDGKernel::validParams()
2222
params.addParam<VariableName>("variable",
2323
"Variable labelling the weak form this kernel is added to");
2424
params.addParam<mfem::real_t>("sigma", -1.0, "One of the DG penalty params. Typically +/- 1.0");
25-
params.addParam<mfem::real_t>("kappa", "One of the DG penalty params. Should be positive. Will default to (order+1)^2");
25+
params.addParam<mfem::real_t>(
26+
"kappa", "One of the DG penalty params. Should be positive. Will default to (order+1)^2");
2627
return params;
2728
}
2829

2930
MFEMDGKernel::MFEMDGKernel(const InputParameters & parameters)
30-
: MFEMGeneralUserObject(parameters),
31-
MFEMBlockRestrictable(parameters,
31+
: MFEMGeneralUserObject(parameters),
32+
MFEMBlockRestrictable(parameters,
3233
getMFEMProblem().getMFEMVariableMesh(getParam<VariableName>("variable"))),
33-
_test_var_name(getParam<VariableName>("variable")),
34-
_fe_order(getMFEMProblem().getProblemData().gridfunctions.Get(_test_var_name)->ParFESpace()->FEColl()->GetOrder())
35-
, _one(1.0), _zero(0.0),
36-
_sigma(getParam<mfem::real_t>("sigma")),
37-
_kappa( (isParamSetByUser("kappa")) ? getParam<mfem::real_t>("kappa") : (_fe_order+1)*(_fe_order+1) )
38-
{}
34+
_test_var_name(getParam<VariableName>("variable")),
35+
_fe_order(getMFEMProblem()
36+
.getProblemData()
37+
.gridfunctions.Get(_test_var_name)
38+
->ParFESpace()
39+
->FEColl()
40+
->GetOrder()),
41+
_one(1.0),
42+
_zero(0.0),
43+
_sigma(getParam<mfem::real_t>("sigma")),
44+
_kappa((isParamSetByUser("kappa")) ? getParam<mfem::real_t>("kappa")
45+
: (_fe_order + 1) * (_fe_order + 1))
46+
{
47+
}
3948

4049
#endif

framework/src/mfem/equation_systems/EquationSystem.C

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ EquationSystem::AddDGKernel(std::shared_ptr<MFEMDGKernel> kernel)
9696
{
9797
auto kernel_field_map =
9898
std::make_shared<Moose::MFEM::NamedFieldsMap<std::vector<std::shared_ptr<MFEMDGKernel>>>>();
99-
_dg_kernels_map.Register(test_var_name, std::move(kernel_field_map));
99+
_dg_kernels_map.Register(test_var_name, std::move(kernel_field_map));
100100
}
101101
// Register new kernels map if not present for the test/trial variable
102102
// pair
@@ -105,7 +105,7 @@ EquationSystem::AddDGKernel(std::shared_ptr<MFEMDGKernel> kernel)
105105
auto kernels = std::make_shared<std::vector<std::shared_ptr<MFEMDGKernel>>>();
106106
_dg_kernels_map.Get(test_var_name)->Register(trial_var_name, std::move(kernels));
107107
}
108-
_dg_kernels_map.GetRef(test_var_name).Get(trial_var_name)->push_back(std::move(kernel));
108+
_dg_kernels_map.GetRef(test_var_name).Get(trial_var_name)->push_back(std::move(kernel));
109109
}
110110

111111
void
@@ -128,10 +128,9 @@ EquationSystem::AddDGBC(std::shared_ptr<MFEMDGBoundaryCondition> bc)
128128
auto bcs = std::make_shared<std::vector<std::shared_ptr<MFEMDGBoundaryCondition>>>();
129129
_dg_bc_map.Get(test_var_name)->Register(trial_var_name, std::move(bcs));
130130
}
131-
_dg_bc_map.GetRef(test_var_name).Get(trial_var_name)->push_back(std::move(bc));
131+
_dg_bc_map.GetRef(test_var_name).Get(trial_var_name)->push_back(std::move(bc));
132132
}
133133

134-
135134
void
136135
EquationSystem::AddIntegratedBC(std::shared_ptr<MFEMIntegratedBC> bc)
137136
{
@@ -421,7 +420,7 @@ EquationSystem::BuildLinearForms()
421420
auto lf = _lfs.GetShared(test_var_name);
422421
ApplyDomainLFIntegrators(test_var_name, lf, _kernels_map);
423422
ApplyBoundaryLFIntegrators(test_var_name, lf, _integrated_bc_map);
424-
423+
425424
// same with the dg stuff
426425
ApplyDomainDGLFIntegrators(test_var_name, lf, _dg_kernels_map);
427426
ApplyBoundaryDGLFIntegrators(test_var_name, lf, _dg_bc_map);
@@ -454,9 +453,9 @@ EquationSystem::BuildBilinearForms()
454453

455454
// and the dg stuff too
456455
ApplyDomainDGBLFIntegrators<mfem::ParBilinearForm>(
457-
test_var_name, test_var_name, blf, _dg_kernels_map);
456+
test_var_name, test_var_name, blf, _dg_kernels_map);
458457
ApplyBoundaryDGBLFIntegrators<mfem::ParBilinearForm>(
459-
test_var_name, test_var_name, blf, _dg_bc_map);
458+
test_var_name, test_var_name, blf, _dg_bc_map);
460459
// Assemble
461460
blf->Assemble();
462461
}

framework/src/mfem/problem/MFEMProblem.C

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ MFEMProblem::addDGKernel(const std::string & kernel_name,
321321
FEProblemBase::addUserObject(kernel_name, name, parameters);
322322
const UserObject * kernel_uo = &(getUserObjectBase(name));
323323

324-
if (dynamic_cast<const MFEMDGKernel*>(kernel_uo)!=nullptr)
324+
if (dynamic_cast<const MFEMDGKernel *>(kernel_uo) != nullptr)
325325
{
326326
auto object_ptr = getUserObject<MFEMDGKernel>(name).getSharedPtr();
327327
auto kernel = std::dynamic_pointer_cast<MFEMDGKernel>(object_ptr);
@@ -352,7 +352,7 @@ MFEMProblem::addDGBoundaryCondition(const std::string & bc_name,
352352
FEProblemBase::addUserObject(bc_name, name, parameters);
353353
const UserObject * bc_uo = &(getUserObjectBase(name));
354354

355-
if (dynamic_cast<const MFEMDGBoundaryCondition*>(bc_uo)!=nullptr)
355+
if (dynamic_cast<const MFEMDGBoundaryCondition *>(bc_uo) != nullptr)
356356
{
357357
auto object_ptr = getUserObject<MFEMDGBoundaryCondition>(name).getSharedPtr();
358358
auto kernel = std::dynamic_pointer_cast<MFEMDGBoundaryCondition>(object_ptr);
@@ -371,7 +371,6 @@ MFEMProblem::addDGBoundaryCondition(const std::string & bc_name,
371371
else
372372
{
373373
mooseError("Unsupported bc of type '", bc_name, "' and name '", name, "' detected.");
374-
375374
}
376375
}
377376

test/tests/mfem/kernels/tests

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
compute_devices = 'cpu'
6464
max_parallel = 1 # schemadiff with multiple ranks
6565
recover = false
66-
expect_out = 'Parallel Type:.*distributed.*Mesh Dimension.*3.*Spatial Dimension.*3.*Elems.*2476.*Num Subdomains.*1.*Solver.*MFEMHypreGMRES'
6766
[]
6867
[MFEMGradDiv]
6968
type = XMLDiff

0 commit comments

Comments
 (0)