4#include "CommonTypes.h"
315#include "NetBottomContactFilter.h"
316#include "NetCableElementSpec.h"
317#include "NetCableElementWithConstraints.h"
318#include "NetElement3NWithConstraints.h"
319#include "NetElementDef.h"
320#include "NetPanelSetup.h"
321#include "NetStructureSpec.h"
322#include "NetFlowInteraction.h"
324#include "sfh/timers/ProfilerWallclock.h"
326#include <fhsim/simobject/SimObject.h>
327#include <fhsim_coribo/JointConstraint.h>
328#include <fhsim_environment/EnvironmentProvider.h>
329#include <fhsim_environment/SeafloorForcesInterface.h>
334#ifdef FH_VISUALIZATION
335# include "sfh/ogre/C3DLine.h"
336# include "sfh/ogre/NMeshGenerators.h"
347 virtual void OdeFcn(
const double dT,
const double*
const adX,
double*
const adXDot)
const;
348 virtual void InitialConditionSetup(
const double dT,
const double*
const adCurrentIC,
double*
const adUpdatedIC, ISimObjectCreator*
const creator);
349 virtual void FinalSetup(
const double dT,
const double*
const adX, ISimObjectCreator*
const creator);
351 void PreOdeFcn(
double T,
const double* X, IStateUpdater* updater)
override;
352 const double*
const outExternalNodeForce(
const double dT,
const double*
const adX,
int extNode);
354#ifdef FH_VISUALIZATION
356 virtual void RenderInit(Ogre::Root*
const ogreRoot, ISimObjectCreator*
const creator);
358 virtual void RenderUpdate(
const double dT,
const double*
const adX);
360 void CreateCapsule(Ogre::ManualObject* capsule_manual);
363 const virtual double*
const NodePos(
const double dT,
const double*
const adX,
int extNode);
364 const virtual double*
const NodeVel(
const double dT,
const double*
const adX,
int extNode);
365 const virtual double*
const BottomContact(
const double dT,
const double*
const adX);
366 void SetAddedDragPerMPS(
double AddedDragPerMPS);
367 const virtual double*
const NodeForce(
const double dT,
const double*
const adX,
int extNode)
const;
369 virtual void CalcStateDerivatives(
const double*
const adX,
double*
const adXDot)
const;
370 virtual void AddExternalForces(
const double dT,
const double*
const adX)
const;
371 virtual void AddNetForces(
const double dT,
const double*
const adX)
const;
372 virtual void AddCableForces(
const double dT,
const double*
const adX)
const;
376 void AddNetForceRange(
double T,
const double* X,
int begin,
int end,
double* nodeForce)
const;
379 void AddCableForceRange(
double T,
const double* X,
int begin,
int end,
double* nodeForce,
bool waterFollowsElement =
false)
const;
383 void FlowAt(
double T,
int point,
const double pos[3],
double vel[3])
const;
387 virtual double AddNodeBottomForce(
const double*
const adX,
int node,
double diam,
double adForceInOut[3])
const;
388 virtual void AddBottomForces(
const double*
const adX)
const;
389 virtual void AddInputPorts(ISimObjectCreator* creator);
390 virtual void CreateNetPanels(std::vector<const NetElementDef*> VNetElementDefs, ISimObjectCreator* creator);
391 virtual void CreateNetCables(std::vector<const NetCableElementSpec*> VCableElements, ISimObjectCreator* creator);
392 virtual void CreateDataStructures();
393 virtual void CreateOutputPorts(ISimObjectCreator* creator);
394 VSPairStrInt CreateExternalNodeMap(std::string tag,
int* piUsed,
NetStructureSpec& NetSpec, ISimObjectCreator* creator);
395 void ValidateConstraintInput(ISimObjectCreator* creator)
const;
396 void PRINTALLNODEFORCES(std::string spec,
double dT);
398 void SetExternalPos(
const double dT,
const double*
const adX)
const;
399 void SetExternalVel(
const double dT,
const double*
const adX)
const;
407 ISignalPort** m_InTopConstraintsVel;
411 double* m_NodeExternalForces;
412 double* m_NodeConstraintsPos;
413 double* m_NodeConstraintsVel;
417 int m_numNodesOutputPosAndVel;
420 int m_numNodesOriginal;
422 int m_numNodeOutputs;
425 double* m_NodeInternalForces;
427 int (*m_hasPosAndVelStates)[2];
429 int m_NumNodesInputPosAndVel;
430 int m_NumNodesOutputForce;
432 VSPairStrInt m_VsNodesInputPosAndVel;
433 VSPairStrInt m_VsNodesOutputForce;
440 double m_bottomContact[6];
442 environment::EnvironmentProvider* m_environment;
443 environment::SeafloorForcesInterface* m_seafloor;
449 net_solidity::SolidityModel m_solidityModel = net_solidity::kDefaultSolidityModel;
455 std::unique_ptr<NetFlowInteraction>
m_flow;
463 std::vector<NetElement3NWithConstraints*> m_VpNetElements;
466 int** m_aaiCableConn;
468 bool m_foldingPointRefinementUsed;
475 VSPairStrInt m_VsNodesInputForce;
476 bool m_useTagForExternalNodes;
483 bool m_CageWakeEffectsActive;
486 CoRiBoDynamics::ConstraintSolver* m_constraintSolver;
494 std::vector<states> m_stateVector;
510 CoRiBoDynamics::JointConstraint* m_jointConstr;
512 mutable double m_topPosition1[3];
513 mutable double m_topVelocity1[3];
514 double m_topOrientation1[4];
515 double m_topangularVel1[3];
516 mutable double m_topPosition2[3];
517 mutable double m_topVelocity2[3];
518 double m_topOrientation2[4];
520 double m_topangularVel2[3];
522 double m_YoungsModulus;
526 int m_numConstraintsElements;
527 double m_depthOfConstraintsCable;
528#ifdef FH_VISUALIZATION
529 Ogre::SceneNode** m_renderNodes;
533#ifdef NetStructureWithConstraints_DO_PROFILE
534 sfh::timers::ProfilerWallclock m_Profiler;
Definition NetStructureSpec.h:39
Definition NetStructureWithConstraints.h:341
VSPairStrInt m_VsNodesOutputPosAndVel
Nodes reachable directly through input or output ports.
Definition NetStructureWithConstraints.h:474
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:481
bool NodeHasOwnStates(int node) const
True unless a rigid element drives the node.
Definition NetStructureWithConstraints.h:506
const states & DrivingElement(int node) const
The state indices of the rigid element that drives the node.
Definition NetStructureWithConstraints.h:508
const double * NodePositionState(const double *X, int node) const
Definition NetStructureWithConstraints.h:502
ISignalPort ** m_InTopConstraintsPos
Interface member variables.
Definition NetStructureWithConstraints.h:406
virtual ~NetStructureWithConstraints()
The destructor deletes dynamically allocated memory.
std::vector< NetCableElementWithConstraints * > m_VpCableElements
Element properties.
Definition NetStructureWithConstraints.h:462
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:525
net_panel_setup::PanelHydrodynamics m_panelHydrodynamics
Panel hydrodynamics (MARE-0095)
Definition NetStructureWithConstraints.h:448
double m_solverFrequencyCoefficient
Frequency coefficient of the constraint solver [1/s].
Definition NetStructureWithConstraints.h:523
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:524
int m_numNodesInputForce
Node counts.
Definition NetStructureWithConstraints.h:416
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:386
NetBottomContactFilter m_BottomContactFilter
Environment.
Definition NetStructureWithConstraints.h:439
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:455
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:457
const double * NodeVelocityState(const double *X, int node) const
The velocity of a calculation node, 3 states in X (as NodePositionState()).
Definition NetStructureWithConstraints.h:504
ISimObjectLogger * m_logger
The FhSim log, kept from FinalSetup for the clamp lines.
Definition NetStructureWithConstraints.h:456
Definition NetWakePanels.h:27
Definition NetStructureWithConstraints.h:488
Class containing the specification for a net object.
Definition NetStructureSpec.h:24
The panel load law and the fluid shared by all panels of a structure.
Definition NetPanelSetup.h:38