Skip to content

Commit

Permalink
Clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
mlund committed Jul 2, 2024
1 parent c3c310e commit 6ba5bd0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/atomdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void to_json(json& j, const AtomData& a)
}

/// Handles optional translational and rotational displacement
void set_dp_and_dprot(const json &j, AtomData &a)
void set_dp_and_dprot(const json& j, AtomData& a)
{
a.dp = get_optional<double>(j, "dp");
if (a.dp.has_value()) { // Later use C++23 `and_then()`
Expand Down
28 changes: 14 additions & 14 deletions src/atomdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,21 @@ class AtomData
friend void from_json(const json&, AtomData&);

public:
std::string name; //!< Name
double charge = 0; //!< Particle charge [e]
double mw = 1; //!< Weight
double sigma = 0; //!< Diameter for e.g Lennard-Jones etc. [angstrom]
//!< Do not set! Only a temporal class member during the refactorization
double activity = 0; //!< Chemical activity [mol/l]
double alphax = 0; //!< Excess polarisability (unit-less)
std::optional<double> dp = std::nullopt; //!< Translational displacement parameter [angstrom]
std::string name; //!< Name
double charge = 0; //!< Particle charge [e]
double mw = 1; //!< Weight
double sigma = 0; //!< Diameter for e.g Lennard-Jones etc. [angstrom]
//!< Do not set! Only a temporal class member during the refactorization
double activity = 0; //!< Chemical activity [mol/l]
double alphax = 0; //!< Excess polarisability (unit-less)
std::optional<double> dp = std::nullopt; //!< Translational displacement parameter [angstrom]
std::optional<double> dprot = std::nullopt; //!< Rotational displacement parameter [degrees]
double tension = 0; //!< Surface tension [kT/Å^2]
double tfe = 0; //!< Transfer free energy [J/mol/angstrom^2/M]
Point mu = {0, 0, 0}; //!< Dipole moment unit vector
double mulen = 0; //!< Dipole moment length
bool hydrophobic = false; //!< Is the particle hydrophobic?
bool implicit = false; //!< Is the particle implicit (e.g. proton)?
double tension = 0; //!< Surface tension [kT/Å^2]
double tfe = 0; //!< Transfer free energy [J/mol/angstrom^2/M]
Point mu = {0, 0, 0}; //!< Dipole moment unit vector
double mulen = 0; //!< Dipole moment length
bool hydrophobic = false; //!< Is the particle hydrophobic?
bool implicit = false; //!< Is the particle implicit (e.g. proton)?
InteractionData
interaction; //!< Arbitrary interaction parameters, e.g., epsilons in various potentials
SpheroCylinderData sphero_cylinder; //!< Data for patchy sphero cylinders (PSCs)
Expand Down
4 changes: 2 additions & 2 deletions src/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ std::optional<Electrolyte> makeElectrolyte(const json& j); //!< Create ionic sal
/// If the value does not exist, return `std::nullopt`
///
/// @throws If value exists but cannot be extracted as `T`.
template<typename T>
std::optional<T> get_optional(const json &j, std::string_view key) {
template <typename T> std::optional<T> get_optional(const json& j, std::string_view key)
{
if (const auto it = j.find(key); it != j.end()) {
return it->get<T>(); // may throw exception
}
Expand Down

0 comments on commit 6ba5bd0

Please sign in to comment.