Automatic documentation
Table of contents on this page
Test
PDBenchmark.PDTest — TypePDTestAn abstract type for tests. It is used to pass tests to the run function.
PDBenchmark.TParam — TypeTParamA type for test parameters. It is used to pass parameters to the test functions.
PDBenchmark.TParam — MethodTParam(name::Union{Function, Type}; args=(), kwargs=Dict())Create a TParam object.
Arguments
name::Union{Function, Type}: The name of the parameter.
Keyword Arguments
args::Tuple: The arguments of the parameter.kwargs::Dict: The keyword arguments of the parameter.
PDBenchmark.Test — TypeTest <: PDTestAn abstract type for tests. It is used to pass tests to the run function.
Fields
solver: The solver to be used.geom: The geometry of the blocks.gen_material: The material of the blocks.spc_material: The special material of the blocks.bc: The boundary conditions of the blocks.RM: The contact models of the blocks.f: The post environment function.dt: The time step.steps: The number of steps.blocknames: The names of the blocks.testname: The name of the test.info: The information of the test.cprint: The function to be used for printing.units: Whether to use units.
PDBenchmark.Test — MethodTest(args...; dt=1.0, steps=1000,
names=nothing,
testname="Test ABC",
info="",
cprint=(x)-> nothing,
units=true
)Create a Test object.
Arguments
args...: The arguments of the test.
Keyword Arguments
dt::Float64: The time step.steps::Int: The number of steps.names::Union{Nothing, Vector{String}}: The names of the blocks.testname::String: The name of the test.info::String: The information of the test.cprint::Function: The function to be used for printing.units::Bool: Whether to use units.
PDBenchmark.realize — Methodrealize(m::TParam, module_::Module)Realizes the parameter m by calling getproperty(module_, m.name)(m.args...; m.kwargs...).
Arguments
m::TParam: The parameter to be realized.module_::Module: The module in which the function is defined.
Returns
- The return value of the
m.
PDBenchmark.realize — Methodrealize(m::TParam, args...; kwargs...)Realizes the parameter m by calling m.name(args..., m.args...; kwargs..., m.kwargs...).
Arguments
m::TParam: The parameter to be realized.args...: The arguments to be passed to the function.
Keyword Arguments
kwargs...: The keyword arguments to be passed to the function.
Returns
- The return value of the
m.
PDBenchmark.realize — Methodrealize(m::TParam)Realizes the parameter m by calling m.name(m.args...; m.kwargs...).
Arguments
m::TParam: The parameter to be realized.
PDBenchmark.run! — Methodrun!(test::Test; append_date=false, pseudorun=false, kwargs...)Runs the test test and returns the environment env after the simulation.
Arguments
test::Test: The test to be run.append_date::Bool=false: If true, the date will be appended to the output directory.pseudorun::Bool=false: If true, the simulation will not be run.kwargs...: Keyword arguments to be passed toPeriDyn.run!function.
steps: Int64, the number of steps to run. Default is 100.filewrite_freq: Int64, the frequency of writing data files to disk. Default is 10.neigh_update_freq: Int64, the frequency of updating neighbors. Default is 1.average_prop_freq: Int64, the frequency of calculating average properties. Default is 1.out_dir: String, the directory where the data files are saved. Default is "datafile".start_at: Int64, the starting step. Default is 0.write_from: Int, the starting index of the data files. Default is 0.ext: Symbol, the extension of the data files. Default is :jld.max_part: Int, the maximum number of particles in a neighborhood. Default is 30.
Returns
env::Env: The environment after the simulation.
PDBenchmark.stage! — Methodstage!(test::Test)Stage the test for running.
Arguments
test::Test: The test to be staged.
Returns
env::Environment: The environment of the test.solver::Solver: The solver of the test.func::Function: The run function of the test.
Tensile
PDBenchmark.TensileBar — MethodTensileBar(args...; testname="Tensile Test Bar", kwargs...)It is a test for uniaxial deformation.
Arguments
args...: The arguments of the test. The arguments are passed to theTensileTestfunction.
Keyword Arguments
testname::String: The name of the test.kwargs...: The keyword arguments of the test. The keyword arguments are passed to theTensileTestfunction.specimenis set to:barby default.
Returns
- The return value of the
TensileTestfunction.
PDBenchmark.TensileNotchedBar — MethodTensileNotchedBar(args...; testname="Tensile Test Notched Bar", kwargs...)It is a test for uniaxial deformation.
Arguments
args...: The arguments of the test. The arguments are passed to theTensileBarfunction.
Keyword Arguments
testname::String: The name of the test.kwargs...: The keyword arguments of the test. The keyword arguments are passed to theTensileBarfunction.notchedis set totrueby default.
Returns
- The return value of the
TensileBarfunction.
PDBenchmark.TensileRod — MethodTensileRod(args...; testname="Tensile Test Rod", kwargs...)It is a test for uniaxial deformation.
Arguments
args...: The arguments of the test. The arguments are passed to theTensileTestfunction.
Keyword Arguments
kwargs...: The keyword arguments of the test. The keyword arguments are passed to theTensileTestfunction.specimenis set to:rodby default.
Returns
- The return value of the
TensileTestfunction.
PDBenchmark.TensileTest — MethodTensileTest(args...; max_strain=0.05, testname="Tensile Test", kwargs...)It is a test for uniaxial deformation.
Arguments
args...: The arguments of the test. The arguments are passed to theUniaxialDeformationTestfunction.
Keyword Arguments
testname::String: The name of the test.max_strain::Float64: The maximum strain of the test. If it is negative, the absolute value of it is used.kwargs...: The keyword arguments of the test. The keyword arguments are passed to theUniaxialDeformationTestfunction.
Returns
- The return value of the
UniaxialDeformationTestfunction.
PDBenchmark.UniaxialDeformationTest — MethodUniaxialDeformationTest(; gen_mat=nothing, spc_mat=nothing, dt=1.0,
max_strain=0.05,
resolution=0.1,
rand_=0.05,
solver=PeriDyn.DSVelocityVerlet(),
steps=10000,
notched=false,
effective_length = 12.0,
specimen=:bar,
testname="Tensile Test")It is a test for uniaxial deformation. The test is performed by applying a displacement on both ends of the specimen. The specimen is a bar by default.
Keyword Arguments
gen_mat: The general material of the specimen.spc_mat: The specific material of the specimen.dt: The time step of the simulation.max_strain::Float64: The maximum strain of the specimen.resolution: The resolution of the specimen.rand_: The random factor of the specimen.solver: The solver.steps: The number of steps.notched: Whether the specimen is notched.effective_length: The effective length of the specimen.specimen: The type of the specimen. It can be:bar,:rodor:cylinder.testname: The name of the test.
Returns
test: The test.
Flexure
PDBenchmark.BeamBendingTest — Methodfunction BeamBendingTest(; gen_mat=nothing, spc_mat=nothing, resolution=0.1,
solver=DSVelocityVerlet(), dt=1.0, steps=1000,
notched=false, _4point=false, testname="Beam Bending Test")It is a test for beam bending. The test is performed by applying a point load on the top of the specimen. The specimen is a beam. Both ends of the beam are supported by a pin support.
Keyword Arguments
gen_mat: The general material of the specimen.spc_mat: The specific material of the specimen.resolution: The resolution of the specimen.solver: The solver of the simulation.dt: The time step of the simulation.steps: The number of steps of the simulation.notched: Whether the specimen is notched._4point: Whether the specimen is a 4 point beam bending test.testname: The name of the test.
PDBenchmark._3PointBeamBendingTest — Method_3PointBeamBendingTest(args...; testname="3 Point Beam Bending Test", kwargs...)It is a test for beam bending. The test is performed by applying a point load on the top of the specimen. The specimen is a beam. Both ends of the beam are supported by a pin support.
Arguments
args...: The arguments of the test. The arguments are passed to theBeamBendingTestfunction.
Keyword Arguments
testname::String: The name of the test.kwargs...: The keyword arguments of the test. The keyword arguments are passed to theBeamBendingTestfunction._4pointis set tofalseby default.
Returns
- The return value of the
BeamBendingTestfunction.
PDBenchmark._3PointNotchedBeamBendingTest — Method_3PointNotchedBeamBendingTest(args...; testname="3 Point Notched Beam Bending Test", kwargs...)It is a test for beam bending. The test is performed by applying a point load on the top of the specimen. The specimen is a beam. Both ends of the beam are supported by a pin support.
Arguments
args...: The arguments of the test. The arguments are passed to the_3PointBeamBendingTestfunction.
Keyword Arguments
testname::String: The name of the test.kwargs...: The keyword arguments of the test. The keyword arguments are passed to the_3PointBeamBendingTestfunction.notchedis set totrueby default.
Returns
- The return value of the
BeamBendingTestfunction.
PDBenchmark._4PointBeamBendingTest — Method_4PointBeamBendingTest(args...; testname="4 Point Beam Bending Test", kwargs...)It is a test for beam bending. The test is performed by applying a point load on the top of the specimen. The specimen is a beam. Both ends of the beam are supported by a pin support.
Arguments
args...: The arguments of the test. The arguments are passed to theBeamBendingTestfunction.
Keyword Arguments
testname::String: The name of the test.kwargs...: The keyword arguments of the test. The keyword arguments are passed to theBeamBendingTestfunction._4pointis set totrueby default.
Returns
- The return value of the
BeamBendingTestfunction.
PDBenchmark._4PointNotchedBeamBendingTest — Method_4PointNotchedBeamBendingTest(args...; testname="4 Point Notched Beam Bending Test", kwargs...)It is a test for beam bending. The test is performed by applying a point load on the top of the specimen. The specimen is a beam. Both ends of the beam are supported by a pin support.
Arguments
args...: The arguments of the test. The arguments are passed to the_4PointBeamBendingTestfunction.
Keyword Arguments
testname::String: The name of the test.kwargs...: The keyword arguments of the test. The keyword arguments are passed to the_4PointBeamBendingTestfunction.notchedis set totrueby default.
Returns
- The return value of the
BeamBendingTestfunction.
Impact
PDBenchmark.PulsePropagationBar — MethodPulsePropagationBar(; gen_mat=nothing,
spc_mat=nothing,
dt = 1.0,
steps=1000,
init_velocity=nothing,
effective_length=20.0,
resolution=0.1,
solver=DSVelocityVerlet(),
testname="PulsePropagationBar Test",
)It is a test for pulse propagation. The test is performed by applying a impact on the right end of the specimen. The impact is applied in the direction of the axis of the specimen. The specimen is a bar.
Keyword Arguments
gen_mat: The general material of the specimen.spc_mat: The specific material of the specimen.dt::Float64: The time step.steps::Int64: The number of steps.init_velocity::Float64: The initial velocity of the impact.effective_length::Float64: The effective length of the specimen.resolution::Float64: The resolution of the specimen.solver::Function: The solver.testname::String: The name of the test.
Indentation
PDBenchmark.IndentationTest — MethodIndentationTest(; gen_mat=nothing, spc_mat=nothing, resolution=1.0,
angle=120.0, sides=3,
solver=DSVelocityVerlet(), dt=1.0, steps=8000, testname="Indentation Test")It is a test for indentation test. The test is performed by applying a displacement to the indentor. The displacement is applied in the direction of the axis of the indentor. The indentor is a triangular pyramid.
Keyword Arguments
gen_mat: The general material.spc_mat: The specific material.resolution::Float64: The resolution of the test.angle::Float64: The angle of the indentor.sides::Int: The number of sides of the indentor.solver::Solver: The solver.dt::Float64: The time step.steps::Int: The number of steps.testname::String: The name of the test.
Predefined geometries
PDBenchmark.PDBGeom — TypePDBGeomAbstract type for PDBGeom objects. A PDBGeom object is a representation of a geometry of an object.
PDMaterialPoints.create — Methodfunction create(geom::PDBGeom; resolution=0.1, rand_=0.05, type=1)Create a PDMaterialPoints object from a PDBGeom object.
Arguments
geom::PDBGeom: a PDBGeom object
Keyword Arguments
resolution::Float64: resolution of the barrand_::Float64: randomization of the bartype::Int: type of the bar
Returns
dict: a dictionary same as the one returned byPDMaterialPoints.create
Bar
PDBenchmark.Bar — TypeBar <: PDBGeomA bar geometry.
Fields
obj::Cuboid: a Cuboid object
PDBenchmark.Bar — MethodBar(;bounds=[0.0 10; 0 2;0 2])Create a Bar object.
Keyword Arguments
bounds::Array{Float64, 2}: bounds of the bar
PDBenchmark.NotchedBar — TypeNotchedBar <: PDBGeomA notched bar geometry.
Fields
obj::Cuboid: a Cuboid objectnotch::Array{Float64, 2}: a 2D array of notches
PDBenchmark.NotchedBar — MethodNotchedBar(;bounds=[0.0 7.0; 0 1;0 1], notch=nothing)Create a NotchedBar object.
Keyword Arguments
bounds::Array{Float64, 2}: bounds of the barnotch::Array{Float64, 2}: a 2D array of notches
PDMaterialPoints.create — Methodfunction create(geom::Bar; resolution=0.1, rand_=0.05, type=1)Create a PDMaterialPoints object from a Bar object.
Arguments
geom::Bar: a Bar object
Keyword Arguments
resolution::Float64: resolution of the barrand_::Float64: randomization of the bartype::Int: type of the bar
Returns
dict: a dictionary same as the one returned byPDMaterialPoints.create
PDMaterialPoints.create — Methodfunction create(geom::NotchedBar; resolution=0.1, rand_=0.05, type=1)Create a PDMaterialPoints object from a NotchedBar object.
Arguments
geom::NotchedBar: a NotchedBar object
Keyword Arguments
resolution::Float64: resolution of the barrand_::Float64: randomization of the bartype::Int: type of the bar
Returns
dict: a dictionary same as the one returned byPDMaterialPoints.create
Standard simulations
Miscellaneous
PDBenchmark.set_device — Methodset_device(x)Set the device to run on.
Arguments
x::Symbol: The device to run on. Can be:cpuor:cuda.
PDBenchmark.set_loglevel — Methodset_loglevel(x)Set the log level.
Arguments
x::Symbol: The log level. Can be:debug,:info,:warn,:error, or:fatal.