AGX Dynamics 2.42.2.1
Loading...
Searching...
No Matches
TerrainMaterial.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or
9having been advised so by Algoryx Simulation AB for a time limited evaluation,
10or having purchased a valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
20#include <agxTerrain/export.h>
21#include <agx/Material.h>
22#include <array>
23
24namespace agxTerrain
25{
26 class Terrain;
28
54 {
55 public:
59 AGX_DECLARE_POINTER_TYPES(ExcavationContactProperties);
60 AGX_DECLARE_POINTER_TYPES(TerramechanicsProperties);
61
62 public:
68
72 const agx::String& getName() const;
73
77 void setName(const agx::String& name);
78
83
87 BulkProperties* getBulkProperties() const;
88
92 CompactionProperties* getCompactionProperties() const;
93
97 ParticleProperties* getParticleProperties() const;
98
102 ExcavationContactProperties* getExcavationContactProperties() const;
103
104 /*
105 \return the soil properties for terramechanics.
106 */
107 TerramechanicsProperties* getTerramechanicsProperties() const;
108
109
114
118 void setDescription(const agx::String& description );
119
125
129 void printParameters() const;
130
131 public:
132
153 {
154 public:
159
163 agx::Real getDensity() const;
164
168 agx::Real getMaximumDensity() const;
169
173 agx::Real getYoungsModulus() const;
174
178 agx::Real getPoissonsRatio() const;
179
183 agx::Real getFrictionAngle() const;
184
188 agx::Real getDilatancyAngle() const;
189
193 agx::Real getCohesion() const;
194
195
196 /*
197 \return the tangential cohesion used between soil aggregate <-> terrain.
198 */
199 agx::Real getTangentialCohesion() const;
200
201
205 agx::Real getSwellFactor() const;
206
211 agx::Real getDeltaReposeAngle() const;
212
217 void setDensity(agx::Real density);
218
223 void setMaximumDensity(agx::Real maxDensity);
224
229 void setYoungsModulus(agx::Real youngsModulus);
230
236 void setPoissonsRatio(agx::Real poissonsRatio);
237
245 void setFrictionAngle(agx::Real frictionAngle);
246
253 void setDilatancyAngle( agx::Real dilatancyAngle );
254
259 void setCohesion(agx::Real cohesion);
260
261 /*
262 Set the tangential cohesion (Pa) of the bulk material.
263 \param tangentialCohesion - the specified tangential cohesion to set to the bulk material.
264 */
265 void setTangentialCohesion(agx::Real tangentialCohesion);
266
273 void setSwellFactor(agx::Real swellFactor);
274
282 void setDeltaReposeAngle(agx::Real deltaReposeAngle);
283
285
286 protected:
287 virtual ~BulkProperties() {}
288 void onChanged();
289
290 public:
301
303 };
304
305
306
323 {
324 public:
326
333
340
347
353
359
365
371
377
390
403
410 void setPreconsolidationStress(agx::Real preconsolidationStress);
411
418
434 void setCompressionIndex(agx::Real compressionIndex);
435
443 void setCompactionTimeRelaxationConstant(agx::Real compactionTimeRelaxationConstant);
444
450 void setStressCutOffFraction(agx::Real stressCutOffFraction);
451
460 void setAngleOfReposeCompactionRate(agx::Real angleOfReposeCompactionRate);
461
471
480 agx::Real getDilatancyAngleScalingFactor() const;
481
483
484 protected:
486
487 private:
488 agx::Real m_hardening_ke;
489 agx::Real m_hardening_ne;
490 agx::Real m_preconsolidationStress;
491 agx::Real m_compressionIndex;
492 agx::Real m_phi0;
493 agx::Real m_compactionTimeRelaxationConstant;
494 agx::Real m_stressCutOffFraction;
495 agx::Real m_angleOfReposeCompactionRate;
496 agx::Real m_dilatancyAngleScalingFactor;
497 };
498
499
500
506 {
507 public:
509
515
520
525
530
535
540
545
550
555
560
565
569 agx::Real getAdhesionOverlapFactor() const;
570
576
582
588
594
600
606
612
618
625
631
637 void setAdhesionOverlapFactor( agx::Real adhesionOverlapFactor );
638
640
641 protected:
643 void onChanged();
644
645 protected:
647 {
649
655 };
656
658 {
660
666 };
667
668 protected:
672
674 };
675
676 public:
678
679
683 void setLastError( const agx::String& errorString );
684
688 void updateIfDirty( Terrain* terrain );
689
694 bool isDirty() const;
695
701 void setDirty(bool isDirty);
702
707 agx::Real calculateAdhesionOverlap( Terrain * terrain, agx::Real adhesion );
708
714 void synchronize(Terrain* terrain);
715
718
719 protected:
720 virtual ~TerrainMaterial();
721
722 void updateParticleDensity( Terrain* terrain );
723 void synchronizeBulkProperties( Terrain* terrain );
724 void synchronizeParticleProperties( Terrain* terrain );
725
726 private:
727 agx::String m_name;
728 agx::String m_description;
729 agx::String m_lastError;
730 BulkPropertiesRef m_bulkProperties;
731 ParticlePropertiesRef m_particleProperties;
732 CompactionPropertiesRef m_compactionProperties;
733 ExcavationContactPropertiesRef m_excavationContactProperties;
734 TerramechanicsPropertiesRef m_terramechanicsProperties;
735 bool m_isDirty;
736 };
737
738
739
745 class AGXTERRAIN_EXPORT TerrainMaterial::ExcavationContactProperties : public agx::Referenced
746 {
747 public:
752
759
766
773
779
792
803
811
824
834 void setExcavationStiffnessMultiplier(agx::Real excavationStiffnessMultiplier);
835
843
851
859 void setDepthIncreaseFactor(agx::Real depthIncreaseFactor);
860
866 void setMaximumAggregateNormalForce(agx::Real maximumAggregateForce);
867
875 void setDepthAngleThreshold( agx::Real depthAngleThreshold );
876
878
879 protected:
881
882 private:
883 agx::Real m_maximumDepth;
884 agx::Real m_depthDecayFactor;
885 agx::Real m_depthIncreaseFactor;
886 agx::Real m_maximumAggregateNormalForce;
887 agx::Real m_aggregateStiffnessMultiplier;
888 agx::Real m_excavationStiffnessMultiplier;
889 agx::Real m_depthAngleThreshold;
890 TerrainMaterial* m_terrainMaterial;
891 };
892
893
894 class AGXTERRAIN_EXPORT TerrainMaterial::TerramechanicsProperties : public agx::Referenced
895 {
896 public:
898
899 /*
900 [-] The 'n_0' in n = n_0 + n_1 * slip_ratio, where 'n' is sinkage exponent
901 */
903
904 /*
905 [-] The 'n_0' in n = n_0 + n_1 * slip_ratio, where 'n' is sinkage exponent
906 */
908
909 /*
910 [-] The 'n_1' in n = n_0 + n_1 * slip_ratio, where 'n' is sinkage exponent
911 */
913
914 /*
915 [-] The 'n_1' in n = n_0 + n_1 * slip_ratio, where 'n' is sinkage exponent
916 */
918
919 /*
920 [m] The 'a_0' in K_x = a_0 + slip_angle * a_1, where tau_x = [c + sigma*tan(phi)][1-exp(-j_x/K_x)]
921 */
923 /*
924 [m] The 'a_0' in K_x = a_0 + slip_angle * a_1, where tau_x = [c + sigma*tan(phi)][1-exp(-j_x/K_x)]
925 */
927
928 /*
929 [m] The 'a_1' in K_x = a_0 + slip_angle * a_1
930 */
932
933 /*
934 [m] The 'a_1' in K_x = a_0 + slip_angle * a_1
935 */
937
938 /*
939 [m] The 'a_0' in K_y = a_0 + slip_angle * a_1, where tau_y = [c + sigma*tan(phi)][1-exp(-j_y/K_y)]
940 */
942
943 /*
944 [m] The 'a_0' in K_y = a_0 + slip_angle * a_1, where tau_y = [c + sigma*tan(phi)][1-exp(-j_y/K_y)]
945 */
947
948 /*
949 [m] The 'a_1' in K_y = a_0 + slip_angle * a_1
950 */
952
953 /*
954 [m] The 'a_1' in K_y = a_0 + slip_angle * a_1
955 */
957
958 /*
959 [N/m^(n+1)] The 'k_c' in p = (k_c/b + k_phi)z^n
960 */
962
963 /*
964 [N/m^(n+1)] The 'k_c' in p = (k_c/b + k_phi)z^n
965 */
967
968 /*
969 [N/m^(n+2)] The 'k_phi' in p = (k_c/b + k_phi)z^n
970 */
972
973 /*
974 [N/m^(n+2)] The 'k_phi' in p = (k_c/b + k_phi)z^n
975 */
977
978 /*
979 [-] The 'k_c_prime' in p = (c*k_c_prime + rho*g*b*k_phi_prime)(z/b)^n
980 */
982
983 /*
984 [-] The 'k_c_prime' in p = (c*k_c_prime + rho*g*b*k_phi_prime)(z/b)^n
985 */
987
988 /*
989 [-] The 'k_phi_prime' in p = (c*k_c_prime + rho*g*b*k_phi_prime)(z/b)^n
990 */
992
993 /*
994 [-] The 'k_phi_prime' in p = (c*k_c_prime + rho*g*b*k_phi_prime)(z/b)^n
995 */
997
998 /*
999 [-] The 'a_0' in theta_m = (a_0 + a_1*slip_ratio) * theta_f
1000 */
1002
1003 /*
1004 [-] The 'a_0' in theta_m = (a_0 + a_1*slip_ratio) * theta_f
1005 */
1007
1008 /*
1009 [-] The 'a_1' in theta_m = (a_0 + a_1*slip_ratio) * theta_f
1010 */
1012
1013 /*
1014 [-] The 'a_1' in theta_m = (a_0 + a_1*slip_ratio) * theta_f
1015 */
1017
1018 /*
1019 [-] The 'a_0' in theta_r = (a_0 + a_1*slip_ratio) * theta_f
1020 */
1022
1023 /*
1024 [-] The 'a_0' in theta_r = (a_0 + a_1*slip_ratio) * theta_f
1025 */
1027
1028 /*
1029 [-] The 'a_1' in theta_r = (a_0 + a_1*slip_ratio) * theta_f
1030 */
1032
1033 /*
1034 [-] The 'a_1' in theta_r = (a_0 + a_1*slip_ratio) * theta_f
1035 */
1037
1039
1040 protected:
1042
1043 private:
1044 agx::Real m_sinkageExponentParameterA;
1045 agx::Real m_sinkageExponentParameterB;
1046 agx::Real m_shearModulusTangentialParameterA;
1047 agx::Real m_shearModulusTangentialParameterB;
1048 agx::Real m_shearModulusLateralParameterA;
1049 agx::Real m_shearModulusLateralParameterB;
1050 agx::Real m_cohesiveModulusBekker;
1051 agx::Real m_frictionalModulusBekker;
1052 agx::Real m_cohesiveModulusReece;
1053 agx::Real m_frictionalModulusReece;
1054 agx::Real m_maximumNormalStressAngleParameterA;
1055 agx::Real m_maximumNormalStressAngleParameterB;
1056 agx::Real m_rearAngleParameterA;
1057 agx::Real m_rearAngleParameterB;
1058 };
1059
1060
1061
1062 inline TerrainMaterial::BulkProperties* TerrainMaterial::getBulkProperties() const
1063 {
1064 return m_bulkProperties;
1065 }
1066
1067
1068 inline TerrainMaterial::CompactionProperties* TerrainMaterial::getCompactionProperties() const
1069 {
1070 return m_compactionProperties;
1071 }
1072
1073
1074 inline TerrainMaterial::ParticleProperties* TerrainMaterial::getParticleProperties() const
1075 {
1076 return m_particleProperties;
1077 }
1078
1079
1080 inline TerrainMaterial::ExcavationContactProperties* TerrainMaterial::getExcavationContactProperties() const
1081 {
1082 return m_excavationContactProperties;
1083 }
1084
1085 inline TerrainMaterial::TerramechanicsProperties* TerrainMaterial::getTerramechanicsProperties() const
1086 {
1087 return m_terramechanicsProperties;
1088 }
1089
1090
1091 inline agx::Real TerrainMaterial::BulkProperties::getDensity() const
1092 {
1093 return m_density;
1094 }
1095
1096
1097 inline agx::Real TerrainMaterial::BulkProperties::getMaximumDensity() const
1098 {
1099 return m_maxDensity;
1100 }
1101
1102
1103 inline agx::Real TerrainMaterial::BulkProperties::getYoungsModulus() const
1104 {
1105 return m_youngsModulus;
1106 }
1107
1108
1109 inline agx::Real TerrainMaterial::BulkProperties::getPoissonsRatio() const
1110 {
1111 return m_poissonsRatio;
1112 }
1113
1114
1115 inline agx::Real TerrainMaterial::BulkProperties::getFrictionAngle() const
1116 {
1117 return m_frictionAngle;
1118 }
1119
1120 inline agx::Real TerrainMaterial::BulkProperties::getDilatancyAngle() const
1121 {
1122 return m_dilatancyAngle;
1123 }
1124
1125 inline agx::Real TerrainMaterial::BulkProperties::getCohesion() const
1126 {
1127 return m_cohesion;
1128 }
1129
1130 inline agx::Real TerrainMaterial::BulkProperties::getTangentialCohesion() const
1131 {
1132 return m_tangentialCohesion;
1133 }
1134
1135 inline agx::Real TerrainMaterial::BulkProperties::getSwellFactor() const
1136 {
1137 return m_swellFactor;
1138 }
1139
1140 inline agx::Real TerrainMaterial::BulkProperties::getDeltaReposeAngle() const
1141 {
1142 return m_deltaReposeAngle;
1143 }
1144
1145 inline agx::Real TerrainMaterial::ParticleProperties::getAdhesionOverlapFactor() const
1146 {
1147 return m_adhesionOverlapFactor;
1148 }
1149
1150 inline agx::Real TerrainMaterial::CompactionProperties::getDilatancyAngleScalingFactor() const
1151 {
1152 return m_dilatancyAngleScalingFactor;
1153 }
1154}
1155
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#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.
void setTangentialCohesion(agx::Real tangentialCohesion)
Class containing the properties of the soil compaction model used in agxTerrain, such as compression ...
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.
agx::Real getCohesiveModulusReece() const
void setDepthDecayFactor(agx::Real depthDecay)
Set the depth decay factor of a soil aggregate <-> terrain contact.
void setMaximumNormalStressAngleParameterB(agx::Real v)
void setShearModulusTangentialParameterA(agx::Real v)
agx::Real getSinkageExponentParameterA() const
agx::Real getDepthAngleThreshold() const
Get the depth angle threshold between the separation normal and the terrain-aggregate contact plane.
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 depth angle threshold between the separation normal and the terrain-aggregate contact plane.
agx::Real getShearModulusTangentialParameterA() const
agx::Real getMaximumAggregateNormalForce() const
agx::Real getShearModulusLateralParameterA() const
void setName(const agx::String &name)
Set the name of the object.
agx::String getLastError() const
void setFrictionalModulusReece(agx::Real v)
const agx::String & getName() const
void setSinkageExponentParameterA(agx::Real v)
void setCohesiveModulusReece(agx::Real v)
void setRearAngleParameterB(agx::Real v)
void setShearModulusTangentialParameterB(agx::Real v)
agx::Real getRearAngleParameterB() 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.
void setShearModulusLateralParameterB(agx::Real v)
agx::Real getAggregateStiffnessMultiplier() const
Internal Method.
agx::Real getShearModulusTangentialParameterB() const
void printParameters() const
Print the internal material parameters in a formatted way.
agx::Real getCohesiveModulusBekker() const
agx::Real getRearAngleParameterA() const
agx::Real getExcavationStiffnessMultiplier() const
Get the contact stiffness multiplier for the generated contacts between the soil aggregates <-> shove...
void setShearModulusLateralParameterA(agx::Real v)
void setCohesiveModulusBekker(agx::Real v)
TerrainMaterial(const agx::String &name="")
Constructor.
void setSinkageExponentParameterB(agx::Real v)
void setMaximumNormalStressAngleParameterA(agx::Real v)
void setAggregateStiffnessMultiplier(agx::Real stiffnessMultiplier)
Internal Method.
agx::Real getMaximumNormalStressAngleParameterB() const
void setMaximumAggregateNormalForce(agx::Real maximumAggregateForce)
Set the maximum force that the soil aggregate <-> terrain contacts are allowed to have.
agx::Real getMaximumContactDepth() const
agx::Real getSinkageExponentParameterB() const
void setFrictionalModulusBekker(agx::Real v)
agx::Real getDepthDecayFactor() const
agx::Real getFrictionalModulusBekker() const
agx::Real getMaximumNormalStressAngleParameterA() const
void setRearAngleParameterA(agx::Real v)
void setDescription(const agx::String &description)
Set the description of the object.
agx::Real getShearModulusLateralParameterB() const
agx::Real getFrictionalModulusReece() const
virtual ~ExcavationContactProperties()
const agx::String & getDescription() const
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
Definition: Terrain.h:92
Base class providing referencing counted objects.
Definition: Referenced.h:120
#define DOXYGEN_END_INTERNAL_BLOCK()
Definition: macros.h:89
#define DOXYGEN_START_INTERNAL_BLOCK()
Definition: macros.h:88
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
Definition: Geometry.h:59
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
double Real
Definition: Real.h:41