Material Testing Commands

The material testing environment is separate from the OpenSees domain, and allows for simple tests to be performed on OpenSees materials, including uniaxial materials, n-dimensional materials, and section force-deformation relationships. In order to use the material testing commands, the test material/section must first be specified with testUniaxialMaterial, testNDMaterial, or testSection.

testUniaxialMaterial $matTag

Argument

Type

Description

$matTag

integer

unique uniaxial material tag.

testNDMaterial $matTag

Argument

Type

Description

$matTag

integer

unique n-dimensional material tag.

testSection $secTag

Argument

Type

Description

$secTag

integer

unique section tag.

Once the test material is specified with either testUniaxialMaterial, testNDMaterial, or testSection, the strain or deformation values can be set with the setStrain command. This command sets and commits the strains/deformations to the material/section.

setStrain[ndf, strains]()

Argument

Type

Description

$strains

list float

ndf input strains

Alternatively, the trial strain or deformation values can be set with the setTrialStrain command and then later committed with the commitStrain command.

setTrialStrain[ndf, strains]()

Argument

Type

Description

$strains

list float

ndf input strains (trial)

commitStrain()

Once the material/section strains/deformations are set, information about the state of the material/section can be queried with the commands getStrain, getStress, getTangent and getDampTangent, and getResponse.

The command getStrain simply returns the list of strain/deformation values inputted with setStrain or setTrialStrain.

getStrain()

The command getStress returns a list of stress/force values corresponding to the inputted strain/deformations.

getStress()

The command getTangent returns the tangent values corresponding to each stress/strain or force/deformation relationship. For uniaxial materials and uniaxial sections, getTangent simply returns a single value. For n-dimensional materials and non-uniaxial sections, getTangent returns the flattened (row-major) tangent matrix.

getTangent()

The command getDampTangent returns the damping tangent (for uniaxial materials only).

getDampTangent()

The command getResponse returns material or section specific information.

getResponse $arg1 $arg2 ....

Argument

Type

Description

$args

list

list of the arguments for the material/section response

NDTest Commands for Direct Material Testing

For more advanced and direct testing of nDMaterial objects, OpenSees provides the NDTest Command which offers additional functionality beyond the basic material testing environment.

The NDTest command provides comprehensive testing capabilities including:

  • Direct strain control with NDTest SetStrain

  • State management with NDTest CommitState

  • Parameter updates during runtime

  • Enhanced response queries

  • Real-time material state inspection

Key differences between the basic material testing environment and NDTest:

  • Basic Testing: Uses testNDMaterial with setStrain/getStress commands

  • NDTest: Uses NDTest with more extensive command set and real-time parameter updates

For complete documentation of NDTest commands, see NDTest.

Example comparing both approaches:

TCL:

# Basic testing approach
testNDMaterial 1
setStrain 0.001 0.0 0.0 0.0 0.0 0.0
set stress [getStress]

# NDTest approach
NDTest SetStrain 1 0.001 0.0 0.0 0.0 0.0 0.0
set stress [NDTest GetStress 1]
NDTest CommitState 1
# Additional capabilities:
set tangent [NDTest GetTangentStiffness 1]
NDTest UpdateDoubleParameter 1 1 2.1e-5

Python:

# Basic testing approach
op.testNDMaterial(1)
op.setStrain(0.001, 0.0, 0.0, 0.0, 0.0, 0.0)
stress = op.getStress()

# NDTest approach
op.NDTest("SetStrain", 1, 0.001, 0.0, 0.0, 0.0, 0.0, 0.0)
stress = op.NDTest("GetStress", 1)
op.NDTest("CommitState", 1)
# Additional capabilities:
tangent = op.NDTest("GetTangentStiffness", 1)
op.NDTest("UpdateDoubleParameter", 1, 1, 2.1e-5)