prisms-center / CASMcode

First-principles statistical mechanical software for the study of multi-component crystalline solids
Other
105 stars 70 forks source link

How to enable selective dynamics in POSCAR? #325

Open sjtuzhanglei opened 1 year ago

sjtuzhanglei commented 1 year ago

As the title said, where I could set this functionality in CASM?

This selective dynamics is absent in prim.json, I am not sure where I could add it.

Thanks!

xivh commented 1 year ago

This is how to set selective dynamics by species: link

However, I tried casm-calc --setup and it did not work.

sjtuzhanglei commented 1 year ago

Looks like the source code needs to be modified. May I know where those source code are located in a condo environment installation?

bpuchala commented 1 year ago

I would add that use of selective dynamics is not very completely tested and supported. The specification in the prim according to that link should work and find the correct symmetry. Also, enumeration should work and structures in the CASM structure JSON representation with the correct selective dynamics tags can be queried using ccasm query -k structure -o out.json. Other aspects may not be tested. For instance, mapping calculated results back onto the prim may not work.

As an example, the following can be used for enumeration with the attached prim.json and enumeration input file enum.json:

ccasm init
ccasm enum -m ConfigEnumAllOccupations -s enum.json
ccasm select --set-on
ccasm query -k structure -o query.json

enum.json prim.json

The conda package installation installs the C++ libraries as binaries. To edit that source code you will need to clone the repository and compile from source. The casm-python Python packages are installed in the typical Python site_packages location, which you could see using help('casm') from the Python CLI prompt.

sjtuzhanglei commented 1 year ago

casm enum --method ScelEnum -i {"max": 4, "dirs": "ab"} ERROR: ERROR: Could not read JSON. Please check your formatting. For instance, try http://www.jsoneditoronline.org.

Is it because my prim.json is wrong?

{ "basis" : [ { "coordinate" : [ 0.150867244979, 0.149328229822, 0.803110000293 ], "occupant_dof" : [ "H_mobile", "Va_mobile" ] }, { "coordinate" : [ 0.651782873113, 0.150485118292, 0.803722691279 ], "occupant_dof" : [ "H_mobile", "Va_mobile" ] }, { "coordinate" : [ 0.004046319883, 0.341794371612, 0.786592827490 ], "occupant_dof" : [ "H_mobile", "Va_mobile" ] }, { "coordinate" : [ -0.001395905736, 0.697270998697, 0.786632472809 ], "occupant_dof" : [ "H_mobile", "Va_mobile" ] }, { "coordinate" : [ 0.500159222103, 0.696603487561, 0.786861137536 ], "occupant_dof" : [ "H_mobile", "Va_mobile" ] }, { "coordinate" : [ 0.506100869374, 0.342626173800, 0.786947509079 ], "occupant_dof" : [ "H_mobile", "Va_mobile" ] }, { "coordinate" : [ 0.250000000000, 0.097170096664, 0.333333333333 ], "occupant_dof" : [ "Ru_fixed" ] }, { "coordinate" : [ 0.750000000000, 0.097170096664, 0.333333333333 ], "occupant_dof" : [ "Ru_fixed" ] }, { "coordinate" : [ 0.000000000000, 0.597170096664, 0.333333333333 ], "occupant_dof" : [ "Ru_fixed" ] }, { "coordinate" : [ 0.500000000000, 0.597170096664, 0.333333333333 ], "occupant_dof" : [ "Ru_fixed" ] }, { "coordinate" : [ 0.250000000000, 0.597170096664, 0.458333333333 ], "occupant_dof" : [ "Ru_fixed" ] }, { "coordinate" : [ 0.750000000000, 0.597170096664, 0.458333333333 ], "occupant_dof" : [ "Ru_fixed" ] }, { "coordinate" : [ 0.000000000000, 0.097170096664, 0.458333333333 ], "occupant_dof" : [ "Ru_fixed" ] }, { "coordinate" : [ 0.500000000000, 0.097170096664, 0.458333333333 ], "occupant_dof" : [ "Ru_fixed" ] }, { "coordinate" : [ 0.250074310052, 0.092022033269, 0.583285866840 ], "occupant_dof" : [ "Ru_mobile" ] }, { "coordinate" : [ 0.749985083659, 0.091984224109, 0.583307194727 ], "occupant_dof" : [ "Ru_mobile" ] }, { "coordinate" : [ 0.500182092636, 0.592972735276, 0.583384234125 ], "occupant_dof" : [ "Ru_mobile" ] }, { "coordinate" : [ -0.000076296723, 0.592930036091, 0.583403757660 ], "occupant_dof" : [ "Ru_mobile" ] }, { "coordinate" : [ 0.250255849209, 0.605545796047, 0.706783931308 ], "occupant_dof" : [ "Ru_mobile" ] }, { "coordinate" : [ 0.750567146063, 0.605443060657, 0.706700330087 ], "occupant_dof" : [ "Ru_mobile" ] }, { "coordinate" : [ 0.501579628417, 0.108761670309, 0.706011254699 ], "occupant_dof" : [ "Ru_mobile" ] }, { "coordinate" : [ 0.000344838820, 0.108559124382, 0.705633042881 ], "occupant_dof" : [ "Ru_mobile" ] }, { "coordinate" : [ 0.250000000000, 0.402829007152, 0.333333557379 ], "occupant_dof" : [ "O_fixed" ] }, { "coordinate" : [ 0.750000000000, 0.402829007152, 0.333333557379 ], "occupant_dof" : [ "O_fixed" ] }, { "coordinate" : [ 0.250000000000, 0.791511186175, 0.333333109287 ], "occupant_dof" : [ "O_fixed" ] }, { "coordinate" : [ 0.750000000000, 0.791511186175, 0.333333109287 ], "occupant_dof" : [ "O_fixed" ] }, { "coordinate" : [ 0.003972009627, 0.182826419745, 0.792185582900 ], "occupant_dof" : [ "O_mobile" ] }, { "coordinate" : [ 0.505403228910, 0.183905674052, 0.792327839983 ], "occupant_dof" : [ "O_mobile" ] }, { "coordinate" : [ 0.500326287585, 0.576120043904, 0.763596261390 ], "occupant_dof" : [ "O_mobile" ] }, { "coordinate" : [ 0.000125341084, 0.575560396220, 0.763749925254 ], "occupant_dof" : [ "O_mobile" ] }, { "coordinate" : [ 0.250000000000, 0.902829007152, 0.458333557379 ], "occupant_dof" : [ "O_fixed" ] }, { "coordinate" : [ 0.750000000000, 0.902829007152, 0.458333557379 ], "occupant_dof" : [ "O_fixed" ] }, { "coordinate" : [ 0.250000000000, 0.291511186175, 0.458333109287 ], "occupant_dof" : [ "O_fixed" ] }, { "coordinate" : [ 0.750000000000, 0.291511186175, 0.458333109287 ], "occupant_dof" : [ "O_fixed" ] }, { "coordinate" : [ 0.000000000000, 0.597170992848, 0.409748060955 ], "occupant_dof" : [ "O_fixed" ] }, { "coordinate" : [ 0.500000000000, 0.597170992848, 0.409748060955 ], "occupant_dof" : [ "O_fixed" ] }, { "coordinate" : [ 0.000000000000, 0.097169200479, 0.381918605711 ], "occupant_dof" : [ "O_fixed" ] }, { "coordinate" : [ 0.500000000000, 0.097169200479, 0.381918605711 ], "occupant_dof" : [ "O_fixed" ] }, { "coordinate" : [ 0.250119135087, 0.399039696131, 0.584289998362 ], "occupant_dof" : [ "O_mobile" ] }, { "coordinate" : [ 0.749957284946, 0.399155563521, 0.584285674858 ], "occupant_dof" : [ "O_mobile" ] }, { "coordinate" : [ 0.250118585747, 0.786618838171, 0.582516944849 ], "occupant_dof" : [ "O_mobile" ] }, { "coordinate" : [ 0.749902453396, 0.786485592654, 0.582509467531 ], "occupant_dof" : [ "O_mobile" ] }, { "coordinate" : [ 0.000000000000, 0.097170992848, 0.534748060955 ], "occupant_dof" : [ "O_fixed" ] }, { "coordinate" : [ 0.500000000000, 0.097170992848, 0.534748060955 ], "occupant_dof" : [ "O_fixed" ] }, { "coordinate" : [ 0.000000000000, 0.597169200479, 0.506918605711 ], "occupant_dof" : [ "O_fixed" ] }, { "coordinate" : [ 0.500000000000, 0.597169200479, 0.506918605711 ], "occupant_dof" : [ "O_fixed" ] }, { "coordinate" : [ 0.250639052253, 0.911071157494, 0.714608567360 ], "occupant_dof" : [ "O_mobile" ] }, { "coordinate" : [ 0.750934022462, 0.911130164844, 0.714477861581 ], "occupant_dof" : [ "O_mobile" ] }, { "coordinate" : [ 0.250748775392, 0.301028716907, 0.704005926340 ], "occupant_dof" : [ "O_mobile" ] }, { "coordinate" : [ 0.750957211206, 0.300724299743, 0.703918144490 ], "occupant_dof" : [ "O_mobile" ] }, { "coordinate" : [ 0.500170213627, 0.610198923286, 0.659927548267 ], "occupant_dof" : [ "O_mobile" ] }, { "coordinate" : [ 0.000314316994, 0.610305683855, 0.659853413931 ], "occupant_dof" : [ "O_mobile" ] }, { "coordinate" : [ 0.499891123010, 0.086250375123, 0.631632192010 ], "occupant_dof" : [ "O_mobile" ] }, { "coordinate" : [ 0.000147053752, 0.086065589826, 0.631667994967 ], "occupant_dof" : [ "O_mobile" ] } ], "coordinate_mode" : "Fractional", "description": "Rutile, selectivedynamics", "lattice_vectors" : [ [ 6.243135755895, -0.000000000000, 0.000000000000 ], [ 0.000000000000, 6.398106514699, 0.000011057101 ], [ 0.000000000000, -0.000044228402, 25.592426058795 ] ], "title" : "H2Ru8O16", "species" : { "Ru_fixed": { "properties": { "selectivedynamics": { "value": [0, 0, 0] } } }, "O_fixed": { "properties": { "selectivedynamics": { "value": [0, 0, 0] } } }, "Ru_mobile": { "properties": { "selectivedynamics": { "value": [1, 1, 1] } } }, "O_mobile": { "properties": { "selectivedynamics": { "value": [1, 1, 1] } } }, "H_mobile": { "properties": { "selectivedynamics": { "value": [1, 1, 1] }
}
}, "Va_mobile": { "properties": { "selectivedynamics": { "value": [1, 1, 1] } } } } }

sjtuzhanglei commented 1 year ago

The one after CASM init:

{ "basis" : [ { "coordinate" : [ 0.150867244979, 0.149328229822, 0.803110000293 ], "occupants" : [ "H_mobile", "Va_mobile" ] }, { "coordinate" : [ 0.651782873113, 0.150485118292, 0.803722691279 ], "occupants" : [ "H_mobile", "Va_mobile" ] }, { "coordinate" : [ 0.004046319883, 0.341794371612, 0.786592827490 ], "occupants" : [ "H_mobile", "Va_mobile" ] }, { "coordinate" : [ -0.001395905736, 0.697270998697, 0.786632472809 ], "occupants" : [ "H_mobile", "Va_mobile" ] }, { "coordinate" : [ 0.500159222103, 0.696603487561, 0.786861137536 ], "occupants" : [ "H_mobile", "Va_mobile" ] }, { "coordinate" : [ 0.506100869374, 0.342626173800, 0.786947509079 ], "occupants" : [ "H_mobile", "Va_mobile" ] }, { "coordinate" : [ 0.250000000000, 0.097170096664, 0.333333333333 ], "occupants" : [ "Ru_fixed" ] }, { "coordinate" : [ 0.750000000000, 0.097170096664, 0.333333333333 ], "occupants" : [ "Ru_fixed" ] }, { "coordinate" : [ 0.000000000000, 0.597170096664, 0.333333333333 ], "occupants" : [ "Ru_fixed" ] }, { "coordinate" : [ 0.500000000000, 0.597170096664, 0.333333333333 ], "occupants" : [ "Ru_fixed" ] }, { "coordinate" : [ 0.250000000000, 0.597170096664, 0.458333333333 ], "occupants" : [ "Ru_fixed" ] }, { "coordinate" : [ 0.750000000000, 0.597170096664, 0.458333333333 ], "occupants" : [ "Ru_fixed" ] }, { "coordinate" : [ 0.000000000000, 0.097170096664, 0.458333333333 ], "occupants" : [ "Ru_fixed" ] }, { "coordinate" : [ 0.500000000000, 0.097170096664, 0.458333333333 ], "occupants" : [ "Ru_fixed" ] }, { "coordinate" : [ 0.250074310052, 0.092022033269, 0.583285866840 ], "occupants" : [ "Ru_mobile" ] }, { "coordinate" : [ 0.749985083659, 0.091984224109, 0.583307194727 ], "occupants" : [ "Ru_mobile" ] }, { "coordinate" : [ 0.500182092636, 0.592972735276, 0.583384234125 ], "occupants" : [ "Ru_mobile" ] }, { "coordinate" : [ -0.000076296723, 0.592930036091, 0.583403757660 ], "occupants" : [ "Ru_mobile" ] }, { "coordinate" : [ 0.250255849209, 0.605545796047, 0.706783931308 ], "occupants" : [ "Ru_mobile" ] }, { "coordinate" : [ 0.750567146063, 0.605443060657, 0.706700330087 ], "occupants" : [ "Ru_mobile" ] }, { "coordinate" : [ 0.501579628417, 0.108761670309, 0.706011254699 ], "occupants" : [ "Ru_mobile" ] }, { "coordinate" : [ 0.000344838820, 0.108559124382, 0.705633042881 ], "occupants" : [ "Ru_mobile" ] }, { "coordinate" : [ 0.250000000000, 0.402829007152, 0.333333557379 ], "occupants" : [ "O_fixed" ] }, { "coordinate" : [ 0.750000000000, 0.402829007152, 0.333333557379 ], "occupants" : [ "O_fixed" ] }, { "coordinate" : [ 0.250000000000, 0.791511186175, 0.333333109287 ], "occupants" : [ "O_fixed" ] }, { "coordinate" : [ 0.750000000000, 0.791511186175, 0.333333109287 ], "occupants" : [ "O_fixed" ] }, { "coordinate" : [ 0.003972009627, 0.182826419745, 0.792185582900 ], "occupants" : [ "O_mobile" ] }, { "coordinate" : [ 0.505403228910, 0.183905674052, 0.792327839983 ], "occupants" : [ "O_mobile" ] }, { "coordinate" : [ 0.500326287585, 0.576120043904, 0.763596261390 ], "occupants" : [ "O_mobile" ] }, { "coordinate" : [ 0.000125341084, 0.575560396220, 0.763749925254 ], "occupants" : [ "O_mobile" ] }, { "coordinate" : [ 0.250000000000, 0.902829007152, 0.458333557379 ], "occupants" : [ "O_fixed" ] }, { "coordinate" : [ 0.750000000000, 0.902829007152, 0.458333557379 ], "occupants" : [ "O_fixed" ] }, { "coordinate" : [ 0.250000000000, 0.291511186175, 0.458333109287 ], "occupants" : [ "O_fixed" ] }, { "coordinate" : [ 0.750000000000, 0.291511186175, 0.458333109287 ], "occupants" : [ "O_fixed" ] }, { "coordinate" : [ 0.000000000000, 0.597170992848, 0.409748060955 ], "occupants" : [ "O_fixed" ] }, { "coordinate" : [ 0.500000000000, 0.597170992848, 0.409748060955 ], "occupants" : [ "O_fixed" ] }, { "coordinate" : [ 0.000000000000, 0.097169200479, 0.381918605711 ], "occupants" : [ "O_fixed" ] }, { "coordinate" : [ 0.500000000000, 0.097169200479, 0.381918605711 ], "occupants" : [ "O_fixed" ] }, { "coordinate" : [ 0.250119135087, 0.399039696131, 0.584289998362 ], "occupants" : [ "O_mobile" ] }, { "coordinate" : [ 0.749957284946, 0.399155563521, 0.584285674858 ], "occupants" : [ "O_mobile" ] }, { "coordinate" : [ 0.250118585747, 0.786618838171, 0.582516944849 ], "occupants" : [ "O_mobile" ] }, { "coordinate" : [ 0.749902453396, 0.786485592654, 0.582509467531 ], "occupants" : [ "O_mobile" ] }, { "coordinate" : [ 0.000000000000, 0.097170992848, 0.534748060955 ], "occupants" : [ "O_fixed" ] }, { "coordinate" : [ 0.500000000000, 0.097170992848, 0.534748060955 ], "occupants" : [ "O_fixed" ] }, { "coordinate" : [ 0.000000000000, 0.597169200479, 0.506918605711 ], "occupants" : [ "O_fixed" ] }, { "coordinate" : [ 0.500000000000, 0.597169200479, 0.506918605711 ], "occupants" : [ "O_fixed" ] }, { "coordinate" : [ 0.250639052253, 0.911071157494, 0.714608567360 ], "occupants" : [ "O_mobile" ] }, { "coordinate" : [ 0.750934022462, 0.911130164844, 0.714477861581 ], "occupants" : [ "O_mobile" ] }, { "coordinate" : [ 0.250748775392, 0.301028716907, 0.704005926340 ], "occupants" : [ "O_mobile" ] }, { "coordinate" : [ 0.750957211206, 0.300724299743, 0.703918144490 ], "occupants" : [ "O_mobile" ] }, { "coordinate" : [ 0.500170213627, 0.610198923286, 0.659927548267 ], "occupants" : [ "O_mobile" ] }, { "coordinate" : [ 0.000314316994, 0.610305683855, 0.659853413931 ], "occupants" : [ "O_mobile" ] }, { "coordinate" : [ 0.499891123010, 0.086250375123, 0.631632192010 ], "occupants" : [ "O_mobile" ] }, { "coordinate" : [ 0.000147053752, 0.086065589826, 0.631667994967 ], "occupants" : [ "O_mobile" ] } ], "coordinate_mode" : "Fractional", "lattice_vectors" : [ [ 6.243135755895, -0.000000000000, 0.000000000000 ], [ 0.000000000000, 6.398106514699, 0.000011057101 ], [ 0.000000000000, -0.000044228402, 25.592426058795 ] ], "species" : { "H_mobile" : { "atoms" : [ { "coordinate" : [ 0.000000000000, 0.000000000000, 0.000000000000 ], "name" : "H_mobile" } ], "name" : "H_mobile", "properties" : { "selectivedynamics" : { "value" : [ 1.000000000000, 1.000000000000, 1.000000000000 ] } } }, "O_fixed" : { "atoms" : [ { "coordinate" : [ 0.000000000000, 0.000000000000, 0.000000000000 ], "name" : "O_fixed" } ], "name" : "O_fixed", "properties" : { "selectivedynamics" : { "value" : [ 0.000000000000, 0.000000000000, 0.000000000000 ] } } }, "O_mobile" : { "atoms" : [ { "coordinate" : [ 0.000000000000, 0.000000000000, 0.000000000000 ], "name" : "O_mobile" } ], "name" : "O_mobile", "properties" : { "selectivedynamics" : { "value" : [ 1.000000000000, 1.000000000000, 1.000000000000 ] } } }, "Ru_fixed" : { "atoms" : [ { "coordinate" : [ 0.000000000000, 0.000000000000, 0.000000000000 ], "name" : "Ru_fixed" } ], "name" : "Ru_fixed", "properties" : { "selectivedynamics" : { "value" : [ 0.000000000000, 0.000000000000, 0.000000000000 ] } } }, "Ru_mobile" : { "atoms" : [ { "coordinate" : [ 0.000000000000, 0.000000000000, 0.000000000000 ], "name" : "Ru_mobile" } ], "name" : "Ru_mobile", "properties" : { "selectivedynamics" : { "value" : [ 1.000000000000, 1.000000000000, 1.000000000000 ] } } }, "Va_mobile" : { "atoms" : [ { "coordinate" : [ 0.000000000000, 0.000000000000, 0.000000000000 ], "name" : "Va_mobile" } ], "name" : "Va_mobile", "properties" : { "selectivedynamics" : { "value" : [ 1.000000000000, 1.000000000000, 1.000000000000 ] } } } }, "title" : "H2Ru8O16" }

bpuchala commented 1 year ago

With the -i option, the JSON needs to be wrapped in quotes: ccasm enum --method ScelEnum -i '{"max": 4, "dirs": "ab"}'.

sjtuzhanglei commented 1 year ago

Thanks Brian, I have set up as you suggested.

I found my POSCAR in the configuration folder has the normal H O Ru atomic species tag without the 'selective dynamics' line, but each atomic coordinate line is appended with the artificial species e.g. H_mobile, O_mobile, O_fix, Ru_mobile, Ru_fix.

Then I found the upper directory has a structure.json file, which has the 'selective dynamics' settings.

Since POSCAR is still not reflecting the 'selective dynamics', does it mean CASM read this 'selective dynamics' info from the structure.json file? For the next relax run, once CONTCAR is copied to POSCAR, even the artificial species tag will be lost. Does it mean as long as the structure.json file is there, 'selective dynamics' will be always under control?

sjtuzhanglei commented 1 year ago

I just want to make sure the 'selective dynamics' is taking into effect. I checked my CONTCAR, it seems that the bottom layers are not strictly fixed but relaxed a little bit.

bpuchala commented 1 year ago

As I noted, using selective dynamics is not fully supported currently. It can be thought of as an experimental feature that we anticipated would be useful but haven't fully implemented and tested.

CASM reads the "selectivedynamics" property from prim.json and includes it in the species properties for occupants associated with discrete occupation degrees of freedom in the Prim. CASM uses this to determine allowed symmetry operations in the prim factor group. Then it can use these symmetry operations to enumerate configurations and keep only symmetrically distinct configurations. The Configuration data structure holds the discrete occupation variables at each site. These occupation variables then encode which sites are occupied by fixed vs mobile occupants. The Configuration can then be converted to a SimpleStructure C++ data structure, comprising lattice vectors, site coordinates, atom types and properties, etc. as output in structure.json. This is part seems to be working as needed.

Since POSCAR is still not reflecting the 'selective dynamics', does it mean CASM read this 'selective dynamics' info from the structure.json file?

Enumerated configurations are stored in a file in the .casm directory. A Configuration is converted to a SimpleStructure which is in turn converted to a POSCAR string (poscar query function ) respecting selective dynamics atom properties (here), but this does not seem to be happening correctly.

For the next relax run, once CONTCAR is copied to POSCAR, even the artificial species tag will be lost. Does it mean as long as the structure.json file is there, 'selective dynamics' will be always under control?

The structure.json file does provide the necessary information, and gets read in and used to create the VASP input files, but the selective dynamics flags needs to be included in the generated POSCARs. It looks like the selective dynamics flags is not being read currently during the read_structure_json function at the first link.

Additionally, mapping results back to configurations while respecting the flags, is not implemented or tested for selective dynamics. If you able to work on selective dynamics support through these steps, I could provide some support pointing you to where functionality is implemented, etc.

sjtuzhanglei commented 1 year ago

Hi Brian,

Thanks for explaining this. Is it because the selective dynamics is default to be inactive? I found this in VaspIO.cc line 41:

  m_sel_dynamics(false),

In that case, the best way is to change this and recompile from source code?

Best,

On Mon, Nov 6, 2023 at 2:25 PM Brian Puchala @.***> wrote:

As I noted, using selective dynamics is not fully supported currently. It can be thought of as an experimental feature that we anticipated would be useful but haven't fully implemented and tested.

CASM reads the "selectivedynamics" property from prim.json and includes it in the species properties for occupants associated with discrete occupation degrees of freedom in the Prim. CASM uses this to determine allowed symmetry operations in the prim factor group. Then it can use these symmetry operations to enumerate configurations and keep only symmetrically distinct configurations. The Configuration data structure holds the discrete occupation variables at each site. These occupation variables then encode which sites are occupied by fixed vs mobile occupants. The Configuration can then be converted to a SimpleStructure C++ data structure, comprising lattice vectors, site coordinates, atom types and properties, etc. as output in structure.json. This is part seems to be working as needed.

Since POSCAR is still not reflecting the 'selective dynamics', does it mean CASM read this 'selective dynamics' info from the structure.json file?

Enumerated configurations are stored in a file in the .casm directory. A Configuration is converted to a SimpleStructure which is in turn converted to a POSCAR string (poscar query function https://github.com/prisms-center/CASMcode/blob/eb5f18051d1e59c2b18305c5347cebbe8b58ed96/src/casm/clex/ConfigIO.cc#L1210 ) respecting selective dynamics atom properties (here https://github.com/prisms-center/CASMcode/blob/eb5f18051d1e59c2b18305c5347cebbe8b58ed96/src/casm/crystallography/io/VaspIO.cc#L44), but this does not seem to be happening correctly.

For the next relax run, once CONTCAR is copied to POSCAR, even the artificial species tag will be lost. Does it mean as long as the structure.json file is there, 'selective dynamics' will be always under control?

The structure.json file does provide the necessary information, and gets read in https://github.com/prisms-center/CASMpython/blob/7cb55a10cfecf66e3fae1895aa9d1d2f9feb794c/casm/casm/vasp/io/poscar.py#L116C14-L116C14 and used to create the VASP input files https://github.com/prisms-center/CASMpython/blob/7cb55a10cfecf66e3fae1895aa9d1d2f9feb794c/casm/casm/vaspwrapper/vasp_calculator_base.py#L137, but the selective dynamics flags needs to be included in the generated POSCARs. It looks like the selective dynamics flags is not being read currently during the read_structure_json function at the first link.

Additionally, mapping results back to configurations while respecting the flags, is not implemented or tested for selective dynamics. If you able to work on selective dynamics support through these steps, I could provide some support pointing you to where functionality is implemented, etc.

— Reply to this email directly, view it on GitHub https://github.com/prisms-center/CASMcode/issues/325#issuecomment-1796136619, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEDNA5K2O3IEPEQTIWC2Z73YDE2T7AVCNFSM6AAAAAA63F4XF6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOJWGEZTMNRRHE . You are receiving this because you authored the thread.Message ID: @.***>

-- Lei Zhang Postdoc Scholar Mechanical Engineering Carnegie Mellon University Google Scholar https://scholar.google.com/citations?hl=en&view_op=list_works&gmla=AJsN-F51HKnfWWVxbsFk4uAWX43G9CzcwBr_848Z2BxrFiXa0q6bPGZqhzAADPpA0vojEKOVP8bkTFTV3wDI8XvJfy5V2hvIuRNadTccjO0J3niAX63sVSA&user=139-zKwAAAAJ Linkedin https://www.linkedin.com/in/lei-zhang-0b8aa126/

bpuchala commented 1 year ago

It will need to be fixed and re-compiled from source, yes. I'm not sure what the fix is. That line is the initialization, but line 44 should activate it to true, then 147, and 160 should evaluate to true. Not sure what's not working.