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

Minor improvements #44

Merged
merged 12 commits into from
Jun 24, 2024
Merged

Minor improvements #44

merged 12 commits into from
Jun 24, 2024

Conversation

Joroks
Copy link
Collaborator

@Joroks Joroks commented Jun 23, 2024

I've added two API functions i've deemed usefull for my usecase. I think these will come in handy for anyone else using this Library.

While I was at it, I've also updated the documentation on command() and changed how it handles newline characters.
While this is technically a breaking change, I think that this should be fine, as most people probably don't have newlines in their command strings anyways. Doing it this way makes it a lot easier to work with the command() function I think...

I've also exported close!() and made sure that LMP(f,...) calls close! on the LAMMPS instance as that's what you'd expect to happen when using this variant of the constructor.

src/LAMMPS.jl Outdated Show resolved Hide resolved
@@ -101,18 +114,38 @@ function check(lmp::LMP)
# TODO: Check err == 1 or err == 2 (MPI)
buf = zeros(UInt8, 100)
API.lammps_get_last_error_message(lmp, buf, length(buf))
error(String(buf))
error(rstrip(String(buf), '\0'))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use some of the improvements in #34

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I revert this then?

@vchuravy vchuravy merged commit b5e0d6d into cesmix-mit:main Jun 24, 2024
8 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants