Autodocs are generated for PDMaterialPoints using Documenter.jl.

PDMaterialPoints.ConeType
Cone(radius::QF, length::QF)

Cone shape.

Fields

  • radius::QF: Radius of the cone.
  • length::QF: Length of the cone.

Example

using PDMaterialPoints

# Create a cone
cone = Cone(1.0, 1.0)

# Create a material-point-geometry.
mpg =create(cone; resolution=0.1, rand_=0.01, type=1)

See also

References

source
PDMaterialPoints.CuboidType
Cuboid(bounds::Array{QF, 2})

Cuboid shape.

Fields

  • bounds::Array{QF, 2}: Bounds of the cuboid.

Example

using PDMaterialPoints

# Create a cuboid
cuboid = Cuboid([0.0 1.0; 0.0 1.0; 0.0 1.0])

# Create a material-point-geometry.
mpg =create(cuboid)

See also

References

source
PDMaterialPoints.CylinderType
Cylinder

Cylinder shape.

Fields

  • radius::QF: Radius of the cylinder.
  • thickness::QF: Thickness of the cylinder.
  • length::QF: Length of the cylinder.

Example

using PDMaterialPoints

# Create a cylinder
cylinder = Cylinder(1.0, 0.1, 2.0)

# Create a material-point-geometry.
mpg =create(cylinder, resolution=0.1)
source
PDMaterialPoints.DiskType
Disk

Disk shape.

Fields

  • radius::QF: Radius of the disk.
  • thickness::QF: Thickness of the disk.

Example

using PDMaterialPoints

# Create a disk
disk = Disk(1.0, 0.1)

# Create a material-point-geometry.
mpg =create(disk, resolution=0.1)
source
PDMaterialPoints.PostOpObjType
PostOpObj

These objects are used to create a post operation object (lazy) from object ( or post operation object)and an operation. Operations will be applied while a create call.

Fields

  • name::String: Name of the object.
  • objs::Vector{Any}: Objects to be operated on.
  • operations::Array{Function}: Operations to be applied.
source
PDMaterialPoints.ShellType
Shell

Shell shape.

Fields

  • outer_radius::QF: Outer radius of the shell.
  • inner_radius::QF: Inner radius of the shell.

Example

using PDMaterialPoints

# Create a shell
shell = Shell(1.0, 0.5)

# Create a material-point-geometry.
mpg =create(shell, resolution=0.1)
source
PDMaterialPoints.SphereType
Sphere

Sphere shape.

Fields

  • radius::QF: Radius of the sphere.

Example

using PDMaterialPoints

# Create a sphere
sphere = Sphere(1.0)

# Create a material-point-geometry.
mpg =create(sphere, resolution=0.1)
source
PDMaterialPoints.CubeMethod
Cube(L)

Cube shape. A special case of Cuboid.

Arguments

  • L::QF: Length of the cube.

Example

using PDMaterialPoints

# Create a cube
cube = Cube(1.0)

# Create a material-point-geometry.
mpg =create(cube)

See also

source
PDMaterialPoints.IndentorMethod
Indentor(angle, height; sides=3)

Indentor shape. A special case of Pyramid.

Arguments

  • angle::QF: Apex angle of the Indentor.
  • height::QF: Height of the Indentor.

Keyword Arguments

  • sides::Int: Number of sides of the Indentor.

Example

using PDMaterialPoints

# Create a Indentor
Indentor = Indentor(60.0, 1.0)

# Create a material-point-geometry.
mpg =create(Indentor)

See also

source
PDMaterialPoints.PyramidMethod
Pyramid

Pyramid shape.

Arguments

  • angle::QF: Apex angle of the Pyramid.

Example

using PDMaterialPoints

# Create a Pyramid
Pyramid = Pyramid(60.0)

# Create a material-point-geometry.
mpg =create(Pyramid)

See also

References

source
PDMaterialPoints.StandardConeMethod
StandardCone()

Standard cone shape. A special case of Cone. Radius and length are 1.0.

Example

using PDMaterialPoints

# Create a standard cone
cone = StandardCone()

# Create a material-point-geometry.
mpg =create(cone)

See also

source
PDMaterialPoints.StandardCuboidMethod
StandardCuboid()

Standard cuboid shape. A special case of Cuboid. Bounds are [-0.5 0.5; -0.5 0.5; -0.5 0.5]. Length is 1.0.

Example

using PDMaterialPoints

# Create a standard cuboid
cuboid = StandardCuboid()

# Create a material-point-geometry.
mpg =create(cuboid)

See also

source
PDMaterialPoints.StandardCylinderMethod
StandardCylinder()

Standard cylinder shape. A special case of Cylinder. Radius is 1.0. Thickness is 0.3. Length is 1.0.

Example

using PDMaterialPoints

# Create a standard cylinder
cylinder = StandardCylinder()

# Create a material-point-geometry.
mpg =create(cylinder)

See also

source
PDMaterialPoints.StandardDiskMethod
StandardDisk()

Standard disk shape. A special case of Disk. Radius is 1.0. Thickness is 0.3.

Example

using PDMaterialPoints

# Create a standard disk
disk = StandardDisk()

# Create a material-point-geometry.
mpg =create(disk)

See also

source
PDMaterialPoints.StandardSphereMethod
StandardSphere()

Standard sphere shape. A special case of Sphere. Radius is 1.0.

Example

using PDMaterialPoints

# Create a standard sphere
sphere = StandardSphere()

# Create a material-point-geometry.
mpg =create(sphere, resolution=0.1)

See also

source
PDMaterialPoints.changetypeMethod
changetype(obj::T, f::Function, ntype::Int) where T <: SuperShape

Change material point type for object using function f.

Arguments

  • obj::T: Object.
  • f::Function: Function that returns a boolean array.
  • ntype::Int: New particle type.

Returns

  • obj::T: Object.

See also

Example

using PDMaterialPoints

# Create a disk
disk = Disk(1.0, 0.1)

# Create a material-point-geometry.
mpg =create(disk, resolution=0.1)

# Change particle type
mpg =changetype(mpg, out -> out['x'][:, 1] .> 0.0, 2)
source
PDMaterialPoints.createMethod
create(c::Cone; resolution=nothing, rand_=0.0, type::Int=1)

Create a material-point-geometry of a cone.

Arguments

  • c::Cone: Cone shape.
  • resolution=nothing: Resolution of the material-point-geometry.
  • rand_=0.0: Randomization factor.
  • type::Int=1: Type of the material-point-geometry.

Returns

  • Dict: Material point gemetry.

Example

using PDMaterialPoints

# Create a cone
cone = Cone(1.0, 1.0)

# Create a material-point-geometry.
mpg =create(cone)

See also

source
PDMaterialPoints.createMethod
create(c::Cuboid; resolution=nothing, rand_=0.0, type::Int=1)

Create a material-point-geometry of a cuboid.

Arguments

  • c::Cuboid: Cuboid shape.
  • resolution=nothing: Resolution of the material-point-geometry.
  • rand_=0.0: Randomization factor.
  • type::Int=1: Type of the material-point-geometry.

Returns

  • Dict: Material point gemetry.

Example

using PDMaterialPoints

# Create a cuboid
cuboid = Cuboid([0.0 1.0; 0.0 1.0; 0.0 1.0])

# Create a material-point-geometry.
mpg =create(cuboid)

See also

source
PDMaterialPoints.createMethod
create(c::Cylinder; resolution=nothing, rand_=0.0, type::Int=1)

Create a material-point-geometry from a cylinder.

Arguments

  • c::Cylinder: Cylinder object.
  • resolution=nothing: Resolution of the material-point-geometry.
  • rand_=0.0: Randomization factor.
  • type::Int=1: Type of the material-point-geometry.

Returns

  • out::Dict{Symbol, Any}: Dictionary containing the material-point-geometry data.

Example

using PDMaterialPoints

# Create a cylinder
cylinder = Cylinder(1.0, 0.1, 2.0)

# Create a material-point-geometry.
mpg =create(cylinder, resolution=0.1)
source
PDMaterialPoints.createMethod
create(c::Disk; resolution=nothing, rand_=0.0, type::Int=1)

Create a material-point-geometry from a disk.

Arguments

  • c::Disk: Disk object.
  • resolution=nothing: Resolution of the material-point-geometry.
  • rand_=0.0: Randomization factor.
  • type::Int=1: Type of the material-point-geometry.

Returns

  • out::Dict{Symbol, Any}: Dictionary containing the material-point-geometry data.

Example

using PDMaterialPoints

# Create a disk
disk = Disk(1.0, 0.1)

# Create a material-point-geometry.
mpg =create(disk, resolution=0.1)
source
PDMaterialPoints.createMethod
create(pobj::PostOpObj, args...; kwargs...)

Create a material-point-geometry from a post operation object.

Arguments

  • pobj::PostOpObj: Post operation object.
  • args...: Arguments to be passed to the create function.
  • kwargs...: Keyword arguments to be passed to the create function.

Returns

  • out::Dict{Symbol, Any}: Dictionary containing the material-point-geometry data.
source
PDMaterialPoints.createMethod
create(s::Sphere; resolution=nothing, rand_=0.0, type::Int=1)

Create a material-point-geometry from a sphere or shell.

Arguments

  • s::Sphere: Sphere object.
  • resolution=nothing: Resolution of the material-point-geometry.
  • rand_=0.0: Randomization factor.
  • type::Int=1: Type of the material-point-geometry.

Returns

  • out::Dict{Symbol, Any}: Dictionary containing the material-point-geometry data.
source
PDMaterialPoints.createMethod
create(shape::T; resolution=nothing, rand_=0.0, type::Int=1) where T <: Shape

Abstact function for creating Shape objects.

Arguments

  • shape::T: Shape object.
  • resolution=nothing: Resolution of the material-point-geometry.
  • rand_=0.0: Randomization factor.
  • type::Int=1: Type of the material-point-geometry.

Returns

  • out::Dict{Symbol, Any}: Dictionary containing the material-point-geometry data.
source
PDMaterialPoints.deleteMethod
delete(obj::T, f::Function) where T <: SuperShape

Delete material points for object using function f.

Arguments

  • obj::T: Object.
  • f::Function: Function that returns a boolean array.

Returns

  • obj::T: Object.

Example

using PDMaterialPoints

# Create a disk
disk = Disk(1.0, 0.1)

# Create a material-point-geometry.
mpg =create(disk, resolution=0.1)

# Delete particles
mpg =delete(mpg, out -> out['x'][:, 1] .> 0.0)

See also

source
PDMaterialPoints.makeMethod
make(shape::T) where T <: Shape

Create a material-point-geometry from a shape. This function is a wrapper for the create function. It is used to create a material-point-geometry from a shape with default arguments.

Arguments

  • shape::T: Shape object.

Returns

  • out::Dict{Symbol, Any}: Dictionary containing the material-point-geometry data.
source
PDMaterialPoints.moveMethod
move(x::Array{QF,2}; by=[0.0, 0.0, 0.0])

Move material points for object by given "by".

Arguments

  • x::Array{QF,2}: Array of material points.
  • by=[0.0, 0.0, 0.0]: Translation vector.

Returns

  • x::Array{QF,2}: Array of material points.

See also

source
PDMaterialPoints.moveMethod
move(obj::T; by=[0.0, 0.0, 0.0]) where T

Move material points for object by given "by".

Arguments

  • obj::T: Object.
  • by=[0.0, 0.0, 0.0]: Translation vector.

Returns

  • obj::T: Object.

Example

using PDMaterialPoints

# Create a disk
disk = Disk(1.0, 0.1)

# Create a material-point-geometry.
mpg =create(disk, resolution=0.1)

# Move particles
mpg =move(mpg, by=[0.0, 0.0, 0.1])

See also

source
PDMaterialPoints.repack!Method
repack!(d::Dict, keys_, vals)

Repack a dictionary from its components inplace.

Arguments

  • d::Dict: Dictionary to be repacked.
  • keys_: Keys of the dictionary.
  • vals: Values of the dictionary.

Returns

  • d::Dict: Dictionary containing the components.
source
PDMaterialPoints.repackMethod
repack(args...; keys_ = (:x, :v, :y, :volume, :type))

Repack a dictionary from its components.

Arguments

  • args...: Components to be packed.
  • keys_ = (:x, :v, :y, :volume, :type): Keys of the dictionary.

Returns

  • d::Dict: Dictionary containing the components.
source
PDMaterialPoints.rotateMethod
rotate(x::Array{QF,2}; angle=0.0, point=[0.0, 0.0, 0.0], vector_=[1.0, 0.0, 0.0])

Rotate material points for object by given angle about given vector and point.

Arguments

  • x::Array{QF,2}: Array of material points.
  • angle=0.0: Rotation angle.
  • point=[0.0, 0.0, 0.0]: Rotation point.
  • vector_=[1.0, 0.0, 0.0]: Rotation vector.

Returns

  • x::Array{QF,2}: Array of material points.

See also

source
PDMaterialPoints.rotateMethod
rotate(obj::T; angle=0.0, point=[0.0, 0.0, 0.0], vector_=[1.0, 0.0, 0.0]) where T <: SuperShape

Rotate shape object by given angle about given vector and point.

source
PDMaterialPoints.unpackMethod
unpack(d::Dict)

Unpack a dictionary into its components.

Arguments

  • d::Dict: Dictionary to be unpacked.

Returns

  • x::Array{QF, 1}: x coordinates.
  • v::Array{QF, 1}: v coordinates.
  • y::Array{QF, 1}: y coordinates.
  • volume::Array{QF, 1}: Volume of the material-point-geometry.
  • type::Array{Int, 1}: Type of the material-point-geometry.
source
PDMaterialPoints.velocityMethod
velocity(v::Array{QF,2}; velocity=[0.0, 0.0, 0.0])

Change velocity of particles for object by given "velocity".

Arguments

  • v::Array{QF,2}: Array of material-point-geometry velocities.
  • velocity=[0.0, 0.0, 0.0]: Velocity vector.

Returns

  • v::Array{QF,2}: Array of material-point-geometry velocities.
source
PDMaterialPoints.velocityMethod
velocity(v::Array{QF,2}; velocity=[0.0, 0.0, 0.0])

Change velocity of particles for object by given "velocity".

Arguments

  • v::Array{QF,2}: Array of material-point-geometry velocities.
  • velocity=[0.0, 0.0, 0.0]: Velocity vector.

Returns

  • v::Array{QF,2}: Array of material-point-geometry velocities.
source
PDMaterialPoints.velocityMethod
velocity(obj::T, f::Function, vel) where T <: SuperShape

Change velocity of particles for object using boolean array from function f.

Arguments

  • obj::T: Object.
  • f::Function: Function that returns boolean array.
  • vel: Velocity vector.

Returns

  • obj::T: Object.
source
PDMaterialPoints.write_dataMethod
write_data(filename::String, out::Dict)

Write data to a file in the following format:

    N
    # id, type, position, velocity, volume
    1, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0
    2, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0
    3, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0
    4, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0
    5, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0

where N is the number of particles, id is the particle id, type is the particle type,
position is the particle position, velocity is the particle velocity, and
volume is the particle volume.

Arguments

  • filename::String: Name of the file to write to.
  • out::Dict: Dictionary containing the following keys:
    • :x: Position of the particles.
    • :v: Velocity of the particles.
    • :type: Type of the particles.
    • :volume: Volume of the particles.

Example

using PDMaterialPoints

# Create a cube
cube = Cube(1.0, 1.0, 1.0)

# Create a dictionary of the union
out = create(cube)

# Write the data to a file
write_data("data.txt", out)

See also

source
PDMaterialPoints.write_dataMethod
write_data(filename::String, x::Matrix, v::Matrix, type::Vector,  vol::Vector)

Write data to a file in the following format:

N
# id, type, position, velocity, volume
1, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0
2, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0
3, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0
4, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0
5, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0

where N is the number of particles, id is the particle id, type is the particle type, position is the particle position, velocity is the particle velocity, and volume is the particle volume.

Arguments

  • filename::String: Name of the file to write to.
  • x::Matrix: Position of the particles.
  • v::Matrix: Velocity of the particles.
  • type::Vector: Type of the particles.
  • vol::Vector: Volume of the particles.

see also

source
PDMaterialPoints.write_dataMethod
write_data(filename::String, obj::SuperShape; kwargs...)

Write data to a file in the following format:

    N
    # id, type, position, velocity, volume
    1, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0
    2, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0
    3, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0
    4, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0
    5, 1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0

where N is the number of particles, id is the particle id, type is the particle type,
position is the particle position, velocity is the particle velocity, and
volume is the particle volume.

Arguments

  • filename::String: Name of the file to write to.
  • obj::SuperShape: Shape or post operation object to write to file.

Keyword Arguments

  • kwargs...: Keyword arguments to pass to create.

Example

using PDMaterialPoints

# Create a cube
cube = Cube(1.0, 1.0, 1.0)

# Write the data to a file
write_data("data.txt", cube)

See also

source
PDMaterialPoints.write_data_peridigmMethod
write_data_peridigm(filename::String, x::Matrix, type::Vector,  vol::Vector)

Write data to a file in the following format:

    N
    # position, type, volume
    0.0, 0.0, 0.0, 1, 1.0
    0.0, 0.0, 0.0, 1, 1.0
    0.0, 0.0, 0.0, 1, 1.0
    0.0, 0.0, 0.0, 1, 1.0
    0.0, 0.0, 0.0, 1, 1.0

where N is the number of particles, type is the particle type, position is the particle position, and volume is the particle volume.

Arguments

  • filename::String: Name of the file to write to.
  • x::Matrix: Position of the particles.
  • type::Vector: Type of the particles.
  • vol::Vector: Volume of the particles.

see also

source
PDMaterialPoints.set_deviceFunction
set_device(device::Symbol)

Set the device to use for computations. The device can be either :cpu or :cuda.

Arguments

  • device::Symbol: Device to use for computations.

Example

using PDMaterialPoints

# Set the device to use for computations
set_device(:cuda)
source
PDMaterialPoints.get_valid_deviceFunction
get_valid_device(x::Symbol)

Get a valid device. If x is :cuda and CUDA is not available, then :cpu is returned.

Arguments

  • x::Symbol: Device to check.
source
PDMaterialPoints.keepitFunction
keepit(out, mask::BitArray)

Keep material points for object using boolean array mask.

Arguments

  • out: Material point gemetry data.
  • mask::BitArray: Boolean array.

Returns

  • out: Material point gemetry data.
source
PDMaterialPoints.addFunction
add(obj1::T1, obj2::T2) where {T1<:SuperShape, T2<:SuperShape}

Add two objects.

Arguments

  • obj1::T1: First object.
  • obj2::T2: Second object.
source
PDMaterialPoints.fhandleFunction
fhandle(filename::String)

Create a file handle for a given filename.

Arguments

  • filename::String: Name of the file to create.
source