From c63edfc932db492adf0d512385a402e0bb6239c2 Mon Sep 17 00:00:00 2001 From: CedricTravelletti Date: Mon, 15 Jan 2024 15:38:29 +0100 Subject: [PATCH] Removed ComponentArrays deps. --- src/atomsbase_interface.jl | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/src/atomsbase_interface.jl b/src/atomsbase_interface.jl index 83b5e25..13c31d4 100644 --- a/src/atomsbase_interface.jl +++ b/src/atomsbase_interface.jl @@ -17,21 +17,6 @@ function update_positions(system, positions::AbstractVector{<:AbstractVector{<:U AbstractSystem(system; particles) end -@doc raw""" -Creates a new system based on ``system`` but with atoms positions and lattice -vectors updated to the ones provided. -New generalized coordinates should be provided in a ComponentArray with -component `atoms` and `bounding_box`, containing new atomic positions -and lattice vectors respectively. - -""" -function update_positions(system, positions::ComponentVector) - # Collect are needed with ComponentArrays to get concrete types. - particles = [Atom(atom; position) for (atom, position) - in zip(system, collect.(positions.atoms))] - AbstractSystem(system; particles, bounding_box=collect.(positions.bounding_box)) -end - @doc raw""" Creates a new system based on ``system`` where the non clamped positions are updated to the ones provided (in the order in which they appear in the system). @@ -44,25 +29,6 @@ function update_not_clamped_positions(system, positions::AbstractVector{<:Unitfu update_positions(system, new_positions) end -@doc raw""" -Creates a new system based on ``system`` where the non clamped positions and -lattice vectors are updated to the ones provided. -Note that the `atoms`component of `positions` should be a vector of -coordinates. - -""" -function update_not_clamped_positions(system, positions::ComponentVector) - mask = not_clamped_mask(system) - new_positions = deepcopy(position(system)) - atoms_positions = collect(positions.atoms) - new_positions[mask] = reinterpret(reshape, SVector{3, eltype(atoms_positions)}, - reshape(atoms_positions, 3, :)) - update_positions(system, - ComponentVector(atoms=new_positions, - bounding_box=collect.(positions.bounding_box)) - ) -end - @doc raw""" Returns a mask for selecting the not clamped atoms in the system.