4#include "CommonTypes.h"
314#include "NetBottomContactFilter.h"
315#include "NetCableElementSpec.h"
316#include "NetCableElementWithConstraints.h"
317#include "NetElement3NWithConstraints.h"
318#include "NetElementDef.h"
319#include "NetPanelSetup.h"
320#include "NetStructureSpec.h"
321#include "NetFlowInteraction.h"
323#include "sfh/timers/ProfilerWallclock.h"
325#include <fhsim/simobject/SimObject.h>
326#include <fhsim_coribo/JointConstraint.h>
327#include <fhsim_environment/EnvironmentProvider.h>
328#include <fhsim_environment/SeafloorForcesInterface.h>
333#ifdef FH_VISUALIZATION
334# include "sfh/ogre/C3DLine.h"
335# include "sfh/ogre/NMeshGenerators.h"
346 virtual void OdeFcn(
const double dT,
const double*
const adX,
double*
const adXDot)
const;
347 virtual void InitialConditionSetup(
const double dT,
const double*
const adCurrentIC,
double*
const adUpdatedIC, ISimObjectCreator*
const creator);
348 virtual void FinalSetup(
const double dT,
const double*
const adX, ISimObjectCreator*
const creator);
350 void PreOdeFcn(
double T,
const double* X, IStateUpdater* updater)
override;
351 const double*
const outExternalNodeForce(
const double dT,
const double*
const adX,
int extNode);
353#ifdef FH_VISUALIZATION
355 virtual void RenderInit(Ogre::Root*
const ogreRoot, ISimObjectCreator*
const creator);
357 virtual void RenderUpdate(
const double dT,
const double*
const adX);
359 void CreateCapsule(Ogre::ManualObject* capsule_manual);
362 const virtual double*
const NodePos(
const double dT,
const double*
const adX,
int extNode);
363 const virtual double*
const NodeVel(
const double dT,
const double*
const adX,
int extNode);
364 const virtual double*
const BottomContact(
const double dT,
const double*
const adX);
365 void SetAddedDragPerMPS(
double AddedDragPerMPS);
366 const virtual double*
const NodeForce(
const double dT,
const double*
const adX,
int extNode)
const;
368 virtual void CalcStateDerivatives(
const double*
const adX,
double*
const adXDot)
const;
369 virtual void AddExternalForces(
const double dT,
const double*
const adX)
const;
370 virtual void AddNetForces(
const double dT,
const double*
const adX)
const;
371 virtual void AddCableForces(
const double dT,
const double*
const adX)
const;
375 void AddNetForceRange(
double T,
const double* X,
int begin,
int end,
double* nodeForce)
const;
378 void AddCableForceRange(
double T,
const double* X,
int begin,
int end,
double* nodeForce,
bool waterFollowsElement =
false)
const;
382 void FlowAt(
double T,
int point,
const double pos[3],
double vel[3])
const;
386 virtual double AddNodeBottomForce(
const double*
const adX,
int node,
double diam,
double adForceInOut[3])
const;
387 virtual void AddBottomForces(
const double*
const adX)
const;
388 virtual void AddInputPorts(ISimObjectCreator* creator);
389 virtual void CreateNetPanels(std::vector<const NetElementDef*> VNetElementDefs, ISimObjectCreator* creator);
390 virtual void CreateNetCables(std::vector<const NetCableElementSpec*> VCableElements, ISimObjectCreator* creator);
391 virtual void CreateDataStructures();
392 virtual void CreateOutputPorts(ISimObjectCreator* creator);
393 VSPairStrInt CreateExternalNodeMap(std::string tag,
int* piUsed,
NetStructureSpec& NetSpec, ISimObjectCreator* creator);
394 void ValidateConstraintInput(ISimObjectCreator* creator)
const;
395 void PRINTALLNODEFORCES(std::string spec,
double dT);
397 void SetExternalPos(
const double dT,
const double*
const adX)
const;
398 void SetExternalVel(
const double dT,
const double*
const adX)
const;
406 ISignalPort** m_InTopConstraintsVel;
410 double* m_NodeExternalForces;
411 double* m_NodeConstraintsPos;
412 double* m_NodeConstraintsVel;
416 int m_numNodesOutputPosAndVel;
419 int m_numNodesOriginal;
421 int m_numNodeOutputs;
424 double* m_NodeInternalForces;
426 int (*m_hasPosAndVelStates)[2];
428 int m_NumNodesInputPosAndVel;
429 int m_NumNodesOutputForce;
431 VSPairStrInt m_VsNodesInputPosAndVel;
432 VSPairStrInt m_VsNodesOutputForce;
439 double m_bottomContact[6];
441 environment::EnvironmentProvider* m_environment;
442 environment::SeafloorForcesInterface* m_seafloor;
448 net_solidity::SolidityModel m_solidityModel = net_solidity::kDefaultSolidityModel;
454 std::unique_ptr<NetFlowInteraction>
m_flow;
462 std::vector<NetElement3NWithConstraints*> m_VpNetElements;
465 int** m_aaiCableConn;
467 bool m_foldingPointRefinementUsed;
474 VSPairStrInt m_VsNodesInputForce;
475 bool m_useTagForExternalNodes;
482 bool m_CageWakeEffectsActive;
485 CoRiBoDynamics::ConstraintSolver* m_constraintSolver;
493 std::vector<states> m_stateVector;
509 CoRiBoDynamics::JointConstraint* m_jointConstr;
511 mutable double m_topPosition1[3];
512 mutable double m_topVelocity1[3];
513 double m_topOrientation1[4];
514 double m_topangularVel1[3];
515 mutable double m_topPosition2[3];
516 mutable double m_topVelocity2[3];
517 double m_topOrientation2[4];
519 double m_topangularVel2[3];
521 double m_YoungsModulus;
525 int m_numConstraintsElements;
526 double m_depthOfConstraintsCable;
527#ifdef FH_VISUALIZATION
528 Ogre::SceneNode** m_renderNodes;
532#ifdef NetStructureWithConstraints_DO_PROFILE
533 sfh::timers::ProfilerWallclock m_Profiler;
Definition NetStructureSpec.h:37
Definition NetStructureWithConstraints.h:340
VSPairStrInt m_VsNodesOutputPosAndVel
Nodes reachable directly through input or output ports.
Definition NetStructureWithConstraints.h:473
void AddNetForceRange(double T, const double *X, int begin, int end, double *nodeForce) const
Adds the forces of panels [begin, end) to nodeForce.
double m_meanTensionTime
The time of the last per-step mean-tension update of the cable elements (owner ruling R64),...
Definition NetStructureWithConstraints.h:480
bool NodeHasOwnStates(int node) const
True unless a rigid element drives the node.
Definition NetStructureWithConstraints.h:505
const states & DrivingElement(int node) const
The state indices of the rigid element that drives the node.
Definition NetStructureWithConstraints.h:507
const double * NodePositionState(const double *X, int node) const
Definition NetStructureWithConstraints.h:501
ISignalPort ** m_InTopConstraintsPos
Interface member variables.
Definition NetStructureWithConstraints.h:405
virtual ~NetStructureWithConstraints()
The destructor deletes dynamically allocated memory.
std::vector< NetCableElementWithConstraints * > m_VpCableElements
Element properties.
Definition NetStructureWithConstraints.h:461
void AddCableForceRange(double T, const double *X, int begin, int end, double *nodeForce, bool waterFollowsElement=false) const
std::vector< double > m_threadNodeForces
One node-force buffer per chunk of the parallel loops, set in FinalSetup.
Definition NetStructureWithConstraints.h:524
net_panel_setup::PanelHydrodynamics m_panelHydrodynamics
Panel hydrodynamics (MARE-0095)
Definition NetStructureWithConstraints.h:447
double m_solverFrequencyCoefficient
Frequency coefficient of the constraint solver [1/s].
Definition NetStructureWithConstraints.h:522
void FlowAt(double T, int point, const double pos[3], double vel[3]) const
The water velocity at a panel centroid (point = panel) or a cable midpoint (point = number of panels ...
int m_numThreads
Threads of the panel and cable loops (NumThreads, R63).
Definition NetStructureWithConstraints.h:523
int m_numNodesInputForce
Node counts.
Definition NetStructureWithConstraints.h:415
void PreOdeFcn(double T, const double *X, IStateUpdater *updater) override
Rebuilds the cast wake when due (with CastWake) and takes the wakes at the panel centroids and cable ...
std::vector< double > m_nodeWaveVelocity
The wave particle velocity at each node of the state being evaluated (R62), 3 per node.
Definition NetStructureWithConstraints.h:385
NetBottomContactFilter m_BottomContactFilter
Environment.
Definition NetStructureWithConstraints.h:438
std::unique_ptr< NetFlowInteraction > m_flow
The wakes cast and received and the water velocity at the panels and cables (MARE-0333); from the con...
Definition NetStructureWithConstraints.h:454
void AddNetAndCableForcesInParallel(double T, const double *X) const
The panel and cable loops on m_numThreads threads, deterministic for a fixed count (owner ruling R63)...
void CableHydrodynamicForce(double T, const double *X, double force[3]) const
The sum of the cables' hydrodynamic forces on the nodes, N (MARE-0141); for the wake caster's log.
void UpdateNodeWaveVelocities(double T, const double *X, int firstNode, int endNode) const
Sets m_nodeWaveVelocity at nodes [firstNode, endNode) of state X (R62).
NetStructureWithConstraints(std::string simObjectName, ISimObjectCreator *creator)
The constructor sets the pointer to the output object and the parser object.
hydrodynamics::PanelClampLog m_clampLog
Which clamps of the load law the panels have hit; reported once each in PreOdeFcn (MARE-0140).
Definition NetStructureWithConstraints.h:456
const double * NodeVelocityState(const double *X, int node) const
The velocity of a calculation node, 3 states in X (as NodePositionState()).
Definition NetStructureWithConstraints.h:503
ISimObjectLogger * m_logger
The FhSim log, kept from FinalSetup for the clamp lines.
Definition NetStructureWithConstraints.h:455
Definition NetWakePanels.h:27
Definition NetStructureWithConstraints.h:487
Class containing the specification for a net object.
Definition NetStructureSpec.h:22
The panel load law and the fluid shared by all panels of a structure.
Definition NetPanelSetup.h:38