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>
14namespace trawl_mooring{
22 CoRiBoDynamics::Quat AlphaM;
23 CoRiBoDynamics::Quat BetaM;
24 CoRiBoDynamics::Quat GammaM;
26 std::vector<int> elements;
32 virtual void ComputeConstraints(
const double T,
const double *
const X);
34 CoRiBoDynamics::vec3 GetBallJointCouplingForce(
int i);
42 m_CouplingData = data;
43 m_elements = elements;
46 void SetStates(
double T,
const double* X){
52 for(
int i = 0; i < m_elements.size()-1; ++i){
53 m_CouplingData.elementA = m_elements[i];
54 m_CouplingData.elementB = m_elements[i+1];
55 m_master->ComputeRigidCoupling(m_CouplingData);
59 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
63 RigidCoupling m_CouplingData;
64 std::vector<int> m_elements;
68 std::vector<CableSegmentTask*> m_CableSegmentTask;
70 std::vector<CoRiBoDynamics::vec3> m_BallJointForces;
79 double elementContactStiffness;
80 double frictionCoefficient;
81 double contactDamping;
82 std::vector<int> elements;
89 double getFrequencyCoefficient() {
90 return m_timeConstant;
93 void setStartTimeCollision(
double time) {
94 m_startTimeCollision = time;
103 CoRiBoDynamics::vec3 Fn;
105 std::vector<ElementContact>* GetContactPoints();
108 double m_startTimeCollision;
109 void ComputeConstraints(
const double T,
const double *
const X);
110 struct CableSegment {
int start;
int end;
double elementLength;
int firstElementInSegment;
int lastElementInSegment;};
111 std::vector<CableSegment> m_CableSegments;
113 std::vector<ElementContact> m_ContactPoints;
114 void CollisionTest( InternalObject* objectA, InternalObject* objectB ,
const double *
const X,
ElementContact& contact);
139 std::vector<int> elements;
141 double elementLength;
143 double elementDisplacementVolume;
152 double displacementVolume;
174 EnvironmentForces(CoRiBoDynamics::ConstraintSolver* solver,
double timeConstant,
const environment::wake::BodyWake& bodyWake);
176 void ComputeConstraints(
const double T,
const double *
const X);
187 void FinalSetup(
const std::string& objectName, ISimObjectCreator* creator);
217 void QueryGaussPointWater(
const double T,
const double *
const X,
const CableSegment& cable,
const int firstPoint);
221 std::vector<CableSegment> m_Cables;
222 std::vector<TrawlDoor> m_TrawlDoors;
223 std::vector<ClumpWeight> m_ClumpWeights;
226 double m_timeConstant;
227 environment::EnvironmentProvider* m_environment;
230 environment::wake::ElementFlowInteraction
m_flow;
Definition DoorAndClumpWakeBodies.h:46
Definition TrawlCableConstraintSets.h:136
void BuildGaussPoints(const double *const X, const CableSegment &cable)
Fills m_gaussPoints from the segment's elements.
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:230
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:229
void TakeWakes(const double T, const double *const X)
environment::EnvironmentProvider *const * EnvironmentPointerAddress() const
The address of the environment pointer, which FinalSetup sets later: what the elements with added mas...
Definition TrawlCableConstraintSets.h:201
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.
environment::SeafloorForcesInterface * m_seafloor
The shared SeafloorForces, set in FinalSetup: the soil load of each cable element,...
Definition TrawlCableConstraintSets.h:228
int NumBodies() const
The number of bodies of the owner's BodyWake: the trawl doors (bodies 0 to their number − 1),...
void FinalSetup(const std::string &objectName, ISimObjectCreator *creator)
wet_cylinder_water::ElementGaussPoints m_gaussPoints
The Gauss points of the segment being computed, for the Gauss-point drag (MARE-0396); buffers kept fr...
Definition TrawlCableConstraintSets.h:224
EnvironmentForces(CoRiBoDynamics::ConstraintSolver *solver, double timeConstant, const environment::wake::BodyWake &bodyWake)
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.
Definition TrawlCableConstraintSets.h:74
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:38
Definition TrawlCableConstraintSets.h:16
Definition GaussPointDrag.h:56
The properties of a clump weight, a cylinder along the body's z axis.
Definition CableSegmentWaterForce.h:151
The properties of a trawl door, a flat plate in the body's x-z plane (normal Ny).
Definition CableSegmentWaterForce.h:142
Definition TrawlCableConstraintSets.h:138
bool gaussPointDrag
Gauss-point drag with the water at the Gauss points (MARE-0396): the elements are in chain order.
Definition TrawlCableConstraintSets.h:145
Definition TrawlCableConstraintSets.h:161
trawl_cable_water::ClumpWeight Law() const
The clump weight's water law.
Definition TrawlCableConstraintSets.h:168
Definition TrawlCableConstraintSets.h:147
trawl_cable_water::Door Law() const
The door's water law.
Definition TrawlCableConstraintSets.h:158
Definition TrawlCableConstraintSets.h:76
Definition TrawlCableConstraintSets.h:110
Definition TrawlCableConstraintSets.h:18