Skip to content

Commit

Permalink
Address PR feedback: Various typos and unneeded parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiangrimberg committed May 8, 2024
1 parent ce06cfa commit f73703b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 30 deletions.
12 changes: 6 additions & 6 deletions palace/drivers/basesolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -449,15 +449,15 @@ void BaseSolver::PostprocessSurfaces(const PostOperator &postop, const std::stri
double scale = 1.0;
switch (data.type)
{
case (SurfaceFluxType::ELECTRIC):
case SurfaceFluxType::ELECTRIC:
scale = iodata.DimensionalizeValue(IoData::ValueType::CAPACITANCE, 1.0);
scale *= iodata.DimensionalizeValue(IoData::ValueType::VOLTAGE, 1.0);
break;
case (SurfaceFluxType::MAGNETIC):
case SurfaceFluxType::MAGNETIC:
scale = iodata.DimensionalizeValue(IoData::ValueType::INDUCTANCE, 1.0);
scale *= iodata.DimensionalizeValue(IoData::ValueType::CURRENT, 1.0);
break;
case (SurfaceFluxType::POWER):
case SurfaceFluxType::POWER:
scale = iodata.DimensionalizeValue(IoData::ValueType::POWER, 1.0);
break;
}
Expand All @@ -475,15 +475,15 @@ void BaseSolver::PostprocessSurfaces(const PostOperator &postop, const std::stri
std::string name, unit;
switch (data.type)
{
case (SurfaceFluxType::ELECTRIC):
case SurfaceFluxType::ELECTRIC:
name = "Φ_elec";
unit = "(C)";
break;
case (SurfaceFluxType::MAGNETIC):
case SurfaceFluxType::MAGNETIC:
name = "Φ_mag";
unit = "(Wb)";
break;
case (SurfaceFluxType::POWER):
case SurfaceFluxType::POWER:
name = "Φ_pow";
unit = "(W)";
break;
Expand Down
17 changes: 3 additions & 14 deletions palace/fem/coefficient.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ template <>
inline void BdrSurfaceFluxCoefficient<SurfaceFluxType::ELECTRIC>::GetLocalFlux(
mfem::ElementTransformation &T, mfem::Vector &V) const
{
// Flux D ⋅ n.
// Flux D.
double W_data[3];
mfem::Vector W(W_data, T.GetSpaceDim());
E->GetVectorValue(T, T.GetIntPoint(), W);
Expand Down Expand Up @@ -459,7 +459,7 @@ inline double InterfaceDielectricCoefficient<InterfaceDielectricType::SA>::Eval(
Vt2 += V * V;
}

// Substrate-air interface: 0.5 * t * (ε_SA * |E_t|² + 1 / ε_MS * |E_n|²) .
// Substrate-air interface: 0.5 * t * (ε_SA * |E_t|² + 1 / ε_SA * |E_n|²) .
return 0.5 * t_i * (epsilon_i * Vt2 + Vn2 / epsilon_i);
}

Expand Down Expand Up @@ -618,23 +618,17 @@ class PoyntingVectorCoefficient : public mfem::VectorCoefficient,
if (V * V < W * W)
{
V = W;
return;
}
else
{
return;
}
}
else if (UseElem2(FET, mat_op, side_n_min))
{
GetLocalPower(*FET.Elem2, V);
return;
}
else
{
GetLocalPower(*FET.Elem1, V);
return;
}
return;
}
MFEM_ABORT("Unsupported element type in PoyntingVectorCoefficient!");
}
Expand Down Expand Up @@ -679,11 +673,6 @@ class BdrFieldVectorCoefficient : public mfem::VectorCoefficient,
if (V * V < W * W)
{
V = W;
return;
}
else
{
return;
}
}
else if (UseElem2(FET, mat_op, side_n_min))
Expand Down
20 changes: 10 additions & 10 deletions palace/models/surfacepostoperator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ SurfacePostOperator::SurfaceFluxData::SurfaceFluxData(const config::SurfaceFluxD
// Store the type of flux.
switch (data.type)
{
case (config::SurfaceFluxData::Type::ELECTRIC):
case config::SurfaceFluxData::Type::ELECTRIC:
type = SurfaceFluxType::ELECTRIC;
break;
case (config::SurfaceFluxData::Type::MAGNETIC):
case config::SurfaceFluxData::Type::MAGNETIC:
type = SurfaceFluxType::MAGNETIC;
break;
case (config::SurfaceFluxData::Type::POWER):
case config::SurfaceFluxData::Type::POWER:
type = SurfaceFluxType::POWER;
break;
}
Expand Down Expand Up @@ -68,15 +68,15 @@ SurfacePostOperator::SurfaceFluxData::GetCoefficient(const mfem::ParGridFunction
{
switch (type)
{
case (SurfaceFluxType::ELECTRIC):
case SurfaceFluxType::ELECTRIC:
return std::make_unique<
RestrictedCoefficient<BdrSurfaceFluxCoefficient<SurfaceFluxType::ELECTRIC>>>(
attr_list, E, nullptr, mat_op, two_sided, center);
case (SurfaceFluxType::MAGNETIC):
case SurfaceFluxType::MAGNETIC:
return std::make_unique<
RestrictedCoefficient<BdrSurfaceFluxCoefficient<SurfaceFluxType::MAGNETIC>>>(
attr_list, nullptr, B, mat_op, two_sided, center);
case (SurfaceFluxType::POWER):
case SurfaceFluxType::POWER:
return std::make_unique<
RestrictedCoefficient<BdrSurfaceFluxCoefficient<SurfaceFluxType::POWER>>>(
attr_list, E, B, mat_op, two_sided, center);
Expand All @@ -95,16 +95,16 @@ SurfacePostOperator::InterfaceDielectricData::InterfaceDielectricData(
// p * E_elec = 1/2 t Re{∫ (ε E)ᴴ E_m dS} .
switch (data.type)
{
case (config::InterfaceDielectricData::Type::DEFAULT):
case config::InterfaceDielectricData::Type::DEFAULT:
type = InterfaceDielectricType::DEFAULT;
break;
case (config::InterfaceDielectricData::Type::MA):
case config::InterfaceDielectricData::Type::MA:
type = InterfaceDielectricType::MA;
break;
case (config::InterfaceDielectricData::Type::MS):
case config::InterfaceDielectricData::Type::MS:
type = InterfaceDielectricType::MS;
break;
case (config::InterfaceDielectricData::Type::SA):
case config::InterfaceDielectricData::Type::SA:
type = InterfaceDielectricType::SA;
break;
}
Expand Down

0 comments on commit f73703b

Please sign in to comment.