AGX Dynamics  2.37.3.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 
151  class AGXMODEL_EXPORT HydrodynamicsParameters : public WindAndWaterParameters
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 
178  AGX_FORCE_INLINE WindAndWaterParameters::ShapeTessellation WindAndWaterParameters::getShapeTessellationLevel() const
179  {
180  return m_tessellation;
181  }
182 }
183 
184 #endif // AGXMODEL_WINDANDWATERPARAMETERS_H
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:400
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...
bool Bool
Definition: Integer.h:48
Base class for a shape.
Definition: Shape.h:53
This namespace consists of a set of classes for handling geometric intersection tests including boole...
agx::observer_ptr< const Shape > ShapeConstObserver
Definition: Shape.h:46
Controller that collects relevant data and executes algorithms (probably mostly aero- and hydrodynami...
#define AGX_FORCE_INLINE
Definition: Object.h:59
Storage that holds data needed for added mass calculations.
Definition: AddedMassDb.h:113
Base class providing referencing counted objects.
Definition: Referenced.h:119
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:36
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:51
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:56
#define AGXMODEL_EXPORT
double Real
Definition: Real.h:42
ShapeTessellation
Tessellation levels of native, non-mesh shapes, e.g, sphere, capsule and cylinder.
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97