Marine systems simulation
CollarChain.h
1#pragma once
2#include <Eigen/Eigen>
3
4#include "SupergridCable.h"
5#include "LineStructureGravityHydro.h"
6
7
8
9
11public:
12 CollarChain(CoRiBoDynamics::ConstraintSolver* solver, ISimObjectCreator* creator, double beta, string name);
13
14 void setEnvironment(CEnvironment*e) { env_wrapper = EnvironmentWrapper(e); }
15
16 virtual void ComputeConstraints(const double T, const double * const X);
17
18protected:
19 static int GetElementNum(ISimObjectCreator* creator);
20
22 {
23 public:
24 EnvironmentWrapper(CEnvironment* environment) { m_environment = environment; }
25
26 Eigen::Vector3d Current(double T, const double* X, const double* Position) { Eigen::Vector3d C; m_environment->GetCurrentVelocity(T, X, Position, C.data()); return C; }
27 double OceanSurfaceElevation(double T, const double* X, const double* Position) { return m_environment->GetSurfaceElevation(T, X, Position); }
28
29 void CurrentQuery(double T, const double* X, const Eigen::Vector3d& Position, Eigen::Vector3d& current, double& surface_elevation, double& density) { auto result = m_environment->PointEnvironmentQuery(T, X, Position.data()); current = Eigen::Vector3d(result.current_velocity); surface_elevation = result.surface_elevation; density = result.density; }
30
31 double SeaDepth(const double* Position) { return m_environment->GetSeadepth(Position); }
32
33 private:
34 CEnvironment* m_environment;
35 };
36 EnvironmentWrapper env_wrapper;
37};
Definition: CEnvironment.h:10
Definition: ConstraintSolver.h:31
Definition: SupergridLineStructure.h:15
Definition: CollarChain.h:22
Definition: CollarChain.h:10
virtual void ComputeConstraints(const double T, const double *const X)