FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
AttractorBase Class Referenceabstract

Class modelling the interface of a general attractor. More...

#include <AttractorBase.h>

+ Inheritance diagram for AttractorBase:

Classes

struct  Motion
 Where the attractor is, how fast it moves, and how strongly it pulls. More...
 

Public Types

using PosAndVelSource = std::function< void(double T, const double *X, double pos[3], double vel[3])>
 Gives the attractor's position and velocity at (T, X), X the model-global states.
 
using StrengthSource = std::function< double(double T)>
 Gives the attractor's relative strength at time T.
 

Public Member Functions

void SetPosAndVelSource (PosAndVelSource source)
 Sets what moves the attractor (Seine/Vessel, when it creates it).
 
void SetStrengthSource (StrengthSource source)
 Sets what scales the attractor's pull (Seine/Operation, in its FinalSetup).
 
Motion MotionAt (double T, const double *X) const
 
virtual void GetForce (const Motion &motion, double *const adForce, const double *const adNodePos, const double *const adNodeVel)=0
 
virtual void AddForce (const Motion &motion, double *const adForce, const double nodeMass, const double *const adNodePos, const double *const adNodeVel)=0
 
virtual void AddForce (const Motion &motion, double *const adForce, const double *const adNodePos, const double *const adNodeVel)=0
 
virtual void SetForceIfActive (const Motion &motion, double *const adForce, const double *const adNodePos, const double *const adNodeVel)
 
virtual bool IsActive (const Motion &motion, const double *const adNodePos)=0
 

Detailed Description

Author
Karl-Johan Reite

Member Function Documentation

◆ MotionAt()

Motion AttractorBase::MotionAt ( double  T,
const double *  X 
) const

The motion at (T, X), X the model-global states: a function of them alone, so every reader gets the same motion for the same (T, X), on any thread and in any order (FISH-0104). Without a source the attractor rests at the origin; without a strength source its strength is 1.


The documentation for this class was generated from the following file: