Skip to content

Commit

Permalink
Change to using std::max_element to calculate Lc
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcars committed Aug 3, 2023
1 parent 8726938 commit 0016dfb
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions palace/utils/iodata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,17 +400,9 @@ void IoData::NondimensionalizeInputs(mfem::ParMesh &mesh)
{
mfem::Vector bbmin, bbmax;
mesh.GetBoundingBox(bbmin, bbmax);
bbmin *= model.L0; // [m]
bbmax *= model.L0;
Lc = -mfem::infinity();
for (int d = 0; d < mesh.SpaceDimension(); d++)
{
double l = bbmax(d) - bbmin(d);
if (Lc < l)
{
Lc = l; // [m]
}
}
bbmax -= bbmin;
bbmax *= model.L0; // [m]
Lc = *std::max_element(bbmax.begin(), bbmax.end());
}
tc = 1.0e9 * Lc / electromagnetics::c0_; // [ns]

Expand Down

0 comments on commit 0016dfb

Please sign in to comment.