AGX Dynamics  2.35.0.1
WindAndWaterParameters.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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 
55 
56  public:
57 
63  void setCoefficient( Coefficient type, agx::Real coefficient );
64 
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 
95 
99  agxModel::WindAndWaterParameters::ShapeTessellation getShapeTessellationLevel() const;
100 
104  const agxCollide::Shape* getShape() const;
105 
109  virtual void store( agxStream::OutputArchive& out ) const;
110 
115 
116  protected:
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:
143 
145  virtual agx::Bool checkParameter( Coefficient type ) const override;
147  };
148 
150 
152  {
153  public:
160 
165 
166  protected:
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
#define AGXMODEL_EXPORT
Base class for a shape.
Definition: Shape.h:54
Storage that holds data needed for added mass calculations.
Definition: AddedMassDb.h:39
AerodynamicsParameters(const agxCollide::Shape *shape, agxModel::AddedMassDbRef addedMassDb)
HydrodynamicsParameters(const agxCollide::Shape *shape, agxModel::AddedMassDbRef addedMassDb)
const agxModel::AddedMassStorage * getAddedMassStorage() const
agx::Bool initializeAddedMassStorage(const agx::String &filename)
Initializes the added mass storage given filename to store and/or restore the data for this given sha...
Controller that collects relevant data and executes algorithms (probably mostly aero- and hydrodynami...
static void setAerodynamicCoefficient(WindAndWaterController *controller, agx::RigidBody *rb, Coefficient type, agx::Real coefficient)
Set a aerodynamic coefficient for a rigid body.
ShapeTessellation
Tessellation levels of native, non-mesh shapes, e.g, sphere, capsule and cylinder.
virtual void restore(agxStream::InputArchive &in)
Internal method.
const agxCollide::Shape * getShape() const
void setCoefficient(Coefficient type, agx::Real coefficient)
Set pressure drag, viscous drag, lift or buoyancy coefficient.
WindAndWaterParameters(const agxCollide::Shape *shape, agxModel::AddedMassDbRef addedMassDb)
static agx::Real shapeTessellationLevelToResolution(agxModel::WindAndWaterParameters::ShapeTessellation tessellationLevel)
Translate from ShapeTessellation to scale of default meshing technique.
static void setHydrodynamicCoefficient(WindAndWaterController *controller, agx::RigidBody *rb, Coefficient type, agx::Real coefficient)
Set a hydrodynamic coefficient for a rigid body.
virtual void store(agxStream::OutputArchive &out) const
Internal method.
void setShapeTessellationLevel(agxModel::WindAndWaterParameters::ShapeTessellation tessellation)
Assign tessellation level for native shapes (sphere, capsule and cylinder) used during aero- and hydr...
agx::Real getCoefficient(Coefficient type) const
Class for reading a binary stream of serialized data.
Definition: InputArchive.h:52
Class for writing serialized data in binary format to a stream.
Definition: OutputArchive.h:57
Base class providing referencing counted objects.
Definition: Referenced.h:114
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:55
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
#define AGX_FORCE_INLINE
Definition: macros.h:58
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
Contain classes for higher level modeling primitives, such as Tree, Terrain etc.
Definition: FlowUnit.h:37
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.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
bool Bool
Definition: Integer.h:48
double Real
Definition: Real.h:42