GithubHelp home page GithubHelp logo

Comments (4)

XiTanna avatar XiTanna commented on June 3, 2024

Furthermore, does mdapy offer a feature that allows for targeted selection within specific regions? For instance, I'm interested in computing thermodynamic properties for particles of type 1 specifically within the region where 0 < z < 5. Is there a mechanism to narrow down such calculations without considering the entire dataset?

from mdapy.

mushroomfire avatar mushroomfire commented on June 3, 2024

Hello,

I recently experimented with mdapy and have thoroughly enjoyed the experience. I was able to install it successfully via pip. However, I encountered an issue related to the glibc version dependency when trying to run some computations. It seems that both taichi and mdapy require a newer version of glibc, whereas my OS offers an older version that I can't upgrade immediately. Could you advise on any potential solutions or workarounds?

In addition, I have a multi-frame trajectory and am interested in performing thermodynamic time averaging over a specific frame range. While I am aware ovito provides such a functionality, I couldn't find a similar feature in the mdapy documentation (perhaps I might have overlooked it).

Below, I've included my installation details, the test script I used, and the associated error message for reference:

Installation: Installing collected packages: pygments, pyarrow, mdurl, dill, markdown-it-py, rich, taichi, mdapy Successfully installed dill-0.3.7 markdown-it-py-3.0.0 mdapy-0.8.9 mdurl-0.1.2 pyarrow-13.0.0 pygments-2.16.1 rich-13.5.2 taichi-1.6.0

Test Script: import mdapy as mp import numpy as np import taichi as ti import time

ti.init(arch=ti.cpu)

print(mp.version)

start_time = time.time() system = mp.System('./mydump-nve.lammpstrj') print("Time taken:", time.time() - start_time, "seconds.") print(system.data)

start_time = time.time() system.build_neighbor(rc=5., max_neigh=60) print("Time taken:", time.time() - start_time, "seconds.")

start_time = time.time() system.cal_centro_symmetry_parameter(N=12) print("Time taken:", time.time() - start_time, "seconds.")

start_time = time.time() system.cal_atomic_entropy() print("Time taken:", time.time() - start_time, "seconds.")

#start_time = time.time() #system.cal_atomic_temperature(amass=np.array([58.933, 58.693, 55.847, 26.982, 63.546])) #print("Time taken:", time.time() - start_time, "seconds.")

print(system.data['atomic_temp'].mean()) # K

csp

error = abs(system.data['c_1'] - system.data['csp']) print(error[error > 0.1], error.max())

error = abs(system.data['c_2'] - system.data['atomic_entropy']) print(error[error > 0.1], error.max())

start_time = time.time() system.write_dump() print("Time taken:", time.time() - start_time, "seconds.")

Error: python test.py [Taichi] version 1.6.0, llvm 16.0.0git, commit f1c6fbbd, linux, python 3.10.8 Traceback (most recent call last): File "/data1/xitan/works/Interface_temp/EmimBF4/lmp/CPM_nemd_right/1.0V/case1/test.py", line 1, in import mdapy as mp File "/home/xitan/anaconda3/envs/xitan_conda/lib/python3.10/site-packages/mdapy/init.py", line 14, in from .create_polycrystalline import CreatePolycrystalline File "/home/xitan/anaconda3/envs/xitan_conda/lib/python3.10/site-packages/mdapy/create_polycrystalline.py", line 17, in import _voronoi_analysis ImportError: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /home/xitan/anaconda3/envs/xitan_conda/lib/python3.10/site-packages/_voronoi_analysis.cpython-310-x86_64-linux-gnu.so)

Hi XiTanna @XiTanna ,

Thank you for your feedback on mdapy.

Regarding the installation problem, there are two potential solutions. I suggest testing it on a Conda virtual environment. The first solution is to update the glibc version by running "conda install -c conda-forge gxx_linux-64", as suggested on the main page of mdapy's GitHub repository. This should resolve the issue. Alternatively, you can install mdapy from source, which will compile mdapy with your operating system. In Linux, it should be as simple as running "pip install pybind11" and "pip install .".

As for the second question, currently mdapy cannot directly handle the trajectory. You will need to manually split it into individual dump files, such as melt.0.dump, melt.100.dump, etc. The System class only accepts a single frame, while the MultiSystem can handle multiple-frame dumps. Time averaging can be achieved through a simple for-loop. mdapy primarily focuses on post-processing for a single frame.

By the way, there are some errors in your test script. For example, the correct syntax is mdapy.version. Additionally, if you are reading a file with a postfix other than .dump or .data, you should explicitly specify its format by passing "format='dump'" or "format='data'".

If you have any other questions, please let me know.

from mdapy.

mushroomfire avatar mushroomfire commented on June 3, 2024

Furthermore, does mdapy offer a feature that allows for targeted selection within specific regions? For instance, I'm interested in computing thermodynamic properties for particles of type 1 specifically within the region where 0 < z < 5. Is there a mechanism to narrow down such calculations without considering the entire dataset?

mdapy currently can not provide the selection feature like in ovito. For a small system, you can directly calculate the entire system, and the speed is similar to calculate a specific region. If your system is very large, you can manually select the region you are interested in, and then generate a new system to compute it.

For example:

data = system.data
select = data[(data['type']==1) & (data['z']<5) & (data['z']>0)] # do what you want to do

new_system = mp.System(pos = select[['x', 'y', 'z']].values, box=system.box, boundary=system.boundary)
# now you can calculate the new_system.

from mdapy.

XiTanna avatar XiTanna commented on June 3, 2024

Thanks for the detailed guidance. Now I have successfully run it through source code installation. It is hoped that in the future, direct processing of trajectories and time averaging can be supported.

from mdapy.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.