13#include <fhsim/ISimObjectLogger.h>
14#include <WakeCaster.h>
15#include <fhsim_environment/WakeSourceSet.h>
19#include <unordered_map>
24class EnvironmentProvider;
36 std::unordered_map<std::string, WakeGroupCaster*>
groups;
88 WakeGroupCaster(std::string name,
const SourceSetWakeSettings& settings, ISimObjectLogger& logger);
95 void Register(EnvironmentProvider& environment);
105 int Join(
const std::string& member,
double rho);
114 void Attach(
int member,
const WakeCastingObject& body,
double T);
131 const std::string&
Name()
const {
return m_name; }
133 const SourceSetWakeSettings&
Settings()
const {
return m_settings; }
136 int NumBodies()
const override {
return static_cast<int>(m_members.size()); }
138 WakeCastState
Body(
const double* X,
int body)
const override {
return m_bodies[body]->Reference(m_lastUpdate, X); }
140 double BodyRadius(
int body)
const override {
return m_bodies[body]->Radius(); }
142 SourceLoad
BodyLoad(
const double* X,
int body,
const double bodyVel[3],
const double waterVel[3])
const override {
return m_bodies[body]->BodyLoad(m_lastUpdate, X, bodyVel, waterVel); }
146 void LogNoMembers(
double T);
148 void LogMembersWithoutABody(
double T);
150 std::string MembersWithoutABody()
const;
153 SourceSetWakeSettings m_settings;
154 ISimObjectLogger& m_logger;
155 EnvironmentProvider* m_environment =
nullptr;
156 std::unique_ptr<WakeCaster> m_caster;
158 std::vector<std::string> m_members;
159 std::vector<const WakeCastingObject*> m_bodies;
160 double m_completeAt = std::numeric_limits<double>::quiet_NaN();
161 double m_lastUpdate = std::numeric_limits<double>::quiet_NaN();
162 double m_firstUpdate = std::numeric_limits<double>::quiet_NaN();
163 bool m_noMembersLogged =
false;
164 bool m_membersWithoutABodyLogged =
false;
Definition WakeCaster.h:202
Definition WakeGroupCaster.h:82
double BodyRadius(int body) const override
The member body's Radius().
Definition WakeGroupCaster.h:140
const std::string & Name() const
The group's name.
Definition WakeGroupCaster.h:131
void Register(EnvironmentProvider &environment)
const WakeCaster * Caster() const
The caster; null before the first Join().
Definition WakeGroupCaster.h:129
const SourceSetWakeSettings & Settings() const
The group's wake parameters.
Definition WakeGroupCaster.h:133
WakeGroupCaster(std::string name, const SourceSetWakeSettings &settings, ISimObjectLogger &logger)
int NumBodies() const override
Number of members.
Definition WakeGroupCaster.h:136
marenv::wake::WakeQuery Query() const
The members' query: the group's lumped field skipped, its private field composed in; empty before the...
void Attach(int member, const WakeCastingObject &body, double T)
SourceLoad BodyLoad(const double *X, int body, const double bodyVel[3], const double waterVel[3]) const override
The member body's BodyLoad().
Definition WakeGroupCaster.h:142
void Update(double T, const double *X)
WakeCastState Body(const double *X, int body) const override
The member body's Reference().
Definition WakeGroupCaster.h:138
int Join(const std::string &member, double rho)
The wake groups of an EnvironmentProvider by name; the provider owns it (EnvironmentProvider::WakeGro...
Definition WakeGroupCaster.h:34
std::unordered_map< std::string, WakeGroupCaster * > groups
The groups by name.
Definition WakeGroupCaster.h:36
The casters behind BodyWake; internal, not for SimObjects (ENV-0102).
Definition CasterStep.h:19
void AddWakeGroup(EnvironmentProvider &environment, const std::string &name, WakeGroupCaster &group)
WakeGroupCaster * FindWakeGroup(const EnvironmentProvider &environment, const std::string &name)
Definition WakeSelection.h:33