4#include "CommonTypes.h"
200#include "NetCableElementSpec.h"
201#include "NetCableElement.h"
203#include "NetElement3N.h"
204#include "NetElementDef.h"
205#include "NetNodeStates.h"
206#include "NetStructureSpec.h"
208#include "sfh/timers/ProfilerWallclock.h"
210#include <fhsim/simobject/SimObject.h>
211#include <fhsim_coribo/JointConstraint.h>
212#include <fhsim_environment/EnvironmentProvider.h>
218#ifdef FH_VISUALIZATION
219# include "sfh/ogre/C3DLine.h"
220# include "sfh/ogre/NMeshGenerators.h"
231 virtual void OdeFcn(
const double dT,
const double*
const adX,
double*
const adXDot)
const;
232 virtual void InitialConditionSetup(
const double dT,
const double*
const adCurrentIC,
double*
const adUpdatedIC, ISimObjectCreator*
const creator);
233 virtual void FinalSetup(
const double dT,
const double*
const adX, ISimObjectCreator*
const creator);
237#ifdef FH_VISUALIZATION
239 virtual void RenderInit(Ogre::Root*
const ogreRoot, ISimObjectCreator*
const creator);
241 virtual void RenderUpdate(
const double dT,
const double*
const adX);
243 void CreateCapsule(Ogre::ManualObject* capsule_manual);
258 void TakeNodeForces(
double T,
const double* X,
const double* nodeForce,
double* XDot)
const override;
260 virtual void AddInputPorts(ISimObjectCreator* creator);
261 virtual void CreateDataStructures();
262 VSPairStrInt CreateExternalNodeMap(std::string tag,
int* piUsed,
const NetStructureSpec& NetSpec, ISimObjectCreator* creator);
263 void ValidateConstraintInput(ISimObjectCreator* creator)
const;
271 ISignalPort** m_InTopConstraintsVel =
nullptr;
278 int m_numNodesOutputPosAndVel;
284 int m_NumNodesInputPosAndVel;
285 int m_NumNodesOutputForce;
287 VSPairStrInt m_VsNodesInputPosAndVel;
288 VSPairStrInt m_VsNodesOutputForce;
299 VSPairStrInt m_VsNodesInputForce;
300 bool m_useTagForExternalNodes;
304 bool m_CageWakeEffectsActive;
316 std::vector<states> m_stateVector;
334 mutable double m_topPosition1[3];
335 mutable double m_topVelocity1[3];
336 double m_topOrientation1[4];
337 double m_topangularVel1[3];
338 mutable double m_topPosition2[3];
339 mutable double m_topVelocity2[3];
340 double m_topOrientation2[4];
342 double m_topangularVel2[3];
344 double m_YoungsModulus;
346 int m_numConstraintsElements;
347 double m_depthOfConstraintsCable;
348#ifdef FH_VISUALIZATION
349 Ogre::SceneNode** m_renderNodes;
353#ifdef NetStructureWithConstraints_DO_PROFILE
354 sfh::timers::ProfilerWallclock m_Profiler;
Definition NetNodeStates.h:39
Definition NetStructureSpec.h:40
Definition NetStructureWithConstraints.h:225
VSPairStrInt m_VsNodesOutputPosAndVel
Nodes reachable directly through input or output ports.
Definition NetStructureWithConstraints.h:298
void SetAddedDragPerMPS(double AddedDragPerMPS)
std::unique_ptr< NetCore > m_core
The net core: the panels, cable elements, their loads and the wakes (NetCore.h); no seabed contact.
Definition NetStructureWithConstraints.h:293
bool NodeHasOwnStates(int node) const
True unless a rigid element drives the node.
Definition NetStructureWithConstraints.h:328
const states & DrivingElement(int node) const
The state indices of the rigid element that drives the node.
Definition NetStructureWithConstraints.h:330
const double * NodePositionState(const double *X, int node) const
Definition NetStructureWithConstraints.h:324
void PreOdeFcn(double T, const double *X) override
Rebuilds the cast wake when due (with CastWake) and takes the wakes at the panel centroids and cable ...
ISignalPort ** m_InTopConstraintsPos
Interface member variables.
Definition NetStructureWithConstraints.h:270
virtual ~NetStructureWithConstraints()
The destructor deletes dynamically allocated memory.
NetNodeLayout Layout() const override
double m_solverFrequencyCoefficient
Frequency coefficient of the constraint solver [1/s].
Definition NetStructureWithConstraints.h:345
void TakeNodeForces(double T, const double *X, const double *nodeForce, double *XDot) const override
The free nodes' derivatives (zero for the driven nodes' frozen states), the driven nodes' forces on t...
int m_numNodesInputForce
Node counts.
Definition NetStructureWithConstraints.h:277
int(* m_hasPosAndVelStates)[2]
Per calculation node: [0] the index of the rigid element that drives it, [1] 1 if it has its own stat...
Definition NetStructureWithConstraints.h:282
NetStructureWithConstraints(std::string simObjectName, ISimObjectCreator *creator)
The constructor sets the pointer to the output object and the parser object.
CoRiBoDynamics::JointConstraint * m_jointConstr
Owned by m_constraintSolver, which deletes its constraint sets.
Definition NetStructureWithConstraints.h:332
void AddExternalForces(double T, const double *X, double *nodeForce) const override
No external node forces.
const double * NodeVelocityState(const double *X, int node) const
The velocity of a calculation node, 3 states in X (as NodePositionState()).
Definition NetStructureWithConstraints.h:326
std::unique_ptr< CoRiBoDynamics::ConstraintSolver > m_constraintSolver
Owns the rigid elements, the constraint sets (m_jointConstr among them) and, with NumCpuCore > 1,...
Definition NetStructureWithConstraints.h:308
Definition NetNodeStates.h:19
Definition NetStructureWithConstraints.h:310