Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- new option "-orthogonal-cell" allows to find a suitable equivalent …
…orthorhombic cell for any type of system.

- updated doc and CHANGELOG.
  • Loading branch information
Pierre Hirel committed Feb 15, 2018
1 parent 7f1c63e commit bc85128
Show file tree
Hide file tree
Showing 17 changed files with 522 additions and 217 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Expand Up @@ -5,11 +5,13 @@ CHANGELOG FOR ATOMSK
Master (development)
--------------------
- added support for reading and writing files in PDFFIT structure file format (*.str or *.stru).
- new option "-orthogonal-cell" allows to find a suitable equivalent orthorhombic cell for any type of system.
- in option "-dislocation", added possibility to construct dislocation loops. Thanks to Emmanuel Clouet, CEA, Gif-sur-Yvette, France, for sharing his code Babel for the construction of dislocation loops.
- in option "-select", added possibility to provide a file containing any ASCII character when using "-select grid"; blank spaces are replaced by 0, any other character by 1. Also added possibility to select atoms inside a 3-D model defined by an STL file. Also added possibility to select atoms inside or outside a torus.
- in option "-properties", fixed a bug that would result in an infinite loop if user wrote numbers instead of atom species after the keyword "charge". Thanks to Srinivasan Mahendran, UMET, Lille, France, for pointing out this bug.
- if electric charges are present and their sum is non-zero, a warning is displayed before writing the output file(s).
- fixed a bug in neighbor search algorithm that would cause a segmentation fault under certain conditions.
- fixed a bug in mode "--create" that caused a segmentation fault if user attempted to orient a non-cubic lattice.



Expand Down
1 change: 1 addition & 0 deletions doc/en/index.html
Expand Up @@ -48,6 +48,7 @@ <h2>Contents:</h2>
<li><a href="./option_mirror.html">mirror</a> - Apply a mirror transformation</li>
<li><a href="./option_options.html">options</a> - Apply options read from a file</li>
<li><a href="./option_orient.html">orient</a> - Change the crystallographic orientation of the system</li>
<li><a href="./option_orthocell.html">orthogonal-cell</a> - Find a suitable equivalent orthogonal cell</li>
<li><a href="./option_properties.html">properties</a> - Set properties of the system</li>
<li><a href="./option_rebox.html">rebox</a> - Try to guess supercell parameters</li>
<li><a href="./option_rmatom.html">remove-atom</a> - Remove one or several atoms</li>
Expand Down
52 changes: 52 additions & 0 deletions doc/en/option_orthocell.html
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="en" >
<head>
<title>Option orthogonal-cell - Atomsk - Pierre Hirel</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" media="screen" type="text/css" title="Default" href="./default.css" />
<link rel="icon" href="../img/atomsk_logo.png" type="image/png" />
</head>

<body>

<p><a href="./index.html">Back to main menu</a></p>

<h2>Option: orthogonal-cell</h2>

<h4>Syntax</h4>

<p><code>-orthogonal-cell</code></p>


<h4>Description</h4>

<p>This option finds the optimal orthorhombic cell that corresponds to the system. This can be useful when working with complex lattices, that one needs to rotate</p>

<p>The system may have any arbitrary vectors H1, H2, H3. This option searches for linear combinations m*H1+n*H2+o*H3 (with m,n,o integers) that produce vectors aligned with the Cartesian directions X, Y, Z. Then, atom positions are duplicated using the translation vectors H1, H2, H3, so as to fill this new orthogonal cell. Finally, the initial cell vectors are replaced by the vectors of the orthorhombic cell. Since the new cell vectors are linear combinations of the initial cell vectors, they respect the lattice periodicity.</p>

<p>If shells (in the sense of an ionic core-shell model) and/or auxiliary properties are present, then they are also duplicated.</p>

<p>Note that, after this option is applied, the total number of atoms may differ from that of the initial system.</p>




<h4>Default</h4>

<p>By default, Atomsk preserves the cell vectors and does not try to find an equivalent orthogonal cell.</p>


<h4>Examples</h4>

<ul>
<li><code class="command">atomsk initial.cfg -rotate 45 z -orthocell final.cfg</code>
<p>The initial system (<code>initial.cfg</code>) is rotated by 45° around the Z axis. Then, a suitable equivalent orthogonal cell is found, and atoms are duplicated to fill the new orthogonal cell. The final result will be output to <code>final.cfg</code>.</p></li>

</ul>


<p><a href="./index.html">Back to main menu</a></p>

</body>

</html>
1 change: 1 addition & 0 deletions doc/en/options.html
Expand Up @@ -47,6 +47,7 @@ <h4>List of options</h4>
<li><a href="./option_mirror.html">mirror</a> - Apply a mirror transformation</li>
<li><a href="./option_options.html">options</a> - Apply options read from a file</li>
<li><a href="./option_orient.html">orient</a> - Change the crystallographic orientation of the system</li>
<li><a href="./option_orthocell.html">orthogonal-cell</a> - Find a suitable equivalent orthogonal cell</li>
<li><a href="./option_properties.html">properties</a> - Set properties of the system</li>
<li><a href="./option_rebox.html">rebox</a> - Try to guess supercell parameters</li>
<li><a href="./option_rmatom.html">remove-atom</a> - Remove one or several atoms</li>
Expand Down
1 change: 1 addition & 0 deletions doc/fr/index.html
Expand Up @@ -48,6 +48,7 @@ <h2>Contenu :</h2>
<li><a href="./option_mirror.html">mirror</a> - Appliquer une transformation miroir</li>
<li><a href="./option_options.html">options</a> - Appliquer les options écrites dans un fichier</li>
<li><a href="./option_orient.html">orient</a> - Changer l'orientation crystallographique</li>
<li><a href="./option_orthocell.html">orthogonal-cell</a> - Trouver une boîte orthogonale équivalente</li>
<li><a href="./option_properties.html">properties</a> - Définir des propriétés du système</li>
<li><a href="./option_rebox.html">rebox</a> - Tente de déterminer les vecteur de boîte</li>
<li><a href="./option_rmatom.html">remove-atom</a> - Supprimer un ou plusieurs atomes</li>
Expand Down
52 changes: 52 additions & 0 deletions doc/fr/option_orthocell.html
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html lang="fr" >
<head>
<title>Option orthogonal-cell - Atomsk - Pierre Hirel</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" media="screen" type="text/css" title="Default" href="./default.css" />
<link rel="icon" href="../img/atomsk_logo.png" type="image/png" />
</head>

<body>

<p><a href="./index.html">Back to main menu</a></p>

<h2>Option : orthogonal-cell</h2>

<h4>Syntaxe</h4>

<p><code>-orthogonal-cell</code></p>


<h4>Description</h4>

<p>Cette option cherche une boîte orthogonale optimale qui convienne au système.</p>

<p>Le système peut être défini par des vecteurs de boîtes arbitraires H1, H2, H3. Cette option recherche les combinaisons linéaires de ces vecteurs, m*H1+n*H2+o*H3 (où m,n,o sont des entiers) qui produisent des vecteurs de boîte alignés avec les axes Cartésiens X, Y, Z. Puis, les positions des atomes sont dupliquées en utilisant les vecteurs de translation H1, H2, H3, afin de remplir la boîte orthorombique. Finalement, les vecteurs de boîte initiaux sont remplacés par les vecteurs de la boîte orthogonale. Puisque ces nouveaux vecteurs de boîte sont une combinaison linéaire des anciens, la périodicité de la maille est préservée.</p>

<p>Si des coquilles (dans le cadre d'un modèle ionique c&oelig;ur-coquille) et/ou des propriétés auxiliaires existent dans le système, alors elles sont aussi dupliquées.</p>

<p>Notez que, après l'application de cette option, le nombre total d'atomes peut être différent du nombre initial.</p>




<h4>Défaut</h4>

<p>Par défaut, Atomsk préserve les vecteurs de boîte et n'essaye pas de trouver une boîte orthogonale équivalente.</p>


<h4>Exemples</h4>

<ul>
<li><code class="command">atomsk initial.cfg -rotate 45 z -orthocell final.cfg</code>
<p>Le système initial (<code>initial.cfg</code>) est tourné de 45° autour de l'axe Z. Puis, une boîte orthogonale équivalente est trouvée, et les atomes sont dupliqués afin de remplir cette boîte. Le résultat final est écrit dans le fichier <code>final.cfg</code>.</p></li>

</ul>


<p><a href="./index.html">Back to main menu</a></p>

</body>

</html>
1 change: 1 addition & 0 deletions doc/fr/options.html
Expand Up @@ -47,6 +47,7 @@ <h4>Liste des options</h4>
<li><a href="./option_mirror.html">mirror</a> - Appliquer une transformation miroir</li>
<li><a href="./option_options.html">options</a> - Appliquer les options écrites dans un fichier</li>
<li><a href="./option_orient.html">orient</a> - Changer l'orientation crystallographique</li>
<li><a href="./option_orthocell.html">orthogonal-cell</a> - Trouver une boîte orthogonale équivalente</li>
<li><a href="./option_properties.html">properties</a> - Définir des propriétés du système</li>
<li><a href="./option_rebox.html">rebox</a> - Tente de déterminer les vecteur de boîte</li>
<li><a href="./option_rmatom.html">remove-atom</a> - Supprimer un ou plusieurs atomes</li>
Expand Down
3 changes: 3 additions & 0 deletions man/atomsk
Expand Up @@ -136,6 +136,9 @@ Reads a list of options from a file, and apply these options to the system.
.B -orient <Hx> <Hy> <Hz> <H'x> <H'y> <H'z>
Changes the crystallographic orientation of the system.
.TP
.B -orthogonal-cell
Finds a suitable equivalent orthogonal cell.
.TP
.B -properties <file>, -prop <file>
Reads some properties of the system from <file>.
.TP
Expand Down
2 changes: 1 addition & 1 deletion src/include/comv.f90
Expand Up @@ -27,7 +27,7 @@ MODULE comv
!* along with this program. If not, see <http://www.gnu.org/licenses/>. *
!**********************************************************************************
!
CHARACTER(LEN=24),PARAMETER:: version = 'Master-2018.02.12' !Version of the program
CHARACTER(LEN=24),PARAMETER:: version = 'Master-2018.02.15' !Version of the program
INTEGER:: nwarn, nerr !number of warnings/errors encountered during run
INTEGER,PARAMETER:: dp = SELECTED_REAL_KIND(15,307) !reals with 64-bits precision
!
Expand Down
25 changes: 23 additions & 2 deletions src/include/messages_DE.f90
Expand Up @@ -10,7 +10,7 @@ MODULE messages_DE
!* Gemeinschaftslabor fuer Elektronenmikroskopie *
!* RWTH Aachen (GERMANY) *
!* ju.barthel@fz-juelich.de *
!* Last modification: P. Hirel - 12 Feb. 2018 *
!* Last modification: P. Hirel - 15 Feb. 2018 *
!**********************************************************************************
!* This program is free software: you can redistribute it and/or modify *
!* it under the terms of the GNU General Public License as published by *
Expand Down Expand Up @@ -1796,6 +1796,12 @@ SUBROUTINE ATOMSK_MSG_DE(imsg,strings,reals)
WRITE(temp,*) NINT(reals(1))
msg = "..> STL file was read successfully ("//TRIM(ADJUSTL(temp))//" triangles)."
CALL DISPLAY_MSG(verbosity,msg,logfile)
CASE(2143)
msg = ">>> Converting system into an orthorhombic cell..."
CALL DISPLAY_MSG(verbosity,msg,logfile)
CASE(2144)
msg = "..> Cell is now orthorhombic ("//TRIM(ADJUSTL(temp))//" atoms)."
CALL DISPLAY_MSG(verbosity,msg,logfile)
!
!2700-2799: WARNUNG MESSAGES
CASE(2700)
Expand Down Expand Up @@ -1962,6 +1968,9 @@ SUBROUTINE ATOMSK_MSG_DE(imsg,strings,reals)
CASE(2759)
msg = "/!\ WARNUNG: Schleifenradius ist zu klein. Ueberspringe."
CALL DISPLAY_MSG(1,msg,logfile)
CASE(2760)
msg = "/!\ WARNING: cell is already orthorhombic, skipping."
CALL DISPLAY_MSG(1,msg,logfile)
!
CASE(2799)
!strings(1) = name of obsolete option
Expand Down Expand Up @@ -2048,6 +2057,15 @@ SUBROUTINE ATOMSK_MSG_DE(imsg,strings,reals)
CASE(2816)
msg = "X!X FEHLER: Elastizitaetstensor nicht definiert. Abbruch."
CALL DISPLAY_MSG(1,msg,logfile)
CASE(2817)
msg = "X!X ERROR: the property '"//TRIM(ADJUSTL(strings(1)))//"' is not defined, aborting."
CALL DISPLAY_MSG(1,msg,logfile)
CASE(2818)
msg = "X!X ERROR: there was an error while reading the STL file, aborting."
CALL DISPLAY_MSG(1,msg,logfile)
CASE(2819)
msg = "X!X ERROR: unable to find an orthogonal cell from initial cell vectors."
CALL DISPLAY_MSG(1,msg,logfile)
!
!
!
Expand Down Expand Up @@ -2832,7 +2850,10 @@ SUBROUTINE ATOMSK_MSG_DE(imsg,strings,reals)
& " definiert. Abbruch."
CALL DISPLAY_MSG(1,msg,logfile)
CASE(4821)
msg = "X!X FEHLER: Atomanzahl zu gross fuer bereitgestellten Speicher."
WRITE(temp,*) NINT(reals(1))
WRITE(temp2,*) NINT(reals(2))
msg = "X!X FEHLER: Atomanzahl ("//TRIM(ADJUSTL(temp))// &
& ") zu gross fuer bereitgestellten Speicher ("//TRIM(ADJUSTL(temp2))//")."
CALL DISPLAY_MSG(1,msg,logfile)
CASE(4822)
msg = "X!X FEHLER: Keine Datei zu bearbeiten. Abbruch."
Expand Down
20 changes: 18 additions & 2 deletions src/include/messages_EN.f90
Expand Up @@ -10,7 +10,7 @@ MODULE messages_EN
!* Université de Lille, Sciences et Technologies *
!* UMR CNRS 8207, UMET - C6, F-59655 Villeneuve D'Ascq, France *
!* pierre.hirel@univ-lille1.fr *
!* Last modification: P. Hirel - 12 Feb. 2018 *
!* Last modification: P. Hirel - 15 Feb. 2018 *
!**********************************************************************************
!* This program is free software: you can redistribute it and/or modify *
!* it under the terms of the GNU General Public License as published by *
Expand Down Expand Up @@ -1837,6 +1837,13 @@ SUBROUTINE ATOMSK_MSG_EN(imsg,strings,reals)
WRITE(temp,*) NINT(reals(1))
msg = "..> STL file was read successfully ("//TRIM(ADJUSTL(temp))//" triangles)."
CALL DISPLAY_MSG(verbosity,msg,logfile)
CASE(2143)
msg = ">>> Converting system into an orthorhombic cell..."
CALL DISPLAY_MSG(verbosity,msg,logfile)
CASE(2144)
WRITE(temp,*) NINT(reals(1))
msg = "..> Cell is now orthorhombic ("//TRIM(ADJUSTL(temp))//" atoms)."
CALL DISPLAY_MSG(verbosity,msg,logfile)
!
!2700-2799: WARNING MESSAGES
CASE(2700)
Expand Down Expand Up @@ -1994,6 +2001,9 @@ SUBROUTINE ATOMSK_MSG_EN(imsg,strings,reals)
CASE(2759)
msg = "/!\ WARNING: dislocation loop radius is too small, skipping."
CALL DISPLAY_MSG(1,msg,logfile)
CASE(2760)
msg = "/!\ WARNING: cell is already orthorhombic, skipping."
CALL DISPLAY_MSG(1,msg,logfile)
!
CASE(2799)
!strings(1) = name of obsolete option
Expand Down Expand Up @@ -2079,6 +2089,9 @@ SUBROUTINE ATOMSK_MSG_EN(imsg,strings,reals)
CASE(2818)
msg = "X!X ERROR: there was an error while reading the STL file, aborting."
CALL DISPLAY_MSG(1,msg,logfile)
CASE(2819)
msg = "X!X ERROR: unable to find an orthogonal cell from initial cell vectors."
CALL DISPLAY_MSG(1,msg,logfile)
!
!
!
Expand Down Expand Up @@ -2822,7 +2835,10 @@ SUBROUTINE ATOMSK_MSG_EN(imsg,strings,reals)
msg = "X!X ERROR: supercell dimensions were not defined, aborting."
CALL DISPLAY_MSG(1,msg,logfile)
CASE(4821)
msg = "X!X ERROR: number of atoms exceeds size of allocated array."
WRITE(temp,*) NINT(reals(1))
WRITE(temp2,*) NINT(reals(2))
msg = "X!X ERROR: number of atoms ("//TRIM(ADJUSTL(temp))// &
& ") exceeds size of allocated array ("//TRIM(ADJUSTL(temp2))//")."
CALL DISPLAY_MSG(1,msg,logfile)
CASE(4822)
msg = "X!X ERROR: no file to be treated, aborting."
Expand Down
19 changes: 17 additions & 2 deletions src/include/messages_FR.f90
Expand Up @@ -10,7 +10,7 @@ MODULE messages_FR
!* Université de Lille, Sciences et Technologies *
!* UMR CNRS 8207, UMET - C6, F-59655 Villeneuve D'Ascq, France *
!* pierre.hirel@univ-lille1.fr *
!* Last modification: P. Hirel - 12 Feb. 2018 *
!* Last modification: P. Hirel - 15 Feb. 2018 *
!**********************************************************************************
!* This program is free software: you can redistribute it and/or modify *
!* it under the terms of the GNU General Public License as published by *
Expand Down Expand Up @@ -1892,6 +1892,12 @@ SUBROUTINE ATOMSK_MSG_FR(imsg,strings,reals)
WRITE(temp,*) NINT(reals(1))
msg = "..> Le fichier STL a bien été lu ("//TRIM(ADJUSTL(temp))//" triangles)."
CALL DISPLAY_MSG(verbosity,msg,logfile)
CASE(2143)
msg = ">>> Conversion du système en une boîte orthorhombique..."
CALL DISPLAY_MSG(verbosity,msg,logfile)
CASE(2144)
msg = "..> La boîte est désormais orthorhombique ("//TRIM(ADJUSTL(temp))//" atomes)."
CALL DISPLAY_MSG(verbosity,msg,logfile)
!
!2700-2799: WARNING MESSAGES
CASE(2700)
Expand Down Expand Up @@ -2050,6 +2056,9 @@ SUBROUTINE ATOMSK_MSG_FR(imsg,strings,reals)
CASE(2759)
msg = "/!\ ALERTE : le rayon de la boucle de dislocation est trop petit, abandon."
CALL DISPLAY_MSG(1,msg,logfile)
CASE(2760)
msg = "/!\ ALERTE : la boîte est déjà orthorhombique, abandon."
CALL DISPLAY_MSG(1,msg,logfile)
!
CASE(2799)
!strings(1) = name of obsolete option
Expand Down Expand Up @@ -2135,6 +2144,9 @@ SUBROUTINE ATOMSK_MSG_FR(imsg,strings,reals)
CASE(2818)
msg = "X!X ERREUR : une erreur s'est produite lors de la lecture du fichier STL, abandon."
CALL DISPLAY_MSG(1,msg,logfile)
CASE(2819)
msg = "X!X ERREUR : impossible de trouver une boîte orthorhombique à partir des vecteurs de boîte initiaux."
CALL DISPLAY_MSG(1,msg,logfile)
!
!
!
Expand Down Expand Up @@ -2883,7 +2895,10 @@ SUBROUTINE ATOMSK_MSG_FR(imsg,strings,reals)
msg = "X!X ERREUR : les dimensions de la supercellule n'ont pas été définis, abandon."
CALL DISPLAY_MSG(1,msg,logfile)
CASE(4821)
msg = "X!X ERREUR : le nombre d'atomes dépasse la taille du tableau alloué."
WRITE(temp,*) NINT(reals(1))
WRITE(temp2,*) NINT(reals(2))
msg = "X!X ERREUR : le nombre d'atomes ("//TRIM(ADJUSTL(temp))// &
& ") dépasse la table du tableau alloué ("//TRIM(ADJUSTL(temp2))//")."
CALL DISPLAY_MSG(1,msg,logfile)
CASE(4822)
msg = "X!X ERREUR : aucun fichier à traiter, abandon."
Expand Down

0 comments on commit bc85128

Please sign in to comment.