Giter Club home page Giter Club logo

Comments (5)

pierrehirel avatar pierrehirel commented on July 25, 2024

Dear Sir,

Thank you for bringing this to my attention. What you are asking for is actually not implemented in Atomsk.

The command that you mention above does the following: atoms inside the box are selected (let's call them atoms of group A); then 18 random atoms are selected (group B); and then the intersection between the two groups is computed. In other words, the 18 random atoms are not picked among group A, they are chosen among all atoms, and only after that the intersection between the two groups is selected.

I will think of a way to implement what you ask, and come back here when it is done.

In the mean time, I suggest you to split the system in two parts: construct a block of perfect crystal; then construct a block containing the 18 random vacancies; and finally, stack them on top on each other (this can be done with mode "--merge"). That should produce the result you expect.

Best regards

from atomsk.

pierrehirel avatar pierrehirel commented on July 25, 2024

I implemented the possibility to select atoms among a previous selection, with the keyword "among". You can try it by replacing "intersect" with "among" in your command-line:

atomsk initial.xyz -select in box 0 198 0 INF 372 INF -select among random 18 Fe -rmatom select final.xyz

Please let me know if it behaves as expected and if it fixes your problem.

from atomsk.

AIzquierdo2 avatar AIzquierdo2 commented on July 25, 2024

Dear Pierre,

Thank you very much for looking into this. I had gone around this problem initially by making a short bash script that makes vacancies by a small amount and rejects the output if they were not all within the desired region. Not very efficient, as you can imagine.

I tested the implementation you made and it works. The only small issue, though, is that it seems that the X and Y axis are swapped so doing

atomsk initial.xyz -select in box 0 50 0 INF 0 INF -select among random 18 Fe -rmatom select final.xyz

will ensure that the 18 vacancies are within a region 0 to INF on the X direction and 0 to 50 angstroms on Y direction. The Z axis works fine.

Thanks a lot for you kind assistance,

Angel

from atomsk.

pierrehirel avatar pierrehirel commented on July 25, 2024

Yes the behaviour you describe is expected, because the syntax to select inside a box is:

-select in box xmin ymin zmin xmax ymax zmax

So, in your command you specified xmin=0 and xmax=INF, and ymin=50 and ymax=0. Atomsk automatically sorts things out so that ymin<ymax, that's why you end up with ymin=0 and ymax=50.

I know that this logic is different from what you can find in other codes, for instance LAMMPS uses the following syntax in the "region" command:

region 1 block xlo xhi ylo yhi zlo zhi

However Atomsk uses a different syntax, as explained above. Please refer to the documentation for more information.

Hope this solves the issue.

from atomsk.

AIzquierdo2 avatar AIzquierdo2 commented on July 25, 2024

Yes it does. Thank you very much for the quick reply.

regards

from atomsk.

Related Issues (20)

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.