AGX Dynamics  2.37.3.2
TerrainMaterial.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
9 having been advised so by Algoryx Simulation AB for a time limited evaluation,
10 or having purchased a 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 <agx/config/AGX_USE_AGXTERRAIN.h>
20 #include <agxTerrain/export.h>
21 #include <agx/Material.h>
22 #include <array>
23 
24 namespace agxTerrain
25 {
26  class Terrain;
28 
54  {
55  public:
59  AGX_DECLARE_POINTER_TYPES(ExcavationContactProperties);
60 
61  public:
65  TerrainMaterial(const agx::String& description="");
66 
70  const agx::String& getDescription() const;
71 
75  BulkProperties* getBulkProperties() const;
76 
80  CompactionProperties* getCompactionProperties() const;
81 
85  ParticleProperties* getParticleProperties() const;
86 
90  ExcavationContactProperties* getExcavationContactProperties() const;
91 
95  agx::Real getSoilPackingFraction() const;
96 
100  void setDescription(const agx::String& description );
101 
106  agx::String getLastError() const;
107 
111  void printParameters() const;
112 
113  public:
114 
135  {
136  public:
140  BulkProperties(TerrainMaterial* terrainMaterial);
141 
145  agx::Real getDensity() const;
146 
150  agx::Real getMaximumDensity() const;
151 
155  agx::Real getYoungsModulus() const;
156 
160  agx::Real getPoissonsRatio() const;
161 
165  agx::Real getFrictionAngle() const;
166 
170  agx::Real getDilatancyAngle() const;
171 
175  agx::Real getCohesion() const;
176 
180  agx::Real getSwellFactor() const;
181 
186  agx::Real getDeltaReposeAngle() const;
187 
192  void setDensity(agx::Real density);
193 
198  void setMaximumDensity(agx::Real maxDensity);
199 
204  void setYoungsModulus(agx::Real youngsModulus);
205 
211  void setPoissonsRatio(agx::Real poissonsRatio);
212 
220  void setFrictionAngle(agx::Real frictionAngle);
221 
228  void setDilatancyAngle( agx::Real dilatancyAngle );
229 
234  void setCohesion(agx::Real cohesion);
235 
242  void setSwellFactor(agx::Real swellFactor);
243 
251  void setDeltaReposeAngle(agx::Real deltaReposeAngle);
252 
254 
255  protected:
256  virtual ~BulkProperties() {}
257  void onChanged();
258 
259  public:
269 
271  };
272 
273 
274 
291  {
292  public:
294 
300  agx::Real getHardeningConstantKE() const;
301 
307  agx::Real getHardeningConstantNE() const;
308 
314  agx::Real getPreconsolidationStress() const;
315 
320  agx::Real getBankStatePhi() const;
321 
326  agx::Real getCompressionIndex() const;
327 
332  agx::Real getCompactionTimeRelaxationConstant() const;
333 
338  agx::Real getStressCutOffFraction() const;
339 
344  agx::Real getAngleOfReposeCompactionRate() const;
345 
357  void setHardeningConstantKE(agx::Real k_e);
358 
370  void setHardeningConstantNE(agx::Real n_e);
371 
378  void setPreconsolidationStress(agx::Real preconsolidationStress);
379 
385  void setBankStatePhi(agx::Real phi0);
386 
402  void setCompressionIndex(agx::Real compressionIndex);
403 
411  void setCompactionTimeRelaxationConstant(agx::Real compactionTimeRelaxationConstant);
412 
418  void setStressCutOffFraction(agx::Real stressCutOffFraction);
419 
428  void setAngleOfReposeCompactionRate(agx::Real angleOfReposeCompactionRate);
429 
438  void setDilatancyAngleScalingFactor( agx::Real scalingFactor );
439 
448  agx::Real getDilatancyAngleScalingFactor() const;
449 
451 
452  protected:
454 
455  private:
456  agx::Real m_hardening_ke;
457  agx::Real m_hardening_ne;
458  agx::Real m_preconsolidationStress;
459  agx::Real m_compressionIndex;
460  agx::Real m_phi0;
461  agx::Real m_compactionTimeRelaxationConstant;
462  agx::Real m_stressCutOffFraction;
463  agx::Real m_angleOfReposeCompactionRate;
464  agx::Real m_dilatancyAngleScalingFactor;
465  };
466 
467 
468 
474  {
475  public:
476  ParticleProperties(TerrainMaterial* terrainMaterial);
477 
482  agx::Real getParticleDensity() const;
483 
487  agx::Real getParticleYoungsModulus() const;
488 
492  agx::Real getParticleRestitution() const;
493 
497  agx::Real getParticleSurfaceFriction() const;
498 
502  agx::Real getParticleRollingResistance() const;
503 
507  agx::Real getParticleCohesion() const;
508 
512  agx::Real getParticleTerrainYoungsModulus() const;
513 
517  agx::Real getParticleTerrainRestitution() const;
518 
522  agx::Real getParticleTerrainSurfaceFriction() const;
523 
527  agx::Real getParticleTerrainRollingResistance() const;
528 
532  agx::Real getParticleTerrainCohesion() const;
533 
537  agx::Real getAdhesionOverlapFactor() const;
538 
543  void setParticleYoungsModulus(agx::Real youngsModulus);
544 
549  void setParticleRestitution(agx::Real restitution);
550 
555  void setParticleSurfaceFriction(agx::Real friction);
556 
561  void setParticleRollingResistance(agx::Real rollingResistance);
562 
567  void setParticleCohesion(agx::Real cohesion);
568 
573  void setParticleTerrainYoungsModulus(agx::Real youngsModulus);
574 
579  void setParticleTerrainRestitution( agx::Real restitution );
580 
585  void setParticleTerrainSurfaceFriction(agx::Real friction);
586 
592  void setParticleTerrainRollingResistance(agx::Real rollingResistance);
593 
598  void setParticleTerrainCohesion(agx::Real cohesion);
599 
605  void setAdhesionOverlapFactor( agx::Real adhesionOverlapFactor );
606 
608 
609  protected:
610  virtual ~ParticleProperties() {}
611  void onChanged();
612 
613  protected:
615  {
617 
623  };
624 
626  {
628 
634  };
635 
636  protected:
640 
642  };
643 
644  public:
646 
647 
651  void setLastError( const agx::String& errorString );
652 
656  void onPreCollideStep( Terrain * terrain );
657 
661  void onPreStep( Terrain * terrain );
662 
666  void onPostStep( Terrain * terrain );
667 
672  bool isDirty() const;
673 
679  void setDirty(bool isDirty);
680 
685  agx::Real calculateAdhesionOverlap( Terrain * terrain, agx::Real adhesion );
686 
692  void synchronize(Terrain* terrain);
693 
696 
697  protected:
698  virtual ~TerrainMaterial();
699 
700  void updateParticleDensity( Terrain* terrain );
701  void synchronizeBulkProperties( Terrain* terrain );
702  void synchronizeParticleProperties( Terrain* terrain );
703 
704  private:
705  agx::String m_description;
706  agx::String m_lastError;
707  BulkPropertiesRef m_bulkProperties;
708  ParticlePropertiesRef m_particleProperties;
709  CompactionPropertiesRef m_compactionProperties;
710  ExcavationContactPropertiesRef m_excavationContactProperties;
711  bool m_isDirty;
712  };
713 
714 
715 
721  class AGXTERRAIN_EXPORT TerrainMaterial::ExcavationContactProperties : public agx::Referenced
722  {
723  public:
727  ExcavationContactProperties(TerrainMaterial* terrainMaterial);
728 
734  agx::Real getMaximumContactDepth() const;
735 
741  agx::Real getDepthDecayFactor() const;
742 
748  agx::Real getDepthIncreaseFactor() const;
749 
754  agx::Real getMaximumAggregateNormalForce() const;
755 
767  agx::Real getAggregateStiffnessMultiplier() const;
768 
778  agx::Real getExcavationStiffnessMultiplier() const;
779 
786  agx::Real getDepthAngleThreshold() const;
787 
799  void setAggregateStiffnessMultiplier(agx::Real stiffnessMultiplier);
800 
810  void setExcavationStiffnessMultiplier(agx::Real excavationStiffnessMultiplier);
811 
818  void setMaximumContactDepth(agx::Real maximumDepth);
819 
826  void setDepthDecayFactor(agx::Real depthDecay);
827 
835  void setDepthIncreaseFactor(agx::Real depthIncreaseFactor);
836 
842  void setMaximumAggregateNormalForce(agx::Real maximumAggregateForce);
843 
851  void setDepthAngleThreshold( agx::Real depthAngleThreshold );
852 
854 
855  protected:
856  virtual ~ExcavationContactProperties();
857 
858  private:
859  agx::Real m_maximumDepth;
860  agx::Real m_depthDecayFactor;
861  agx::Real m_depthIncreaseFactor;
862  agx::Real m_maximumAggregateNormalForce;
863  agx::Real m_aggregateStiffnessMultiplier;
864  agx::Real m_excavationStiffnessMultiplier;
865  agx::Real m_depthAngleThreshold;
866  TerrainMaterial* m_terrainMaterial;
867  };
868 
869 
870 
872  {
873  return m_bulkProperties;
874  }
875 
876 
878  {
879  return m_compactionProperties;
880  }
881 
882 
884  {
885  return m_particleProperties;
886  }
887 
888 
890  {
891  return m_excavationContactProperties;
892  }
893 
894 
896  {
897  return m_density;
898  }
899 
900 
902  {
903  return m_maxDensity;
904  }
905 
906 
908  {
909  return m_youngsModulus;
910  }
911 
912 
914  {
915  return m_poissonsRatio;
916  }
917 
918 
920  {
921  return m_frictionAngle;
922  }
923 
925  {
926  return m_dilatancyAngle;
927  }
928 
930  {
931  return m_cohesion;
932  }
933 
935  {
936  return m_swellFactor;
937  }
938 
940  {
941  return m_deltaReposeAngle;
942  }
943 
945  {
946  return m_adhesionOverlapFactor;
947  }
948 
950  {
951  return m_dilatancyAngleScalingFactor;
952  }
953 }
954 
#define AGXTERRAIN_STORE_RESTORE_INTERFACE
ParticleTerrainParameters m_particleTerrainParameters
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
ParticleParticleParameters m_particleParticleParameters
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes...
Definition: Geometry.h:59
AgXString< std::string > String
Definition: String.h:427
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
This class is used to describe the general material properties of the Terrain.
Base class providing referencing counted objects.
Definition: Referenced.h:119
ExcavationContactProperties * getExcavationContactProperties() const
CompactionProperties * getCompactionProperties() const
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
ParticleProperties * getParticleProperties() const
ExcavationContactProperties(TerrainMaterial *terrainMaterial)
Default constructor.
Class containing the properties of the soil compaction model used in agxTerrain, such as compression ...
#define AGXTERRAIN_EXPORT
BulkProperties * getBulkProperties() const
Class containing the soil bulk properties of and agxTerrain object.
double Real
Definition: Real.h:42
Class containing the properties of the created soil particles in the Terrain, such as particle densit...
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: Object.h:98
agx::Real getDilatancyAngleScalingFactor() const
Get the dilatancy angle scaling factor with respect to the compaction in the terrain.
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: Object.h:97