VasiliBaranov / packing-generation

Hard-sphere packing generation in C++ with the Lubachevsky–Stillinger, Jodrey–Tory, and force-biased algorithms and packing post-processing.
MIT License
106 stars 43 forks source link

Error when trying to start with diameters.txt #25

Closed anton2tchekov closed 3 years ago

anton2tchekov commented 3 years ago

Dear Dr. Baranov,

I am a PhD student working on beads packing. I developed a python script generating dense polydisperse packing in 2D and it works well but now I need a 3D version for the following of my thesis.

I recently found out your great package that I managed to use to generate monodisperse close packing. However when I tried to use a diameters.txt file with random radii instead of copying packing.xyzd from the Docs folder I get an error that I don't understand.

The only thing I changed when I generated the solution on VisualStudio is that I commented few lines like these: _DenseBase::segment(Index start, Index size) const { EIGEN_STATIC_ASSERT_VECTORONLY(Derived) return ConstSegmentReturnType(derived(), start, size); }

The reason was that these gave me some errors (c2373 and c2447) that I did not succeed to correct (I nearly know nothing in C++). Any chance that these lines I commented are the source of my problem?

Thanks a lot!

Antoine Montiel

Capture

VasiliBaranov commented 3 years ago

Hi Antoine,

sorry for a long time to reply.

I can only make several wild guesses that may or may not be helpful.

If nothing helps, you can also try to use packing.xyzd directly instead of diameters.txt: i.e., you place particles at random positions, but you set their diameters as you intended. Then you put this file instead of diameters.txt. This generation script can be easily written in Python with numpy.

Hope this helps!

Best Regards, Vasili

anton2tchekov commented 3 years ago

Hello Vasili, happy new year,

Thanks a lot for your help. Finally I managed to use your compiled version and it works perfectly on Windows 10. I came to the same conclusions concerning my compiling, I guess the compiler raises some errors because it is a newer version and it does not support anymore the way you coded your algo.

May I ask you another question? Now I need a Linux version to be used in my calculator. How can I do since until now I used your precompiled .exe?

Best regards,

Antoine

VasiliBaranov commented 3 years ago

Dear Antoine,

I guess the compiler raises some errors because it is a newer version and it does not support anymore the way you coded your algo.

Yes, exactly. Though the error seems to come from the library that i used back then, Eigen, https://en.wikipedia.org/wiki/Eigen_(C%2B%2B_library) , http://eigen.tuxfamily.org/index.php?title=Main_Page

May I ask you another question? Now I need a Linux version to be used in my calculator. How can I do since until now I used your precompiled .exe?

Unfortunately i don't have a precompiled version for Linux, so you unfortunately have to compile it yourself (with the gcc compiler and the make files, see https://github.com/VasiliBaranov/packing-generation/wiki/Compilation and the folder _Release). If you see errors like above, you have several options:

Hope this helps!

Best Regards, Vasili

anton2tchekov commented 3 years ago

Hello Vasili,

I succeeded to compile your package on Linux using make. So a big thanks for your help and advice.

Best regards,

Antoine