AGX Dynamics  2.38.0.2
WindAndWaterParameters.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #ifndef AGXMODEL_WINDANDWATERPARAMETERS_H
18 #define AGXMODEL_WINDANDWATERPARAMETERS_H
19 
20 #include <agxModel/AddedMassDb.h>
21 
22 #include <agx/Referenced.h>
23 
24 namespace agxModel
25 {
26  class WindAndWaterController;
27 
29  {
30  public:
36  {
37  LOW,
41  DEFAULT_TESSELLATION = MEDIUM
42  };
43 
44  enum Coefficient {
48  BUOYANCY
49  };
50 
54  static agx::Real shapeTessellationLevelToResolution( agxModel::WindAndWaterParameters::ShapeTessellation tessellationLevel );
55 
56  public:
57 
63  void setCoefficient( Coefficient type, agx::Real coefficient );
64 
68  agx::Real getCoefficient( Coefficient type ) const;
69 
77  static void setHydrodynamicCoefficient( WindAndWaterController* controller, agx::RigidBody* rb, Coefficient type, agx::Real coefficient );
78 
86  static void setAerodynamicCoefficient( WindAndWaterController* controller, agx::RigidBody* rb, Coefficient type, agx::Real coefficient );
87 
94  void setShapeTessellationLevel( agxModel::WindAndWaterParameters::ShapeTessellation tessellation );
95 
99  agxModel::WindAndWaterParameters::ShapeTessellation getShapeTessellationLevel() const;
100 
104  const agxCollide::Shape* getShape() const;
105 
109  virtual void store( agxStream::OutputArchive& out ) const;
110 
114  virtual void restore( agxStream::InputArchive& in );
115 
116  protected:
118  virtual ~WindAndWaterParameters();
119 
121  virtual agx::Bool checkParameter( Coefficient type ) const = 0;
123 
124  protected:
125  agx::Real m_pressureDragCoefficient;
126  agx::Real m_liftCoefficient;
127  agx::Real m_viscousDragCoefficient;
128  agx::Real m_buoyancyScaling;
129  agxModel::AddedMassStorage::Identifier m_addedMassIdentifier;
130  agxModel::AddedMassDbRef m_addedMassDb;
132  ShapeTessellation m_tessellation;
133  };
134 
136 
138  {
139  protected:
142  virtual ~AerodynamicsParameters();
143 
145  virtual agx::Bool checkParameter( Coefficient type ) const override;
147  };
148 
150 
152  {
153  public:
159  agx::Bool initializeAddedMassStorage( const agx::String& filename );
160 
164  const agxModel::AddedMassStorage* getAddedMassStorage() const;
165 
166  protected:
169  virtual ~HydrodynamicsParameters();
170 
172  virtual agx::Bool checkParameter( Coefficient type ) const override;
174  };
175 
177 
179  {
180  return m_tessellation;
181  }
182 }
183 
184 #endif // AGXMODEL_WINDANDWATERPARAMETERS_H
Referenced.h
agxModel::WindAndWaterParameters::PRESSURE_DRAG
@ PRESSURE_DRAG
Definition: WindAndWaterParameters.h:45
agx::Real
double Real
Definition: Real.h:42
agxModel
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:36
agxStream::out
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive.
Definition: OutputArchive.h:412
agx::RigidBody
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:51
DOXYGEN_END_INTERNAL_BLOCK
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
DOXYGEN_START_INTERNAL_BLOCK
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
agxModel::WindAndWaterParameters::MEDIUM
@ MEDIUM
Definition: WindAndWaterParameters.h:38
agxModel::WindAndWaterParameters::HIGH
@ HIGH
Definition: WindAndWaterParameters.h:39
agx
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Definition: AddedMassInteraction.h:22
agxStream::in
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
Definition: InputArchive.h:399
agxModel::AddedMassStorage
Storage that holds data needed for added mass calculations.
Definition: AddedMassDb.h:113
agxModel::WindAndWaterParameters
Definition: WindAndWaterParameters.h:28
agx::ref_ptr< AddedMassDb >
agxModel::WindAndWaterController
Controller that collects relevant data and executes algorithms (probably mostly aero- and hydrodynami...
Definition: WindAndWaterController.h:45
agxCollide::Shape
Base class for a shape.
Definition: Shape.h:53
agxModel::AerodynamicsParameters
Definition: WindAndWaterParameters.h:137
agxStream::OutputArchive
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:56
agxModel::WindAndWaterParameters::ShapeTessellation
ShapeTessellation
Tessellation levels of native, non-mesh shapes, e.g, sphere, capsule and cylinder.
Definition: WindAndWaterParameters.h:35
agxStream::InputArchive
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:50
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:119
agxCollide
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Definition: ContactForceFilterParticipant.h:22
agx::Bool
bool Bool
Definition: Integer.h:40
agxModel::HydrodynamicsParameters
Definition: WindAndWaterParameters.h:151
agxModel::WindAndWaterParameters::LIFT
@ LIFT
Definition: WindAndWaterParameters.h:47
agxModel::WindAndWaterParameters::Coefficient
Coefficient
Definition: WindAndWaterParameters.h:44
AddedMassDb.h
AGXMODEL_EXPORT
#define AGXMODEL_EXPORT
Definition: agxModel/export.h:42
agxModel::WindAndWaterParameters::VISCOUS_DRAG
@ VISCOUS_DRAG
Definition: WindAndWaterParameters.h:46
agx::AgXString< std::string >
agxModel::WindAndWaterParameters::LOW
@ LOW
Definition: WindAndWaterParameters.h:37
agxCollide::ShapeConstObserver
agx::observer_ptr< const Shape > ShapeConstObserver
Definition: Shape.h:46
agxModel::WindAndWaterParameters::ULTRA_HIGH
@ ULTRA_HIGH
Definition: WindAndWaterParameters.h:40
AGX_FORCE_INLINE
#define AGX_FORCE_INLINE
Definition: macros.h:58