1#ifndef TRAWLCABLE_CONSTRAINT_SETS_H
2#define TRAWLCABLE_CONSTRAINT_SETS_H
3#include "CableSegmentWaterForce.h"
5#include <fhsim_environment/BodyWake.h>
6#include <fhsim_environment/EnvironmentProvider.h>
7#include <fhsim_environment/ElementFlowInteraction.h>
8#include <fhsim_environment/SeafloorForcesInterface.h>
9#include <fhsim_coribo/CollisionManager.h>
10#include <fhsim_coribo/JointConstraint.h>
13namespace CoRiBoDynamics{
25 std::vector<int> elements;
31 virtual void ComputeConstraints(
const double T,
const double *
const X);
33 vec3 GetBallJointCouplingForce(
int i);
41 m_CouplingData = data;
42 m_elements = elements;
45 void SetStates(
double T,
const double* X){
51 for(
int i = 0; i < m_elements.size()-1; ++i){
52 m_CouplingData.elementA = m_elements[i];
53 m_CouplingData.elementB = m_elements[i+1];
54 m_master->ComputeRigidCoupling(m_CouplingData);
58 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
62 RigidCoupling m_CouplingData;
63 std::vector<int> m_elements;
67 std::vector<CableSegmentTask*> m_CableSegmentTask;
69 std::vector<vec3> m_BallJointForces;
78 double elementContactStiffness;
79 double frictionCoefficient;
80 double contactDamping;
81 std::vector<int> elements;
88 double getFrequencyCoefficient() {
89 return m_timeConstant;
92 void setStartTimeCollision(
double time) {
93 m_startTimeCollision = time;
104 std::vector<ElementContact>* GetContactPoints();
107 double m_startTimeCollision;
108 void ComputeConstraints(
const double T,
const double *
const X);
109 struct CableSegment {
int start;
int end;
double elementLength;
int firstElementInSegment;
int lastElementInSegment;};
110 std::vector<CableSegment> m_CableSegments;
112 std::vector<ElementContact> m_ContactPoints;
113 void CollisionTest( InternalObject* objectA, InternalObject* objectB ,
const double *
const X,
ElementContact& contact);
138 std::vector<int> elements;
140 double elementLength;
142 double elementDisplacementVolume;
149 double displacementVolume;
171 EnvironmentForces(ConstraintSolver* solver,
double timeConstant,
const environment::wake::BodyWake& bodyWake);
173 void ComputeConstraints(
const double T,
const double *
const X);
184 void FinalSetup(
const std::string& objectName, ISimObjectCreator* creator);
208 std::vector<CableSegment> m_Cables;
209 std::vector<TrawlDoor> m_TrawlDoors;
210 std::vector<ClumpWeight> m_ClumpWeights;
212 double m_timeConstant;
213 environment::EnvironmentProvider* m_environment;
216 environment::wake::ElementFlowInteraction
m_flow;
Definition DoorAndClumpWakeBodies.h:46
Definition TrawlCableConstraintSets.h:135
environment::EnvironmentProvider *const * EnvironmentPointerAddress() const
The address of the environment pointer, which FinalSetup sets later: what the elements with added mas...
Definition TrawlCableConstraintSets.h:198
environment::SeafloorForcesInterface * m_seafloor
The shared SeafloorForces, set in FinalSetup: the soil load of each cable element,...
Definition TrawlCableConstraintSets.h:214
const environment::wake::BodyWake & m_bodyWake
The owner's: the water velocity of the doors and clump weights, and the query the cables receive with...
Definition TrawlCableConstraintSets.h:215
EnvironmentForces(ConstraintSolver *solver, double timeConstant, const environment::wake::BodyWake &bodyWake)
void FinalSetup(const std::string &objectName, ISimObjectCreator *creator)
environment::wake::ElementFlowInteraction m_flow
The flow at the centres of the cable elements, the other objects' wakes taken per step as the owner r...
Definition TrawlCableConstraintSets.h:216
void TakeWakes(const double T, const double *const X)
const ClumpWeight * ClumpOfBody(int body) const
The clump weight that is body body of the owner's BodyWake, or nullptr if the body is a door.
const TrawlDoor * DoorOfBody(int body) const
The door that is body body of the owner's BodyWake, or nullptr if the body is a clump weight.
int NumBodies() const
The number of bodies of the owner's BodyWake: the trawl doors (bodies 0 to their number − 1),...
Definition TrawlCableConstraintSets.h:73
void TestAgainstMainSegments(int i, const double *const X)
Test the non-mooring body i against the mooring segments in the collision map (steps 4a-4d).
The rigid couplings along one cable segment, computed in ComputeConstraints.
Definition TrawlCableConstraintSets.h:37
Definition TrawlCableConstraintSets.h:15
Definition TrawlCableConstraintSets.h:137
Definition TrawlCableConstraintSets.h:158
trawl_cable_water::ClumpWeight Law() const
The clump weight's water law.
Definition TrawlCableConstraintSets.h:165
Definition TrawlCableConstraintSets.h:144
trawl_cable_water::Door Law() const
The door's water law.
Definition TrawlCableConstraintSets.h:155
Definition TrawlCableConstraintSets.h:75
Definition TrawlCableConstraintSets.h:109
Definition TrawlCableConstraintSets.h:96
double MainSegmentPosition
contact point on element B
Definition TrawlCableConstraintSets.h:101
double la
index of element B
Definition TrawlCableConstraintSets.h:99
int ib
index of element A
Definition TrawlCableConstraintSets.h:98
double lb
contact point on element A
Definition TrawlCableConstraintSets.h:100
Definition TrawlCableConstraintSets.h:17
The properties of a clump weight, a cylinder along the body's z axis.
Definition CableSegmentWaterForce.h:140
The properties of a trawl door, a flat plate in the body's x-z plane (normal Ny).
Definition CableSegmentWaterForce.h:131