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>
217#ifdef FH_VISUALIZATION
218# include "sfh/ogre/C3DLine.h"
219# include "sfh/ogre/NMeshGenerators.h"
230 virtual void OdeFcn(
const double dT,
const double*
const adX,
double*
const adXDot)
const;
231 virtual void InitialConditionSetup(
const double dT,
const double*
const adCurrentIC,
double*
const adUpdatedIC, ISimObjectCreator*
const creator);
232 virtual void FinalSetup(
const double dT,
const double*
const adX, ISimObjectCreator*
const creator);
236#ifdef FH_VISUALIZATION
238 virtual void RenderInit(Ogre::Root*
const ogreRoot, ISimObjectCreator*
const creator);
240 virtual void RenderUpdate(
const double dT,
const double*
const adX);
242 void CreateCapsule(Ogre::ManualObject* capsule_manual);
257 void TakeNodeForces(
double T,
const double* X,
const double* nodeForce,
double* XDot)
const override;
259 virtual void AddInputPorts(ISimObjectCreator* creator);
260 virtual void CreateDataStructures();
261 VSPairStrInt CreateExternalNodeMap(std::string tag,
int* piUsed,
const NetStructureSpec& NetSpec, ISimObjectCreator* creator);
262 void ValidateConstraintInput(ISimObjectCreator* creator)
const;
270 ISignalPort** m_InTopConstraintsVel =
nullptr;
277 int m_numNodesOutputPosAndVel;
283 int m_NumNodesInputPosAndVel;
284 int m_NumNodesOutputForce;
286 VSPairStrInt m_VsNodesInputPosAndVel;
287 VSPairStrInt m_VsNodesOutputForce;
298 VSPairStrInt m_VsNodesInputForce;
299 bool m_useTagForExternalNodes;
303 bool m_CageWakeEffectsActive;
315 std::vector<states> m_stateVector;
333 mutable double m_topPosition1[3];
334 mutable double m_topVelocity1[3];
335 double m_topOrientation1[4];
336 double m_topangularVel1[3];
337 mutable double m_topPosition2[3];
338 mutable double m_topVelocity2[3];
339 double m_topOrientation2[4];
341 double m_topangularVel2[3];
343 double m_YoungsModulus;
345 int m_numConstraintsElements;
346 double m_depthOfConstraintsCable;
347#ifdef FH_VISUALIZATION
348 Ogre::SceneNode** m_renderNodes;
352#ifdef NetStructureWithConstraints_DO_PROFILE
353 sfh::timers::ProfilerWallclock m_Profiler;
Definition NetNodeStates.h:39
Definition NetStructureSpec.h:40
Definition NetStructureWithConstraints.h:224
VSPairStrInt m_VsNodesOutputPosAndVel
Nodes reachable directly through input or output ports.
Definition NetStructureWithConstraints.h:297
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:292
bool NodeHasOwnStates(int node) const
True unless a rigid element drives the node.
Definition NetStructureWithConstraints.h:327
const states & DrivingElement(int node) const
The state indices of the rigid element that drives the node.
Definition NetStructureWithConstraints.h:329
const double * NodePositionState(const double *X, int node) const
Definition NetStructureWithConstraints.h:323
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:269
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:344
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:276
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:281
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:331
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:325
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:307
Definition NetNodeStates.h:19
Definition NetStructureWithConstraints.h:309