AGX Dynamics  2.37.3.2
AddedMassInteractionHandler.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 #pragma once
18 
20 
21 namespace agx
22 {
28  {
29  public:
34 
42  agx::Bool setBlock( agx::RigidBody* rb, const agx::AddedMassInteraction::Matrix6x6& matrix );
43 
55 
60  void garbageCollect();
61 
62  protected:
66 
67  protected:
71  virtual ~AddedMassInteractionHandler();
72 
76  virtual void preSystemCallback( agx::DynamicsSystem* dynamicsSystem ) override;
77 
81  virtual void postSystemCallback( agx::DynamicsSystem* dynamicsSystem ) override;
82 
83  protected:
87  SymmetricRigidBodyPtrPair createKey( agx::RigidBody* rb1, agx::RigidBody* rb2 ) const;
88 
92  agx::AddedMassInteraction* getOrCreateInteraction( agx::RigidBody* rb );
93 
97  agx::AddedMassInteraction* getOrCreateInteraction( agx::RigidBody* rb1, agx::RigidBody* rb2 );
98 
102  void removeInteraction( agx::RigidBody* rb );
103 
107  void removeInteraction( agx::RigidBody* rb1, agx::RigidBody* rb2 );
108 
112  agx::AddedMassInteractionRef createInteraction( agx::RigidBody* rb1, agx::RigidBody* rb2 = nullptr ) const;
113 
114  private:
115  RbAddedMassInteractionContainer m_rbInteractions;
116  RbRbAddedMassInteractionContainer m_pairInteractions;
117  };
118 
120 }
121 
A std::pair, with both elements of the same type, and symmetric so (a, b) == (b, a) ...
Definition: SymmetricPair.h:31
bool Bool
Definition: Integer.h:48
ref_ptr< AddedMassInteractionHandler > AddedMassInteractionHandlerRef
agx::HashVector< agx::RigidBody *, agx::AddedMassInteractionRef > RbAddedMassInteractionContainer
agx::HashVector< SymmetricRigidBodyPtrPair, agx::AddedMassInteractionRef > RbRbAddedMassInteractionContainer
6x6 matrix class with blockwise interface to get or set 3x3 matrices: [ M(0, 0) M(0, 1) ] [ M(1, 0) M(1, 1) ]
#define AGXPHYSICS_EXPORT
Class containing and handling a global view of several objects interacting trough strong added mass i...
The base class for interactions.
Definition: Interaction.h:31
agx::SymmetricPair< agx::RigidBody *> SymmetricRigidBodyPtrPair
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Interface to write added mass matrices for one or two rigid bodies.
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:29
The rigid body class, combining a geometric model and a frame of reference.
Definition: RigidBody.h:54
The complete physical system with bodies, interactions, data layout, time stepper, and solver.