Automatic documentation

Table of contents on this page

Test

PDBenchmark.TParamMethod
TParam(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.
source
PDBenchmark.TestType
Test <: PDTest

An 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.
source
PDBenchmark.TestMethod
Test(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.
source
PDBenchmark.realizeMethod
realize(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.
source
PDBenchmark.realizeMethod
realize(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.
source
PDBenchmark.realizeMethod
realize(m::TParam)

Realizes the parameter m by calling m.name(m.args...; m.kwargs...).

Arguments

  • m::TParam: The parameter to be realized.
source
PDBenchmark.run!Method
run!(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 to PeriDyn.run! function.
Keyword Arguments are same as for `PeriDyn.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.
source
PDBenchmark.stage!Method
stage!(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.
source

Tensile

PDBenchmark.TensileBarMethod
TensileBar(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 the TensileTest function.

Keyword Arguments

  • testname::String: The name of the test.
  • kwargs...: The keyword arguments of the test. The keyword arguments are passed to the TensileTest function. specimen is set to :bar by default.

Returns

  • The return value of the TensileTest function.
source
PDBenchmark.TensileNotchedBarMethod
TensileNotchedBar(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 the TensileBar function.

Keyword Arguments

  • testname::String: The name of the test.
  • kwargs...: The keyword arguments of the test. The keyword arguments are passed to the TensileBar function. notched is set to true by default.

Returns

  • The return value of the TensileBar function.
source
PDBenchmark.TensileRodMethod
TensileRod(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 the TensileTest function.

Keyword Arguments

  • kwargs...: The keyword arguments of the test. The keyword arguments are passed to the TensileTest function. specimen is set to :rod by default.

Returns

  • The return value of the TensileTest function.
source
PDBenchmark.TensileTestMethod
TensileTest(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 the UniaxialDeformationTest function.

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 the UniaxialDeformationTest function.

Returns

  • The return value of the UniaxialDeformationTest function.
source
PDBenchmark.UniaxialDeformationTestMethod
UniaxialDeformationTest(; 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, :rod or :cylinder.
  • testname: The name of the test.

Returns

  • test: The test.
source

Flexure

PDBenchmark.BeamBendingTestMethod
function 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.
source
PDBenchmark._3PointBeamBendingTestMethod
_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 the BeamBendingTest function.

Keyword Arguments

  • testname::String: The name of the test.
  • kwargs...: The keyword arguments of the test. The keyword arguments are passed to the BeamBendingTest function. _4point is set to false by default.

Returns

  • The return value of the BeamBendingTest function.
source
PDBenchmark._3PointNotchedBeamBendingTestMethod
_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 _3PointBeamBendingTest function.

Keyword Arguments

  • testname::String: The name of the test.
  • kwargs...: The keyword arguments of the test. The keyword arguments are passed to the _3PointBeamBendingTest function. notched is set to true by default.

Returns

  • The return value of the BeamBendingTest function.
source
PDBenchmark._4PointBeamBendingTestMethod
_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 the BeamBendingTest function.

Keyword Arguments

  • testname::String: The name of the test.
  • kwargs...: The keyword arguments of the test. The keyword arguments are passed to the BeamBendingTest function. _4point is set to true by default.

Returns

  • The return value of the BeamBendingTest function.
source
PDBenchmark._4PointNotchedBeamBendingTestMethod
_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 _4PointBeamBendingTest function.

Keyword Arguments

  • testname::String: The name of the test.
  • kwargs...: The keyword arguments of the test. The keyword arguments are passed to the _4PointBeamBendingTest function. notched is set to true by default.

Returns

  • The return value of the BeamBendingTest function.
source

Impact

PDBenchmark.PulsePropagationBarMethod
PulsePropagationBar(; 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.
source

Indentation

PDBenchmark.IndentationTestMethod
IndentationTest(; 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.
source

Predefined geometries

PDBenchmark.PDBGeomType
PDBGeom

Abstract type for PDBGeom objects. A PDBGeom object is a representation of a geometry of an object.

source
PDMaterialPoints.createMethod
function 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 bar
  • rand_::Float64: randomization of the bar
  • type::Int: type of the bar

Returns

  • dict: a dictionary same as the one returned by PDMaterialPoints.create
source

Bar

PDBenchmark.BarMethod
Bar(;bounds=[0.0 10; 0 2;0 2])

Create a Bar object.

Keyword Arguments

  • bounds::Array{Float64, 2}: bounds of the bar
source
PDBenchmark.NotchedBarType
NotchedBar <: PDBGeom

A notched bar geometry.

Fields

  • obj::Cuboid: a Cuboid object
  • notch::Array{Float64, 2}: a 2D array of notches
source
PDBenchmark.NotchedBarMethod
NotchedBar(;bounds=[0.0 7.0; 0 1;0 1], notch=nothing)

Create a NotchedBar object.

Keyword Arguments

  • bounds::Array{Float64, 2}: bounds of the bar
  • notch::Array{Float64, 2}: a 2D array of notches
source
PDMaterialPoints.createMethod
function 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 bar
  • rand_::Float64: randomization of the bar
  • type::Int: type of the bar

Returns

  • dict: a dictionary same as the one returned by PDMaterialPoints.create
source
PDMaterialPoints.createMethod
function 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 bar
  • rand_::Float64: randomization of the bar
  • type::Int: type of the bar

Returns

  • dict: a dictionary same as the one returned by PDMaterialPoints.create
source

Standard simulations

Miscellaneous

PDBenchmark.set_deviceMethod
set_device(x)

Set the device to run on.

Arguments

  • x::Symbol: The device to run on. Can be :cpu or :cuda.
source
PDBenchmark.set_loglevelMethod
set_loglevel(x)

Set the log level.

Arguments

  • x::Symbol: The log level. Can be :debug, :info, :warn, :error, or :fatal.
source