Closed fcgrogan closed 4 years ago
Your code should work just fine. Can you please specify which version of PyGran you're using? The recently added "multisphere.py" example also works without any problems in v1.2.2 and above.
I'm using v1.2.1 on Ubuntu 18.04.
I just noticed in "CHANGELOG.md" it says "New interface for user-defined functions used in multisphere particles" under v1.2.2. I updated PyGran according to the instructions you provided on another issue (or at least thought I did) as the final step pip3 install . --upgrade
gave me the following
Processing /home/<user>/PyGran
Collecting numpy (from PyGran==1.2.2)
Using cached https://files.pythonhosted.org/packages/62/20/4d43e141b5bc426ba38274933ef8e76e85c7adea2c321ecf9ebf7421cedf/numpy-1.18.1-cp36-cp36m-manylinux1_x86_64.whl
Collecting scipy (from PyGran==1.2.2)
Using cached https://files.pythonhosted.org/packages/dc/29/162476fd44203116e7980cfbd9352eef9db37c49445d1fec35509022f6aa/scipy-1.4.1-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: numpy, scipy, PyGran
Running setup.py install for PyGran ... done
Successfully installed PyGran-1.2.2 numpy-1.18.1 scipy-1.4.1
However, "multisphere.py" still failed in the same way, and when I checked
import PyGran._version
PyGran._version.__version__
it still said I had v1.2.1. I'm assuming this means I messed up the upgrade and am still only on v1.2.1. However, I'm still unable to get "multisphere.py" to work on v1.2.1 (stack trace the same as the above post).
I see where the problem is right now. v1.2.2 is still experimental, i.e. I have not yet packaged it via pypi. It's only available from github for now. Plz try to remove pygran completely via: "pip uninstall pygran". Then clone the pygran repo and run from the source dir: "pip install . --user".
pip uninstall pygran
git clone https://github.com/Andrew-AbiMansour/PyGran
cd PyGran
git submodule init
git submodule update
pip install . --user
Thank you for your help! I upgraded to v1.2.2 and was able to run 'multisphere.py' (it did give me "WARNING: Energy calculated for multisphere particles is currently not correct (../fix_multisphere.cpp:1312)", but this is from LIGGGHTS.log, not PyGran).
Yup that's a feature still in the works in LIGGGHTS v3.8.0. If you encounter any other problems, plz feel free to report them as new issues.
I'm trying to create custom non-spherical particles using multispheres. When I run compaction.py (replacing the original species parameters with the line below)
I get the following stack trace:
On another note, I noticed you put up a new multisphere.py example, but it seems like
template_multisphere()
is not quite fully functional yet?I was wondering if this more general template was going to be added to PyGranSim/models.py in the near future.