Skip to content

Commit 82cdf3d

Browse files
committed
swap HydroForces/HydroSystem naming for semantic clarity
Rename user-facing façade from HydroForces to HydroSystem to align with Chrono conventions (ChSystem = main entry point). Rename internal Chrono-free force engine from HydroSystem to HydroForces (in hydrochrono::hydro namespace) since it computes forces. Changes: - HydroForces → HydroSystem (user-facing façade, include/hydroc/hydro_system.h) - HydroSystem → hydrochrono::hydro::HydroForces (internal engine, include/hydroc/core/hydro_forces.h) - Add backward-compat aliases: TestHydro, HydroForces → HydroSystem - Add compatibility header (hydro_forces.h → hydro_system.h) for existing includes - Update ChronoHydroCoupler, setup_from_yaml, CMakeLists.txt No behavioral changes; all existing tests pass.
1 parent 4d9d2e9 commit 82cdf3d

File tree

10 files changed

+686
-647
lines changed

10 files changed

+686
-647
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ set(HYDROCHRONO_SOURCES
345345
src/hydro/config/setup_from_yaml.cpp
346346
src/hydro/config/yaml_discovery.cpp
347347
# Core facade and utilities
348-
src/hydro/hydro_forces.cpp
348+
src/hydro/hydro_system.cpp
349349
src/hydro/utils/helper.cpp
350350
# Hydro modules
351351
src/hydro/waves/wave_base.cpp
@@ -354,7 +354,7 @@ set(HYDROCHRONO_SOURCES
354354
src/hydro/waves/irregular_wave.cpp
355355
src/hydro/radiation/radiation_rirf_processing.cpp
356356
src/hydro/radiation/radiation_rirf_convolution.cpp
357-
src/hydro/core/hydro_system.cpp
357+
src/hydro/core/hydro_forces.cpp
358358
# Chrono coupling layer (bridges Chrono physics with Chrono-free core)
359359
src/hydro/chrono/chrono_state_utils.cpp
360360
src/hydro/chrono/chrono_hydro_coupler.cpp
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
/*********************************************************************
2-
* @file hydro_system.h
3-
* @brief HydroSystem: Chrono-free core that orchestrates force components.
2+
* @file hydro_forces.h
3+
* @brief HydroForces: Chrono-free core that orchestrates force components.
44
*
55
* MAIN TYPES:
6-
* - HydroSystem: Owns force components, computes total BodyForces
7-
* - HydroSystemProfileStats: Timing/call counts per component type
6+
* - HydroForces: Owns force components, computes total BodyForces
7+
* - HydroForcesProfileStats: Timing/call counts per component type
88
*
9-
* ROLE: This is the Chrono-free hydrodynamics core. HydroForces (façade)
10-
* and ChronoHydroCoupler delegate force computation to HydroSystem.
9+
* ROLE: This is the Chrono-free hydrodynamics core. HydroSystem (façade)
10+
* and ChronoHydroCoupler delegate force computation to HydroForces.
1111
*********************************************************************/
1212

13-
#ifndef HYDROC_CORE_HYDRO_SYSTEM_H
14-
#define HYDROC_CORE_HYDRO_SYSTEM_H
13+
#ifndef HYDROC_CORE_HYDRO_FORCES_H
14+
#define HYDROC_CORE_HYDRO_FORCES_H
1515

1616
#include <hydroc/core/system_state.h>
1717
#include <hydroc/core/force_component.h>
@@ -21,11 +21,11 @@
2121
namespace hydrochrono::hydro {
2222

2323
/**
24-
* @brief Profiling statistics for HydroSystem components.
24+
* @brief Profiling statistics for HydroForces components.
2525
*
2626
* Tracks cumulative execution time and call counts for each component type.
2727
*/
28-
struct HydroSystemProfileStats {
28+
struct HydroForcesProfileStats {
2929
double hydrostatics_seconds = 0.0;
3030
double radiation_seconds = 0.0;
3131
double excitation_seconds = 0.0;
@@ -41,21 +41,21 @@ struct HydroSystemProfileStats {
4141
};
4242

4343
/**
44-
* @brief HydroSystem: orchestrates force components to compute total forces.
44+
* @brief HydroForces: orchestrates force components to compute total forces.
4545
*
4646
* Owns a collection of force components (hydrostatics, radiation, excitation)
4747
* and evaluates their combined contributions given system state and time.
48-
* This is a Chrono-free façade for force computation.
48+
* This is a Chrono-free engine for force computation.
4949
*/
50-
class HydroSystem {
50+
class HydroForces {
5151
public:
5252
/**
5353
* @brief Constructor.
5454
*
5555
* @param num_bodies Number of bodies in the system
5656
* @param components Vector of force components (ownership transferred via move)
5757
*/
58-
HydroSystem(int num_bodies,
58+
HydroForces(int num_bodies,
5959
std::vector<std::unique_ptr<IHydroForceComponent>> components);
6060

6161
/**
@@ -83,9 +83,9 @@ class HydroSystem {
8383
*
8484
* Returns cumulative timing and call counts for each component type.
8585
*
86-
* @return HydroSystemProfileStats Profiling statistics
86+
* @return HydroForcesProfileStats Profiling statistics
8787
*/
88-
HydroSystemProfileStats GetProfileStats() const { return profile_stats_; }
88+
HydroForcesProfileStats GetProfileStats() const { return profile_stats_; }
8989

9090
/**
9191
* @brief Reset profiling statistics.
@@ -113,11 +113,11 @@ class HydroSystem {
113113
private:
114114
int num_bodies_;
115115
std::vector<std::unique_ptr<IHydroForceComponent>> components_;
116-
mutable HydroSystemProfileStats profile_stats_;
116+
mutable HydroForcesProfileStats profile_stats_;
117117
bool profiling_enabled_ = false; ///< Profiling disabled by default
118118
};
119119

120120
} // namespace hydrochrono::hydro
121121

122-
#endif // HYDROC_CORE_HYDRO_SYSTEM_H
122+
#endif // HYDROC_CORE_HYDRO_FORCES_H
123123

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/*********************************************************************
22
* @file chrono_coupler.h
3-
* @brief ChronoHydroCoupler: bridges Chrono bodies and HydroSystem.
3+
* @brief ChronoHydroCoupler: bridges Chrono bodies and HydroForces.
44
*
55
* MAIN TYPES:
6-
* - ChronoHydroCoupler: Adapter between Chrono and HydroSystem
6+
* - ChronoHydroCoupler: Adapter between Chrono and HydroForces
77
*
8-
* ROLE: Extracts SystemState from Chrono bodies, invokes HydroSystem
9-
* to compute forces. Used internally by HydroForces façade.
8+
* ROLE: Extracts SystemState from Chrono bodies, invokes HydroForces
9+
* to compute forces. Used internally by HydroSystem façade.
1010
*********************************************************************/
1111

1212
#ifndef HYDROC_COUPLING_CHRONO_COUPLER_H
1313
#define HYDROC_COUPLING_CHRONO_COUPLER_H
1414

1515
#include <hydroc/core/system_state.h>
16-
#include <hydroc/core/hydro_system.h>
16+
#include <hydroc/core/hydro_forces.h>
1717
#include <chrono/physics/ChBody.h>
1818
#include <vector>
1919
#include <memory>
@@ -26,27 +26,27 @@ void BuildSystemStateFromChronoBodies(
2626
SystemState& out_state);
2727

2828
/**
29-
* @brief ChronoHydroCoupler: bridges Chrono bodies and HydroSystem.
29+
* @brief ChronoHydroCoupler: bridges Chrono bodies and HydroForces.
3030
*
31-
* Extracts state from Chrono bodies, evaluates forces via HydroSystem,
31+
* Extracts state from Chrono bodies, evaluates forces via HydroForces,
3232
* and (in future) applies forces back to Chrono bodies. This is the
33-
* adapter between Chrono's physics engine and the Chrono-free HydroSystem.
33+
* adapter between Chrono's physics engine and the Chrono-free HydroForces.
3434
*/
3535
class ChronoHydroCoupler {
3636
public:
3737
/**
3838
* @brief Constructor.
3939
*
40-
* @param hydro_system Shared pointer to HydroSystem for force evaluation
40+
* @param hydro_forces Shared pointer to HydroForces for force evaluation
4141
* @param bodies Vector of Chrono body pointers
4242
*/
43-
ChronoHydroCoupler(std::shared_ptr<HydroSystem> hydro_system,
43+
ChronoHydroCoupler(std::shared_ptr<HydroForces> hydro_forces,
4444
std::vector<std::shared_ptr<chrono::ChBody>> bodies);
4545

4646
/**
4747
* @brief Evaluate hydrodynamic forces.
4848
*
49-
* Extracts state from Chrono bodies, calls HydroSystem to compute
49+
* Extracts state from Chrono bodies, calls HydroForces to compute
5050
* forces, and returns the result.
5151
*
5252
* @param time Current simulation time
@@ -64,31 +64,30 @@ class ChronoHydroCoupler {
6464
void ApplyForcesToChrono(const BodyForces& forces);
6565

6666
/**
67-
* @brief Get profiling statistics from HydroSystem.
67+
* @brief Get profiling statistics from HydroForces.
6868
*
6969
* Returns cumulative timing and call counts for each component type.
7070
*
71-
* @return HydroSystemProfileStats Profiling statistics
71+
* @return HydroForcesProfileStats Profiling statistics
7272
*/
73-
HydroSystemProfileStats GetProfileStats() const {
74-
return hydro_system_->GetProfileStats();
73+
HydroForcesProfileStats GetProfileStats() const {
74+
return hydro_forces_->GetProfileStats();
7575
}
7676

7777
/**
78-
* @brief Enable or disable profiling in HydroSystem.
78+
* @brief Enable or disable profiling in HydroForces.
7979
*
8080
* @param enabled True to enable profiling, false to disable
8181
*/
8282
void SetProfilingEnabled(bool enabled) {
83-
hydro_system_->SetProfilingEnabled(enabled);
83+
hydro_forces_->SetProfilingEnabled(enabled);
8484
}
8585

8686
private:
87-
std::shared_ptr<HydroSystem> hydro_system_;
87+
std::shared_ptr<HydroForces> hydro_forces_;
8888
std::vector<std::shared_ptr<chrono::ChBody>> bodies_;
8989
};
9090

9191
} // namespace hydrochrono::hydro
9292

9393
#endif // HYDROC_COUPLING_CHRONO_COUPLER_H
94-

0 commit comments

Comments
 (0)