[ase-users] ase-users Digest, Vol 114, Issue 11

fabian Fabian.T89 at web.de
Thu Jan 18 11:13:33 CET 2018


Dear Ask


Here are two example files in POSCAR format to illustrate my problem:

The initial file looks like this and i want to move the Atom with the 
number 138 ( Co ) and Nr 28 (Ag) to the
top position. I want to do this for core level calculations in VASP. 
Line 1 , 6 and 7 need to
be changed accordingly. The constraints should be kept.

This is the original file:

Ag  C Co  H  N
  1.0000000000000000
     25.0000000000000000    0.0000000000000000 0.0000000000000000
      0.0000000000000000   25.0000000000000000 0.0000000000000000
      0.0000000000000000    0.0000000000000000 25.0000000000000000
   Ag   C  Co   H   N
  105  32   1  16   8
Selective dynamics
Direct
   0.6090803600000000  0.5857669400000001  0.4996232600000001   F F   F
   0.2799763200000001  0.3556645000000001  0.3821792600000001   F F   F
   0.1163763200000000  0.3556645000000001  0.3821792600000001   F F   F
   0.7707763200000000  0.2399821000000000  0.3821792600000001   F F   F
   0.6071763200000000  0.2399821000000000  0.3821792600000001   F F   F
   0.4435763200000000  0.2399821000000000  0.3821792600000001   F F   F
   0.2799763200000001  0.2399821000000000  0.3821792600000001   F F   F
   0.1163763200000000  0.2399821000000000  0.3821792600000001   F F   F
   0.7707763200000000  0.1242993000000000  0.3821792600000001   F F   F
   0.6071763200000000  0.1242993000000000  0.3821792600000001   F F   F
   0.4435763200000000  0.1242993000000000  0.3821792600000001   F F   F
   0.4435763200000000  0.3556645000000001  0.3821792600000001   F F   F
   0.2799763200000001  0.1242993000000000  0.3821792600000001   F F   F
   0.8525763200000001  0.8762369000000000  0.4400208600000000   F F   F
   0.6889763200000000  0.8762369000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.8762369000000000  0.4400208600000000   F F   F
   0.3617763199999999  0.8762369000000000  0.4400208600000000   F F   F
   0.6071763200000000  0.3556645000000001  0.3821792600000001   F F   F
   0.7707763200000000  0.3556645000000001  0.3821792600000001   F F   F
   0.1163763200000000  0.4713473000000000  0.3821792600000001   F F   F
   0.1163763200000000  0.7027125000000001  0.3821792600000001   F F   F
   0.4435763200000000  0.8183952999999999  0.3821792600000001   F F   F
   0.2799763200000001  0.8183952999999999  0.3821792600000001   F F   F
   0.1163763200000000  0.1242993000000000  0.3821792600000001   F F   F
   0.1166915600000000  0.7017219800000001  0.5023776999999999   F F   F
   0.7703688400000001  0.5868240600000000  0.4957197800000000   F F   F
   0.4283580400000001  0.5869699800000001  0.5117408999999999   F F   F
   0.4440308400000001  0.4709338599999999  0.4955598200000000   F F   F
   0.6051446400000000  0.3548827800000000  0.5000838200000000   F F   F
   0.7718089200000000  0.3552123400000001  0.4996821400000001   F F   F
   0.1079593200000000  0.4718153400000000  0.5064656200000001   F F   F
   0.2808980000000000  0.4720677400000000  0.5026511400000000   F F   F
   0.1156164000000000  0.5864674200000001  0.5026437000000000   F F   F
   0.6046482000000001  0.4729675000000000  0.4999921400000000   F F   F
   0.7853373200000000  0.4702147800000000  0.5118581799999999   F F   F
   0.2882623200000001  0.5866844200000000  0.5065793800000000   F F   F
   0.2798955600000000  0.3567740200000000  0.5024840200000000   F F   F
   0.4460259600000001  0.3525738200000001  0.5039260600000000   F F   F
   0.2768091600000001  0.1243713000000000  0.5023631800000000   F F   F
   0.1147546000000000  0.3562627400000000  0.5020041000000000   F F   F
   0.7712901200000001  0.2380044200000000  0.5018854200000000   F F   F
   0.6074153200000001  0.2395691800000000  0.5030330600000000   F F   F
   0.4436814000000001  0.2382351800000000  0.5020511800000000   F F   F
   0.2802522400000000  0.2407153800000000  0.5017992999999999   F F   F
   0.1153430400000000  0.2400188600000000  0.5018243400000000   F F   F
   0.7685268800000000  0.1244202600000000  0.5029229399999999   F F   F
   0.6071988000000000  0.1242661000000000  0.5021513399999999   F F   F
   0.4457270000000000  0.1237631000000000  0.5029607800000000   F F   F
   0.1195087600000000  0.1242921000000000  0.5023295400000000   F F   F
   0.6071763200000000  0.8183952999999999  0.3821792600000001   F F   F
   0.1163763200000000  0.8183952999999999  0.3821792600000001   F F   F
   0.7707763200000000  0.7027125000000001  0.3821792600000001   F F   F
   0.7707763200000000  0.8183952999999999  0.3821792600000001   F F   F
   0.4435763200000000  0.7027125000000001  0.3821792600000001   F F   F
   0.6099528000000000  0.7034191000000000  0.5010784600000000   F F   F
   0.4422784400000001  0.7025504200000000  0.4999780200000000   F F   F
   0.2814884400000001  0.7022537000000000  0.5019653400000000   F F   F
   0.5253763200000000  0.2978233000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.7605541000000001  0.4400208600000000   F F   F
   0.8525763200000001  0.5291885000000001  0.4400208600000000   F F   F
   0.3617763199999999  0.7605541000000001  0.4400208600000000   F F   F
   0.1981763200000000  0.7605541000000001  0.4400208600000000   F F   F
   0.8525763200000001  0.6448713000000000  0.4400208600000000   F F   F
   0.6889763200000000  0.6448713000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.6448713000000000  0.4400208600000000   F F   F
   0.3617763199999999  0.6448713000000000  0.4400208600000000   F F   F
   0.1981763200000000  0.6448713000000000  0.4400208600000000   F F   F
   0.6889763200000000  0.5291885000000001  0.4400208600000000   F F   F
   0.1981763200000000  0.4135061000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.5291885000000001  0.4400208600000000   F F   F
   0.3617763199999999  0.5291885000000001  0.4400208600000000   F F   F
   0.1981763200000000  0.5291885000000001  0.4400208600000000   F F   F
   0.8525763200000001  0.4135061000000000  0.4400208600000000   F F   F
   0.6889763200000000  0.4135061000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.4135061000000000  0.4400208600000000   F F   F
   0.3617763199999999  0.4135061000000000  0.4400208600000000   F F   F
   0.6071763200000000  0.7027125000000001  0.3821792600000001   F F   F
   0.7673126800000000  0.7051474600000001  0.5045174200000000   F F   F
   0.1161400400000000  0.8177720200000000  0.5017669400000000   F F   F
   0.8525763200000001  0.2978233000000000  0.4400208600000000   F F   F
   0.2799763200000001  0.5870301000000001  0.3821792600000001   F F   F
   0.2799763200000001  0.7027125000000001  0.3821792600000001   F F   F
   0.7707763200000000  0.5870301000000001  0.3821792600000001   F F   F
   0.2799763200000001  0.4713473000000000  0.3821792600000001   F F   F
   0.6071763200000000  0.5870301000000001  0.3821792600000001   F F   F
   0.4435763200000000  0.5870301000000001  0.3821792600000001   F F   F
   0.2811071200000000  0.8184734600000000  0.5019000200000000   F F   F
   0.1163763200000000  0.5870301000000001  0.3821792600000001   F F   F
   0.7707763200000000  0.4713473000000000  0.3821792600000001   F F   F
   0.6071763200000000  0.4713473000000000  0.3821792600000001   F F   F
   0.4435763200000000  0.4713473000000000  0.3821792600000001   F F   F
   0.8525763200000001  0.7605541000000001  0.4400208600000000   F F   F
   0.6889763200000000  0.7605541000000001  0.4400208600000000   F F   F
   0.1981763200000000  0.8762369000000000  0.4400208600000000   F F   F
   0.3617763199999999  0.2978233000000000  0.4400208600000000   F F   F
   0.4429855600000001  0.8199110600000000  0.5018481000000000   F F   F
   0.6889763200000000  0.2978233000000000  0.4400208600000000   F F   F
   0.6071245200000001  0.8185741400000001  0.5028047000000000   F F   F
   0.7706584399999999  0.8195798600000000  0.5020021400000000   F F   F
   0.3617763199999999  0.1821405000000000  0.4400208600000000   F F   F
   0.1981763200000000  0.1821405000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.1821405000000000  0.4400208600000000   F F   F
   0.6889763200000000  0.1821405000000000  0.4400208600000000   F F   F
   0.8525763200000001  0.1821405000000000  0.4400208600000000   F F   F
   0.1981763200000000  0.2978233000000000  0.4400208600000000   F F   F
   0.4738177600000000  0.4243317000000000  0.6074731400000001   T T   T
   0.3891376400000000  0.3792657000000000  0.6074843000000000   T T   T
   0.5929819600000000  0.6451439000000001  0.6094740600000000   T T   T
   0.4450681200000000  0.3763277000000000  0.6099905000000000   T T   T
   0.3627263200000000  0.4286837400000000  0.6025507000000000   T T   T
   0.6964393600000000  0.4514139400000001  0.6000701800000000   T T   T
   0.5149989600000001  0.6031284200000000  0.6008739800000000   T T   T
   0.3912292800000000  0.4764081400000000  0.5982081000000000   T T   T
   0.5030729200000000  0.6593205400000001  0.6030852999999999   T T   T
   0.5548970400000001  0.7419290200000001  0.6104686200000000   T T   T
   0.4548012800000000  0.6876971400000000  0.6011623000000000   T T   T
   0.5070244400000000  0.7703991400000000  0.6083248200000000   T T   T
   0.4575183200000000  0.7438516200000000  0.6042082200000000   T T   T
   0.4472749600000000  0.4736283400000001  0.5993271400000001   T T   T
   0.5523108000000001  0.6860696199999999  0.6080027000000000   T T   T
   0.7227203600000000  0.5403221000000000  0.5980567800000000   T T   T
   0.4886574000000000  0.5142680600000000  0.5982601800000000   T T   T
   0.7640161200000000  0.5810401800000000  0.5992672600000000   T T   T
   0.6813811200000001  0.6183715000000001  0.6100204600000000   T T   T
   0.5298712400000000  0.4361348600000000  0.6095252999999999   T T   T
   0.7081702400000001  0.3951871800000001  0.6022642600000000   T T   T
   0.7037590400000000  0.2840949400000000  0.6083366200000000   T T   T
   0.7563169999999999  0.3665955400000000  0.6009709400000000   T T   T
   0.6559585600000000  0.3127173800000000  0.6098748200000000   T T   T
   0.7533335600000000  0.3105012600000000  0.6045216200000000   T T   T
   0.7660062800000000  0.6782247800000001  0.6107509000000000   T T   T
   0.6182751200000001  0.4095003400000000  0.6084598200000000   T T   T
   0.8219276800000000  0.6754961000000000  0.6079473800000000   T T   T
   0.8484997599999999  0.6262288600000001  0.6023806600000000   T T   T
   0.8201119600000000  0.5784483400000000  0.5977756600000000   T T   T
   0.7373937200000000  0.6301992200000001  0.6078925400000000   T T   T
   0.6588323200000000  0.3685458200000000  0.6069962200000000   T T   T
   0.6056890800000000  0.5272941000000000  0.6019361800000000   T T   T
   0.7901668399999999  0.2872737800000000  0.6057155399999999   T T   T
   0.5932365600000000  0.7621030600000001  0.6146996200000000   T T   T
   0.5076192400000000  0.8138770200000001  0.6100819800000000   T T   T
   0.4206299600000001  0.7669855000000000  0.6047755000000000   T T   T
   0.4165518000000000  0.6668639400000000  0.6016806200000000   T T   T
   0.8405512399999999  0.5403697400000000  0.5926253800000000   T T   T
   0.3191790400000000  0.4294728600000001  0.6014517800000000   T T   T
   0.7453117600000000  0.7158554600000001  0.6178207400000000   T T   T
   0.8452907999999999  0.7121184600000001  0.6104885400000000   T T   T
   0.8920406799999999  0.6256093000000000  0.6009295400000000   T T   T
   0.6174960400000000  0.2927866200000000  0.6141005400000000   T T   T
   0.7946574799999999  0.3872661000000000  0.6020454600000000   T T   T
   0.7030673199999999  0.2406331800000000  0.6104611800000000   T T   T
   0.3709025200000000  0.5145899400000000  0.5933906200000000   T T   T
   0.4656575600000000  0.3385837000000000  0.6167625400000000   T T   T
   0.3656699600000000  0.3426898200000000  0.6097303000000001   T T   T
   0.6445762399999999  0.6559647800000000  0.6124961799999999   T T   T
   0.5382244000000000  0.4912794600000001  0.6041795000000000   T T   T
   0.6420933599999999  0.4600043400000000  0.6045427800000001   T T   T
   0.6731049600000000  0.5632332600000001  0.6042627000000000   T T   T
   0.4773552000000000  0.5661988200000000  0.5936113800000000   T T   T
   0.5666982000000000  0.3985929000000000  0.6116293400000000   T T   T
   0.7340422000000000  0.4884438600000000  0.5929399800000000   T T   T
   0.5693051200000000  0.5945938600000001  0.6053694199999999   T T   T

The result should look like this:


Co  Ag  C  H  N
  1.0000000000000000
     25.0000000000000000    0.0000000000000000 0.0000000000000000
      0.0000000000000000   25.0000000000000000 0.0000000000000000
      0.0000000000000000    0.0000000000000000 25.0000000000000000
   Co   Ag   C   H   N
  1  105  32  16   8
Selective dynamics
Direct
   0.6056890800000000  0.5272941000000000  0.6019361800000000   T T   T
   0.6090803600000000  0.5857669400000001  0.4996232600000001   F F   F
   0.2799763200000001  0.3556645000000001  0.3821792600000001   F F   F
   0.1163763200000000  0.3556645000000001  0.3821792600000001   F F   F
   0.7707763200000000  0.2399821000000000  0.3821792600000001   F F   F
   0.6071763200000000  0.2399821000000000  0.3821792600000001   F F   F
   0.4435763200000000  0.2399821000000000  0.3821792600000001   F F   F
   0.2799763200000001  0.2399821000000000  0.3821792600000001   F F   F
   0.1163763200000000  0.2399821000000000  0.3821792600000001   F F   F
   0.7707763200000000  0.1242993000000000  0.3821792600000001   F F   F
   0.6071763200000000  0.1242993000000000  0.3821792600000001   F F   F
   0.4435763200000000  0.1242993000000000  0.3821792600000001   F F   F
   0.4435763200000000  0.3556645000000001  0.3821792600000001   F F   F
   0.2799763200000001  0.1242993000000000  0.3821792600000001   F F   F
   0.8525763200000001  0.8762369000000000  0.4400208600000000   F F   F
   0.6889763200000000  0.8762369000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.8762369000000000  0.4400208600000000   F F   F
   0.3617763199999999  0.8762369000000000  0.4400208600000000   F F   F
   0.6071763200000000  0.3556645000000001  0.3821792600000001   F F   F
   0.7707763200000000  0.3556645000000001  0.3821792600000001   F F   F
   0.1163763200000000  0.4713473000000000  0.3821792600000001   F F   F
   0.1163763200000000  0.7027125000000001  0.3821792600000001   F F   F
   0.4435763200000000  0.8183952999999999  0.3821792600000001   F F   F
   0.2799763200000001  0.8183952999999999  0.3821792600000001   F F   F
   0.1163763200000000  0.1242993000000000  0.3821792600000001   F F   F
   0.1166915600000000  0.7017219800000001  0.5023776999999999   F F   F
   0.7703688400000001  0.5868240600000000  0.4957197800000000   F F   F
   0.4283580400000001  0.5869699800000001  0.5117408999999999   F F   F
   0.4440308400000001  0.4709338599999999  0.4955598200000000   F F   F
   0.6051446400000000  0.3548827800000000  0.5000838200000000   F F   F
   0.7718089200000000  0.3552123400000001  0.4996821400000001   F F   F
   0.1079593200000000  0.4718153400000000  0.5064656200000001   F F   F
   0.2808980000000000  0.4720677400000000  0.5026511400000000   F F   F
   0.1156164000000000  0.5864674200000001  0.5026437000000000   F F   F
   0.6046482000000001  0.4729675000000000  0.4999921400000000   F F   F
   0.7853373200000000  0.4702147800000000  0.5118581799999999   F F   F
   0.2882623200000001  0.5866844200000000  0.5065793800000000   F F   F
   0.2798955600000000  0.3567740200000000  0.5024840200000000   F F   F
   0.4460259600000001  0.3525738200000001  0.5039260600000000   F F   F
   0.2768091600000001  0.1243713000000000  0.5023631800000000   F F   F
   0.1147546000000000  0.3562627400000000  0.5020041000000000   F F   F
   0.7712901200000001  0.2380044200000000  0.5018854200000000   F F   F
   0.6074153200000001  0.2395691800000000  0.5030330600000000   F F   F
   0.4436814000000001  0.2382351800000000  0.5020511800000000   F F   F
   0.2802522400000000  0.2407153800000000  0.5017992999999999   F F   F
   0.1153430400000000  0.2400188600000000  0.5018243400000000   F F   F
   0.7685268800000000  0.1244202600000000  0.5029229399999999   F F   F
   0.6071988000000000  0.1242661000000000  0.5021513399999999   F F   F
   0.4457270000000000  0.1237631000000000  0.5029607800000000   F F   F
   0.1195087600000000  0.1242921000000000  0.5023295400000000   F F   F
   0.6071763200000000  0.8183952999999999  0.3821792600000001   F F   F
   0.1163763200000000  0.8183952999999999  0.3821792600000001   F F   F
   0.7707763200000000  0.7027125000000001  0.3821792600000001   F F   F
   0.7707763200000000  0.8183952999999999  0.3821792600000001   F F   F
   0.4435763200000000  0.7027125000000001  0.3821792600000001   F F   F
   0.6099528000000000  0.7034191000000000  0.5010784600000000   F F   F
   0.4422784400000001  0.7025504200000000  0.4999780200000000   F F   F
   0.2814884400000001  0.7022537000000000  0.5019653400000000   F F   F
   0.5253763200000000  0.2978233000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.7605541000000001  0.4400208600000000   F F   F
   0.8525763200000001  0.5291885000000001  0.4400208600000000   F F   F
   0.3617763199999999  0.7605541000000001  0.4400208600000000   F F   F
   0.1981763200000000  0.7605541000000001  0.4400208600000000   F F   F
   0.8525763200000001  0.6448713000000000  0.4400208600000000   F F   F
   0.6889763200000000  0.6448713000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.6448713000000000  0.4400208600000000   F F   F
   0.3617763199999999  0.6448713000000000  0.4400208600000000   F F   F
   0.1981763200000000  0.6448713000000000  0.4400208600000000   F F   F
   0.6889763200000000  0.5291885000000001  0.4400208600000000   F F   F
   0.1981763200000000  0.4135061000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.5291885000000001  0.4400208600000000   F F   F
   0.3617763199999999  0.5291885000000001  0.4400208600000000   F F   F
   0.1981763200000000  0.5291885000000001  0.4400208600000000   F F   F
   0.8525763200000001  0.4135061000000000  0.4400208600000000   F F   F
   0.6889763200000000  0.4135061000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.4135061000000000  0.4400208600000000   F F   F
   0.3617763199999999  0.4135061000000000  0.4400208600000000   F F   F
   0.6071763200000000  0.7027125000000001  0.3821792600000001   F F   F
   0.7673126800000000  0.7051474600000001  0.5045174200000000   F F   F
   0.1161400400000000  0.8177720200000000  0.5017669400000000   F F   F
   0.8525763200000001  0.2978233000000000  0.4400208600000000   F F   F
   0.2799763200000001  0.5870301000000001  0.3821792600000001   F F   F
   0.2799763200000001  0.7027125000000001  0.3821792600000001   F F   F
   0.7707763200000000  0.5870301000000001  0.3821792600000001   F F   F
   0.2799763200000001  0.4713473000000000  0.3821792600000001   F F   F
   0.6071763200000000  0.5870301000000001  0.3821792600000001   F F   F
   0.4435763200000000  0.5870301000000001  0.3821792600000001   F F   F
   0.2811071200000000  0.8184734600000000  0.5019000200000000   F F   F
   0.1163763200000000  0.5870301000000001  0.3821792600000001   F F   F
   0.7707763200000000  0.4713473000000000  0.3821792600000001   F F   F
   0.6071763200000000  0.4713473000000000  0.3821792600000001   F F   F
   0.4435763200000000  0.4713473000000000  0.3821792600000001   F F   F
   0.8525763200000001  0.7605541000000001  0.4400208600000000   F F   F
   0.6889763200000000  0.7605541000000001  0.4400208600000000   F F   F
   0.1981763200000000  0.8762369000000000  0.4400208600000000   F F   F
   0.3617763199999999  0.2978233000000000  0.4400208600000000   F F   F
   0.4429855600000001  0.8199110600000000  0.5018481000000000   F F   F
   0.6889763200000000  0.2978233000000000  0.4400208600000000   F F   F
   0.6071245200000001  0.8185741400000001  0.5028047000000000   F F   F
   0.7706584399999999  0.8195798600000000  0.5020021400000000   F F   F
   0.3617763199999999  0.1821405000000000  0.4400208600000000   F F   F
   0.1981763200000000  0.1821405000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.1821405000000000  0.4400208600000000   F F   F
   0.6889763200000000  0.1821405000000000  0.4400208600000000   F F   F
   0.8525763200000001  0.1821405000000000  0.4400208600000000   F F   F
   0.1981763200000000  0.2978233000000000  0.4400208600000000   F F   F
   0.4738177600000000  0.4243317000000000  0.6074731400000001   T T   T
   0.3891376400000000  0.3792657000000000  0.6074843000000000   T T   T
   0.5929819600000000  0.6451439000000001  0.6094740600000000   T T   T
   0.4450681200000000  0.3763277000000000  0.6099905000000000   T T   T
   0.3627263200000000  0.4286837400000000  0.6025507000000000   T T   T
   0.6964393600000000  0.4514139400000001  0.6000701800000000   T T   T
   0.5149989600000001  0.6031284200000000  0.6008739800000000   T T   T
   0.3912292800000000  0.4764081400000000  0.5982081000000000   T T   T
   0.5030729200000000  0.6593205400000001  0.6030852999999999   T T   T
   0.5548970400000001  0.7419290200000001  0.6104686200000000   T T   T
   0.4548012800000000  0.6876971400000000  0.6011623000000000   T T   T
   0.5070244400000000  0.7703991400000000  0.6083248200000000   T T   T
   0.4575183200000000  0.7438516200000000  0.6042082200000000   T T   T
   0.4472749600000000  0.4736283400000001  0.5993271400000001   T T   T
   0.5523108000000001  0.6860696199999999  0.6080027000000000   T T   T
   0.7227203600000000  0.5403221000000000  0.5980567800000000   T T   T
   0.4886574000000000  0.5142680600000000  0.5982601800000000   T T   T
   0.7640161200000000  0.5810401800000000  0.5992672600000000   T T   T
   0.6813811200000001  0.6183715000000001  0.6100204600000000   T T   T
   0.5298712400000000  0.4361348600000000  0.6095252999999999   T T   T
   0.7081702400000001  0.3951871800000001  0.6022642600000000   T T   T
   0.7037590400000000  0.2840949400000000  0.6083366200000000   T T   T
   0.7563169999999999  0.3665955400000000  0.6009709400000000   T T   T
   0.6559585600000000  0.3127173800000000  0.6098748200000000   T T   T
   0.7533335600000000  0.3105012600000000  0.6045216200000000   T T   T
   0.7660062800000000  0.6782247800000001  0.6107509000000000   T T   T
   0.6182751200000001  0.4095003400000000  0.6084598200000000   T T   T
   0.8219276800000000  0.6754961000000000  0.6079473800000000   T T   T
   0.8484997599999999  0.6262288600000001  0.6023806600000000   T T   T
   0.8201119600000000  0.5784483400000000  0.5977756600000000   T T   T
   0.7373937200000000  0.6301992200000001  0.6078925400000000   T T   T
   0.6588323200000000  0.3685458200000000  0.6069962200000000   T T   T
   0.7901668399999999  0.2872737800000000  0.6057155399999999   T T   T
   0.5932365600000000  0.7621030600000001  0.6146996200000000   T T   T
   0.5076192400000000  0.8138770200000001  0.6100819800000000   T T   T
   0.4206299600000001  0.7669855000000000  0.6047755000000000   T T   T
   0.4165518000000000  0.6668639400000000  0.6016806200000000   T T   T
   0.8405512399999999  0.5403697400000000  0.5926253800000000   T T   T
   0.3191790400000000  0.4294728600000001  0.6014517800000000   T T   T
   0.7453117600000000  0.7158554600000001  0.6178207400000000   T T   T
   0.8452907999999999  0.7121184600000001  0.6104885400000000   T T   T
   0.8920406799999999  0.6256093000000000  0.6009295400000000   T T   T
   0.6174960400000000  0.2927866200000000  0.6141005400000000   T T   T
   0.7946574799999999  0.3872661000000000  0.6020454600000000   T T   T
   0.7030673199999999  0.2406331800000000  0.6104611800000000   T T   T
   0.3709025200000000  0.5145899400000000  0.5933906200000000   T T   T
   0.4656575600000000  0.3385837000000000  0.6167625400000000   T T   T
   0.3656699600000000  0.3426898200000000  0.6097303000000001   T T   T
   0.6445762399999999  0.6559647800000000  0.6124961799999999   T T   T
   0.5382244000000000  0.4912794600000001  0.6041795000000000   T T   T
   0.6420933599999999  0.4600043400000000  0.6045427800000001   T T   T
   0.6731049600000000  0.5632332600000001  0.6042627000000000   T T   T
   0.4773552000000000  0.5661988200000000  0.5936113800000000   T T   T
   0.5666982000000000  0.3985929000000000  0.6116293400000000   T T   T
   0.7340422000000000  0.4884438600000000  0.5929399800000000   T T   T
   0.5693051200000000  0.5945938600000001  0.6053694199999999   T T   T



Or if i choose Atom Nr 28 (an Ag Atom) from the initial file the Output 
should be:


Ag  Ag  C Co  H  N
  1.0000000000000000
     25.0000000000000000    0.0000000000000000 0.0000000000000000
      0.0000000000000000   25.0000000000000000 0.0000000000000000
      0.0000000000000000    0.0000000000000000 25.0000000000000000
   Ag   Ag   C  Co   H   N
  1  104  32   1  16   8
Selective dynamics
Direct
   0.4440308400000001  0.4709338599999999  0.4955598200000000   T T   T
   0.6090803600000000  0.5857669400000001  0.4996232600000001   F F   F
   0.2799763200000001  0.3556645000000001  0.3821792600000001   F F   F
   0.1163763200000000  0.3556645000000001  0.3821792600000001   F F   F
   0.7707763200000000  0.2399821000000000  0.3821792600000001   F F   F
   0.6071763200000000  0.2399821000000000  0.3821792600000001   F F   F
   0.4435763200000000  0.2399821000000000  0.3821792600000001   F F   F
   0.2799763200000001  0.2399821000000000  0.3821792600000001   F F   F
   0.1163763200000000  0.2399821000000000  0.3821792600000001   F F   F
   0.7707763200000000  0.1242993000000000  0.3821792600000001   F F   F
   0.6071763200000000  0.1242993000000000  0.3821792600000001   F F   F
   0.4435763200000000  0.1242993000000000  0.3821792600000001   F F   F
   0.4435763200000000  0.3556645000000001  0.3821792600000001   F F   F
   0.2799763200000001  0.1242993000000000  0.3821792600000001   F F   F
   0.8525763200000001  0.8762369000000000  0.4400208600000000   F F   F
   0.6889763200000000  0.8762369000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.8762369000000000  0.4400208600000000   F F   F
   0.3617763199999999  0.8762369000000000  0.4400208600000000   F F   F
   0.6071763200000000  0.3556645000000001  0.3821792600000001   F F   F
   0.7707763200000000  0.3556645000000001  0.3821792600000001   F F   F
   0.1163763200000000  0.4713473000000000  0.3821792600000001   F F   F
   0.1163763200000000  0.7027125000000001  0.3821792600000001   F F   F
   0.4435763200000000  0.8183952999999999  0.3821792600000001   F F   F
   0.2799763200000001  0.8183952999999999  0.3821792600000001   F F   F
   0.1163763200000000  0.1242993000000000  0.3821792600000001   F F   F
   0.1166915600000000  0.7017219800000001  0.5023776999999999   F F   F
   0.7703688400000001  0.5868240600000000  0.4957197800000000   F F   F
   0.4283580400000001  0.5869699800000001  0.5117408999999999   F F   F
   0.6051446400000000  0.3548827800000000  0.5000838200000000   F F   F
   0.7718089200000000  0.3552123400000001  0.4996821400000001   F F   F
   0.1079593200000000  0.4718153400000000  0.5064656200000001   F F   F
   0.2808980000000000  0.4720677400000000  0.5026511400000000   F F   F
   0.1156164000000000  0.5864674200000001  0.5026437000000000   F F   F
   0.6046482000000001  0.4729675000000000  0.4999921400000000   F F   F
   0.7853373200000000  0.4702147800000000  0.5118581799999999   F F   F
   0.2882623200000001  0.5866844200000000  0.5065793800000000   F F   F
   0.2798955600000000  0.3567740200000000  0.5024840200000000   F F   F
   0.4460259600000001  0.3525738200000001  0.5039260600000000   F F   F
   0.2768091600000001  0.1243713000000000  0.5023631800000000   F F   F
   0.1147546000000000  0.3562627400000000  0.5020041000000000   F F   F
   0.7712901200000001  0.2380044200000000  0.5018854200000000   F F   F
   0.6074153200000001  0.2395691800000000  0.5030330600000000   F F   F
   0.4436814000000001  0.2382351800000000  0.5020511800000000   F F   F
   0.2802522400000000  0.2407153800000000  0.5017992999999999   F F   F
   0.1153430400000000  0.2400188600000000  0.5018243400000000   F F   F
   0.7685268800000000  0.1244202600000000  0.5029229399999999   F F   F
   0.6071988000000000  0.1242661000000000  0.5021513399999999   F F   F
   0.4457270000000000  0.1237631000000000  0.5029607800000000   F F   F
   0.1195087600000000  0.1242921000000000  0.5023295400000000   F F   F
   0.6071763200000000  0.8183952999999999  0.3821792600000001   F F   F
   0.1163763200000000  0.8183952999999999  0.3821792600000001   F F   F
   0.7707763200000000  0.7027125000000001  0.3821792600000001   F F   F
   0.7707763200000000  0.8183952999999999  0.3821792600000001   F F   F
   0.4435763200000000  0.7027125000000001  0.3821792600000001   F F   F
   0.6099528000000000  0.7034191000000000  0.5010784600000000   F F   F
   0.4422784400000001  0.7025504200000000  0.4999780200000000   F F   F
   0.2814884400000001  0.7022537000000000  0.5019653400000000   F F   F
   0.5253763200000000  0.2978233000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.7605541000000001  0.4400208600000000   F F   F
   0.8525763200000001  0.5291885000000001  0.4400208600000000   F F   F
   0.3617763199999999  0.7605541000000001  0.4400208600000000   F F   F
   0.1981763200000000  0.7605541000000001  0.4400208600000000   F F   F
   0.8525763200000001  0.6448713000000000  0.4400208600000000   F F   F
   0.6889763200000000  0.6448713000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.6448713000000000  0.4400208600000000   F F   F
   0.3617763199999999  0.6448713000000000  0.4400208600000000   F F   F
   0.1981763200000000  0.6448713000000000  0.4400208600000000   F F   F
   0.6889763200000000  0.5291885000000001  0.4400208600000000   F F   F
   0.1981763200000000  0.4135061000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.5291885000000001  0.4400208600000000   F F   F
   0.3617763199999999  0.5291885000000001  0.4400208600000000   F F   F
   0.1981763200000000  0.5291885000000001  0.4400208600000000   F F   F
   0.8525763200000001  0.4135061000000000  0.4400208600000000   F F   F
   0.6889763200000000  0.4135061000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.4135061000000000  0.4400208600000000   F F   F
   0.3617763199999999  0.4135061000000000  0.4400208600000000   F F   F
   0.6071763200000000  0.7027125000000001  0.3821792600000001   F F   F
   0.7673126800000000  0.7051474600000001  0.5045174200000000   F F   F
   0.1161400400000000  0.8177720200000000  0.5017669400000000   F F   F
   0.8525763200000001  0.2978233000000000  0.4400208600000000   F F   F
   0.2799763200000001  0.5870301000000001  0.3821792600000001   F F   F
   0.2799763200000001  0.7027125000000001  0.3821792600000001   F F   F
   0.7707763200000000  0.5870301000000001  0.3821792600000001   F F   F
   0.2799763200000001  0.4713473000000000  0.3821792600000001   F F   F
   0.6071763200000000  0.5870301000000001  0.3821792600000001   F F   F
   0.4435763200000000  0.5870301000000001  0.3821792600000001   F F   F
   0.2811071200000000  0.8184734600000000  0.5019000200000000   F F   F
   0.1163763200000000  0.5870301000000001  0.3821792600000001   F F   F
   0.7707763200000000  0.4713473000000000  0.3821792600000001   F F   F
   0.6071763200000000  0.4713473000000000  0.3821792600000001   F F   F
   0.4435763200000000  0.4713473000000000  0.3821792600000001   F F   F
   0.8525763200000001  0.7605541000000001  0.4400208600000000   F F   F
   0.6889763200000000  0.7605541000000001  0.4400208600000000   F F   F
   0.1981763200000000  0.8762369000000000  0.4400208600000000   F F   F
   0.3617763199999999  0.2978233000000000  0.4400208600000000   F F   F
   0.4429855600000001  0.8199110600000000  0.5018481000000000   F F   F
   0.6889763200000000  0.2978233000000000  0.4400208600000000   F F   F
   0.6071245200000001  0.8185741400000001  0.5028047000000000   F F   F
   0.7706584399999999  0.8195798600000000  0.5020021400000000   F F   F
   0.3617763199999999  0.1821405000000000  0.4400208600000000   F F   F
   0.1981763200000000  0.1821405000000000  0.4400208600000000   F F   F
   0.5253763200000000  0.1821405000000000  0.4400208600000000   F F   F
   0.6889763200000000  0.1821405000000000  0.4400208600000000   F F   F
   0.8525763200000001  0.1821405000000000  0.4400208600000000   F F   F
   0.1981763200000000  0.2978233000000000  0.4400208600000000   F F   F
   0.4738177600000000  0.4243317000000000  0.6074731400000001   T T   T
   0.3891376400000000  0.3792657000000000  0.6074843000000000   T T   T
   0.5929819600000000  0.6451439000000001  0.6094740600000000   T T   T
   0.4450681200000000  0.3763277000000000  0.6099905000000000   T T   T
   0.3627263200000000  0.4286837400000000  0.6025507000000000   T T   T
   0.6964393600000000  0.4514139400000001  0.6000701800000000   T T   T
   0.5149989600000001  0.6031284200000000  0.6008739800000000   T T   T
   0.3912292800000000  0.4764081400000000  0.5982081000000000   T T   T
   0.5030729200000000  0.6593205400000001  0.6030852999999999   T T   T
   0.5548970400000001  0.7419290200000001  0.6104686200000000   T T   T
   0.4548012800000000  0.6876971400000000  0.6011623000000000   T T   T
   0.5070244400000000  0.7703991400000000  0.6083248200000000   T T   T
   0.4575183200000000  0.7438516200000000  0.6042082200000000   T T   T
   0.4472749600000000  0.4736283400000001  0.5993271400000001   T T   T
   0.5523108000000001  0.6860696199999999  0.6080027000000000   T T   T
   0.7227203600000000  0.5403221000000000  0.5980567800000000   T T   T
   0.4886574000000000  0.5142680600000000  0.5982601800000000   T T   T
   0.7640161200000000  0.5810401800000000  0.5992672600000000   T T   T
   0.6813811200000001  0.6183715000000001  0.6100204600000000   T T   T
   0.5298712400000000  0.4361348600000000  0.6095252999999999   T T   T
   0.7081702400000001  0.3951871800000001  0.6022642600000000   T T   T
   0.7037590400000000  0.2840949400000000  0.6083366200000000   T T   T
   0.7563169999999999  0.3665955400000000  0.6009709400000000   T T   T
   0.6559585600000000  0.3127173800000000  0.6098748200000000   T T   T
   0.7533335600000000  0.3105012600000000  0.6045216200000000   T T   T
   0.7660062800000000  0.6782247800000001  0.6107509000000000   T T   T
   0.6182751200000001  0.4095003400000000  0.6084598200000000   T T   T
   0.8219276800000000  0.6754961000000000  0.6079473800000000   T T   T
   0.8484997599999999  0.6262288600000001  0.6023806600000000   T T   T
   0.8201119600000000  0.5784483400000000  0.5977756600000000   T T   T
   0.7373937200000000  0.6301992200000001  0.6078925400000000   T T   T
   0.6588323200000000  0.3685458200000000  0.6069962200000000   T T   T
   0.6056890800000000  0.5272941000000000  0.6019361800000000   T T   T
   0.7901668399999999  0.2872737800000000  0.6057155399999999   T T   T
   0.5932365600000000  0.7621030600000001  0.6146996200000000   T T   T
   0.5076192400000000  0.8138770200000001  0.6100819800000000   T T   T
   0.4206299600000001  0.7669855000000000  0.6047755000000000   T T   T
   0.4165518000000000  0.6668639400000000  0.6016806200000000   T T   T
   0.8405512399999999  0.5403697400000000  0.5926253800000000   T T   T
   0.3191790400000000  0.4294728600000001  0.6014517800000000   T T   T
   0.7453117600000000  0.7158554600000001  0.6178207400000000   T T   T
   0.8452907999999999  0.7121184600000001  0.6104885400000000   T T   T
   0.8920406799999999  0.6256093000000000  0.6009295400000000   T T   T
   0.6174960400000000  0.2927866200000000  0.6141005400000000   T T   T
   0.7946574799999999  0.3872661000000000  0.6020454600000000   T T   T
   0.7030673199999999  0.2406331800000000  0.6104611800000000   T T   T
   0.3709025200000000  0.5145899400000000  0.5933906200000000   T T   T
   0.4656575600000000  0.3385837000000000  0.6167625400000000   T T   T
   0.3656699600000000  0.3426898200000000  0.6097303000000001   T T   T
   0.6445762399999999  0.6559647800000000  0.6124961799999999   T T   T
   0.5382244000000000  0.4912794600000001  0.6041795000000000   T T   T
   0.6420933599999999  0.4600043400000000  0.6045427800000001   T T   T
   0.6731049600000000  0.5632332600000001  0.6042627000000000   T T   T
   0.4773552000000000  0.5661988200000000  0.5936113800000000   T T   T
   0.5666982000000000  0.3985929000000000  0.6116293400000000   T T   T
   0.7340422000000000  0.4884438600000000  0.5929399800000000   T T   T
   0.5693051200000000  0.5945938600000001  0.6053694199999999   T T   T


I managed to do what i want by reading the original file line by line 
and doing the manipulation
necessary in the file by shuffling lines etc, but it would be nice to do 
it in ASE while still keeping the constraints set as they where.


All the best


fabian



Am 02.01.2018 um 14:17 schrieb Ask Hjorth Larsen:
> Hi Fabian,
>
> (Please send to the list; re-added list to recipients)
>
> 2017-12-21 12:56 GMT+01:00 fabian <Fabian.T89 at web.de>:
>> Hi,
>>
>> I just use the TTT and FFF flags for the VASP format to indicate which atoms
>> should be relaxed.
>>
>> I want to create specific input files for additional calculations were no
>> relaxation should be performed.
>> If i set the NSW tag to 0 in the INCAR file it is not necessary to keep them
>> i guess but if i want to do additional stuff later
>> it would be handy to still have them.
>>
>> Is it somehow possible to reread them from the original CONTCAR/POSCAR file
>> and make a pair wise
>> comparison based on the atomic positions in an additional step to add them
>> to the new file?
> Could you attach the file in question?  I cannot guess what is happening.
>
> Best regards
> Ask
>
>
>>
>> All the best and thank you for your awesome support
>>
>> fabian
>>
>>
>> Am 21.12.2017 um 02:09 schrieb Ask Hjorth Larsen:
>>
>> Hi,
>>
>> El 19 dic. 2017 22:14, "fabian" <Fabian.T89 at web.de> escribió:
>>
>> Dear Eric,
>>
>> Unfortunately when i try to use your code like this:
>>
>>
>>
>> from ase.io import read, write
>> from ase import Atom
>> from ase.atoms import Atoms
>> from ase.constraints import FixAtoms
>> import numpy as np
>> n_atom=2
>>
>> Filename='CONTCAR'
>> atoms = read(Filename)
>> indices = np.arange(len(atoms))
>>
>> indices[n_atom] = 0
>> indices[0] = n_atom
>> atoms = atoms[indices]
>> write('POSCAR', atoms, vasp5=True, sort=False,
>> direct=True,long_format=True,format='vasp')
>>
>>
>> i get the following error:
>>
>>
>>    File "...\make_newposcar.py", line 13, in <module>
>>      atoms = atoms[indices]
>>    File "C:\Program Files (x86)\Python27\lib\site-packages\ase\atoms.py",
>> line 877, in __getitem__
>>      con.index_shuffle(self, i)
>>    File "C:\Program Files
>> (x86)\Python27\lib\site-packages\ase\constraints.py", line 133, in
>> index_shuffle
>>
>>
>> Right.  It appears the atoms have a constraint which does not know how to
>> act when the atoms are reordered. Unfortunately you will need to remove the
>> constraint (e.g. atoms.set_constraint(None)) in order to reorder the atoms
>> object.  Probably you can simply set the constraint again once you need to
>> do a calculation.
>>
>> It looks like the error message should be better though.  I will try to have
>> a look at this if I can find time.
>>
>> Which constraint is it, by the way?
>>
>> Best regards
>> Ask
>>
>>
>>
>>      for new, old in slice2enlist(ind, len(atoms)):
>>    File "C:\Program Files
>> (x86)\Python27\lib\site-packages\ase\constraints.py", line 22, in
>> slice2enlist
>>      return enumerate(range(*s.indices(n)))
>> AttributeError: 'numpy.ndarray' object has no attribute 'indices'
>>
>>
>> Would you be willing to give me another tip? I feel like i should be able to
>> solve this by myself, but somehow i can´t find a
>> solution.
>>
>>
>> All the best
>>
>> fabian
>>
>>
>>
>> Am 10.12.2017 um 12:58 schrieb Ask Hjorth Larsen:
>>> 2017-12-10 12:00 GMT+01:00 fabian <Fabian.T89 at web.de>:
>>>> Dear Eric,
>>>>
>>>> Thanks once again for your help.
>>>>
>>>> Now i am left with the problem that the cell information and the
>>>> constraints
>>>> are not written, wich i would
>>>> like to keep.
>>> Oh right, oops.
>>>
>>> Actually:
>>>
>>> import numpy as np
>>> indices = np.arange(len(atoms))
>>> indices[n_atom] = 0
>>> indices[0] = n_atom
>>> atoms = atoms[indices]
>>>
>>> This is the most general way to reorder atoms objects: Creating an
>>> array of indices and slicing the atoms object with the array.
>>>
>>> This will preserve the maximum amount of info on the atoms object,
>>> including FixAtoms constraints.
>>>
>>> Best regards
>>> Ask
>>>
>>>> It is easy to just rewrite the cell parameter, but to reflect the
>>>> constraints correctly they have to be
>>>> shifted in the list of constraints depending on whether the poped atom
>>>> had
>>>> constraints or not.
>>>>
>>>> Unfortunately my code posted below gives me the error:
>>>>
>>>> TypeError: unsupported operand type(s) for +: 'instance' and 'int'
>>>>
>>>> Is it somehow possible to access the list of constaints directly with the
>>>> FixAtoms method and later rewrite them via:
>>>>
>>>> indices = shifted_list
>>>> constraint = FixAtoms(indices=indices)
>>>> atoms.set_constraint(constraints)
>>>>
>>>> or
>>>>
>>>> atoms.set_constraint([FixAtoms(indices=shifted_list)]+new_position)
>>>>
>>>>
>>>> Here is the code that doesnt work:
>>>>
>>>> from ase.io import read, write
>>>> from ase import Atom
>>>> from ase.atoms import Atoms
>>>> from ase.constraints import FixAtoms
>>>>
>>>> n_atom=390
>>>> Filename='CONTCAR'
>>>> atoms = read(Filename)
>>>> cell = atoms.get_cell()
>>>> atoms.resort = None
>>>> constraints=atoms.constraints
>>>> #indices=FixAtoms(constraints).indicies
>>>>
>>>>
>>>> print(constraints)
>>>> print (type(constraints))
>>>> if n_atom not in constraints:
>>>>       print ("yes")
>>>>       #shift_constraints=[x+1 for x in constraints]
>>>>       map(lambda x:x+1, constraints)
>>>> elif n_atom in constraints:
>>>>       pass # n_atom has to be deleted from constraints. And constraints
>>>> have
>>>> to be shifted by +1.
>>>>              # 0 has to be added to list of constraints
>>>> atoms = Atoms([atoms.pop(n_atom)]) + atoms
>>>>
>>>>
>>>> atoms.set_cell(cell)
>>>> atoms.set_constraint(constraints)
>>>> write('POSCAR', atoms, vasp5=True, sort=False,
>>>> direct=True,long_format=True,format='vasp')
>>>>
>>>>
>>>> Thanks in advance
>>>>
>>>> fabian
>>>>
>>>>
>>>>
>>>> Am 09.12.2017 um 20:34 schrieb Ask Hjorth Larsen:
>>>>> Hi,
>>>>>
>>>>> 2017-12-09 12:16 GMT+01:00 fabian via ase-users
>>>>> <ase-users at listserv.fysik.dtu.dk>:
>>>>>> Dear Eric,
>>>>>>
>>>>>> Thank you for the clarification!
>>>>>>
>>>>>>
>>>>>> Unfortunately if i try to use your solution like this:
>>>>>>
>>>>>> from ase.io import read, write
>>>>>> from ase import Atom
>>>>>> from ase.atoms import Atoms
>>>>>> from ase.constraints import FixAtoms
>>>>>> n_atom=379
>>>>>> Filename='CONTCAR'
>>>>>> atoms = read(Filename)
>>>>>> atoms = atoms.pop(n_atom) + atoms
>>>>>> write('POSCAR', atoms, vasp5=True, sort=False,
>>>>>> direct=True,long_format=True,
>>>>>> format='vasp')
>>>>>>
>>>>>>
>>>>>> i get the following error:
>>>>>>
>>>>>>
>>>>>> TypeError: unsupported operand type(s) for +: 'Atom' and 'Atoms'
>>>>> Right, the first is an Atom and the second is an Atoms object.  They
>>>>> both need to be Atoms.  Maybe the natural way is something like:
>>>>>
>>>>> atoms = read(Filename)
>>>>> atoms = Atoms([atoms.pop(n_atom)]) + atoms
>>>>>
>>>>> Best regards
>>>>> Ask
>>>>>
>>>>>
>>>>>
>>>>>> Do you have any suggestion how to resolve this issue?
>>>>>>
>>>>>> All the best and thank you for your reply
>>>>>>
>>>>>>
>>>>>> fabian
>>>>>>
>>>>>>
>>>>>>
>>>>>> Am 08.12.2017 um 23:26 schrieb ase-users-request at listserv.fysik.dtu.dk:
>>>>>>> Send ase-users mailing list submissions to
>>>>>>>            ase-users at listserv.fysik.dtu.dk
>>>>>>>
>>>>>>> To subscribe or unsubscribe via the World Wide Web, visit
>>>>>>>            https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>>>>>>> or, via email, send a message with subject or body 'help' to
>>>>>>>            ase-users-request at listserv.fysik.dtu.dk
>>>>>>>
>>>>>>> You can reach the person managing the list at
>>>>>>>            ase-users-owner at listserv.fysik.dtu.dk
>>>>>>>
>>>>>>> When replying, please edit your Subject line so it is more specific
>>>>>>> than "Re: Contents of ase-users digest..."
>>>>>>>
>>>>>>>
>>>>>>> Today's Topics:
>>>>>>>
>>>>>>>        1. Re: From CIF files to XYZ (Eric Hermes)
>>>>>>>        2. Re: Resort atoms object by atom number (Eric Hermes)
>>>>>>>        3. Re: Thermochemistry (Eric Hermes)
>>>>>>>        4. saxis in vasp calculator (Protik Das)
>>>>>>>
>>>>>>>
>>>>>>> ----------------------------------------------------------------------
>>>>>>>
>>>>>>> Message: 1
>>>>>>> Date: Fri, 8 Dec 2017 19:08:01 +0000
>>>>>>> From: Eric Hermes <ehermes at chem.wisc.edu>
>>>>>>> To: "ase-users at listserv.fysik.dtu.dk"
>>>>>>>            <ase-users at listserv.fysik.dtu.dk>
>>>>>>> Subject: Re: [ase-users] From CIF files to XYZ
>>>>>>> Message-ID: <1512760079.4568.1.camel at wisc.edu>
>>>>>>> Content-Type: text/plain; charset="utf-8"
>>>>>>>
>>>>>>> On Fri, 2017-12-08 at 18:48 +0000, Landi, Alessandro via ase-users
>>>>>>> wrote:
>>>>>>>> Hello.
>>>>>>>>
>>>>>>>> Obviously, I typed it wrong.
>>>>>>>>
>>>>>>>> Here the right command lines I use:
>>>>>>>>
>>>>>>>> atoms_ase=ase.io.read('filename.cif')
>>>>>>>> ase.io.write('filename.xyz', atoms_ase)
>>>>>>>>
>>>>>>>> Anyway, I have the problem that the xyz file is wrong as I explained
>>>>>>>> in my first e-mail: the molecules need to be reconnected (see files
>>>>>>>> attached).
>>>>>>> I don't understand what you mean by "reconnected". Neither xyz file
>>>>>>> that you uploaded contains any information regarding connectivity, and
>>>>>>> ASE doesn't have any conception of connectivity anyway (aside from a
>>>>>>> distance-based metric used in the ASE GUI to draw sticks between
>>>>>>> nearby
>>>>>>> atoms). The atom ordering produced by ASE is more consistent than the
>>>>>>> "realstructure.xyz" file as compared to the original cif ordering. It
>>>>>>> might be that whatever program you are using with the xyz files
>>>>>>> expects
>>>>>>> connected atoms to be contiguous; to the best of my knowledge this is
>>>>>>> not typical. If you want to ensure this ordering within ASE, you will
>>>>>>> need to manually rearrange the Atoms object.
>>>>>>>
>>>>>>> Eric
>>>>>>>
>>>>>>>> "pentacene.cif" is the cif file that I give as input to ASE;
>>>>>>>> "pentacene.xyz" is the xyz file written by ASE;
>>>>>>>> "realstructure.xyz" is the structure of the reconnected molecules
>>>>>>>> (obtained using CCDC Mercury)
>>>>>>>>
>>>>>>>> Any suggestions?
>>>>>>>>
>>>>>>>> Best regards,
>>>>>>>> Alessandro
>>>>>>>>
>>>>>>>> Da: Oscar Xavier Guerrero <oscarxavier.ox at gmail.com>
>>>>>>>> Inviato: venerd? 8 dicembre 2017 18:36:10
>>>>>>>> A: Landi, Alessandro
>>>>>>>> Cc: ase-users at listserv.fysik.dtu.dk
>>>>>>>> Oggetto: Re: [ase-users] From CIF files to XYZ
>>>>>>>> ?
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> When you read the structure an Atoms object is created. You need to
>>>>>>>> store that object on a variable and then you can write that one. As
>>>>>>>> so:
>>>>>>>>
>>>>>>>> First read the data:
>>>>>>>> from ase.io import read, write
>>>>>>>> atoms = read('filename.cif')
>>>>>>>> Then write:
>>>>>>>> write('filename.xyz', atoms)
>>>>>>>> or you can use:
>>>>>>>> atoms.write('filename.xyz')
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 2017-12-08 12:19 GMT+00:00 Landi, Alessandro via ase-users <ase-users
>>>>>>>> @listserv.fysik.dtu.dk>:
>>>>>>>>> Hello everyone.
>>>>>>>>>
>>>>>>>>> I am using ASE to read some CIF files and (among other things) to
>>>>>>>>> convert the structure in xyz format.
>>>>>>>>>
>>>>>>>>> However using the following commands:
>>>>>>>>>
>>>>>>>>> ase.io.read('filename.cif', atoms_ase)
>>>>>>>>> ase.io.write('filename.xyz', atoms_ase)
>>>>>>>>>
>>>>>>>>> I obtain a wrong structure, since the molecules need to be
>>>>>>>>> reconnected. This happens for all the molecules I have tested
>>>>>>>>> (about 20).
>>>>>>>>>
>>>>>>>>> Could you please explain me what I am doing wrong?
>>>>>>>>>
>>>>>>>>> If could be of any help, I attached an example:
>>>>>>>>> "pentacene.cif" is the cif file that I give as input to ASE;
>>>>>>>>> "pentacene.xyz" is the xyz file written by ASE;
>>>>>>>>> "realstructure.xyz" is the structure of the reconnected molecules
>>>>>>>>> (obtained using CCDC Mercury)
>>>>>>>>>
>>>>>>>>> Best regards,
>>>>>>>>> Alessandro
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> _______________________________________________
>>>>>>>>> ase-users mailing list
>>>>>>>>> ase-users at listserv.fysik.dtu.dk
>>>>>>>>> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> ase-users mailing list
>>>>>>>> ase-users at listserv.fysik.dtu.dk
>>>>>>>> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------
>>>>>>>
>>>>>>> Message: 2
>>>>>>> Date: Fri, 8 Dec 2017 19:15:01 +0000
>>>>>>> From: Eric Hermes <ehermes at chem.wisc.edu>
>>>>>>> To: "ase-users at listserv.fysik.dtu.dk"
>>>>>>>            <ase-users at listserv.fysik.dtu.dk>
>>>>>>> Subject: Re: [ase-users] Resort atoms object by atom number
>>>>>>> Message-ID: <1512760499.4568.3.camel at wisc.edu>
>>>>>>> Content-Type: text/plain; charset="utf-8"
>>>>>>>
>>>>>>> On Fri, 2017-12-08 at 19:47 +0100, fabian via ase-users wrote:
>>>>>>>> Dear all,
>>>>>>>> I read a POSCAR file into an atoms object via
>>>>>>>> atoms = read("POSCAR")
>>>>>>>> now i want to resort the atoms object such that the atom with the
>>>>>>>> Number n_atom is moved from its postion to the index 0?
>>>>>>>> (1 if not counted the pythonic way), such that it is later writen as
>>>>>>>> the first entry? into the atoms object.?
>>>>>>>> later i want to write the object via:
>>>>>>>> write('POSCAR', atoms, vasp5=True, sort=False,
>>>>>>>> direct=True,long_format=True, format='vasp')
>>>>>>>> and have the entry corresponding to n_atom as the first Atom in the
>>>>>>>> POSCAR file. I found a dirty workaround with temp files but
>>>>>>>> this means i have to convert each initial structure to the right
>>>>>>>> format . Else i create wrong files.
>>>>>>>> Is this possible within ASE?
>>>>>>>> On a side not if i pop an atom via:
>>>>>>>> atoms.pop( n_atom)
>>>>>>>>
>>>>>>>> is n_atom defined the pythonic way and starting at 0?
>>>>>>> To start by answering your last question: yes, everything in ASE is 0-
>>>>>>> indexed. Note that this is not only the Pythonic way, it is a common
>>>>>>> standard used by most languages with some notable exceptions (Fortran,
>>>>>>> Julia, and R probably being the most relevant).
>>>>>>>
>>>>>>> In fact, you should be able to use Atoms.pop() to do exactly what you
>>>>>>> want. Try the following:
>>>>>>>
>>>>>>> atoms = atoms.pop(n_atom) + atoms
>>>>>>>
>>>>>>> One other thing is that when ASE sorts VASP POSCAR files, the first
>>>>>>> atom will never change place, so sort=False is not completely
>>>>>>> necessary
>>>>>>> (you can still use it if you want to though).
>>>>>>>
>>>>>>> Eric
>>>>>>>
>>>>>>>> Al the best
>>>>>>>> fabian
>>>>>>>> ?_______________________________________________
>>>>>>>> ase-users mailing list
>>>>>>>> ase-users at listserv.fysik.dtu.dk
>>>>>>>> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------
>>>>>>>
>>>>>>> Message: 3
>>>>>>> Date: Fri, 8 Dec 2017 19:25:11 +0000
>>>>>>> From: Eric Hermes <ehermes at chem.wisc.edu>
>>>>>>> To: "ase-users at listserv.fysik.dtu.dk"
>>>>>>>            <ase-users at listserv.fysik.dtu.dk>
>>>>>>> Subject: Re: [ase-users] Thermochemistry
>>>>>>> Message-ID: <1512761110.4568.5.camel at wisc.edu>
>>>>>>> Content-Type: text/plain; charset="utf-8"
>>>>>>>
>>>>>>> On Fri, 2017-12-08 at 14:53 +0300, Alexander Romanov via ase-users
>>>>>>> wrote:
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> I investigate diffusion of atoms on metal surfaces and want to use
>>>>>>>> thermochemistry module for energy estimation of transition states.
>>>>>>>> What can I do with imaginary frequencies?? If I understand properly,
>>>>>>>> Gaussian simply subtract them from calculation, but ase module can't
>>>>>>>> do this automatically.? Can I do the same manually??
>>>>>>> Which frequencies you pass to the Thermo classes is up to you. You are
>>>>>>> free to exclude any imaginary frequencies returned by the Vibrations
>>>>>>> class from the list you pass to the Thermo class if you want.
>>>>>>>
>>>>>>> However, be aware of what you are doing by excluding certain
>>>>>>> frequencies from the Thermo classes. You need to ensure that you are
>>>>>>> considering all 3N degrees of freedom of your system.
>>>>>>>
>>>>>>> For an ideal gas, 5 or 6 of those are translations/rotations, so 5 or
>>>>>>> 6
>>>>>>> of your vibrational frequencies should be small and potentially
>>>>>>> imaginary (since you will capture the effects of those modes with a
>>>>>>> rigid rotor/particle in a box model separately).
>>>>>>>
>>>>>>> In the context of transition state theory, you actually are removing a
>>>>>>> degree of freedom from your system, so the imaginary mode of a
>>>>>>> transition state corresponding to the reaction coordinate should be
>>>>>>> removed from the thermodynamic analysis.
>>>>>>>
>>>>>>> In most other cases, simply removing a vibrational frequency will
>>>>>>> result in significant errors in the system entropy, which is very
>>>>>>> important if you are trying to compare the free energy of two system
>>>>>>> configurations.
>>>>>>>
>>>>>>> Eric
>>>>>>>
>>>>>>>> Best regards,
>>>>>>>> Alex
>>>>>>>> _______________________________________________
>>>>>>>> ase-users mailing list
>>>>>>>> ase-users at listserv.fysik.dtu.dk
>>>>>>>> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------
>>>>>>>
>>>>>>> Message: 4
>>>>>>> Date: Fri, 8 Dec 2017 14:25:43 -0800
>>>>>>> From: Protik Das <protik77 at gmail.com>
>>>>>>> To: Eric Hermes via ase-users <ase-users at listserv.fysik.dtu.dk>
>>>>>>> Subject: [ase-users] saxis in vasp calculator
>>>>>>> Message-ID:
>>>>>>>
>>>>>>> <CADFNK8Urug3oj5h342dv2JAhLAjbMkVJa-rUYSCX6aoz2Ysxfw at mail.gmail.com>
>>>>>>> Content-Type: text/plain; charset="utf-8"
>>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I am trying to set saxis keyword using the vasp calculator of ase. But
>>>>>>> unfortunately the INCAR file does not have the keyword. I tried giving
>>>>>>> a
>>>>>>> numpy array and a list as input but no luck.
>>>>>>>
>>>>>>> With the saxis in the calculator object, there is an empty line in the
>>>>>>> INCAR file which is not there without the keyword. I am using ASE
>>>>>>> 3.15.0
>>>>>>> with python 3.6.3.
>>>>>>>
>>>>>>> Any help regarding this will be really appreciated.
>>>>>>>
>>>>>> _______________________________________________
>>>>>> ase-users mailing list
>>>>>> ase-users at listserv.fysik.dtu.dk
>>>>>> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>>>>
>>
>>



More information about the ase-users mailing list