5858#include < Eigen/Dense>
5959
6060// Chrono library includes
61- #include < chrono/solver/ChIterativeSolverLS.h>
62- #include < chrono/solver/ChSolverPMINRES.h>
63- #include < chrono/timestepper/ChTimestepper.h>
64- #include < chrono/timestepper/ChTimestepperHHT.h>
65-
61+ // Note: We include only the headers strictly necessary for the types used in this header.
62+ // Implementation-only Chrono headers are included in hydro_forces.cpp.
63+ // ChForce.h includes ChFunction internally, so we don't need a separate include.
6664#include < chrono/physics/ChBody.h>
67- #include < chrono/physics/ChBodyEasy.h>
6865#include < chrono/physics/ChForce.h>
69- #include < chrono/physics/ChLoad.h>
7066#include < chrono/physics/ChLoadContainer.h>
71- #include < chrono/physics/ChLoadsBody.h>
72- #include < chrono/physics/ChSystemNSC.h>
73- #include < chrono/physics/ChSystemSMC.h>
74-
75- // Chrono FEA includes
76- #include < chrono/fea/ChMeshFileLoader.h>
7767
7868// Hydroc library includes
7969#include < hydroc/io/h5_reader.h>
@@ -97,13 +87,16 @@ class ChronoHydroCoupler;
9787// Types GeneralizedForce and BodyForces are defined in hydro_types.h (included above)
9888}
9989
100- using namespace chrono ;
101- using namespace chrono ::fea;
102-
10390class ForceFunc6d ;
10491class TestHydro ;
10592
106- class ComponentFunc : public ChFunction {
93+ /* *
94+ * @brief Per-DOF force function for Chrono's ChForce system.
95+ *
96+ * Inherits from chrono::ChFunction to provide time-dependent force values.
97+ * Each instance represents a single degree of freedom (surge, sway, heave, roll, pitch, yaw).
98+ */
99+ class ComponentFunc : public chrono ::ChFunction {
107100 public:
108101 /* *
109102 * @brief Default constructor.
@@ -162,7 +155,7 @@ class ForceFunc6d {
162155 * @param object The body in the system to which this 6-dimensional force is being applied.
163156 * @param all_hydro_forces_user The TestHydro class where the total force on all bodies is calculated.
164157 */
165- ForceFunc6d (std::shared_ptr<ChBody> object, TestHydro* all_hydro_forces_user);
158+ ForceFunc6d (std::shared_ptr<chrono:: ChBody> object, TestHydro* all_hydro_forces_user);
166159
167160 /* *
168161 * @brief Copy constructor that ensures the force is only added to a body once.
@@ -199,15 +192,16 @@ class ForceFunc6d {
199192 */
200193 void ApplyForceAndTorqueToBody ();
201194
202- std::shared_ptr<ChBody> body_; // /< Pointer to the body this force is applied to.
195+ std::shared_ptr<chrono:: ChBody> body_; // /< Pointer to the body this force is applied to.
203196 int b_num_; // /< Body's index in the system. Currently 1-indexed.
204197 ComponentFunc forces_[6 ]; // /< Forces for each degree of freedom.
205198 std::shared_ptr<ComponentFunc> force_ptrs_[6 ]; // /< Pointers to the forces.
206- std::shared_ptr<ChForce> chrono_force_; // /< Chrono force for the body.
207- std::shared_ptr<ChForce> chrono_torque_; // /< Chrono torque for the body.
199+ std::shared_ptr<chrono:: ChForce> chrono_force_; // /< Chrono force for the body.
200+ std::shared_ptr<chrono:: ChForce> chrono_torque_; // /< Chrono torque for the body.
208201 TestHydro* all_hydro_forces_; // /< Pointer to TestHydro for calculations.
209202};
210203
204+ // Forward declaration of ChLoadAddedMass (defined in added_mass.h, included in .cpp)
211205class ChLoadAddedMass ;
212206
213207// Lightweight hydrodynamics profiling stats
@@ -236,7 +230,7 @@ class TestHydro {
236230 * @param h5_file_name Name of the h5 file where hydro data is stored.
237231 * @param waves WaveBase object. Defaults to NoWave if not provided.
238232 */
239- TestHydro (std::vector<std::shared_ptr<ChBody>> user_bodies,
233+ TestHydro (std::vector<std::shared_ptr<chrono:: ChBody>> user_bodies,
240234 std::string h5_file_name,
241235 std::shared_ptr<WaveBase> waves = std::make_shared<NoWave>());
242236
@@ -364,7 +358,7 @@ class TestHydro {
364358
365359 private:
366360 // Class properties related to the body and hydrodynamics
367- std::vector<std::shared_ptr<ChBody>> bodies_;
361+ std::vector<std::shared_ptr<chrono:: ChBody>> bodies_;
368362 int num_bodies_;
369363 HydroData file_info_;
370364 std::vector<ForceFunc6d> force_per_body_;
@@ -390,7 +384,7 @@ class TestHydro {
390384 double cached_state_time_ = std::numeric_limits<double >::quiet_NaN();
391385
392386 // Added mass related properties
393- std::shared_ptr<ChLoadContainer> my_loadcontainer;
387+ std::shared_ptr<chrono:: ChLoadContainer> my_loadcontainer;
394388 std::shared_ptr<ChLoadAddedMass> my_loadbodyinertia;
395389
396390 /* *
0 commit comments