Skip to content

Commit 9895269

Browse files
committed
Wave Body: don't use auto with Eigen (#79)
Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
1 parent 6bc56b7 commit 9895269

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

gz-waves/src/systems/linear_wave_body/LinearWaveBody.cc

+17-17
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class gz::sim::systems::LinearWaveBodyPrivate
181181
///
182182
/// 12. Use math::eigen3::convert for converting Matrix and Vector types.
183183
///
184-
///
184+
/// 13. Review use of Eigen.
185185
///
186186

187187
/// \brief WEC-Sim BEMIO hydro data structure (read from HDF5 file)
@@ -1344,7 +1344,7 @@ void LinearWaveBody::Configure(const Entity &_entity,
13441344
if (this->dataPtr->forceFlags.radiationAddedMassOn)
13451345
{
13461346
// parameters
1347-
auto& A = this->dataPtr->hydroForceCoeffs.A;
1347+
Eigen::Matrix6d& A = this->dataPtr->hydroForceCoeffs.A;
13481348

13491349
// convert from Eigen to gz
13501350
gz::math::Matrix6d gzA;
@@ -1843,9 +1843,9 @@ void LinearWaveBodyPrivate::UpdateLinkState(const UpdateInfo &_info,
18431843
this->linkState.X_WBcm.Rot().RotateVector(this->linkState.p_BcmBwp_Bcm);
18441844

18451845
// position vector of body center of buoyancy
1846-
auto& cb = this->hydroData.cb;
1847-
auto& cg = this->hydroData.cg;
1848-
auto p_BcmBcb = cb - cg;
1846+
Eigen::Vector3d& cb = this->hydroData.cb;
1847+
Eigen::Vector3d& cg = this->hydroData.cg;
1848+
Eigen::Vector3d p_BcmBcb = cb - cg;
18491849

18501850
// position vector of body CoB wrt body CoM in body/world frame
18511851
this->linkState.p_BcmBcb_B =
@@ -1990,17 +1990,17 @@ void LinearWaveBodyPrivate::UpdateHydrostaticForces(const UpdateInfo &_info,
19901990
double g = this->simParams.g;
19911991
double rho = this->simParams.rho;
19921992
double Vo = this->geometry.Vo;
1993-
auto& K_hs = this->hydroForceCoeffs.K_hs;
1993+
Eigen::Matrix6d& K_hs = this->hydroForceCoeffs.K_hs;
19941994

19951995
/// \todo check whether to add correction - in WEC-Sim buoyancy force is
19961996
/// applied at CoB not CoM, so there is an additional moment. This
19971997
/// to be compared with the point of application in the linear model,
19981998
/// which seems to apply all forces at the origin of the waterplane?
19991999

20002000
// center of buoyancy in link frame (i.e. wrt link origin)
2001-
// auto& cb = this->hydroData.cb;
2002-
// auto& cg = this->hydroData.cg;
2003-
// auto p_BcmBcb = cb - cg;
2001+
// Eigen::Vector3d& cb = this->hydroData.cb;
2002+
// Eigen::Vector3d& cg = this->hydroData.cg;
2003+
// Eigen::Vector3d p_BcmBcb = cb - cg;
20042004

20052005
// link properties
20062006
gz::sim::Link baseLink(this->linkEntity);
@@ -2124,7 +2124,7 @@ void LinearWaveBodyPrivate::UpdateRadiationDampingForces(
21242124
return;
21252125

21262126
// parameters
2127-
auto& B = this->hydroForceCoeffs.B;
2127+
Eigen::Matrix6d& B = this->hydroForceCoeffs.B;
21282128

21292129
// link properties
21302130
gz::sim::Link baseLink(this->linkEntity);
@@ -2221,7 +2221,7 @@ void LinearWaveBodyPrivate::UpdateRadiationAddedMassForces(
22212221
(currentTime - this->prevTime) < updatePeriod)
22222222
{
22232223
// parameters
2224-
auto& A = this->hydroForceCoeffs.A;
2224+
Eigen::Matrix6d& A = this->hydroForceCoeffs.A;
22252225

22262226
// link properties
22272227
gz::sim::Link baseLink(this->linkEntity);
@@ -2320,12 +2320,12 @@ void LinearWaveBodyPrivate::UpdateExcitationForces(const UpdateInfo &_info,
23202320
double height = this->waves.height;
23212321
double phase = this->waves.phase;
23222322
double omega = this->simParams.w;
2323-
auto& ex_re = this->hydroForceCoeffs.ex_re;
2324-
auto& ex_im = this->hydroForceCoeffs.ex_im;
2325-
auto& fk_re = this->hydroForceCoeffs.fk_re;
2326-
auto& fk_im = this->hydroForceCoeffs.fk_im;
2327-
auto& sc_re = this->hydroForceCoeffs.sc_re;
2328-
auto& sc_im = this->hydroForceCoeffs.sc_im;
2323+
Eigen::Vector6d& ex_re = this->hydroForceCoeffs.ex_re;
2324+
Eigen::Vector6d& ex_im = this->hydroForceCoeffs.ex_im;
2325+
Eigen::Vector6d& fk_re = this->hydroForceCoeffs.fk_re;
2326+
Eigen::Vector6d& fk_im = this->hydroForceCoeffs.fk_im;
2327+
Eigen::Vector6d& sc_re = this->hydroForceCoeffs.sc_re;
2328+
Eigen::Vector6d& sc_im = this->hydroForceCoeffs.sc_im;
23292329

23302330
// link properties
23312331
gz::sim::Link baseLink(this->linkEntity);

0 commit comments

Comments
 (0)