Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix gather/scatter type verification #57

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/LAMMPS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -616,10 +616,6 @@ Compute entities have the prefix `c_`, fix entities use the prefix `f_`, and per

The returned Array is decoupled from the internal state of the LAMMPS instance.

!!! warning "Type Verification"
Due to how the underlying C-API works, it's not possible to verify the element data-type of fix or compute style data.
Supplying the wrong data-type will not throw an error but will result in nonsensical output

!!! warning "ids"
The optional parameter `ids` only works, if there is a map defined. For example by doing:
`command(lmp, "atom_modify map yes")`
Expand Down Expand Up @@ -659,10 +655,6 @@ The optional parameter `ids` determines to which subset of atoms the data will b

Compute entities have the prefix `c_`, fix entities use the prefix `f_`, and per-atom entites have no prefix.

!!! warning "Type Verification"
Due to how the underlying C-API works, it's not possible to verify the element data-type of fix or compute style data.
Supplying the wrong data-type will not throw an error but will result in nonsensical date being supplied to the LAMMPS instance.

!!! warning "ids"
The optional parameter `ids` only works, if there is a map defined. For example by doing:
`command(lmp, "atom_modify map yes")`
Expand Down Expand Up @@ -732,7 +724,7 @@ end

function _get_T(lmp::LMP, name::String)
if startswith(name, r"[f,c]_")
return missing # As far as I know, it's not possible to determine the datatype of computes or fixes at runtime
return Float64 # computes and fixes are allways doubles
end

type = API.lammps_extract_atom_datatype(lmp, name)
Expand Down
Loading