FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
SeafloorForces.h
1#pragma once
2#include "SeafloorForcesInterface.h"
3
4#include <fhsim_environment/seabed/SeabedContact.h>
5
6#include <atomic>
7#include <functional>
8#include <marenv/seafloor/BathymetryField.h>
9#include <memory>
10#include <string>
11namespace environment
12{
13
24class SeafloorForces : public SeafloorForcesInterface
25{
26public:
31 explicit SeafloorForces(std::shared_ptr<marenv::seafloor::BathymetryField> bathymetrybroker);
32
34 using WarningSink = std::function<void(const std::string&)>;
35
41 SeafloorForces(std::shared_ptr<marenv::seafloor::BathymetryField> bathymetrybroker, WarningSink warn);
43 seabed::ContactLoad<double> Sphere(const seabed::Sphere& sphere, const double pos[3], const double vel[3]) override;
45 seabed::NodePairLoad<double> CableElement(double diameter, const double posA[3], const double posB[3], const double velA[3], const double velB[3]) override;
47 seabed::ContactLoad<double> RigidCylinder(const seabed::Cylinder& cylinder, const seabed::RigidMotion<double>& motion) override;
49 seabed::ContactLoad<double> Plate(const seabed::Polygon& polygon, const seabed::RigidMotion<double>& motion) override;
51 seabed::ContactLoad<double> TrawlDoor(const seabed::TrawlDoorShape& door, const seabed::RigidMotion<double>& motion) override;
53 seabed::ContactLoad<double> AnchorShank(const seabed::AnchorShank& shank, const seabed::RigidMotion<double>& motion) override;
54
55private:
61 template<class Law>
62 auto Evaluate(const double pos[3], const Law& law);
63
69 void WarnOnceNoSeabedDepth(const double pos[3], marenv::Status status);
70
71 seabed::SeabedModel m_model;
72 WarningSink m_warn;
73 std::atomic<bool> m_warned{false};
74
75 std::shared_ptr<marenv::seafloor::BathymetryField> m_bathymetry;
76};
77
78} // namespace environment
Definition SeafloorForces.h:25
seabed::ContactLoad< double > Plate(const seabed::Polygon &polygon, const seabed::RigidMotion< double > &motion) override
std::function< void(const std::string &)> WarningSink
Receives the one warning of a run about a contact point with no seabed depth.
Definition SeafloorForces.h:34
SeafloorForces(std::shared_ptr< marenv::seafloor::BathymetryField > bathymetrybroker)
seabed::ContactLoad< double > RigidCylinder(const seabed::Cylinder &cylinder, const seabed::RigidMotion< double > &motion) override
seabed::NodePairLoad< double > CableElement(double diameter, const double posA[3], const double posB[3], const double velA[3], const double velB[3]) override
seabed::ContactLoad< double > TrawlDoor(const seabed::TrawlDoorShape &door, const seabed::RigidMotion< double > &motion) override
SeafloorForces(std::shared_ptr< marenv::seafloor::BathymetryField > bathymetrybroker, WarningSink warn)
seabed::ContactLoad< double > AnchorShank(const seabed::AnchorShank &shank, const seabed::RigidMotion< double > &motion) override
seabed::ContactLoad< double > Sphere(const seabed::Sphere &sphere, const double pos[3], const double vel[3]) override
Status
Definition marenv.h:40