FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
TrawlRig.h
1#pragma once
2
22#include "DoorAndClumpWakeBodies.h"
23#include "TrawlCableConstraintSets.h"
24
25#include <fhsim/simobject/ISimObjectCreator.h>
26#include <fhsim_coribo/ConstraintSolver.h>
27#include <fhsim_environment/BodyWake.h>
28#include <fhsim_environment/EnvironmentProvider.h>
29#include <memory>
30#include <optional>
31#include <string>
32
33class ITrawlCable;
34
35namespace trawl_mooring
36{
46
49{
50public:
58 TrawlRig(const std::string& ownerName, double frequencyCoefficient, std::optional<double> collisionFrequencyCoefficient, ISimObjectCreator& creator);
59
61 TrawlRig(const std::string& ownerName, CoRiBoDynamics::ConstraintSolver& solver, double frequencyCoefficient, std::optional<double> collisionFrequencyCoefficient, ISimObjectCreator& creator);
62
63 ~TrawlRig();
64 TrawlRig(const TrawlRig&) = delete;
65 TrawlRig& operator=(const TrawlRig&) = delete;
66
68 const RigParts& Parts() const { return m_parts; }
69
71 void Register(ISimObjectCreator& creator);
72
74 void Register(environment::EnvironmentProvider& environment, ISimObjectCreator& creator);
75
77 void Step(double T, const double* X);
78
80 environment::wake::SourceSetBodyWake& BodyWake() { return *m_bodyWake; }
81
84
85private:
86 void Build(CoRiBoDynamics::ConstraintSolver& solver, std::optional<double> collisionFrequencyCoefficient, ISimObjectCreator& creator);
87
88 std::string m_ownerName;
89 RigParts m_parts;
90 std::unique_ptr<environment::wake::SourceSetBodyWake> m_bodyWake;
91 std::unique_ptr<trawl_mooring::DoorAndClumpWakeBodies> m_wakeBodies;
92 bool m_ownsSolver = false;
93};
94
96bool OwnsRig(ISimObjectCreator& creator);
97
104ITrawlCable& JoinedRig(ISimObjectCreator& creator);
105} // namespace trawl_mooring
What a TrawlCable that owns a rig offers the cables that join it (a TrawlCable with TrawlCable,...
Definition ITrawlCable.h:18
Definition DoorAndClumpWakeBodies.h:46
Definition TrawlCableConstraintSets.h:136
Definition TrawlCableConstraintSets.h:74
Definition TrawlCableConstraintSets.h:16
The rig of the object that owns the solver (a TrawlCable without TrawlCable, or a RundDorg).
Definition TrawlRig.h:49
const RigParts & Parts() const
The solver and its shared parts.
Definition TrawlRig.h:68
TrawlRig(const std::string &ownerName, CoRiBoDynamics::ConstraintSolver &solver, double frequencyCoefficient, std::optional< double > collisionFrequencyCoefficient, ISimObjectCreator &creator)
Builds a rig on solver, which it does not own (test support).
environment::wake::SourceSetBodyWake & BodyWake()
The BodyWake of the doors and clump weights.
Definition TrawlRig.h:80
void Step(double T, const double *X)
The owner's PreOdeFcn at the step start T: the BodyWake's update over the doors and clump weights,...
void Register(environment::EnvironmentProvider &environment, ISimObjectCreator &creator)
Registration without an integrator (test support): the BodyWake on environment, then the environment ...
void Register(ISimObjectCreator &creator)
The owner's FinalSetup, after every cable has added its elements: the symplectic step from the integr...
TrawlRig(const std::string &ownerName, double frequencyCoefficient, std::optional< double > collisionFrequencyCoefficient, ISimObjectCreator &creator)
trawl_mooring::DoorAndClumpWakeBodies & WakeBodies()
The doors and clump weights as the BodyWake casts them.
Definition TrawlRig.h:83
The parts of one constraint solver that every cable on it uses.
Definition TrawlRig.h:39
CoRiBoDynamics::ConstraintSolver * solver
6-DOF rigid body constrained dynamic solver.
Definition TrawlRig.h:40
trawl_mooring::TrawlCableCollisionManager * collisions
Collision constraints; owned by the solver; null in a RundDorg rig.
Definition TrawlRig.h:42
double frequencyCoefficient
The owner's regulator frequency coefficient.
Definition TrawlRig.h:44
trawl_mooring::EnvironmentForces * environmentForces
Water, wake and seabed forces; owned by the solver.
Definition TrawlRig.h:43
trawl_mooring::TrawlCableJointConstraint * joints
Structural joint constraints; owned by the solver.
Definition TrawlRig.h:41