AGX Dynamics  2.35.0.1
TerrainMaterial.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. 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 
96 
100  void setDescription(const agx::String& description );
101 
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 
301 
308 
315 
321 
327 
333 
339 
345 
358 
371 
378  void setPreconsolidationStress(agx::Real preconsolidationStress);
379 
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 
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:
477 
483 
488 
493 
498 
503 
508 
513 
518 
523 
528 
533 
537  agx::Real getAdhesionOverlapFactor() const;
538 
543  void setParticleYoungsModulus(agx::Real youngsModulus);
544 
550 
556 
561  void setParticleRollingResistance(agx::Real rollingResistance);
562 
568 
574 
580 
586 
593 
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:
728 
735 
742 
749 
755 
768 
779 
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:
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 AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#define AGXTERRAIN_STORE_RESTORE_INTERFACE
#define AGXTERRAIN_EXPORT
Class containing the soil bulk properties of and agxTerrain object.
void setDensity(agx::Real density)
Set the bulk density (kg/m^3) of the bulk material.
void setFrictionAngle(agx::Real frictionAngle)
Set the internal friction angle (rad) of the bulk material.
void setCohesion(agx::Real cohesion)
Set the bulk cohesion (Pa) of the bulk material.
void setSwellFactor(agx::Real swellFactor)
Set the swell factor of the material, i.e how much the material will expand during excavation.
void setDilatancyAngle(agx::Real dilatancyAngle)
Set the dilatancy angle (rad) of the bulk material.
BulkProperties(TerrainMaterial *terrainMaterial)
Default constructor.
void setMaximumDensity(agx::Real maxDensity)
Set the maximum density (kg/m^3) of the bulk material.
void setPoissonsRatio(agx::Real poissonsRatio)
Set the bulk Poisson's ratio of the bulk material.
void setDeltaReposeAngle(agx::Real deltaReposeAngle)
Set the delta repose angle.
void setYoungsModulus(agx::Real youngsModulus)
Set the bulk Young's modulus (Pa) of the bulk material.
Class containing the properties of the soil compaction model used in agxTerrain, such as compression ...
agx::Real getDilatancyAngleScalingFactor() const
Get the dilatancy angle scaling factor with respect to the compaction in the terrain.
void setBankStatePhi(agx::Real phi0)
Set the phi0 value of the bank state soil.
void setDilatancyAngleScalingFactor(agx::Real scalingFactor)
Set the dilatancy angle scaling factor with respect to compaction in the terrain.
void setCompressionIndex(agx::Real compressionIndex)
Sets the compression index for the soil, which is the constant that determines how fast the soil shou...
void setHardeningConstantKE(agx::Real k_e)
Set the hardening constant k_e of the bulk material, i.e how the Young's modulus of the terrain conta...
void setAngleOfReposeCompactionRate(agx::Real angleOfReposeCompactionRate)
Set how the compaction should increase the angle of repose.
void setPreconsolidationStress(agx::Real preconsolidationStress)
Set the stress at which the soil in the default state was compressed in, i.e when it has nominal comp...
void setCompactionTimeRelaxationConstant(agx::Real compactionTimeRelaxationConstant)
Set time relaxation for compaction.
void setStressCutOffFraction(agx::Real stressCutOffFraction)
Set the fraction of the surface stress that should serve as a cutoff value from when the stress propa...
void setHardeningConstantNE(agx::Real n_e)
Set the hardening constant n_e of the bulk material, i.e how the Young's modulus of the terrain conta...
Class containing the properties of the created soil particles in the Terrain, such as particle densit...
ParticleProperties(TerrainMaterial *terrainMaterial)
void setParticleTerrainRestitution(agx::Real restitution)
Set particle <-> terrain restitution of the bulk material.
ParticleTerrainParameters m_particleTerrainParameters
void setParticleTerrainSurfaceFriction(agx::Real friction)
Set the particle <-> terrain surface friction of the bulk material.
void setParticleTerrainRollingResistance(agx::Real rollingResistance)
Set the particle <-> terrain rolling resistance of the bulk material.
void setParticleYoungsModulus(agx::Real youngsModulus)
Set the particle Young's modulus (Pa) of the bulk material.
void setParticleTerrainYoungsModulus(agx::Real youngsModulus)
Set particle <-> Terrain Young's modulus (Pa) of the bulk material.
void setParticleSurfaceFriction(agx::Real friction)
Set the particle surface friction of the bulk material.
void setParticleRollingResistance(agx::Real rollingResistance)
Set the particle rolling resistance of the bulk material.
ParticleParticleParameters m_particleParticleParameters
void setAdhesionOverlapFactor(agx::Real adhesionOverlapFactor)
Set the adhesion overlap factor of particle contacts, i.e what fraction of the particle radius is all...
void setParticleTerrainCohesion(agx::Real cohesion)
Set the particle <-> terrain cohesion (Pa) of the bulk material.
void setParticleRestitution(agx::Real restitution)
Set the particle restitution of the bulk material.
void setParticleCohesion(agx::Real cohesion)
Set the particle cohesion (Pa) of the bulk material.
This class is used to describe the general material properties of the Terrain.
ExcavationContactProperties(TerrainMaterial *terrainMaterial)
Default constructor.
BulkProperties * getBulkProperties() const
agx::Real getMaximumDepth() const
void setDepthDecayFactor(agx::Real depthDecay)
Set the depth decay factor of a soil aggregate <-> terrain contact.
agx::Real getDepthAngleThreshold() const
Return the lower angle threshold between the separation normal and the aggregate <-> terrain contact ...
agx::Real getSoilPackingFraction() const
agx::Real getDepthIncreaseFactor() const
void setExcavationStiffnessMultiplier(agx::Real excavationStiffnessMultiplier)
Set the contact stiffness multiplier for the generated contacts between the soil aggregates <-> shove...
void setDepthAngleThreshold(agx::Real depthAngleThreshold)
Set the lower angle threshold between the separation normal and the aggregate <-> terrain contact pla...
agx::Real getMaximumAggregateNormalForce() const
ExcavationContactProperties * getExcavationContactProperties() const
agx::String getLastError() const
CompactionProperties * getCompactionProperties() const
void setDepthIncreaseFactor(agx::Real depthIncreaseFactor)
Set the depth increase factor of a soil aggregate <-> terrain contact.
void setMaximumContactDepth(agx::Real maximumDepth)
Set the maximum depth (m) of a soil aggregate <-> terrain contact.
const agx::String & getDescription() const
agx::Real getAggregateStiffnessMultiplier() const
Internal Method.
TerrainMaterial(const agx::String &description="")
Default constructor.
void printParameters() const
Print the internal material parameters in a formatted way.
agx::Real getExcavationStiffnessMultiplier() const
Get the contact stiffness multiplier for the generated contacts between the soil aggregates <-> shove...
void setAggregateStiffnessMultiplier(agx::Real stiffnessMultiplier)
Internal Method.
void setMaximumAggregateNormalForce(agx::Real maximumAggregateForce)
Set the maximum force that the soil aggregate <-> terrain contacts are allowed to have.
agx::Real getDepthDecayFactor() const
ParticleProperties * getParticleProperties() const
void setDescription(const agx::String &description)
Set the name of the object.
virtual ~ExcavationContactProperties()
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
Base class providing referencing counted objects.
Definition: Referenced.h:114
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:97
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:96
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
Definition: Geometry.h:60
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
AgXString< std::string > String
Definition: String.h:423
double Real
Definition: Real.h:42