Skip to content

Commit

Permalink
chore: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
yoctoyotta1024 committed Oct 30, 2024
1 parent 38201b0 commit 2084cc4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ repos:
rev: 0.8.0
hooks:
- id: cpplint
args: [--linelength=100, "--filter=-runtime/references,-readability/braces,-build/include,-build/c++11"]
args: [--linelength=100, "--filter=-runtime/references,-readability/braces,-build/include,-build/c++17"]
types_or: [c, c++, cuda]
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v3.4.0
Expand Down
2 changes: 1 addition & 1 deletion libs/cartesiandomain/add_supers_at_domain_top.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ std::pair<size_t, double> CreateSuperdrop::new_xi_radius(const double gbxvolume)
const auto radius = double{std::pow(10.0, log10r)};

const auto nconc = dist.droplet_numconc_distribution(log10r, log10rup, log10rlow);
const auto xi = (uint64_t)std::round(nconc * gbxvolume); // cast double to uint64_t
const auto xi = static_cast<uint64_t>(std::round(nconc * gbxvolume));

return std::make_pair(xi, radius); // xi_radius
}
Expand Down
6 changes: 2 additions & 4 deletions libs/cleoconstants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,8 @@ constexpr double surfconst = 4.0 * DC::SURFSIGMA * std::numbers::pi * R0 * R0;
*
*/
namespace LIMITVALUES {
constexpr unsigned int uintmax =
std::numeric_limits<unsigned int>::max(); /**< Maximum unsigned int. */
constexpr uint64_t uint64_t_max =
std::numeric_limits<uint64_t>::max(); /**< Maximum 64 byte unsigned int. */
constexpr unsigned int uintmax = std::numeric_limits<unsigned int>::max(); /**< Max unsigned int. */
constexpr uint64_t uint64_t_max = std::numeric_limits<uint64_t>::max(); /**< Max 64 byte u-int. */

constexpr double llim = -1.0 * std::numeric_limits<double>::max(); /**< Maximum negative double. */
constexpr double ulim = std::numeric_limits<double>::max(); /**< Maximum positive double. */
Expand Down
6 changes: 3 additions & 3 deletions libs/superdrops/collisions/breakup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ KOKKOS_FUNCTION void DoBreakup<NFrags>::twin_superdroplet_breakup(Superdrop &dro
const auto totnfrags = double{nfrags(drop1, drop2) * old_xi};
assert(((totnfrags / old_xi) > 2.5) && "nfrags must be > 2.5");

const auto new_xi1 = (uint64_t)Kokkos::round(totnfrags / 2); // cast double to uint64_t
const auto new_xi2 = (uint64_t)Kokkos::round(totnfrags - new_xi1); // cast double to uint64_t
const auto new_xi1 = static_cast<uint64_t>(Kokkos::round(totnfrags / 2));
const auto new_xi2 = static_cast<uint64_t>(Kokkos::round(totnfrags - new_xi1));
const auto new_xitot = new_xi1 + new_xi2;
assert((new_xi2 > old_xi) && "nfrags must increase the drop2's multiplicity during breakup");
assert((new_xitot > (old_xi * 2)) && "nfrags must increase total multiplicity during breakup");
Expand Down Expand Up @@ -205,7 +205,7 @@ KOKKOS_FUNCTION void DoBreakup<NFrags>::different_superdroplet_breakup(Superdrop
drop1.set_xi(new_xi1);

const auto totnfrags = double{nfrags(drop1, drop2) * old_xi2};
const auto new_xi2 = (uint64_t)Kokkos::round(totnfrags); // cast double to uint64_t
const auto new_xi2 = static_cast<uint64_t>(Kokkos::round(totnfrags));
assert(((totnfrags / old_xi2) > 2.5) && "nfrags must be > 2.5");

assert((new_xi2 > old_xi2) && "nfrags must increase the drop2's multiplicity during breakup");
Expand Down

0 comments on commit 2084cc4

Please sign in to comment.