AGX Dynamics  2.37.3.2
StabilityReport.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 AGX_STABILITYREPORT_H
18 #define AGX_STABILITYREPORT_H
19 
20 #include <agx/SparseTypes.h>
21 #include <agx/agx_valarray_types.h>
22 
27 
28 namespace agx
29 {
30  class Solver;
31  class DirectSolverData;
32  class ElementaryConstraint;
33 
35 
37  {
38  public:
40  {
41  public:
43 
44  public:
45  Diff();
46  Diff( const agx::RealValarray& solution,
47  agx::RangeReal range,
48  agx::UInt permutedRowIndex );
49 
50  agx::Bool isValid() const { return m_permutedRowIndex != agx::InvalidIndex; }
51  agx::Real getSolution() const { return m_solution; }
52  agx::RangeReal getBound() const { return m_bound; }
53  agx::Real getDiff() const { return m_diff; }
54  agx::UInt getPermutedRowIndex() const { return m_permutedRowIndex; }
55 
56  bool operator < ( const Diff& other ) const { return m_diff < other.m_diff; }
57 
58  private:
59  Real m_solution;
60  RangeReal m_bound;
61  Real m_diff;
62  UInt m_permutedRowIndex;
63  };
64 
66  {
67  public:
69 
70  public:
71  Frame( const agx::RealValarray& solution, const agx::SparseRangeReal& bounds, const agx::String& description );
72 
73  const Diff::Container& getDiffs() const;
74 
75  private:
76  void initialize( const agx::RealValarray& solution, const agx::SparseRangeReal& bounds, const agx::String& description );
77 
78  private:
79  Diff::Container m_diffs;
80  agx::String m_description;
81  };
82 
84  {
85  public:
87 
88  public:
91  const agx::UInt permutedStartRow )
92  : diff( diff )
93  , contact( contact )
94  , permutedStartRow( permutedStartRow )
95  {
96  }
97 
101  };
102 
104  {
105  public:
107 
108  public:
110  const agx::ConstraintImplementation* constraint,
111  const agx::Physics::ConstraintBasePtr constraintEntity,
112  const agx::ElementaryConstraint* elementaryConstraint,
113  const agx::UInt permutedStartRow )
114  : diff( diff )
115  , constraint( constraint )
116  , constraintEntity( constraintEntity )
117  , elementaryConstraint( elementaryConstraint )
118  , permutedStartRow( permutedStartRow )
119  {
120  }
121 
127  };
128 
129  public:
130  StabilityReport();
131 
132  void setEnable( agx::Bool enable );
133  agx::Bool getEnable() const;
134 
135  agx::Bool empty() const;
136 
137  const agx::StabilityReport::PotentialConstraintIssue::Container& getPotentialConstraintIssues() const;
138  const agx::StabilityReport::PotentialContactIssue::Container& getPotentialContactIssues() const;
139 
140  virtual void report( const agx::RealValarray& z,
141  const agx::SparseRangeReal& bounds,
142  const agx::String& description );
143  virtual void finalize( agx::Solver *solver,
144  const agx::Physics::SolveIslandPtr island,
145  const agx::Physics::ContactConstraintData& contactConstraint,
146  const agx::Physics::BinaryConstraintData& binaryConstraint,
147  const agx::Physics::ManyBodyConstraintData& manyBodyConstraint );
148 
149  protected:
150  virtual ~StabilityReport();
151 
152  protected:
157  };
158 }
159 
160 #endif
Elementary constraint base class with interface and global constraint functionality.
agx::Real getDiff() const
bool Bool
Definition: Integer.h:48
Pointer to a entity instance of type Physics.ContactConstraint.
Frame::Container m_frames
agx::Vector< Frame > Container
#define AGXPHYSICS_EXPORT
AGXCORE_EXPORT const InvalidIndexStruct InvalidIndex
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
agx::Vector< PotentialContactIssue > Container
Pointer to a entity instance of type Physics.SolveIsland.
Base class providing referencing counted objects.
Definition: Referenced.h:119
const agx::Physics::ConstraintBasePtr constraintEntity
Essentially a sparse array of bounds.
Definition: SparseTypes.h:73
uint32_t UInt
Definition: Integer.h:34
const agx::StabilityReport::Diff diff
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
std::valarray< agx::Real > RealValarray
For this module, vectors are defined using valarray.
Pointer to a entity instance of type Physics.ConstraintBase.
PotentialConstraintIssue::Container m_potentialConstraintIssues
PotentialContactIssue(const agx::StabilityReport::Diff &diff, const agx::Physics::ContactConstraintPtr contact, const agx::UInt permutedStartRow)
PotentialContactIssue::Container m_potentialContactIssues
const agx::Physics::ContactConstraintPtr contact
agx::Vector< PotentialConstraintIssue > Container
agx::Real getSolution() const
agx::RangeReal getBound() const
const agx::StabilityReport::Diff diff
agx::VectorPOD< Diff > Container
double Real
Definition: Real.h:42
agx::Bool isValid() const
agx::UInt getPermutedRowIndex() const
const agx::ConstraintImplementation * constraint
PotentialConstraintIssue(const agx::StabilityReport::Diff &diff, const agx::ConstraintImplementation *constraint, const agx::Physics::ConstraintBasePtr constraintEntity, const agx::ElementaryConstraint *elementaryConstraint, const agx::UInt permutedStartRow)
const agx::ElementaryConstraint * elementaryConstraint