Python Script Examples
Code Snippet: Manipulation of Bolt Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
boltList = model.getAllBoltProperties()
bolt1 = boltList[0]
bolt2 = boltList[1]
bolt3 = boltList[2]
bolt1.setBoltName("Example Bolt 1")
bolt1.setBoltType(BoltTypes.FULLY_BONDED)
bolt1.FullyBonded.setBoltDiameter(28)
bolt1.FullyBonded.setJointShear(True)
bolt1.FullyBonded.setPreTensioningForce(0.2)
print(bolt1.FullyBonded.getBoltDiameter())
print(bolt1.FullyBonded.getJointShear())
print(bolt1.FullyBonded.getPreTensioningForce())
bolt2.setBoltName("Example Bolt 2")
bolt2.setBoltType(BoltTypes.END_ANCHORED)
bolt2.EndAnchored.setProperties(BoltModulusE=250000, OutofPlaneSpacing=1.2, TensileCapacity=0.2)
print(bolt2.EndAnchored.getProperties())
bolt3.setBoltName("Example Bolt 3")
bolt3.setBoltType(BoltTypes.PLAIN_STRAND_CABLE)
bolt3.PlainStrandCable.setProperties(AddBulges=True, AddPullOutForce=True, PullOutForce=1)
# Not all functions are accessible through the setProperties method.
# Consult setProperties method definition in documentation to determine properties available.
bolt3.PlainStrandCable.setBulgeLocations([10,20,30])
print(bolt3.PlainStrandCable.getProperties())
# Not all functions are accessible through the getProperties method.
# Consult getProperties method definition in documentation to determine properties available.
print(bolt3.PlainStrandCable.getBulgeLocations())
model.close()
Code Snippet: Manipulation of Liner Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
linerList = model.getAllLinerProperties()
liner1 = linerList[0]
liner2 = linerList[1]
liner3 = linerList[2]
liner1.setLinerName("Example Liner 1")
liner1.setLinerType(LinerTypes.CABLE_TRUSS)
liner1.CableTruss.setYoungsModulus(250000)
liner1.CableTruss.setMaterialType(MaterialType.ELASTIC)
liner1.CableTruss.setStageCableProperties(False)
print(liner1.CableTruss.getYoungsModulus())
print(liner1.CableTruss.getMaterialType())
print(liner1.CableTruss.getMaterialType())
liner2.setLinerName("Example Liner 2")
liner2.setLinerType(LinerTypes.GEOSYNTHETIC)
liner2.Geosynthetic.setProperties(MaterialType=MaterialType.PLASTIC, TensileStrengthPeak=0.05, TensileStrengthResidual=0.025)
print(liner2.Geosynthetic.getProperties())
liner3.setLinerName("Example Liner 3")
liner3.setLinerType(LinerTypes.REINFORCED_CONCRETE)
liner3.ReinforcedConcrete.setProperties(IncludeWeightInStressAnalysis=False, Spacing=2.2, SlidingGap=False)
# Not all functions are accessible through the getProperties method.
# Consult setProperties method definition in documentation to determine properties available.
liner3.ReinforcedConcrete.setStaticTemperatureGridToUse("Default Grid")
print(liner3.ReinforcedConcrete.getProperties())
# Not all functions are accessible through the getProperties method.
# Consult getProperties method definition in documentation to determine properties available.
print(liner3.ReinforcedConcrete.getStaticTemperatureGridToUse())
model.close()
Code Snippet: Manipulation of Liner Stage Factor Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
liner = model.getLinerPropertyByName("Liner 1")
liner.setLinerType(LinerTypes.REINFORCED_CONCRETE)
liner.ReinforcedConcrete.setStageConcreteProperties(True)
definedStageFactors = liner.ReinforcedConcrete.stageFactorInterface.getDefinedStageFactors()
newStageFactor = liner.ReinforcedConcrete.stageFactorInterface.createStageFactor(2)
definedStageFactors[2] = newStageFactor
liner.ReinforcedConcrete.stageFactorInterface.setDefinedStageFactors(StageFactorDefinitionMethod.RELATIVE_STAGE_FACTOR, definedStageFactors)
# Get factors for stage 2
reinforcedConcreteFactors = liner.ReinforcedConcrete.stageFactorInterface.getDefinedStageFactors()
stageFactor = reinforcedConcreteFactors[2]
stageFactor.setThicknessFactor(3)
stageFactor.setConcreteYoungsModulusFactor(2.2)
stageFactor.setConcreteCompressiveStrengthFactor(4)
stageFactor.setConcreteTensileStrengthFactor(1.5)
stageFactor.setAxialStrainExpansionFactor(0.8)
stageFactor.setAreaFactor(1.1)
liner.setLinerType(LinerTypes.STANDARD_BEAM)
liner.StandardBeam.setStageLinerProperties(True)
standardBeamFactors = liner.StandardBeam.stageFactorInterface.getDefinedStageFactors()
linerStageFactors = standardBeamFactors[2]
linerStageFactors.setThicknessFactor(3)
linerStageFactors.setYoungsModulusFactor(2)
linerStageFactors.setPoissonsRatioFactor(1.45)
linerStageFactors.setAxialStrainExpansionFactor(0.8)
model.close()
Code Snippet: Manipulation of Joint Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
jointList = model.getAllJointProperties()
joint1 = jointList[0]
joint2 = jointList[1]
joint3 = jointList[2]
joint1.setJointName("Example Joint 1")
joint1.setSlipCriterion(JointTypes.MOHR_COULOMB)
joint1.MohrCoulomb.setTensileStrength(50)
joint1.MohrCoulomb.setNormalStiffness(150000)
joint1.MohrCoulomb.setApplyAdditionalPressureInsideJoint(True)
print(joint1.MohrCoulomb.getTensileStrength())
print(joint1.MohrCoulomb.getNormalStiffness())
print(joint1.MohrCoulomb.getApplyAdditionalPressureInsideJoint())
joint2.setJointName("Example Joint 2")
joint2.setSlipCriterion(JointTypes.HYPERBOLIC_SOFTENING)
joint2.HyperbolicSoftening.setProperties(PeakCohesion=155, ShearStiffness=15000, ApplyPressureToLinerSideOnly=False)
print(joint2.HyperbolicSoftening.getProperties())
joint3.setJointName("Example Joint 3")
joint3.setSlipCriterion(JointTypes.DISPLACEMENT_DEPENDENT)
joint3.DisplacementDependent.setProperties(AdditionalPressureType=AdditionalPressureType.PRESSURE, AdditionalPressureInsideJoint=5)
# Not all functions are accessible through the setProperties method.
# Consult setProperties method definition in documentation to determine properties available.
joint3.DisplacementDependent.setDisplacementDependentTable([[2,8,9,12],[5,6,7,8]])
print(joint3.DisplacementDependent.getProperties())
# Not all functions are accessible through the getProperties method.
# Consult getProperties method definition in documentation to determine properties available.
print(joint3.DisplacementDependent.getDisplacementDependentTable())
model.close()
Code Snippet: Manipulation of Joint Stage Factor Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
joint = model.getJointPropertyByName("Joint 1")
joint.setSlipCriterion(JointTypes.MOHR_COULOMB)
definedStageFactors = joint.MohrCoulomb.stageFactorInterface.getDefinedStageFactors()
newStageFactor = joint.MohrCoulomb.stageFactorInterface.createStageFactor(2)
definedStageFactors[2] = newStageFactor
joint.MohrCoulomb.stageFactorInterface.setDefinedStageFactors(definedStageFactors)
mohrCoulombFactors = joint.MohrCoulomb.stageFactorInterface.getDefinedStageFactors()
stage2mohrCoulombFactors = mohrCoulombFactors[2]
stage2mohrCoulombFactors.setNormalStiffnessFactor(3)
stage2mohrCoulombFactors.setShearStiffnessFactor(3)
stage2mohrCoulombFactors.setTensileStrengthFactor(3)
stage2mohrCoulombFactors.setPeakCohesionFactor(3)
stage2mohrCoulombFactors.setPeakFrictionAngleFactor(3)
stage2mohrCoulombFactors.setResCohesionFactor(3)
stage2mohrCoulombFactors.setResFrictionAngleFactor(3)
stage2mohrCoulombFactors.setResTensileStrengthFactor(3)
stage2mohrCoulombFactors.setAdditionalPressureInsideJointFactor(6)
stage2mohrCoulombFactors.setGroundwaterPressureFactor(6)
joint.setSlipCriterion(JointTypes.BARTON_BANDIS)
bartonBandisfactors = joint.BartonBandis.stageFactorInterface.getDefinedStageFactors()
stage2bartonBandisFactors = bartonBandisfactors[2]
stage2bartonBandisFactors.setNormalStiffnessFactor(3)
stage2bartonBandisFactors.setShearStiffnessFactor(3)
stage2bartonBandisFactors.setJRCFactor(3)
stage2bartonBandisFactors.setJCSFactor(3)
stage2bartonBandisFactors.setResidualFrictionAngleFactor(3)
stage2bartonBandisFactors.setAdditionalPressureInsideJointFactor(6)
stage2bartonBandisFactors.setGroundwaterPressureFactor(6)
model.close()
Code Snippet: Manipulation of Pile Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
pile = model.getAllPileProperties()[0]
pile.setPileName("MultiLinear Pile")
pile.setConnectionType(PileConnectionType.HINGED)
pile.setLength(6)
pile.setOutOfPlaneSpacing(0.6)
pile.setSkinResistance(PileSkinResistanceType.MULTI_LINEAR)
pile.MultiLinear.setShearStiffness(1001)
pile.MultiLinear.setDefinitionMethod(PileDefinitionMethod.DISTANCE_FROM_TOP)
pile.MultiLinear.setCoordinates([5,6,7],[10,11,12])
pile.MultiLinear.setUseBaseResistance(False)
pile.Beam.setApplication(PileApplicationType.DEFINE_BEAM_SEGMENT_BY_LENGTH)
pile.Beam.defineBeamSegment([3,6], ["Liner 4", "Liner 5"])
pile.ForceDisplacement.setApply(PileEndCondition.FORCE)
pile.ForceDisplacement.setX(0.5)
pile.ForceDisplacement.setY(0.6)
model.close()
Code Snippet: Manipulation of Pile Stage Factor Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
pile = model.getPilePropertyByName("Pile 1")
# Manipulation of Pile Force/Displacement factors for stage 2
pile.setStageForceDisplacement(True)
definedStageFactors = pile.ForceDisplacement.stageFactorInterface.getDefinedStageFactors()
newStageFactor = pile.ForceDisplacement.stageFactorInterface.createStageFactor(2)
definedStageFactors[2] = newStageFactor
pile.ForceDisplacement.stageFactorInterface.setDefinedStageFactors(definedStageFactors)
stageFactors = pile.ForceDisplacement.stageFactorInterface.getDefinedStageFactors()[2]
stageFactors.setXFactor(1.5)
stageFactors.setYFactor(1.8)
print(f"X Factor : {stageFactors.getXFactor()}, Y Factor : {stageFactors.getYFactor()}")
model.close()
Code Snippet: Manipulation of Structural Interface Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
structural = model.getAllStructuralInterfaceProperties()[0]
structural.setStructuralInterfaceName("Example Structural 1")
structural.setPositiveJointPropertyByName("Joint 3")
structural.setLinerPropertyByName("Liner 4")
structural.setNegativeJointPropertyByName("Joint 5")
model.close()
Code Snippet: Manipulation of Composite Liner Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
composite = model.getAllCompositeLinerProperties()[0]
composite.setCompositeName("Example Composite 1")
composite.setNumberOfLayers(3)
composite.setCompositeLinerPropertyByName(1, "Liner 2")
composite.setCompositeLinerPropertyByName(2, "Liner 3")
composite.setCompositeLinerPropertyByName(3, "Liner 5")
composite.setInstallDelay(2, 2)
composite.setInstallDelay(3, 1)
composite.setRemovedStage(1, 1)
composite.setRemovedStage(2, 2)
composite.setRemovedStage(3, -1)
composite.setJointApplied(True)
composite.setCompositeJointPropertyByName("Joint 5")
composite.setJointPlacement(CompositeJointPlacementTypes.BETWEEN_THIRD_AND_FOURTH_LINER)
model.close()
Code Snippet: Manipulation of Material Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
material = model.getAllMaterialProperties()[0]
material.InitialConditions.setInitialElementLoading(InitialElementLoadingType.BODY_FORCE_ONLY)
material.Stiffness.setElasticType(MaterialElasticityTypes.TRANSVERSELY_ISOTROPIC)
material.Stiffness.TransverselyIsotropic.setUseUnloadingCondition(True)
material.Strength.setFailureCriterion(StrengthCriteriaTypes.HOEK_BROWN)
material.Strength.HoekBrown.setCompressiveStrength(101)
material.Hydraulic.StaticGroundwater.setStaticWaterMode(StaticWaterModes.PORE_WATER_PRESSURE)
material.Hydraulic.setMaterialBehaviour(MaterialBehaviours.UNDRAINED)
model.close()
Code Snippet: Manipulation of Material Initial Condition Stage Factor Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
material = model.getAllMaterialProperties()[0]
# Make sure your material stiffness type isn't Custom before changing factor values
material.Stiffness.setElasticType(MaterialElasticityTypes.ISOTROPIC)
# Make sure to stage Strength and Stiffness Stage Factor option before manipulating any factor properties
material.StageFactors.setStageStrengthStiffnessStageFactors(True)
definedStageFactors = material.StageFactors.getDefinedStageFactors()
newStageFactor = material.StageFactors.createStageFactor(2)
definedStageFactors[2] = newStageFactor
material.StageFactors.setDefinedStageFactors(definedStageFactors)
initialConditionStage2Factor = material.InitialConditions.stageFactorInterface.getDefinedStageFactors()[2]
initialConditionStage2Factor.setUnitWeightFactor(3)
initialConditionStage2Factor.setPorosityValueFactor(5)
print(f"Unit Weight Factor = {initialConditionStage2Factor.getUnitWeightFactor()}, Porosity Value Factor = {initialConditionStage2Factor.getPorosityValueFactor()}")
model.close()
Code Snippet: Manipulation of Material Joint Stage Factor Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
# Manipulation of Material Joint Mohr Coulomb Stage Factor for stage 2
material = model.getAllMaterialProperties()[0]
material.Strength.setFailureCriterion(StrengthCriteriaTypes.JOINTED_MOHR_COULOMB)
matJointOptions = material.Strength.JointedMohrCoulomb.getJointOptions()
jointmaterial = matJointOptions.getJoint(0)
jointmaterial.MohrCoulombMaterial.setApplyStageFactors(True)
definedStageFactors = jointmaterial.MohrCoulombMaterial.stageFactorInterface.getDefinedStageFactors()
newStageFactor = jointmaterial.MohrCoulombMaterial.stageFactorInterface.createStageFactor(2)
definedStageFactors[2] = newStageFactor
jointmaterial.MohrCoulombMaterial.stageFactorInterface.setDefinedStageFactors(definedStageFactors)
stageFactor = jointmaterial.MohrCoulombMaterial.stageFactorInterface.getDefinedStageFactors()[2]
stageFactor.setTensileStrengthFactor(25)
stageFactor.setPeakFrictionAngleFactor(39)
stageFactor.setPeakCohesionFactor(20)
stageFactor.setResTensileStrengthFactor(14)
stageFactor.setResCohesionFactor(14)
stageFactor.setResFrictionAngleFactor(22)
stageFactor.setDilationAngleFactor(2.7)
# Manipulation of Material Joint Barton Bandis Stage Factor
jointmaterial.BartonBandisMaterial.setApplyStageFactors(True)
stageFactor = jointmaterial.BartonBandisMaterial.stageFactorInterface.getDefinedStageFactors()[2]
jointmaterial.BartonBandisMaterial.setJCS(36.5)
jointmaterial.BartonBandisMaterial.setJRC(28.5)
jointmaterial.BartonBandisMaterial.setResidualFrictionAngle(27.5)
jointmaterial.BartonBandisMaterial.setResidualStrength(1)
jointmaterial.BartonBandisMaterial.setApplyStageFactors(1)
jointmaterial.BartonBandisMaterial.setDilationAngle(2.3)
# Manipulation of Material Joint Geosynthetic Hyperbolic Stage Factor
jointmaterial.GeosyntheticHyperbolicMaterial.setApplyStageFactors(True)
stageFactor = jointmaterial.GeosyntheticHyperbolicMaterial.stageFactorInterface.getDefinedStageFactors()[2]
jointmaterial.GeosyntheticHyperbolicMaterial.setPeakAdhesionAtSigninf(37.5)
jointmaterial.GeosyntheticHyperbolicMaterial.setPeakFrictionAngleAtSign0(28.5)
jointmaterial.GeosyntheticHyperbolicMaterial.setResAdhesionAtSigninf(27.5)
jointmaterial.GeosyntheticHyperbolicMaterial.setResFrictionAngleAtSign0(36.7)
jointmaterial.GeosyntheticHyperbolicMaterial.setApplyStageFactors(1)
jointmaterial.GeosyntheticHyperbolicMaterial.setTensileStrength(14.6)
jointmaterial.GeosyntheticHyperbolicMaterial.setDilationRatio(2.2)
model.close()
Code Snippet: Manipulation of Hydraulic Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
staticGroundwaterModel = modeler.openFile(rf"{current_dir}\example_models\StaticGroundwater.fez")
FEAGroundwaterModel = modeler.openFile(rf"{current_dir}\example_models\FEAGroundwater.fez")
material = staticGroundwaterModel.getAllMaterialProperties()[0]
hydraulic = material.Hydraulic
hydraulic.setMaterialBehaviour(MaterialBehaviours.UNDRAINED)
hydraulic.setFluidBulkModulus(6)
hydraulic.setUseBiotsCoefficientForCalculatingEffectiveStress(True)
staticgroundwater = hydraulic.StaticGroundwater
staticgroundwater.setStaticWaterMode(StaticWaterModes.PIEZO)
staticgroundwater.setPiezoToUse("None")
print(f"Piezo To Use = {staticgroundwater.getPiezoToUse()}")
staticgroundwater.setStaticWaterMode(StaticWaterModes.RU)
staticgroundwater.setRuValue(4)
print("\nStatic Groundwater Properties\n")
print(f"Static Water Mode = {staticgroundwater.getStaticWaterMode()}, RU Value = {staticgroundwater.getRuValue()}")
material = FEAGroundwaterModel.getAllMaterialProperties()[0]
FEAGroundwater = hydraulic.FEAGroundwater
FEAGroundwater.setK2K1(2)
FEAGroundwater.setK1Definition(AnisotropyDefinitions.ANGLE)
FEAGroundwater.setK1Angle(30)
print("\nFEA Groundwater Properties\n")
print(f"K2/K1 = {FEAGroundwater.getK2K1()}, K1 Definition = {FEAGroundwater.getK1Definition()}, K1 Angle = {FEAGroundwater.getK1Angle()}\n")
# Manipulation of Hydraulic Stage Factor Properties for FEAGroundwater model for stage 2
# Make sure to stage Hydraulic Stage Factor option before manipulating any factor properties
material.StageFactors.setStageHydraulicStageFactor(True)
definedStageFactors = material.StageFactors.getDefinedStageFactors()
newStageFactor = material.StageFactors.createStageFactor(2)
definedStageFactors[2] = newStageFactor
material.StageFactors.setDefinedStageFactors(definedStageFactors)
hydraulicStageFactor = material.Hydraulic.stageFactorInterface.getDefinedStageFactors()[2]
hydraulicStageFactor.setMaterialBehaviourFactor(MaterialBehaviours.UNDRAINED)
print(f"Hydraulic Material Behaviour Stage Factor Value = {hydraulicStageFactor.getMaterialBehaviourFactor()}")
staticGroundwaterModel.close()
FEAGroundwaterModel.close()
Code Snippet: Manipulation of Hydraulic Static Groundwater Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\StaticGroundwater.fez")
material = model.getAllMaterialProperties()[0]
material.Hydraulic.setMaterialBehaviour(MaterialBehaviours.DRAINED)
material.Hydraulic.setFluidBulkModulus(5)
material.Hydraulic.setUseBiotsCoefficientForCalculatingEffectiveStress(True)
staticGroundwater = material.Hydraulic.StaticGroundwater
staticGroundwater.setStaticWaterMode(StaticWaterModes.PORE_WATER_PRESSURE)
staticGroundwater.setStaticPoreWaterPressure(5)
poreWaterPressure = staticGroundwater.getStaticPoreWaterPressure()
print(f"Static Pore Water Pressure = {poreWaterPressure}")
staticGroundwater.setStaticWaterMode(StaticWaterModes.RU)
staticGroundwater.setRuValue(5)
ruValue = staticGroundwater.getRuValue()
print(f"Ru Value = {ruValue}")
staticGroundwater.setStaticWaterMode(StaticWaterModes.PIEZO)
staticGroundwater.setPiezoToUse("1")
staticGroundwater.setHuType(HuTypes.CUSTOM)
staticGroundwater.setHuValue(5)
huValue = staticGroundwater.getHuValue()
print(f"Hu Value = {huValue}")
staticGroundwater.setStaticWaterMode(StaticWaterModes.GRID)
staticGroundwater.setGridToUse("Default Grid")
# Manipulation of StaticGroundwater Stage Factor Properties for stage 2
# Make sure to stage Hydraulic Stage Factor option before manipulating any factor properties
material.StageFactors.setStageHydraulicStageFactor(True)
definedStageFactors = material.StageFactors.getDefinedStageFactors()
newStageFactor = material.StageFactors.createStageFactor(2)
definedStageFactors[2] = newStageFactor
material.StageFactors.setDefinedStageFactors(definedStageFactors)
staticGroundwaterStageFactor = material.Hydraulic.StaticGroundwater.stageFactorInterface.getDefinedStageFactors()[2]
staticGroundwaterStageFactor.setGridToUse("Default Grid")
staticGroundwaterStageFactor.setPiezoToUse("None")
print(f"StaticGroundwater Factor Grid To Use = {staticGroundwaterStageFactor.getGridToUse()}, Static Groundwater Piezo To Use = {staticGroundwaterStageFactor.getPiezoToUse()}")
model.close()
Code Snippet: Manipulation of Hydraulic FEA Groundwater Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\FEAGroundwater.fez")
material = model.getAllMaterialProperties()[0]
hydraulic = material.Hydraulic
hydraulic.setMaterialBehaviour(MaterialBehaviours.UNDRAINED)
hydraulic.setFluidBulkModulus(6)
hydraulic.setUseBiotsCoefficientForCalculatingEffectiveStress(True)
FEAGroundwater = hydraulic.FEAGroundwater
FEAGroundwater.setK2K1(2)
FEAGroundwater.setK1Definition(AnisotropyDefinitions.ANGLE)
FEAGroundwater.setK1Angle(30)
FEAGroundwater.setMvModel(MVModel.CONSTANT)
FEAGroundwater.setMv(0.05)
FEAGroundwater.Simple.setKs(0.005)
FEAGroundwater.Simple.setWCInputType(WCInputType.BY_WATER_CONTENT)
FEAGroundwater.Simple.setWCSat(0.5)
FEAGroundwater.Simple.setWCRes(0.3)
FEAGroundwater.Simple.setWCInputType(WCInputType.BY_DEGREE_OF_SATURATION)
FEAGroundwater.Simple.setDoSSat(0.3)
FEAGroundwater.Simple.setDoSRes(1)
print(f"Fluid Bulk Modulus = {hydraulic.getFluidBulkModulus()}, K2/K1 = {FEAGroundwater.getK2K1()}, K1 Definition = {FEAGroundwater.getK1Definition()}")
print(f"K1 Angle = {FEAGroundwater.getK1Angle()}, MV Model = {FEAGroundwater.getMvModel()}, Mv Value = {FEAGroundwater.getMv()}")
print(f"Ks Value = {FEAGroundwater.Simple.getKs()}, Water Content Sat = {FEAGroundwater.Simple.getWCSat()}, Water Content Res = {FEAGroundwater.Simple.getWCRes()}")
print(f"Degree of Saturation Sat = {FEAGroundwater.Simple.getDoSSat()}, Degree of Staturation Res = {FEAGroundwater.Simple.getDoSRes()}\n")
simple = FEAGroundwater.Simple
simple.setSoilType(EnhancedSimpleSoilTypes.SILT)
print(f"Soil Type = {simple.getSoilType()}\n")
fredlund = FEAGroundwater.Fredlund
fredlund.setA(8)
fredlund.setB(5)
fredlund.setC(6)
print(f"Fredlund Param A = {fredlund.getA()}, Fredlung Param B = {fredlund.getB()}, Fredlund Param C = {fredlund.getC()}\n")
genuchten = FEAGroundwater.Genuchten
genuchten.setAlpha(20)
genuchten.setN(3.13)
genuchten.setCustomM(True)
genuchten.setM(0.55)
print(f"Alpha = {genuchten.getAlpha()}, N = {genuchten.getN()}, Custom M Value = {genuchten.getM()}\n")
brooks = FEAGroundwater.Brooks
brooks.setPoreSizeIndex(2)
brooks.setBubblingPressure(3)
print(f"Pore Size Index = {brooks.getPoreSizeIndex()}, Bubbling Pressure = {brooks.getBubblingPressure()}\n")
gardener = FEAGroundwater.Gardner
gardener.setA(0.5)
gardener.setN(5)
print(f"Param A = {gardener.getA()}, Param N = {gardener.getN()}\n")
userDefined = FEAGroundwater.UserDefined
userDefined.setUserDefinedPermeabilityAndWaterContentFunction("User Defined 1")
print(f"User Defined Permeability And Water Content Function Name = {userDefined.getUserDefinedPermeabilityAndWaterContentFunction()}\n")
# Manipulation of FEAGroundwater Stage Factor Properties for stage 2
# Make sure to stage Hydraulic Stage Factor option before manipulating any factor properties
material.StageFactors.setStageHydraulicStageFactor(True)
definedStageFactors = material.StageFactors.getDefinedStageFactors()
newStageFactor = material.StageFactors.createStageFactor(2)
definedStageFactors[2] = newStageFactor
material.StageFactors.setDefinedStageFactors(definedStageFactors)
feaGroundwaterStageFactor = material.Hydraulic.FEAGroundwater.stageFactorInterface.getDefinedStageFactors()[2]
feaGroundwaterStageFactor.setK1AngleFactor(0.7)
feaGroundwaterStageFactor.setK2K1Factor(2.2)
feaGroundwaterStageFactor.setMvFactor(5)
print("\nFEAGroundwater Stage Factor Values")
print(f"K1 Angle Factor = {feaGroundwaterStageFactor.getK1AngleFactor()}, K2/K1 Factor = {feaGroundwaterStageFactor.getK2K1Factor()}, MV Factor = {feaGroundwaterStageFactor.getMvFactor()}")
# Manipulation of FEAGroundwater Constant Model Stage Factor Properties for stage 2
constantModelStageFactor = material.Hydraulic.FEAGroundwater.Constant.stageFactorInterface.getDefinedStageFactors()[2]
constantModelStageFactor.setWCCurveSlopeFactor(1.7)
print("\nFEAGroundwater Constant Model Factor Values")
print(f"Curve Slope Factor = {constantModelStageFactor.getWCCurveSlopeFactor()}")
fredlundModelStageFactor = material.Hydraulic.FEAGroundwater.Fredlund.stageFactorInterface.getDefinedStageFactors()[2]
fredlundModelStageFactor.setAFactor(0.7)
fredlundModelStageFactor.setBFactor(2.2)
fredlundModelStageFactor.setCFactor(5)
fredlundModelStageFactor.setKsFactor(5)
print("\nFEAGroundwater Fredlund Model Factor Values")
print(f"A Factor = {fredlundModelStageFactor.getAFactor()}, B Factor = {fredlundModelStageFactor.getBFactor()}, C Factor = {fredlundModelStageFactor.getCFactor()}, Ks Factor = {fredlundModelStageFactor.getKsFactor()}")
model.close()
Code Snippet: Manipulation of Datum Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
material = model.getAllMaterialProperties()[0]
# Make sure to set Material Stiffness Type to Isotropic before changing Datum Dependency Properties
material.Stiffness.setElasticType(MaterialElasticityTypes.ISOTROPIC)
material.Datum.setUsingDatum(True)
youngDatum = material.Datum.getDatumYoungsModulus()
youngDatum.setUsing(True)
youngDatum.setType(DatumType.DATUM_TYPE_DEPTH)
youngDatum.setDatum(5)
youngDatum.setType(DatumType.DATUM_TYPE_RADIAL)
youngDatum.setCenter(3.5,2)
youngDatum.setUseCutoff(True)
youngDatum.setChange(0.5)
youngDatum.setCutoff(0.8)
print("\nYoungs Modulus Datum Dependent Type:")
print(f"Datum Type = {youngDatum.getType()}, Datum Value = {youngDatum.getDatum()}, Center = {youngDatum.getCenter()}")
print(f"Use Cutoff = {youngDatum.getUseCutoff()}, Datum Change = {youngDatum.getChange()}, Cutoff = {youngDatum.getCutoff()}\n")
# Set Material Strength failure criterion to Mohr-Coulomb and material type to Plastic
# This allows to specify properties for Friction and Cohesion Datum Dependent Types
material.Strength.setFailureCriterion(StrengthCriteriaTypes.MOHR_COULOMB)
material.Strength.MohrCoulombStrength.setMaterialType(MaterialType.PLASTIC)
frictionDatum = material.Datum.getDatumFrictionAngle()
frictionDatum.setUsing(True)
frictionDatum.setType(DatumType.DATUM_TYPE_DEPTH)
frictionDatum.setDatum(5)
frictionDatum.setType(DatumType.DATUM_TYPE_DEPTH)
frictionDatum.setCenter(5, 6)
frictionDatum.setPeakChange(1)
frictionDatum.setUsePeakCutoff(True)
frictionDatum.setPeakCutoffValue(44)
frictionDatum.setResidualChange(0.5)
frictionDatum.setUseResidualCutoff(True)
frictionDatum.setResidualCutoffValue(45)
print("\nFriction Datum Dependent Type:")
print(f"Datum Type = {frictionDatum.getType()}, Datum Value = {frictionDatum.getDatum()}, Center = {frictionDatum.getCenter()}")
print(f"Use Peak Cutoff = {frictionDatum.getUsePeakCutoff()}, Peak Change = {frictionDatum.getPeakChange()}, Peak Cutoff = {frictionDatum.getPeakCutoffValue()}")
print(f"Use Residual Cutoff = {frictionDatum.getUseResidualCutoff()}, Residual Cutoff Value = {frictionDatum.getResidualCutoffValue()}\n")
cohesion = material.Datum.getDatumCohesion()
cohesion.setType(DatumType.DATUM_TYPE_DEPTH)
cohesion.setDatum(5)
cohesion.setType(DatumType.DATUM_TYPE_RADIAL)
cohesion.setCenter(5, 6)
cohesion.setPeakChange(1)
cohesion.setUsePeakCutoff(True)
cohesion.setPeakCutoffValue(44)
cohesion.setResidualChange(0.5)
cohesion.setUseResidualCutoff(True)
cohesion.setResidualCutoffValue(45)
print("\nCohesion Datum Dependent Type:")
print(f"Datum Type = {cohesion.getType()}, Datum Value = {cohesion.getDatum()}, Center = {cohesion.getCenter()}")
print(f"Use Peak Cutoff = {cohesion.getUsePeakCutoff()}, Peak Change = {cohesion.getPeakChange()}, Peak Cutoff = {cohesion.getPeakCutoffValue()}")
print(f"Use Residual Cutoff = {cohesion.getUseResidualCutoff()}, Residual Cutoff Value = {cohesion.getResidualCutoffValue()}\n")
# Manipulation of Datum Stage Factor Properties for stage 2
# Make sure to stage Datum Stage Factor option before manipulating any factor properties
material.StageFactors.setStageDatumStageFactor(True)
definedStageFactors = material.StageFactors.getDefinedStageFactors()
newStageFactor = material.StageFactors.createStageFactor(2)
definedStageFactors[2] = newStageFactor
material.StageFactors.setDefinedStageFactors(definedStageFactors)
datumStageFactor = material.Datum.stageFactorInterface.getDefinedStageFactors()[2]
datumYoungStageFactor = datumStageFactor.getDatumYoungsStageFactor()
datumYoungStageFactor.setChange(0.2)
datumYoungStageFactor.setDatum(3)
datumYoungStageFactor.setPeakCutoffValue(4.42)
print(f"Change Factor = {datumYoungStageFactor.getChange()}, Datum Factor Value= {datumYoungStageFactor.getDatum()}, Peak Cutoff Value Factor = {datumYoungStageFactor.getPeakCutoffValue()}")
model.close()
Code Snippet: Manipulation of Stiffness Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
material = model.getAllMaterialProperties()[0]
stiffness = material.Stiffness
custom = stiffness.Custom
custom.setUseConstantPoissonsRatio(False)
custom.setCustomStiffnessLoadingTable(mode=CustomMode.CUSTOM_Q,
table=[(1, 2, 0.3), (4, 5, 0.4)])
custom.setUseUnloadingCondition(True)
custom.setUnloadingCondition(UnloadingConditions.DEVIATORIC_STRESS)
custom.setUnloadingUseConstantPoissonsRatio(False)
custom.setCustomStiffnessUnloadingTable(mode=CustomMode.CUSTOM_Q,
table=[(1, 2, 0.3), (4, 5, 0.4)])
# Make sure to define Stiffness Loading and Unloading tables before setting Custom Model and Stiffness Elastic Type to Custom
custom.setCustomMode(CustomMode.CUSTOM_Q)
stiffness.setElasticType(MaterialElasticityTypes.CUSTOM)
print(f"Loading Custom Table = {custom.getCustomStiffnessLoadingTable()}")
print(f"Unloading Condition = {custom.getUnloadingCondition()}")
print(f"Unloading Custom Table = {custom.getCustomStiffnessUnloadingTable()}")
# Manipulation of Stiffness Stage Factor Properties for stage 2
# Make sure to your Stiffness Elastic Type isn't Custom before manipulating any stiffness related factor values
material.Stiffness.setElasticType(MaterialElasticityTypes.ISOTROPIC)
material.StageFactors.setStageStrengthStiffnessStageFactors(True)
definedStageFactors = material.StageFactors.getDefinedStageFactors()
newStageFactor = material.StageFactors.createStageFactor(2)
definedStageFactors[2] = newStageFactor
material.StageFactors.setDefinedStageFactors(definedStageFactors)
stiffnessStageFactor = material.Stiffness.Isotropic.stageFactorInterface.getDefinedStageFactors()[2]
stiffnessStageFactor.setPoissonsRatioFactor(3)
stiffnessStageFactor.setResidualYoungsModulusFactor(2.2)
stiffnessStageFactor.setShearModulusFactor(1.9)
print("\nIsotropic Stage Factor Values")
print(f"Poisson Ratio Factor = {stiffnessStageFactor.getPoissonsRatioFactor()}, Res. Youngs Modulus Factor = {stiffnessStageFactor.getYoungsModulusFactor()}, Shear Modulus Factor = {stiffnessStageFactor.getShearModulusFactor()}")
nonLinearHyperbolicFactors = material.Stiffness.NonLinearHyperbolic.stageFactorInterface.getDefinedStageFactors()[2]
nonLinearHyperbolicFactors.setFailureRatioRfFactor(1)
nonLinearHyperbolicFactors.setBulkModulusExpMFactor(2)
nonLinearHyperbolicFactors.setAtmosphericPressureFactor(3.3)
print("\nNonLinear Hyperbolic Stage Factor Values")
print(f"Failure Ratio of RF = {nonLinearHyperbolicFactors.getFailureRatioRfFactor()}, Bulk Modulus ExpM = {nonLinearHyperbolicFactors.getBulkModulusExpMFactor()}, Atmospheric Pressure = {nonLinearHyperbolicFactors.getAtmosphericPressureFactor()}")
model.close()
Code Snippet: Manipulation of Strength Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
material = model.getAllMaterialProperties()[0]
strength = material.Strength
strength.setFailureCriterion(StrengthCriteriaTypes.MOHR_COULOMB)
material.Strength.MohrCoulombStrength.setMaterialType(MaterialType.PLASTIC)
strength.setUnsaturatedBehavior(UnsaturatedParameterType.SINGLE_EFFECTIVE_STRESS)
strength.setSingleEffectiveStressMethod(UnsaturatedSingleEffectiveStressMethod.TABULAR_VALUE)
strength.setUseCutoff(True)
strength.setCutoffValue(-0.8)
mohr_coulomb = strength.MohrCoulombStrength
mohr_coulomb.setPeakTensileStrength(1)
mohr_coulomb.setPeakFrictionAngle(30)
mohr_coulomb.setPeakCohesion(12)
mohr_coulomb.setResidualTensileStrength(2)
mohr_coulomb.setResidualFrictionAngle(35)
mohr_coulomb.setResidualCohesion(13.5)
mohr_coulomb.setDilationAngle(15)
print(f"Peak Tensile Strength = {mohr_coulomb.getPeakTensileStrength()}, Peak Friction Angle = {mohr_coulomb.getPeakFrictionAngle()}, Peak Cohesion = {mohr_coulomb.getPeakCohesion()}")
print(f"Res Peak Tensile = {mohr_coulomb.getResidualTensileStrength()}, Res Peak Friction = {mohr_coulomb.getResidualFrictionAngle()}, Res Cohesion = {mohr_coulomb.getResidualFrictionAngle()}")
tabularValueMethod = strength.setTabularValues(UnsaturatedTabularValueMethod.WITH_RESPECT_TO_SUCTION)
strength.setUnsaturatedZoneTableWithRespectToSuction(coefficients=[1, 2], values=[5, 6])
snowdenAnisotripicFunction = material.Strength.SnowdenModAnisotropicLinear.getBeddingStrengthFunction()
snowdenAnisotripicFunction.setDilationRatio(0.74)
snowdenAnisotripicFunction.setPeakTensileStrength(5)
snowdenAnisotripicFunction.setResidualTensileStrength(8)
snowdenAnisotripicFunction.setFunctionType(SnowdenAnisotropicFunctionType.FUNCTION_TYPE_SHEAR_NORMAL)
snowdenAnisotripicFunction.setShearNormalFunctionWithResidual(normalStress=[1 , 2],
shearStress=[3, 4],
residualShearStress=[2.2, 3.6])
print(f"Normal Stress = {snowdenAnisotripicFunction.getNormalStress()}")
print(f"Shear Stress = {snowdenAnisotripicFunction.getShearStress()}")
print(f"Residual Shear Stress = {snowdenAnisotripicFunction.getResidualShearStress()}\n")
# Manipulation of Strength Stage Factor Properties for stage 2
# Make sure to your Stiffness Elastic Type isn't Custom before manipulating any factor values
material.Stiffness.setElasticType(MaterialElasticityTypes.ISOTROPIC)
material.StageFactors.setStageStrengthStiffnessStageFactors(True)
definedStageFactors = material.StageFactors.getDefinedStageFactors()
newStageFactor = material.StageFactors.createStageFactor(2)
definedStageFactors[2] = newStageFactor
material.StageFactors.setDefinedStageFactors(definedStageFactors)
strengthFactor = material.Strength.stageFactorInterface.getDefinedStageFactors()[2]
strengthFactor.setResetYield(True)
strengthFactor.setAirEntryValueFactor(1.5)
strengthFactor.setUnsaturatedShearStrengthAngleFactor(3.9)
print("\nStrength Stage Factor Values:")
print(f"Reset Yield = {strengthFactor.getResetYield()}, Air Entry Value = {strengthFactor.getAirEntryValueFactor()}, Unsaturated Shear Strength Angle = {strengthFactor.getUnsaturatedShearStrengthAngleFactor()}")
# Manipulation of Strength Basic Barcelona Model Stage 2 factors
material.Strength.setFailureCriterion(StrengthCriteriaTypes.BARCELONA_BASIC)
barcelonaFactors = material.Strength.BarcelonaBasic.stageFactorInterface.getDefinedStageFactors()[2]
barcelonaFactors.setGammaFactor(3.3)
barcelonaFactors.setLambdaFactor(2)
barcelonaFactors.setNParameterFactor(5)
print("\nStrength Basic Barcelona Model Stage Factor Values")
print(f"Gamma Factor = {barcelonaFactors.getGammaFactor()}, Lambda Factor = {barcelonaFactors.getLambdaFactor()},N Parameter Factor = {barcelonaFactors.getNParameterFactor()}")
# Manipulation of Strength Hoek Brown Stage 2 factors
material.Strength.setFailureCriterion(StrengthCriteriaTypes.HOEK_BROWN)
hoekBrownFactors = material.Strength.HoekBrown.stageFactorInterface.getDefinedStageFactors()[2]
hoekBrownFactors.setDilationParameterFactor(2.2)
hoekBrownFactors.setCompressiveStrengthFactor(5)
hoekBrownFactors.setMbParameterFactor(1)
print("\nHoek Brown Stage Factor Values")
print(f"Dilation Parameter = {hoekBrownFactors.getDilationParameterFactor()}, Compressive Strength = {hoekBrownFactors.getCompressiveStrengthFactor()}, MB Parameter = {hoekBrownFactors.getMbParameterFactor()}")
model.close()
Code Snippet: Manipulation of Thermal Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\TransientGroundwaterAndThermal.fez")
material = model.getAllMaterialProperties()[0]
thermal = material.Thermal
thermal.setWaterContent(ThermalWaterContentMethodType.DEFINE)
thermal.setWaterContentValue(0.35)
conductivity = thermal.Conductivity
conductivity.setMethod(ThermalType.JOHANSEN_LU)
johansenLu = conductivity.JohansenLu
johansenLu.setSoilType(ThermalSoilType.CRUSHED_ROCK)
johansenLu.setQuartzContent(0.88)
print(f"Soil Type = {johansenLu.getSoilType()}, Quartz Content = {johansenLu.getQuartzContent()}")
conductivity.setMethod(ThermalType.CUSTOM)
conductivity.Tabular.setDependence(ThermalVolumetricDepencenceType.TEMPERATURE)
conductivity.Tabular.setThermalConductivityTemperatureFunction(temperature=[1, 2, 3],
conductivity=[1.5, 3.3, 4.8])
print(f"\nThermal Temp. Vs Conductivity Table Values = {conductivity.Tabular.getThermalConductivityTemperatureFunction()}")
heatCapacity = thermal.HeatCapacity
heatCapacity.setType(ThermalHeatCapacityType.JAME_NEWMAN)
jameNewman = thermal.HeatCapacity.JameNewman
jameNewman.setIncludeLatentHeat(True)
jameNewman.setSoilSpecificHeatCapacity(890)
print(f"Heat Capacity Type = {heatCapacity.getType()}, Include Latent = {jameNewman.getIncludeLatentHeat()}, Specific Heat Capacity = {jameNewman.getSoilSpecificHeatCapacity()}")
custom = heatCapacity.CustomHeatCapacity
custom.setDependence(ThermalVolumetricDepencenceType.WATER_CONTENT)
custom.setVolumetricHeatCapacityVsWaterContentTable(volumetricHeatCapacity=[1, 2.4],
waterContent=[7, 8.5])
print("Volumetric Heat Capacity VS Water Content Table", custom.getVolumetricHeatCapacityVsWaterContentTable())
soilUnfrozenWaterContent = thermal.SoilUnfrozenWaterContent
ticeAnderson = soilUnfrozenWaterContent.TiceAnderson
ticeAnderson.setFrozenTemperature(-0.05)
ticeAnderson.setInputAlpha(0.009)
ticeAnderson.setInputBeta(0.0085)
print(f"Input Alpha = {ticeAnderson.getInputAlpha()}, Input Beta = {ticeAnderson.getInputBeta()}, Frozen Temp = {ticeAnderson.getFrozenTemperature()}")
soilUnfrozenWaterContent.setType(ThermalWaterContentType.CUSTOM)
soilUnfrozenWaterContent.CustomWaterContent.setTemperatureVsUnfrozenWaterContentValues(temperature=[1, 2, 3],
unfrozenWaterContent=[4, 5, 6])
print("\nThermal Temperature vs Soil Unfrozen Water Content Table Values",
soilUnfrozenWaterContent.CustomWaterContent.getTemperatureVsUnfrozenWaterContentValues())
soilUnfrozenWC = thermal.SoilUnfrozenWaterContent
# Make sure to set Soil Unfrozen Water Content type to Hydraulic Properties
soilUnfrozenWC.setType(ThermalWaterContentType.SOIL_WATER_CONTENT_IN_HYDRAULIC_PROPERTIES)
hydraulic_soilUnfrozenWC = soilUnfrozenWaterContent.HydraulicModel
# Make sure to set Hydraulic Model to your desired type
hydraulic_soilUnfrozenWC.setSelectHydraulicModel(GroundWaterModes.GARDNER)
hydraulic_soilUnfrozenWC.setFrozenTemperature(-0.015)
hydraulic_soilUnfrozenWC.setWCSat(0.34)
hydraulic_soilUnfrozenWC.setWCRes(0.01)
gardenerWaterContent = hydraulic_soilUnfrozenWC.GardnerWaterContent
gardenerWaterContent.setA(8)
gardenerWaterContent.setN(3)
print(f"\n Thermal Soil Unfrozen Water Content Type = {soilUnfrozenWaterContent.getType()}, Hydraulic Model Type = {hydraulic_soilUnfrozenWC.getSelectHydraulicModel()}")
print(f"Frozen Temperature = {hydraulic_soilUnfrozenWC.getFrozenTemperature()}, WC Sat = {hydraulic_soilUnfrozenWC.getWCSat()}, WC Res = {hydraulic_soilUnfrozenWC.getWCRes()}")
print(f"Gardener Parameter A = {gardenerWaterContent.getA()}, Gardener Parameter N = {gardenerWaterContent.getN()}")
thermal.setThermalExpansion(True)
thermal.setExpansionCoefficient(0.0005)
thermal.setDispersivity(True)
thermal.setLongitudinalDispersivity(2)
thermal.setTransverseDispersivity(3)
print(f"Thermal Expansion Coeff. = {thermal.getExpansionCoefficient()}")
print(f"Longitudinal Dispersivity = {thermal.getLongitudinalDispersivity()}, Transverse Dispersivity = {thermal.getTransverseDispersivity()}\n")
# Manipulation of Thermal Stage Factor Properties for stage 1
material.StageFactors.setStageThermalStageFactors(True)
definedStageFactors = material.StageFactors.getDefinedStageFactors()
newStageFactor = material.StageFactors.createStageFactor(2)
definedStageFactors[2] = newStageFactor
material.StageFactors.setDefinedStageFactors(definedStageFactors)
thermalStageFactors = thermal.stageFactorInterface.getDefinedStageFactors()[2]
thermalStageFactors.setThermalGridFactor("Default Grid")
print(f"Thermal Stage Factor Grid To Use = {thermalStageFactors.getThermalGridFactor()}")
model.close()
Code Snippet: Manipulation of Stage Factors for various properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
joint = model.getAllJointProperties()[0]
liner = model.getAllLinerProperties()[0]
material = model.getAllMaterialProperties()[0]
# Manipulation of AbsoluteStageFactorInterface type object
joint.setSlipCriterion(JointTypes.MOHR_COULOMB)
definedStageFactors = joint.MohrCoulomb.stageFactorInterface.getDefinedStageFactors()
newStageFactor = joint.MohrCoulomb.stageFactorInterface.createStageFactor(2)
definedStageFactors[2] = newStageFactor
joint.MohrCoulomb.stageFactorInterface.setDefinedStageFactors(definedStageFactors)
mohrCoulombFactors = joint.MohrCoulomb.stageFactorInterface.getDefinedStageFactors()
stage2mohrCoulombFactors = mohrCoulombFactors[2]
stage2mohrCoulombFactors.setNormalStiffnessFactor(3)
stage2mohrCoulombFactors.setShearStiffnessFactor(3)
stage2mohrCoulombFactors.setTensileStrengthFactor(3)
# Manipulation of RelativeStageFactorInterface type object
liner.setLinerType(LinerTypes.REINFORCED_CONCRETE)
liner.ReinforcedConcrete.setStageConcreteProperties(True)
definedStageFactors = liner.ReinforcedConcrete.stageFactorInterface.getDefinedStageFactors()
newStageFactor = liner.ReinforcedConcrete.stageFactorInterface.createStageFactor(2)
definedStageFactors[2] = newStageFactor
liner.ReinforcedConcrete.stageFactorInterface.setDefinedStageFactors(StageFactorDefinitionMethod.RELATIVE_STAGE_FACTOR, definedStageFactors)
reinforcedConcreteFactors = liner.ReinforcedConcrete.stageFactorInterface.getDefinedStageFactors()
stageFactor = reinforcedConcreteFactors[2]
stageFactor.setThicknessFactor(3)
stageFactor.setConcreteYoungsModulusFactor(2.2)
stageFactor.setConcreteCompressiveStrengthFactor(4)
# Manipulation of AbsoluteStageFactorGettersInterface type object
material.Stiffness.setElasticType(MaterialElasticityTypes.ISOTROPIC)
material.StageFactors.setStageStrengthStiffnessStageFactors(True)
definedStageFactors = material.StageFactors.getDefinedStageFactors()
newStageFactor = material.StageFactors.createStageFactor(2)
definedStageFactors[2] = newStageFactor
material.StageFactors.setDefinedStageFactors(definedStageFactors)
strengthFactor = material.Strength.stageFactorInterface.getDefinedStageFactors()[2]
strengthFactor.setResetYield(True)
strengthFactor.setAirEntryValueFactor(1.5)
strengthFactor.setUnsaturatedShearStrengthAngleFactor(3.9)
model.close()
Code Snippet: Model Manipulation
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.interpreter.RS2Interpreter import RS2Interpreter
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
bolt = model.getAllBoltProperties()[0]
liner = model.getAllLinerProperties()[0]
joint = model.getAllJointProperties()[0]
bolt.setBoltType(BoltTypes.SWELLEX)
liner.setLinerType(LinerTypes.REINFORCED_CONCRETE)
joint.setSlipCriterion(JointTypes.MATERIAL_DEPENDENT)
model.save()
model.compute()
model.close()
interpreter = RS2Interpreter()
interpreterModel = interpreter.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
interpreterModel.save()
interpreterModel.close()
Code Snippet: Modeler Scripting Functionality
from rs2.modeler.RS2Modeler import RS2Modeler
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
model.close()
Code Snippet: Get Model Mesh Results
from rs2.interpreter.RS2Interpreter import RS2Interpreter
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.interpreter.InterpreterEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
interpreter = RS2Interpreter()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
model.compute()
interpretModel = interpreter.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
interpretModel.SetResultType(ExportResultType.SOLID_EFFECTIVE_STRESS_EFFECTIVE_SIGMA_Z)
exportResult = interpretModel.GetMeshResults()
# Extracting results for specific vertex index
x_coord = exportResult.getXCoordinate(0)
y_coord = exportResult.getYCoordinate(0)
value = exportResult.getValue(0)
print(f"Vertex 0 : (x-coord, y-coord, result type value) = ({x_coord, y_coord, value})")
model.close()
interpretModel.close()
Code Snippet: Manipulation of History Query and its results
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.interpreter.RS2Interpreter import RS2Interpreter
from rs2.interpreter.InterpreterEnums import *
from rs2.interpreter.InterpreterGraphEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
interpreter = RS2Interpreter()
modelPath = rf"{current_dir}\example_models\ExampleModel.fez"
modeler_model = modeler.openFile(modelPath)
modeler_model.AddHistoryQueryPoint(history_query_name="Testing Point 1", x=-3.1, y=2.8)
modeler_model.RemoveHistoryQueryPoint("HQ 1")
interpreter_model = interpreter.openFile(modelPath)
results = interpreter_model.GetHistoryQueryResults(hq_name="HQ 2",
horizontal_axis=HistoryQueryGraphEnums.HorizontalAxisTypes.TIME,
vertical_axis=HistoryQueryGraphEnums.VerticalAxisTypes.EFFECTIVE_STRESS_YY,
stages=[1, 2])
stage_number = 1
results_for_stage_1 = results[stage_number]
for data in results_for_stage_1:
x_coord = data.GetXCoordinate()
y_coord = data.GetYCoordinate()
horizontal_result = data.GetHorizontalAxisResult()
vertical_result = data.GetVerticalAxisResult()
modeler_model.close()
interpreter_model.close()
Code Snippet: Manipulation of Material Queries
from rs2.interpreter.RS2Interpreter import RS2Interpreter
from rs2.interpreter.InterpreterEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
interpreter = RS2Interpreter()
model = interpreter.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
pointID = model.AddMaterialQuery(points=[[3.3, -2.2]])
points_making_line = [[4.5, 4.5], [-2.5, 4.5], [-2.5, 2.5], [-6, 2.5]]
lineID = model.AddMaterialQuery(points=points_making_line)
model.RemoveMaterialQuery([pointID])
model.SetActiveStage(2)
results = model.GetMaterialQueryResults()
for mat_query_data in results:
unique_ID = mat_query_data.GetUniqueIdentifier()
material_ID = mat_query_data.GetMaterialID()
print(f"Query Unique ID = {unique_ID}, MaterialID = {material_ID}")
print("----------------")
query_results = mat_query_data.GetAllValues()
for result in query_results:
x = result.GetXCoordinate()
y = result.GetYCoordinate()
distance = result.GetDistance()
value = result.GetValue()
print(f"X-Coord ={x}, Y-Coordinate = {y}, Distance = {distance}, Result Type Node Value = {value}")
model.close()
Code Snippet: Manipulation of Material Joint Properties
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.modeler.properties.PropertyEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\ExampleModel.fez")
material = model.getAllMaterialProperties()[0]
material.Strength.setFailureCriterion(StrengthCriteriaTypes.JOINTED_MOHR_COULOMB)
jointOptions = material.Strength.JointedMohrCoulomb.getJointOptions()
jointOptions.setNumberOfJoints(2)
jointOptions.setTracePlaneProperties(1, 20.1, 2.2, 3.4)
joint = jointOptions.getJoint(1)
joint.setSlipCriterion(JointTypes.BARTON_BANDIS)
joint.BartonBandisMaterial.setDilationAngle(30)
joint.BartonBandisMaterial.setJCS(2.2)
model.close()
Code Snippet: Manipulation of Time Query and its results
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.interpreter.RS2Interpreter import RS2Interpreter
from rs2.interpreter.InterpreterGraphEnums import *
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
modeler = RS2Modeler()
filePath = rf"{current_dir}\example_models\DynamicModel.fez"
model = modeler.openFile(filePath)
points1 = [[5, -4.5], [5, 0]]
points2 = [[-5, 2], [11, 2]]
points_on_line = 8
lineID_1 = model.AddTimeQueryLine(points1, points_on_line)
lineID_2 = model.AddTimeQueryLine(points2, points_on_line)
model.RemoveTimeQueryLine([lineID_1])
pointID_1 = model.AddTimeQueryPoint(x=4.5, y=2.7)
pointID_2 = model.AddTimeQueryPoint(x=9, y=-2)
model.RemoveTimeQueryPoint([pointID_1])
model.save()
model.compute()
interpreter = RS2Interpreter()
interpreter_model = interpreter.openFile(filePath)
result = interpreter_model.GetAllTimeQueryPointResults(
stages=[1, 2, 3, 4],
vertical_axis=TimeQueryGraphEnums.VerticalAxisTypes.EFFECTIVE_STRESS_XY)
for stageNumber, stageData in result.items():
print(f"\nStage {stageNumber} Time Query Points Data")
for time_query_point_data in stageData:
uniqueIdentifier = time_query_point_data.GetUniqueIdentifier()
all_node_values = time_query_point_data.GetAllValues()
for node_val in all_node_values:
x_coord = node_val.GetXCoordinate()
y_coord = node_val.GetYCoordinate()
stage_time = node_val.GetStageTime()
value = node_val.GetValue()
print(f"UniqueID = {uniqueIdentifier}, X-Coord = {x_coord}, Y-Coord = {y_coord}, Dynamic Stage Time = {stage_time}, Value = {value}\n")
print("-----------------------")
print(f"\nEnd of Stage {stageNumber} Data\n")
print("\n Time Query Line Results")
line_results = interpreter_model.GetAllTimeQueryLinesResults(
stages=[1, 2, 3, 4],
vertical_axis=TimeQueryGraphEnums.VerticalAxisTypes.EFFECTIVE_STRESS_XY,
apply_post_process_scaling=True
)
for stageNumber, stageData in line_results.items():
print(f"\nStage {stageNumber} Time Query Line Data\n")
for time_query_line_data in stageData:
uniqueIdentifier = time_query_line_data.GetUniqueIdentifier()
print(f"Unique Identifier for Line Query = {uniqueIdentifier} with data as follows:\n")
all_node_obj = time_query_line_data.GetAllNodeObjects()
for node_obj in all_node_obj:
all_node_values = node_obj.GetNodeValues()
for node_val in all_node_values:
x_coord = node_val.GetXCoordinate()
y_coord = node_val.GetYCoordinate()
stage_time = node_val.GetStageTime()
value = node_val.GetValue()
print(f"X-Coord = {x_coord}, Y-Coord = {y_coord}, Dynamic Stage Time = {stage_time}, Value = {value}")
print()
print("\nEnd of Line Data\n")
print("-----------------------")
print(f"\nEnd of Stage {stageNumber} Data\n")
model.RemoveTimeQueryPoint([pointID_2])
model.RemoveTimeQueryLine([lineID_2])
model.save()
model.close()
interpreter_model.close()
Code Snippet: Get Support Bolt Results
from rs2.interpreter.RS2Interpreter import RS2Interpreter
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
interpreter = RS2Interpreter()
model = interpreter.openFile(rf"{current_dir}\example_models\SupportResults.fez")
stages = [1, 2]
results = model.GetBoltResults(stages)
for stageNum, allBoltResults in results.items():
print(f"Stage {stageNum} Bolt Results")
for singleBoltResult in allBoltResults:
boltID = singleBoltResult.entity_id
start_x = singleBoltResult.start_x
start_y = singleBoltResult.start_y
end_x = singleBoltResult.end_x
end_y = singleBoltResult.end_y
print(f"\tBolt Unique ID = {boltID}, \n\tStart X-Coord = {start_x}, \n\tStart Y-Coord = {start_y}, End X-Coord = {end_x}, End Y-Coord = {end_y}")
yieldingResults = singleBoltResult.yielding_results
print("\tBolt Yielding Results:")
for boltYieldData in yieldingResults:
start_x = boltYieldData.start_x
start_y = boltYieldData.start_y
end_x = boltYieldData.end_x
end_y = boltYieldData.end_y
yieldingStatus = boltYieldData.yielding_flag
print(f"\t\tYielded Start X-Coord = {start_x}, Yielded Start Y-Coord = {start_y}, Yielded End X-Coord = {end_x}, Yielded End Y-Coord = {end_y}")
print(f"\t\tYielded Status = {yieldingStatus}")
print("\tForce Displacement Results:")
forceDisplacementResults = singleBoltResult.force_displacement_results
for dispResult in forceDisplacementResults:
loc_x = dispResult.location_x
loc_y = dispResult.location_y
dist = dispResult.distance
axial_force = dispResult.axial_force
axial_stress = dispResult.axial_stress
shear_force = dispResult.shear_force
rock_disp = dispResult.rock_displacement
bolt_disp = dispResult.bolt_displacement
print(f"\t\tLocation X = {loc_x}, Location Y = {loc_y}, Distance = {dist}, Axial Force = {axial_force}, Axial Stress = {axial_stress}")
print(f"\t\tShear Force = {shear_force}, Rock Displacement = {rock_disp}, Bolt Displacement = {bolt_disp}\n")
model.close()
Code Snippet: Get Support Joint Results
from rs2.interpreter.RS2Interpreter import RS2Interpreter
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
interpreter = RS2Interpreter()
model = interpreter.openFile(rf"{current_dir}\example_models\SupportResults.fez")
stages = [1, 2]
results = model.GetJointResults(stages)
for stageNum, allJointResults in results.items():
print(f"Stage {stageNum} Joint Results\n")
for singleJointResult in allJointResults:
jointID = singleJointResult.entity_id
print(f"\tJoint Unique ID = {jointID}")
joint_element_results = singleJointResult.joint_element_results
print("\tJoint Element Results:\n")
for jointResult in joint_element_results:
start_x = jointResult.start_x
start_y = jointResult.start_y
end_x = jointResult.end_x
end_y = jointResult.end_y
distance = jointResult.distance
normal_stress = jointResult.normal_stress
shear_stress = jointResult.shear_stress
confining_stress = jointResult.confining_stress
normal_displacement = jointResult.normal_displacement
shear_displacement = jointResult.shear_displacement
yieldedStatus = jointResult.yielded
print(f"\tStart X-Coord = {start_x}, Start Y-Coord = {start_y}, End X-Coord = {end_x}, End Y-Coord = {end_y}")
print(f"\tDistance = {distance}, Normal Stress = {normal_stress}, Shear Stress = {shear_stress}, Confining Stress = {confining_stress}")
print(f"\tNormal Displacement = {normal_displacement}, Shear Displacement = {shear_displacement}, Yielded = {yieldedStatus}\n")
model.close()
Code Snippet: Get Support Liner Results
from rs2.interpreter.RS2Interpreter import RS2Interpreter
import os, inspect
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
interpreter = RS2Interpreter()
model = interpreter.openFile(rf"{current_dir}\example_models\SupportResults.fez")
stages = [1, 2]
results = model.GetLinerResults(stages)
for stageNum, allLinerResults in results.items():
print(f"Stage {stageNum} Liner Results\n")
for singleLinerResult in allLinerResults:
linerID = singleLinerResult.entity_id
print(f"\tLiner Unique ID = {linerID}")
liner_element_results = singleLinerResult.liner_element_results
print("\tLiner Element Results:\n")
for linerResult in liner_element_results:
composite_layer = linerResult.composite_layer
node_start = linerResult.node_start
node_end = linerResult.node_end
start_x = linerResult.start_x
start_y = linerResult.start_y
end_x = linerResult.end_x
end_y = linerResult.end_y
distance = linerResult.distance
axial_force = linerResult.axial_force
moment1 = linerResult.moment1
moment_mid = linerResult.moment_mid
moment2 = linerResult.moment2
shear_force = linerResult.shear_force
displacement_total = linerResult.displacement_total
displacemet_x = linerResult.displacement_x
displacement_y = linerResult.displacement_y
axi_sym_force = linerResult.axi_sym_force
axi_sym_moment = linerResult.axi_sym_moment
beam_yield = linerResult.beam_yield
temperature = linerResult.temperature
print(f"\tComposite Layer = {composite_layer}, Node Start = {node_start}, Node End = {node_end}")
print(f"\tStart X-Coord = {start_x}, Start Y-Coord = {start_y}, End X-Coord = {end_x}, End Y-Coord = {end_y}")
print(f"\tDistance = {distance}, Axial Force = {axial_force}, Moment 1 = {moment1}")
print(f"\tMoment-Mid = {moment_mid}, Moment 2 = {moment2}, Shear Force = {shear_force}")
print(f"\tDisplacement Total = {displacement_total}, Displacement X = {displacemet_x}, Displacement Y = {displacement_y}")
print(f"\tAxial Symmetry Force = {axi_sym_force}, Axial Symmetry Moment = {axi_sym_moment}")
print(f"\tBeam Yield = {beam_yield}, Temperature = {temperature}\n")
model.close()
Code Snippet: Get Support Pile Results
from rs2.interpreter.RS2Interpreter import RS2Interpreter
import os, inspect
def OutputJointResult(singleJointResult):
jointID = singleJointResult.entity_id
print(f"\t\tJoint Unique ID = {jointID}")
joint_element_results = singleJointResult.joint_element_results
print("\t\tJoint Element Results:\n")
for jointResult in joint_element_results:
start_x = jointResult.start_x
start_y = jointResult.start_y
end_x = jointResult.end_x
end_y = jointResult.end_y
distance = jointResult.distance
normal_stress = jointResult.normal_stress
shear_stress = jointResult.shear_stress
confining_stress = jointResult.confining_stress
normal_displacement = jointResult.normal_displacement
shear_displacement = jointResult.shear_displacement
yieldedStatus = jointResult.yielded
print(f"\t\tStart X-Coord = {start_x}, Start Y-Coord = {start_y}, End X-Coord = {end_x}, End Y-Coord = {end_y}")
print(f"\t\tDistance = {distance}, Normal Stress = {normal_stress}, Shear Stress = {shear_stress}, Confining Stress = {confining_stress}")
print(f"\t\tNormal Displacement = {normal_displacement}, Shear Displacement = {shear_displacement}, Yielded = {yieldedStatus}\n")
def OutputLinerResult(singleLinerResult):
linerID = singleLinerResult.entity_id
print(f"\t\tLiner Unique ID = {linerID}")
liner_element_results = singleLinerResult.liner_element_results
print("\t\tLiner Element Results:\n")
for linerResult in liner_element_results:
composite_layer = linerResult.composite_layer
node_start = linerResult.node_start
node_end = linerResult.node_end
start_x = linerResult.start_x
start_y = linerResult.start_y
end_x = linerResult.end_x
end_y = linerResult.end_y
distance = linerResult.distance
axial_force = linerResult.axial_force
moment1 = linerResult.moment1
moment_mid = linerResult.moment_mid
moment2 = linerResult.moment2
shear_force = linerResult.shear_force
displacement_total = linerResult.displacement_total
displacemet_x = linerResult.displacement_x
displacement_y = linerResult.displacement_y
axi_sym_force = linerResult.axi_sym_force
axi_sym_moment = linerResult.axi_sym_moment
beam_yield = linerResult.beam_yield
temperature = linerResult.temperature
print(f"\t\tComposite Layer = {composite_layer}, Node Start = {node_start}, Node End = {node_end}")
print(f"\t\tStart X-Coord = {start_x}, Start Y-Coord = {start_y}, End X-Coord = {end_x}, End Y-Coord = {end_y}")
print(f"\t\tDistance = {distance}, Axial Force = {axial_force}, Moment 1 = {moment1}")
print(f"\t\tMoment-Mid = {moment_mid}, Moment 2 = {moment2}, Shear Force = {shear_force}")
print(f"\t\tDisplacement Total = {displacement_total}, Displacement X = {displacemet_x}, Displacement Y = {displacement_y}")
print(f"\t\tAxial Symmetry Force = {axi_sym_force}, Axial Symmetry Moment = {axi_sym_moment}")
print(f"\t\tBeam Yield = {beam_yield}, Temperature = {temperature}\n")
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
interpreter = RS2Interpreter()
model = interpreter.openFile(rf"{current_dir}\example_models\SupportResults.fez")
stages = [1, 2]
results = model.GetPileResults(stages)
for stageNum, allPileResults in results.items():
print(f"Stage {stageNum} Pile Results\n")
for singlePileResult in allPileResults:
pileID = singlePileResult.entity_id
print(f"\tPile Unique ID = {pileID}")
joint_result = singlePileResult.joint_result
print(f"\tJoint Result for Pile with ID {pileID}:\n")
OutputJointResult(joint_result)
liner_result = singlePileResult.liner_result
print(f"\tLiner Result for Pile with ID {pileID}:\n")
OutputLinerResult(liner_result)
model.close()
Code Snippet: Get Support Composite Results
from rs2.interpreter.RS2Interpreter import RS2Interpreter
import os, inspect
def OutputJointResult(singleJointResult):
jointID = singleJointResult.entity_id
print(f"\t\tJoint Unique ID = {jointID}")
joint_element_results = singleJointResult.joint_element_results
print("\t\tJoint Element Results:\n")
for jointResult in joint_element_results:
start_x = jointResult.start_x
start_y = jointResult.start_y
end_x = jointResult.end_x
end_y = jointResult.end_y
distance = jointResult.distance
normal_stress = jointResult.normal_stress
shear_stress = jointResult.shear_stress
confining_stress = jointResult.confining_stress
normal_displacement = jointResult.normal_displacement
shear_displacement = jointResult.shear_displacement
yieldedStatus = jointResult.yielded
print(f"\t\tStart X-Coord = {start_x}, Start Y-Coord = {start_y}, End X-Coord = {end_x}, End Y-Coord = {end_y}")
print(f"\t\tDistance = {distance}, Normal Stress = {normal_stress}, Shear Stress = {shear_stress}, Confining Stress = {confining_stress}")
print(f"\t\tNormal Displacement = {normal_displacement}, Shear Displacement = {shear_displacement}, Yielded = {yieldedStatus}\n")
def OutputLinerResult(singleLinerResult):
linerID = singleLinerResult.entity_id
print(f"\t\tLiner Unique ID = {linerID}")
liner_element_results = singleLinerResult.liner_element_results
print("\t\tLiner Element Results:\n")
for linerResult in liner_element_results:
composite_layer = linerResult.composite_layer
node_start = linerResult.node_start
node_end = linerResult.node_end
start_x = linerResult.start_x
start_y = linerResult.start_y
end_x = linerResult.end_x
end_y = linerResult.end_y
distance = linerResult.distance
axial_force = linerResult.axial_force
moment1 = linerResult.moment1
moment_mid = linerResult.moment_mid
moment2 = linerResult.moment2
shear_force = linerResult.shear_force
displacement_total = linerResult.displacement_total
displacemet_x = linerResult.displacement_x
displacement_y = linerResult.displacement_y
axi_sym_force = linerResult.axi_sym_force
axi_sym_moment = linerResult.axi_sym_moment
beam_yield = linerResult.beam_yield
temperature = linerResult.temperature
print(f"\t\tComposite Layer = {composite_layer}, Node Start = {node_start}, Node End = {node_end}")
print(f"\t\tStart X-Coord = {start_x}, Start Y-Coord = {start_y}, End X-Coord = {end_x}, End Y-Coord = {end_y}")
print(f"\t\tDistance = {distance}, Axial Force = {axial_force}, Moment 1 = {moment1}")
print(f"\t\tMoment-Mid = {moment_mid}, Moment 2 = {moment2}, Shear Force = {shear_force}")
print(f"\t\tDisplacement Total = {displacement_total}, Displacement X = {displacemet_x}, Displacement Y = {displacement_y}")
print(f"\t\tAxial Symmetry Force = {axi_sym_force}, Axial Symmetry Moment = {axi_sym_moment}")
print(f"\t\tBeam Yield = {beam_yield}, Temperature = {temperature}\n")
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
interpreter = RS2Interpreter()
model = interpreter.openFile(rf"{current_dir}\example_models\SupportResults.fez")
stages = [1, 2]
results = model.GetCompositeResults(stages)
for stageNum, allCompositeResults in results.items():
print(f"Stage {stageNum} Composite Results\n")
for singleCompositeResult in allCompositeResults:
compositeID = singleCompositeResult.entity_id
print(f"\Composite Unique ID = {compositeID}")
joint_result = singleCompositeResult.joint_result
print(f"\tJoint Result for Composite with ID {compositeID}:\n")
OutputJointResult(joint_result)
liner_result = singleCompositeResult.liner_result
print(f"\tLiner Result for Composite with ID {compositeID}:\n")
OutputLinerResult(liner_result)
model.close()
Code Snippet: Get Support Structural Results
from rs2.interpreter.RS2Interpreter import RS2Interpreter
import os, inspect
def OutputJointResult(singleJointResult):
jointID = singleJointResult.entity_id
print(f"\t\tJoint Unique ID = {jointID}")
joint_element_results = singleJointResult.joint_element_results
print("\t\tJoint Element Results:\n")
for jointResult in joint_element_results:
start_x = jointResult.start_x
start_y = jointResult.start_y
end_x = jointResult.end_x
end_y = jointResult.end_y
distance = jointResult.distance
normal_stress = jointResult.normal_stress
shear_stress = jointResult.shear_stress
confining_stress = jointResult.confining_stress
normal_displacement = jointResult.normal_displacement
shear_displacement = jointResult.shear_displacement
yieldedStatus = jointResult.yielded
print(f"\t\tStart X-Coord = {start_x}, Start Y-Coord = {start_y}, End X-Coord = {end_x}, End Y-Coord = {end_y}")
print(f"\t\tDistance = {distance}, Normal Stress = {normal_stress}, Shear Stress = {shear_stress}, Confining Stress = {confining_stress}")
print(f"\t\tNormal Displacement = {normal_displacement}, Shear Displacement = {shear_displacement}, Yielded = {yieldedStatus}\n")
def OutputLinerResult(singleLinerResult):
linerID = singleLinerResult.entity_id
print(f"\t\tLiner Unique ID = {linerID}")
liner_element_results = singleLinerResult.liner_element_results
print("\t\tLiner Element Results:\n")
for linerResult in liner_element_results:
composite_layer = linerResult.composite_layer
node_start = linerResult.node_start
node_end = linerResult.node_end
start_x = linerResult.start_x
start_y = linerResult.start_y
end_x = linerResult.end_x
end_y = linerResult.end_y
distance = linerResult.distance
axial_force = linerResult.axial_force
moment1 = linerResult.moment1
moment_mid = linerResult.moment_mid
moment2 = linerResult.moment2
shear_force = linerResult.shear_force
displacement_total = linerResult.displacement_total
displacemet_x = linerResult.displacement_x
displacement_y = linerResult.displacement_y
axi_sym_force = linerResult.axi_sym_force
axi_sym_moment = linerResult.axi_sym_moment
beam_yield = linerResult.beam_yield
temperature = linerResult.temperature
print(f"\t\tComposite Layer = {composite_layer}, Node Start = {node_start}, Node End = {node_end}")
print(f"\t\tStart X-Coord = {start_x}, Start Y-Coord = {start_y}, End X-Coord = {end_x}, End Y-Coord = {end_y}")
print(f"\t\tDistance = {distance}, Axial Force = {axial_force}, Moment 1 = {moment1}")
print(f"\t\tMoment-Mid = {moment_mid}, Moment 2 = {moment2}, Shear Force = {shear_force}")
print(f"\t\tDisplacement Total = {displacement_total}, Displacement X = {displacemet_x}, Displacement Y = {displacement_y}")
print(f"\t\tAxial Symmetry Force = {axi_sym_force}, Axial Symmetry Moment = {axi_sym_moment}")
print(f"\t\tBeam Yield = {beam_yield}, Temperature = {temperature}\n")
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
interpreter = RS2Interpreter()
model = interpreter.openFile(rf"{current_dir}\example_models\SupportStructuralResults.fez")
stages = [1, 2]
results = model.GetStructuralResults(stages)
for stageNum, allStructuralResults in results.items():
print(f"Stage {stageNum} Structural Results\n")
for singleStructuralResult in allStructuralResults:
structuralID = singleStructuralResult.entity_id
print(f"\Structural Unique ID = {structuralID}")
joint_result = singleStructuralResult.joint_result
print(f"\tJoint Result for Structural with ID {structuralID}:\n")
OutputJointResult(joint_result)
liner_result = singleStructuralResult.liner_result
print(f"\tLiner Result for Structural with ID {structuralID}:\n")
OutputLinerResult(liner_result)
model.close()
Code Snippet: Get Model Units
from rs2.modeler.RS2Modeler import RS2Modeler
from rs2.interpreter.RS2Interpreter import RS2Interpreter
import os, inspect
from pprint import pprint
current_dir = os.path.dirname(os.path.abspath(inspect.getfile(lambda: None)))
interpreter = RS2Interpreter()
interpreterModel = interpreter.openFile(rf"{current_dir}\example_models\SupportResults.fez")
interpreterModelUnits = interpreterModel.getUnits()
print("\nInterpreter Model Units")
print("\nSolid Units :")
pprint(interpreterModelUnits.solid_units)
print("\nHydro Units :")
pprint(interpreterModelUnits.hydro_units)
print("\nThermal Units :")
pprint(interpreterModelUnits.thermal_units)
modeler = RS2Modeler()
model = modeler.openFile(rf"{current_dir}\example_models\SupportStructuralResults.fez")
modelerUnits = model.getUnits()
print("\nModeler Units")
print("\nSolid Units :")
pprint(modelerUnits.solid_units)
print("\nHydro Units :")
pprint(modelerUnits.hydro_units)
print("\nThermal Units :")
pprint(modelerUnits.thermal_units)
model.ResetProperties()
model.close()
interpreterModel.close()