From 082b336d74d1fcc8a128238201eedd8fed3d51a6 Mon Sep 17 00:00:00 2001 From: Kai Partmann Date: Wed, 16 Oct 2024 15:19:35 +0200 Subject: [PATCH] Remove old commented code --- src/physics/bond_based.jl | 58 ------------------- src/physics/continuum_kinematics_inspired.jl | 58 ------------------- src/physics/correspondence.jl | 59 -------------------- src/physics/ordinary_state_based.jl | 59 -------------------- 4 files changed, 234 deletions(-) diff --git a/src/physics/bond_based.jl b/src/physics/bond_based.jl index 13848f36..d46c8922 100644 --- a/src/physics/bond_based.jl +++ b/src/physics/bond_based.jl @@ -107,68 +107,10 @@ struct BBStorage <: AbstractStorage n_active_bonds::Vector{Int} end -# function BBVerletStorage(::BBMaterial, ::VelocityVerlet, system::BondSystem) -# n_loc_points = get_n_loc_points(system) -# position = copy(system.position) -# displacement = zeros(3, n_loc_points) -# velocity = zeros(3, n_loc_points) -# velocity_half = zeros(3, n_loc_points) -# acceleration = zeros(3, n_loc_points) -# b_int = zeros(3, n_loc_points) -# b_ext = zeros(3, n_loc_points) -# damage = zeros(n_loc_points) -# bond_active = ones(Bool, length(system.bonds)) -# n_active_bonds = copy(system.n_neighbors) -# s = BBVerletStorage(position, displacement, velocity, velocity_half, acceleration, -# b_int, b_ext, damage, bond_active, n_active_bonds) -# return s -# end - @storage BBMaterial BBStorage @loc_to_halo_fields BBStorage :position -# struct BBRelaxationStorage <: AbstractStorage -# position::Matrix{Float64} -# displacement::Matrix{Float64} -# velocity::Matrix{Float64} -# velocity_half::Matrix{Float64} -# velocity_half_old::Matrix{Float64} -# b_int::Matrix{Float64} -# b_int_old::Matrix{Float64} -# b_ext::Matrix{Float64} -# density_matrix::Matrix{Float64} -# damage::Vector{Float64} -# bond_active::Vector{Bool} -# n_active_bonds::Vector{Int} -# end - -# function BBRelaxationStorage(::BBMaterial, ::DynamicRelaxation, system::BondSystem) -# n_loc_points = get_n_loc_points(system) -# position = copy(system.position) -# displacement = zeros(3, n_loc_points) -# velocity = zeros(3, n_loc_points) -# velocity_half = zeros(3, n_loc_points) -# velocity_half_old = zeros(3, n_loc_points) -# b_int = zeros(3, n_loc_points) -# b_int_old = zeros(3, n_loc_points) -# b_ext = zeros(3, n_loc_points) -# density_matrix = zeros(3, n_loc_points) -# damage = zeros(n_loc_points) -# bond_active = ones(Bool, length(system.bonds)) -# n_active_bonds = copy(system.n_neighbors) -# s = BBRelaxationStorage(position, displacement, velocity, velocity_half, -# velocity_half_old, b_int, b_int_old, b_ext, density_matrix, -# damage, bond_active, n_active_bonds) -# return s -# end - -# @storage BBMaterial DynamicRelaxation BBRelaxationStorage - -# @loc_to_halo_fields BBRelaxationStorage :position - -# const BBStorage = Union{BBVerletStorage,BBRelaxationStorage} - function force_density_point!(storage::BBStorage, system::BondSystem, ::BBMaterial, params::BBPointParameters, i::Int) for bond_id in each_bond_idx(system, i) diff --git a/src/physics/continuum_kinematics_inspired.jl b/src/physics/continuum_kinematics_inspired.jl index 2e1464f6..c4f11c16 100644 --- a/src/physics/continuum_kinematics_inspired.jl +++ b/src/physics/continuum_kinematics_inspired.jl @@ -96,68 +96,10 @@ struct CKIStorage <: AbstractStorage n_active_one_nis::Vector{Int} end -# function CKIVerletStorage(::CKIMaterial, ::VelocityVerlet, system::InteractionSystem) -# n_loc_points = get_n_loc_points(system) -# position = copy(system.position) -# displacement = zeros(3, n_loc_points) -# velocity = zeros(3, n_loc_points) -# velocity_half = zeros(3, n_loc_points) -# acceleration = zeros(3, n_loc_points) -# b_int = zeros(3, n_loc_points) -# b_ext = zeros(3, n_loc_points) -# damage = zeros(n_loc_points) -# one_ni_active = ones(Bool, length(system.one_nis)) -# n_active_one_nis = copy(system.n_one_nis) -# s = CKIVerletStorage(position, displacement, velocity, velocity_half, acceleration, -# b_int, b_ext, damage, one_ni_active, n_active_one_nis) -# return s -# end - @storage CKIMaterial CKIStorage @loc_to_halo_fields CKIStorage :position -# struct CKIRelaxationStorage <: AbstractStorage -# position::Matrix{Float64} -# displacement::Matrix{Float64} -# velocity::Matrix{Float64} -# velocity_half::Matrix{Float64} -# velocity_half_old::Matrix{Float64} -# b_int::Matrix{Float64} -# b_int_old::Matrix{Float64} -# b_ext::Matrix{Float64} -# density_matrix::Matrix{Float64} -# damage::Vector{Float64} -# one_ni_active::Vector{Bool} -# n_active_one_nis::Vector{Int} -# end - -# function CKIRelaxationStorage(::CKIMaterial, ::DynamicRelaxation, system::InteractionSystem) -# n_loc_points = get_n_loc_points(system) -# position = copy(system.position) -# displacement = zeros(3, n_loc_points) -# velocity = zeros(3, n_loc_points) -# velocity_half = zeros(3, n_loc_points) -# velocity_half_old = zeros(3, n_loc_points) -# b_int = zeros(3, n_loc_points) -# b_int_old = zeros(3, n_loc_points) -# b_ext = zeros(3, n_loc_points) -# density_matrix = zeros(3, n_loc_points) -# damage = zeros(n_loc_points) -# one_ni_active = ones(Bool, length(system.one_nis)) -# n_active_one_nis = copy(system.n_one_nis) -# s = CKIRelaxationStorage(position, displacement, velocity, velocity_half, -# velocity_half_old, b_int, b_int_old, b_ext, density_matrix, -# damage, one_ni_active, n_active_one_nis) -# return s -# end - -# @storage CKIMaterial DynamicRelaxation CKIRelaxationStorage - -# @loc_to_halo_fields CKIRelaxationStorage :position - -# const CKIStorage = Union{CKIVerletStorage,CKIRelaxationStorage} - function force_density_point!(storage::CKIStorage, system::InteractionSystem, mat::CKIMaterial, params::AbstractParameterSetup, i::Int) force_density_point_one_ni!(storage, system, mat, params, i) diff --git a/src/physics/correspondence.jl b/src/physics/correspondence.jl index 0e3932a4..c7eb15d1 100644 --- a/src/physics/correspondence.jl +++ b/src/physics/correspondence.jl @@ -119,23 +119,6 @@ struct NOSBStorage <: AbstractStorage n_active_bonds::Vector{Int} end -# function NOSBVerletStorage(::NOSBMaterial, ::VelocityVerlet, system::BondSystem) -# n_loc_points = get_n_loc_points(system) -# position = copy(system.position) -# displacement = zeros(3, n_loc_points) -# velocity = zeros(3, n_loc_points) -# velocity_half = zeros(3, n_loc_points) -# acceleration = zeros(3, n_loc_points) -# b_int = zeros(3, get_n_points(system)) -# b_ext = zeros(3, n_loc_points) -# damage = zeros(n_loc_points) -# bond_active = ones(Bool, length(system.bonds)) -# n_active_bonds = copy(system.n_neighbors) -# s = NOSBVerletStorage(position, displacement, velocity, velocity_half, acceleration, -# b_int, b_ext, damage, bond_active, n_active_bonds) -# return s -# end - function init_field(::NOSBMaterial, ::AbstractTimeSolver, system::BondSystem, ::Val{:b_int}) return zeros(3, get_n_points(system)) end @@ -145,48 +128,6 @@ end @loc_to_halo_fields NOSBStorage :position @halo_to_loc_fields NOSBStorage :b_int -# struct NOSBRelaxationStorage <: AbstractStorage -# position::Matrix{Float64} -# displacement::Matrix{Float64} -# velocity::Matrix{Float64} -# velocity_half::Matrix{Float64} -# velocity_half_old::Matrix{Float64} -# b_int::Matrix{Float64} -# b_int_old::Matrix{Float64} -# b_ext::Matrix{Float64} -# density_matrix::Matrix{Float64} -# damage::Vector{Float64} -# bond_active::Vector{Bool} -# n_active_bonds::Vector{Int} -# end - -# function NOSBRelaxationStorage(::NOSBMaterial, ::DynamicRelaxation, system::BondSystem) -# n_loc_points = get_n_loc_points(system) -# position = copy(system.position) -# displacement = zeros(3, n_loc_points) -# velocity = zeros(3, n_loc_points) -# velocity_half = zeros(3, n_loc_points) -# velocity_half_old = zeros(3, n_loc_points) -# b_int = zeros(3, get_n_points(system)) -# b_int_old = zeros(3, n_loc_points) -# b_ext = zeros(3, n_loc_points) -# density_matrix = zeros(3, n_loc_points) -# damage = zeros(n_loc_points) -# bond_active = ones(Bool, length(system.bonds)) -# n_active_bonds = copy(system.n_neighbors) -# s = NOSBRelaxationStorage(position, displacement, velocity, velocity_half, -# velocity_half_old, b_int, b_int_old, b_ext, density_matrix, -# damage, bond_active, n_active_bonds) -# return s -# end - -# @storage NOSBMaterial DynamicRelaxation NOSBRelaxationStorage - -# @loc_to_halo_fields NOSBRelaxationStorage :position -# @halo_to_loc_fields NOSBRelaxationStorage :b_int - -# const NOSBStorage = Union{NOSBVerletStorage,NOSBRelaxationStorage} - function force_density_point!(storage::NOSBStorage, system::BondSystem, mat::NOSBMaterial, paramhandler::AbstractParameterHandler, i::Int) params = get_params(paramhandler, i) diff --git a/src/physics/ordinary_state_based.jl b/src/physics/ordinary_state_based.jl index df174613..9cbaaa14 100644 --- a/src/physics/ordinary_state_based.jl +++ b/src/physics/ordinary_state_based.jl @@ -97,23 +97,6 @@ struct OSBStorage <: AbstractStorage n_active_bonds::Vector{Int} end -# function OSBVerletStorage(::OSBMaterial, ::VelocityVerlet, system::BondSystem) -# n_loc_points = get_n_loc_points(system) -# position = copy(system.position) -# displacement = zeros(3, n_loc_points) -# velocity = zeros(3, n_loc_points) -# velocity_half = zeros(3, n_loc_points) -# acceleration = zeros(3, n_loc_points) -# b_int = zeros(3, get_n_points(system)) -# b_ext = zeros(3, n_loc_points) -# damage = zeros(n_loc_points) -# bond_active = ones(Bool, length(system.bonds)) -# n_active_bonds = copy(system.n_neighbors) -# s = OSBVerletStorage(position, displacement, velocity, velocity_half, acceleration, -# b_int, b_ext, damage, bond_active, n_active_bonds) -# return s -# end - @storage OSBMaterial OSBStorage function init_field(::OSBMaterial, ::AbstractTimeSolver, system::BondSystem, ::Val{:b_int}) @@ -123,48 +106,6 @@ end @loc_to_halo_fields OSBStorage :position @halo_to_loc_fields OSBStorage :b_int -# struct OSBRelaxationStorage <: AbstractStorage -# position::Matrix{Float64} -# displacement::Matrix{Float64} -# velocity::Matrix{Float64} -# velocity_half::Matrix{Float64} -# velocity_half_old::Matrix{Float64} -# b_int::Matrix{Float64} -# b_int_old::Matrix{Float64} -# b_ext::Matrix{Float64} -# density_matrix::Matrix{Float64} -# damage::Vector{Float64} -# bond_active::Vector{Bool} -# n_active_bonds::Vector{Int} -# end - -# function OSBRelaxationStorage(::OSBMaterial, ::DynamicRelaxation, system::BondSystem) -# n_loc_points = get_n_loc_points(system) -# position = copy(system.position) -# displacement = zeros(3, n_loc_points) -# velocity = zeros(3, n_loc_points) -# velocity_half = zeros(3, n_loc_points) -# velocity_half_old = zeros(3, n_loc_points) -# b_int = zeros(3, get_n_points(system)) -# b_int_old = zeros(3, n_loc_points) -# b_ext = zeros(3, n_loc_points) -# density_matrix = zeros(3, n_loc_points) -# damage = zeros(n_loc_points) -# bond_active = ones(Bool, length(system.bonds)) -# n_active_bonds = copy(system.n_neighbors) -# s = OSBRelaxationStorage(position, displacement, velocity, velocity_half, -# velocity_half_old, b_int, b_int_old, b_ext, density_matrix, -# damage, bond_active, n_active_bonds) -# return s -# end - -# @storage OSBMaterial DynamicRelaxation OSBRelaxationStorage - -# @loc_to_halo_fields OSBRelaxationStorage :position -# @halo_to_loc_fields OSBRelaxationStorage :b_int - -# const OSBStorage = Union{OSBVerletStorage,OSBRelaxationStorage} - function force_density_point!(storage::OSBStorage, system::BondSystem, mat::OSBMaterial, params::OSBPointParameters, i::Int) wvol = calc_weighted_volume(storage, system, mat, params, i)