Skip to content

Commit

Permalink
Merge pull request #300 from cniethammer/fix-quaternion-default-inita…
Browse files Browse the repository at this point in the history
…lisation

Fix quaternion default initialisation
  • Loading branch information
cniethammer authored Dec 20, 2024
2 parents f456911 + 0a02250 commit 2a9cd42
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/molecules/AutoPasSimpleMolecule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Component* AutoPasSimpleMolecule::_component = nullptr;
Quaternion AutoPasSimpleMolecule::_quaternion = Quaternion(1.0, 0.0, 0.0, 0.0);

AutoPasSimpleMolecule::AutoPasSimpleMolecule(unsigned long id, Component* component, double rx, double ry, double rz,
double vx, double vy, double vz, double q0, double q1, double q2,
double q3, double Dx, double Dy, double Dz)
double vx, double vy, double vz, double qw, double qx, double qy,
double qz, double Dx, double Dy, double Dz)
: autopas::ParticleFP64({rx, ry, rz}, {vx, vy, vz}, id) {
if (_component == nullptr) {
_component = component;
Expand Down
4 changes: 2 additions & 2 deletions src/molecules/AutoPasSimpleMolecule.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
class AutoPasSimpleMolecule final : public MoleculeInterface, public autopas::ParticleFP64 {
public:
explicit AutoPasSimpleMolecule(unsigned long id = 0, Component* component = nullptr, double rx = 0., double ry = 0.,
double rz = 0., double vx = 0., double vy = 0., double vz = 0., double q0 = 1.,
double q1 = 1., double q2 = 0., double q3 = 0., double Dx = 0., double Dy = 0.,
double rz = 0., double vx = 0., double vy = 0., double vz = 0., double qw = 1.,
double qx = 0., double qy = 0., double qz = 0., double Dx = 0., double Dy = 0.,
double Dz = 0.);

AutoPasSimpleMolecule(const AutoPasSimpleMolecule& m) = default;
Expand Down
4 changes: 2 additions & 2 deletions src/molecules/FullMolecule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
FullMolecule::FullMolecule(unsigned long id, Component *component,
double rx, double ry, double rz,
double vx, double vy, double vz,
double q0, double q1, double q2, double q3,
double qw, double qx, double qy, double qz,
double Dx, double Dy, double Dz
)
: _q(q0, q1, q2, q3) {
: _q(qw, qx, qy, qz) {
_id = id;
_component = component;
_r[0] = rx;
Expand Down
2 changes: 1 addition & 1 deletion src/molecules/FullMolecule.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class FullMolecule : public MoleculeInterface {
FullMolecule(unsigned long id = 0, Component *component = nullptr,
double rx = 0., double ry = 0., double rz = 0.,
double vx = 0., double vy = 0., double vz = 0.,
double q0 = 1., double q1 = 1., double q2 = 0., double q3 = 0.,
double qw = 1., double qx = 0., double qy = 0., double qz = 0.,
double Dx = 0., double Dy = 0., double Dz = 0.
);
FullMolecule(const FullMolecule& m);
Expand Down
4 changes: 2 additions & 2 deletions src/molecules/MoleculeRMM.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class MoleculeRMM : public MoleculeInterface {
MoleculeRMM(unsigned long id = 0, Component *component = nullptr,
double rx = 0., double ry = 0., double rz = 0.,
double vx = 0., double vy = 0., double vz = 0.,
double = 0., double = 0., double = 0., double = 0., /*q0, q1, q2, q3*/
double = 0., double = 0., double = 0. /*Dx, Dy, Dz*/
double qw = 0., double qx = 0., double qy = 0., double qz = 0.,
double Dx = 0., double Dy = 0., double Dz = 0.
) {
_state = STORAGE_AOS;
_r[0] = rx;
Expand Down
2 changes: 1 addition & 1 deletion src/molecules/Quaternion.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
class Quaternion {
public:
Quaternion(double qw = 1., double qx = 1., double qy = 0., double qz = 0.)
Quaternion(double qw = 1., double qx = 0., double qy = 0., double qz = 0.)
: m_qw(qw), m_qx(qx), m_qy(qy), m_qz(qz) {
}

Expand Down

0 comments on commit 2a9cd42

Please sign in to comment.