Geometry - Functions
Index
PeriLab.Geometry.compute_shape_tensors!
PeriLab.Geometry.compute_strain
PeriLab.Geometry.rotation_tensor
Geometry
PeriLab.Geometry.compute_shape_tensors!
— Methodcompute_shape_tensors!(nodes::AbstractVector{Int64}, nlist, volume, omega, bond_damage, undeformed_bond, shape_tensor, inverse_shape_tensor)
Calculate the shape tensor and its inverse for a set of nodes in a computational mechanics context.
Arguments
nodes::AbstractVector{Int64}
: A vector of integers representing node IDs.dof::Int64
: An integer representing the degrees of freedom.nlist
: A data structure (e.g., a list or array) representing neighboring node IDs for each node.volume
: A vector or array containing volume information for each node.omega
: A vector or array containing omega information for each node.bond_damage
: A data structure representing bond damage for each node.undeformed_bond
: A data structure representing bond geometries for each node.shape_tensor
: A preallocated 3D array to store the shape tensors for each node.inverse_shape_tensor
: A preallocated 3D array to store the inverse shape tensors for each node.
Output
shape_tensor
: An updatedshape_tensor
array with calculated shape tensors.inverse_shape_tensor
: An updatedinverse_shape_tensor
array with calculated inverse shape tensors.
Description
This function calculates the shape tensor and its inverse for a set of nodes in a computational mechanics context. The shape tensor is a key quantity used in continuum mechanics to describe material deformation. It is calculated based on bond damage, bond geometries, volume, and omega information for each node.
For each node in nodes
, the function iterates through degrees of freedom (dof
) and computes elements of the shape tensor. The inverse of the shape tensor is also calculated and stored in inverse_shape_tensor
.
Example
```julia nodes = [1, 2, 3] dof = 3 nlist = [[2, 3], [1, 3], [1, 2]] volume = [0.1, 0.2, 0.3] omega = [0.5, 0.4, 0.6] bonddamage = zeros(Float64, length(nodes), length(nlist[1])) undeformedbond = rand(Float64, length(nodes), length(nlist[1]), dof) shapetensor = zeros(Float64, length(nodes), dof, dof) inverseshape_tensor = zeros(Float64, length(nodes), dof, dof)
PeriLab.Geometry.compute_strain
— Methodfunction compute_strain(nodes::Union{Base.OneTo{Int64},Vector{Int64}, SubArray}, deformation_gradient, strain)
Calculate strains for specified nodes based on deformation gradients.
Arguments
nodes::AbstractVector{Int64}
: List of nodesdeformation_gradient
: Deformation gradient at current time step (2D or 3D array).
Returns
- Updated
strain
array containing strains.
This function iterates over the specified nodes and computes strain at each node using the given deformation gradients.
PeriLab.Geometry.rotation_tensor
— Methodfunction rotation_tensor(angles::Vector{Float64})
Creates the rotation tensor for 2D or 3D applications. Uses Rotations.jl package.
Arguments
angles::Vector{Float64}
: Vector of angles definede in degrees of length one or three
Returns
- Rotation tensor