FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
AttractorNetBin Class Reference

The net bin of Seine/Vessel: a sphere that pulls the net and warp nodes inside it. More...

#include <AttractorNetBin.h>

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 SetParams (const double radius, const double springStiffness, const double damping)
 
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
 
void AddForce (const Motion &motion, double *const adForce, const double *const adNodePos, const double *const adNodeVel) const
 
bool Contains (const Motion &motion, const double *const adNodePos) const
 Whether adNodePos lies strictly inside the radius.
 

Detailed Description

Author
Karl-Johan Reite

Member Function Documentation

◆ AddForce()

void AttractorNetBin::AddForce ( const Motion &  motion,
double *const  adForce,
const double *const  adNodePos,
const double *const  adNodeVel 
) const

Adds the pull on a node at adNodePos moving at adNodeVel to adForce: nothing outside the radius; inside it relStrength·(−ê·k·d + (v_a − v_n)·c), with ê the unit vector from the attractor to the node and d their distance, plus the depth penalty −relStrength·1000·z in z, once, for a node with z > 0 (FISH-0111).

◆ MotionAt()

Motion AttractorNetBin::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: