AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StabilityReport.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. 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, agx::RangeReal range, agx::UInt index );
47 
48  agx::Bool isValid() const { return m_index != agx::InvalidIndex; }
49  agx::Real getSolution() const { return m_solution; }
50  agx::RangeReal getBound() const { return m_bound; }
51  agx::Real getDiff() const { return m_diff; }
52  agx::UInt getIndex() const { return m_index; }
53 
54  bool operator < ( const Diff& other ) const { return m_diff < other.m_diff; }
55 
56  private:
57  Real m_solution;
58  RangeReal m_bound;
59  Real m_diff;
60  UInt m_index;
61  };
62 
64  {
65  public:
67 
68  public:
69  Frame( const agx::RealValarray& solution, const agx::SparseRangeReal& bounds, const agx::String& description );
70 
71  const Diff::Container& getDiffs() const;
72 
73  private:
74  void initialize( const agx::RealValarray& solution, const agx::SparseRangeReal& bounds, const agx::String& description );
75 
76  private:
77  Diff::Container m_diffs;
78  agx::String m_description;
79  };
80 
82  {
83  public:
85  };
86 
88  {
89  public:
91 
92  public:
93  PotentialConstraintIssue( const agx::StabilityReport::Diff& diff, const agx::ConstraintImplementation* constraint, const agx::ElementaryConstraint* elementaryConstraint );
94 
95  const agx::StabilityReport::Diff& getDiff() const;
96  const agx::ConstraintImplementation* getConstraint() const;
97  const agx::ElementaryConstraint* getElementaryConstraint() const;
98 
99  private:
100  PotentialConstraintIssue& operator= ( const PotentialConstraintIssue& ) { return *this; }
101 
102  private:
103  const agx::StabilityReport::Diff m_diff;
104  const agx::ConstraintImplementation* m_constraint;
105  const agx::ElementaryConstraint* m_ec;
106  };
107 
108  public:
109  StabilityReport();
110 
111  void setEnable( agx::Bool enable );
112  agx::Bool getEnable() const;
113 
114  agx::Bool empty() const;
115 
116  const agx::StabilityReport::PotentialConstraintIssue::Container& getPotentialConstraintIssues() const;
117  const agx::StabilityReport::PotentialContactIssue::Container& getPotentialContactIssues() const;
118 
119  virtual void report( const agx::RealValarray& z, const agx::SparseRangeReal& bounds, const agx::String& description );
120  virtual void finalize( agx::Solver *solver, const agx::Physics::SolveIslandPtr island, const agx::Physics::ContactConstraintData& contactConstraint, const agx::Physics::BinaryConstraintData& binaryConstraint, const agx::Physics::ManyBodyConstraintData& manyBodyConstraint );
121 
122  protected:
123  virtual ~StabilityReport();
124 
125  protected:
130  };
131 }
132 
133 #endif
Elementary constraint base class with interface and global constraint functionality.
bool Bool
Definition: Integer.h:48
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:248
Pointer to a entity instance of type Physics.SolveIsland.
Base class providing referencing counted objects.
Definition: Referenced.h:113
Essentially a sparse array of bounds.
Definition: SparseTypes.h:73
uint32_t UInt
Definition: Integer.h:34
agx::UInt getIndex() const
std::valarray< agx::Real > RealValarray
For this module, vectors are defined using valarray.
agx::Vector< PotentialContactIssue > Container
agx::Real getSolution() const
PotentialConstraintIssue::Container m_potentialConstraintIssues
PotentialContactIssue::Container m_potentialContactIssues
agx::Real getDiff() const
agx::Vector< PotentialConstraintIssue > Container
agx::RangeReal getBound() const
agx::VectorPOD< Diff > Container
double Real
Definition: Real.h:42
agx::Bool isValid() const