AGXDynamics  2.31.1.0
TerrainMaterial.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
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  void setDensity(agx::Real density);
187 
192  void setMaximumDensity(agx::Real maxDensity);
193 
198  void setYoungsModulus(agx::Real youngsModulus);
199 
205  void setPoissonsRatio(agx::Real poissonsRatio);
206 
214  void setFrictionAngle(agx::Real frictionAngle);
215 
222  void setDilatancyAngle( agx::Real dilatancyAngle );
223 
228  void setCohesion(agx::Real cohesion);
229 
236  void setSwellFactor(agx::Real swellFactor);
237 
239 
240  protected:
241  virtual ~BulkProperties() {}
242  void onChanged();
243 
244  public:
253 
255  };
256 
257 
258 
275  {
276  public:
278 
284  agx::Real getHardeningConstantKE() const;
285 
291  agx::Real getHardeningConstantNE() const;
292 
298  agx::Real getPreconsolidationStress() const;
299 
304  agx::Real getBankStatePhi() const;
305 
310  agx::Real getCompressionIndex() const;
311 
316  agx::Real getCompactionTimeRelaxationConstant() const;
317 
322  agx::Real getStressCutOffFraction() const;
323 
328  agx::Real getAngleOfReposeCompactionRate() const;
329 
341  void setHardeningConstantKE(agx::Real k_e);
342 
354  void setHardeningConstantNE(agx::Real n_e);
355 
362  void setPreconsolidationStress(agx::Real preconsolidationStress);
363 
369  void setBankStatePhi(agx::Real phi0);
370 
386  void setCompressionIndex(agx::Real compressionIndex);
387 
395  void setCompactionTimeRelaxationConstant(agx::Real compactionTimeRelaxationConstant);
396 
402  void setStressCutOffFraction(agx::Real stressCutOffFraction);
403 
412  void setAngleOfReposeCompactionRate(agx::Real angleOfReposeCompactionRate);
413 
422  void setDilatancyAngleScalingFactor( agx::Real scalingFactor );
423 
432  agx::Real getDilatancyAngleScalingFactor() const;
433 
435 
436  protected:
438 
439  private:
440  agx::Real m_hardening_ke;
441  agx::Real m_hardening_ne;
442  agx::Real m_preconsolidationStress;
443  agx::Real m_compressionIndex;
444  agx::Real m_phi0;
445  agx::Real m_compactionTimeRelaxationConstant;
446  agx::Real m_stressCutOffFraction;
447  agx::Real m_angleOfReposeCompactionRate;
448  agx::Real m_dilatancyAngleScalingFactor;
449  };
450 
451 
452 
458  {
459  public:
460  ParticleProperties(TerrainMaterial* terrainMaterial);
461 
466  agx::Real getParticleDensity() const;
467 
471  agx::Real getParticleYoungsModulus() const;
472 
476  agx::Real getParticleRestitution() const;
477 
481  agx::Real getParticleSurfaceFriction() const;
482 
486  agx::Real getParticleRollingResistance() const;
487 
491  agx::Real getParticleCohesion() const;
492 
496  agx::Real getParticleTerrainYoungsModulus() const;
497 
501  agx::Real getParticleTerrainRestitution() const;
502 
506  agx::Real getParticleTerrainSurfaceFriction() const;
507 
511  agx::Real getParticleTerrainRollingResistance() const;
512 
516  agx::Real getParticleTerrainCohesion() const;
517 
521  agx::Real getAdhesionOverlapFactor() const;
522 
527  void setParticleYoungsModulus(agx::Real youngsModulus);
528 
533  void setParticleRestitution(agx::Real restitution);
534 
539  void setParticleSurfaceFriction(agx::Real friction);
540 
545  void setParticleRollingResistance(agx::Real rollingResistance);
546 
551  void setParticleCohesion(agx::Real cohesion);
552 
557  void setParticleTerrainYoungsModulus(agx::Real youngsModulus);
558 
563  void setParticleTerrainRestitution( agx::Real restitution );
564 
569  void setParticleTerrainSurfaceFriction(agx::Real friction);
570 
576  void setParticleTerrainRollingResistance(agx::Real rollingResistance);
577 
582  void setParticleTerrainCohesion(agx::Real cohesion);
583 
589  void setAdhesionOverlapFactor( agx::Real adhesionOverlapFactor );
590 
592 
593  protected:
594  virtual ~ParticleProperties() {}
595  void onChanged();
596 
597  protected:
599  {
601 
607  };
608 
610  {
612 
618  };
619 
620  protected:
624 
626  };
627 
628  public:
630 
631 
635  void setLastError( const agx::String& errorString );
636 
640  void onPreCollideStep( Terrain * terrain );
641 
645  void onPreStep( Terrain * terrain );
646 
650  void onPostStep( Terrain * terrain );
651 
656  bool isDirty() const;
657 
663  void setDirty(bool isDirty);
664 
669  agx::Real calculateAdhesionOverlap( Terrain * terrain, agx::Real adhesion );
670 
676  void synchronize(Terrain* terrain);
677 
680 
681  protected:
682  virtual ~TerrainMaterial();
683 
684  void updateParticleDensity( Terrain* terrain );
685  void synchronizeBulkProperties( Terrain* terrain );
686  void synchronizeParticleProperties( Terrain* terrain );
687 
688  private:
689  agx::String m_description;
690  agx::String m_lastError;
691  BulkPropertiesRef m_bulkProperties;
692  ParticlePropertiesRef m_particleProperties;
693  CompactionPropertiesRef m_compactionProperties;
694  ExcavationContactPropertiesRef m_excavationContactProperties;
695  bool m_isDirty;
696  };
697 
698 
699 
705  class AGXTERRAIN_EXPORT TerrainMaterial::ExcavationContactProperties : public agx::Referenced
706  {
707  public:
711  ExcavationContactProperties(TerrainMaterial* terrainMaterial);
712 
718  agx::Real getMaximumDepth() const;
719 
725  agx::Real getDepthDecayFactor() const;
726 
732  agx::Real getDepthIncreaseFactor() const;
733 
738  agx::Real getMaximumAggregateNormalForce() const;
739 
751  agx::Real getAggregateStiffnessMultiplier() const;
752 
762  agx::Real getExcavationStiffnessMultiplier() const;
763 
770  agx::Real getDepthAngleThreshold() const;
771 
783  void setAggregateStiffnessMultiplier(agx::Real stiffnessMultiplier);
784 
794  void setExcavationStiffnessMultiplier(agx::Real excavationStiffnessMultiplier);
795 
802  void setMaximumContactDepth(agx::Real maximumDepth);
803 
810  void setDepthDecayFactor(agx::Real depthDecay);
811 
819  void setDepthIncreaseFactor(agx::Real depthIncreaseFactor);
820 
826  void setMaximumAggregateNormalForce(agx::Real maximumAggregateForce);
827 
835  void setDepthAngleThreshold( agx::Real depthAngleThreshold );
836 
838 
839  protected:
840  virtual ~ExcavationContactProperties();
841 
842  private:
843  agx::Real m_maximumDepth;
844  agx::Real m_depthDecayFactor;
845  agx::Real m_depthIncreaseFactor;
846  agx::Real m_maximumAggregateNormalForce;
847  agx::Real m_aggregateStiffnessMultiplier;
848  agx::Real m_excavationStiffnessMultiplier;
849  agx::Real m_depthAngleThreshold;
850  TerrainMaterial* m_terrainMaterial;
851  };
852 
853 
854 
856  {
857  return m_bulkProperties;
858  }
859 
860 
862  {
863  return m_compactionProperties;
864  }
865 
866 
868  {
869  return m_particleProperties;
870  }
871 
872 
874  {
875  return m_excavationContactProperties;
876  }
877 
878 
880  {
881  return m_density;
882  }
883 
884 
886  {
887  return m_maxDensity;
888  }
889 
890 
892  {
893  return m_youngsModulus;
894  }
895 
896 
898  {
899  return m_poissonsRatio;
900  }
901 
902 
904  {
905  return m_frictionAngle;
906  }
907 
909  {
910  return m_dilatancyAngle;
911  }
912 
914  {
915  return m_cohesion;
916  }
917 
919  {
920  return m_swellFactor;
921  }
922 
924  {
925  return m_adhesionOverlapFactor;
926  }
927 
929  {
930  return m_dilatancyAngleScalingFactor;
931  }
932 }
933 
#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
Copyright 2007 - 2018.
Definition: Geometry.h:56
AgXString< std::string > String
Definition: String.h:423
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
This class is used to describe the general material properties of the Terrain.
Base class providing referencing counted objects.
Definition: Referenced.h:113
ExcavationContactProperties * getExcavationContactProperties() const
CompactionProperties * getCompactionProperties() const
Namespace agx 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 ...
typedef void(GLAD_API_PTR *GLDEBUGPROC)(GLenum source
#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:102
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:101