group Particle charge/sign comparison functions

Particle charge/sign comparison functions

Functions

Name
booloppSign(const Particle & a, const Particle & b)
Return true if Particlesa and b have the opposite charge sign.
boolsameSign(const Particle & a, const Particle & b)
booloppCharge(const Particle & a, const Particle & b)
boolsameCharge(const Particle & a, const Particle & b)
booldiffCharge(const Particle & a, const Particle & b)
Return true if Particlesa and b have a different (not necessarily opposite) charge.

Functions Documentation

function oppSign

inline bool oppSign(
    const Particle & a,
    const Particle & b
)

Return true if Particlesa and b have the opposite charge sign.

Note: Two neutrals returns false

function sameSign

inline bool sameSign(
    const Particle & a,
    const Particle & b
)

Note: Two neutrals returns true

Return true if Particlesa and b have the same charge sign

function oppCharge

inline bool oppCharge(
    const Particle & a,
    const Particle & b
)

Note: Two neutrals returns false

Return true if Particlesa and b have the exactly opposite charge

function sameCharge

inline bool sameCharge(
    const Particle & a,
    const Particle & b
)

Note: Two neutrals returns true

Return true if Particlesa and b have the same charge (including neutral)

function diffCharge

inline bool diffCharge(
    const Particle & a,
    const Particle & b
)

Return true if Particlesa and b have a different (not necessarily opposite) charge.


Updated on 2022-08-07 at 20:17:17 +0100