AGX Dynamics  2.37.2.0
GranularFields.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 
19 #include <agxModel/export.h>
20 
21 #include <agx/Frame.h>
23 
24 #include <agx/ref_ptr.h>
25 
26 namespace agxModel
27 {
28  class GranularFieldPostProcessor;
29 
30  typedef std::pair<agx::Physics::GranularBodyPtr, agx::Real> ParticleWeightPair;
32 
38 
39 
45  {
46  public:
52  GranularField(agx::UInt dimensions, agx::String name);
53 
61  virtual bool addToField(agx::UInt index, ParticleWeightPair* pair);
62 
69  virtual bool calculateFieldElement(agx::UInt /* index */);
70 
74  virtual ~GranularField();
75 
80  agx::Real* getFieldData();
81 
85  void clearField();
86 
91  bool allocateField();
92 
97  agx::UInt getFieldSize();
98 
103  agx::Vec4u getFieldShape();
104 
109  agxModel::GranularFieldPostProcessor* getGranularFieldPostProcessor();
110 
115  agx::String getName();
116 
121  void setGranularFieldPostProcesser(agxModel::GranularFieldPostProcessor* pp);
122 
127  const agx::Vector<agx::String>& getRequiredFields();
128 
129 
130  protected:
135 
136  private:
137  agxModel::GranularFieldPostProcessor* m_granularFieldPostProcessor;
138  };
139 
141  {
142  public:
144 
145  virtual bool addToField(agx::UInt index, ParticleWeightPair* pair);
146  virtual bool calculateFieldElement(agx::UInt index);
147 
148  protected:
150 
151  private:
152 
153  };
154 
156  {
157  public:
159 
160  virtual bool addToField(agx::UInt index, ParticleWeightPair* pair);
161  virtual bool calculateFieldElement(agx::UInt index);
162 
163  // Used for debugging mass conservation
164  agx::Real calculateTotalMassInField();
165  protected:
167 
168  private:
169 
170  };
171 
173  {
174  public:
176 
177  virtual bool addToField(agx::UInt index, ParticleWeightPair* pair);
178  virtual bool calculateFieldElement(agx::UInt index);
179 
180  protected:
182 
183  private:
184  };
185 
187  {
188  public:
194 
195  virtual bool addToField(agx::UInt index, ParticleWeightPair* pair);
196  virtual bool calculateFieldElement(agx::UInt index);
197 
198  protected:
200  };
201 }
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:34
std::pair< agx::Physics::GranularBodyPtr, agx::Real > ParticleWeightPair
agx::Vector< agx::String > m_requiredFields
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
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
uint32_t UInt
Definition: Integer.h:34
Class for calculating different granular fields.
agx::Vector< ParticleWeightPair > ParticleWeightPairVector
#define AGXMODEL_EXPORT
double Real
Definition: Real.h:42
#define AGX_DECLARE_VECTOR_TYPES(type)
Definition: Vector.h:34
Base class for a GranularField.
agx::Vector< agx::Real > m_field