@@ -115,8 +115,8 @@ class ComponentFunc : public chrono::ChFunction {
115115 virtual double GetVal (double x) const override ;
116116
117117 private:
118- ForceFunc6d* base_; // /< Pointer to the full 6D force on the body.
119- int index_; // /< Index representing force degree of freedom on the body.
118+ ForceFunc6d* base_ = nullptr ; // /< Pointer to the full 6D force on the body.
119+ int index_ = 0 ; // /< Index representing force degree of freedom on the body.
120120};
121121
122122/* *
@@ -176,13 +176,13 @@ class ForceFunc6d {
176176
177177 // / Body index in the system (1-indexed, parsed from Chrono body name "bodyN").
178178 // / This matches Chrono's body naming convention where bodies are named body1, body2, etc.
179- int b_num_;
179+ int b_num_ = 0 ;
180180
181181 ComponentFunc forces_[kDofPerBody ]; // /< Forces for each degree of freedom.
182182 std::shared_ptr<ComponentFunc> force_ptrs_[kDofPerBody ]; // /< Pointers to the forces.
183183 std::shared_ptr<chrono::ChForce> chrono_force_; // /< Chrono force for the body.
184184 std::shared_ptr<chrono::ChForce> chrono_torque_; // /< Chrono torque for the body.
185- HydroSystem* all_hydro_forces_; // /< Pointer to HydroSystem for calculations.
185+ HydroSystem* all_hydro_forces_ = nullptr ; // /< Pointer to HydroSystem for calculations.
186186};
187187
188188// Forward declaration of ChLoadAddedMass (defined in added_mass.h, included in .cpp)
@@ -425,6 +425,12 @@ class HydroSystem {
425425
426426 // Time tracking for force caching
427427 double prev_time;
428+
429+ // Debug counter for printing first few timesteps
430+ int debug_call_count_ = 0 ;
431+
432+ // Track if we've already reported NaN (to avoid spamming)
433+ bool nan_reported_ = false ;
428434
429435 // Cached SystemState: built once per time step and reused by all force computations
430436 hydrochrono::hydro::SystemState cached_state_;
0 commit comments