\documentclass[final]{beamer}
% beamer 3.10: do NOT use option hyperref={pdfpagelabels=false}!
\mode<presentation>
{
  \usetheme{Icy-AM}
}
\usepackage[english]{babel}
\usepackage{times}
\usepackage{xspace}
\usepackage{hyperref}
\usepackage{minibox}
\usepackage{fancyvrb}
\usepackage{setspace}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,positioning,intersections,calc,fadings}
% \usepackage{chemfig}
\usepackage{ragged2e}
\usepackage{multicol}

\renewcommand*\ttdefault{txtt}

\setlength{\columnsep}{1.25cm}

\bibliographystyle{abbrv-AM-unsrt}

\usepackage[orientation=portrait,size=a0,scale=1.4,debug]{beamerposter}

\let\oldurl\url
\renewcommand{\url}[1]{{\color{i6colorscheme4} \bf \small \oldurl{#1}}}
\newcommand{\smalltag}[1]{
  {\footnotesize\texttt{#1}}
}

\title{Integration of TCOD (Theoretical Crystallography Open Database) and
       AiiDA (Automated Interactive Infrastructure and Database for
       Atomistic simulations)}
\author{Andrius~Merkys$^{a,b}$, Giovanni~Pizzi$^{a}$,
        Andrea~Cepellotti$^{a}$, Nicolas~Mounet$^{a}$,
        Saulius~Gra\v{z}ulis$^{b}$ and Nicola~Marzari$^{a}$}
\institute{$^{a}$Theory and Simulation of Materials (THEOS) and National
           Centre for Computational Design and Discovery of Novel Materials
           (MARVEL), \'{E}cole Polytechnique F\'{e}d\'{e}rale de Lausanne,
           CH-1015 Lausanne, Switzerland;
           $^{b}$Department of Protein-DNA Interactions, Vilnius University
           Institute of Biotechnology, V.~A.~Grai\v{c}i\={u}no~8, LT-02241
           Vilnius, Lithuania}
\corespinstitution{\'{E}cole Polytechnique F\'{e}d\'{e}rale de Lausanne,
                   Vilnius University Institute of Biotechnology}
\corespemail{andrius.merkys@gmail.com}

\addtolength{\textwidth}{1cm}

\newcommand\code[2]{
  \def\x{6*(#2-2.5)};
  \begin{scope}[shift={({14-sqrt(200-\x^2)},-#2*6)}]
    \shade[top color=white,bottom color=i6colorscheme2,rounded corners=1.5cm]
      (-3.5,-2) rectangle (3.5,2);
      \node at (0,0) {%
        \begin{minipage}{5cm}
          \centering
          \footnotesize #1
        \end{minipage}
      };
  \end{scope}
  \def\x{6*(#2-2)};
  \begin{scope}[shift={({15-sqrt(200-\x^2)},-#2*6)}]
    \fill[i6colorscheme2] (-2,-2) -- (2,-2) to[out=0,in=90] (3.25,-3) to[out=270,in=0] (2,-4) -- (-2,-4);
  \end{scope}
}

\newcommand\compenv[3]{
    \begin{scope}[shift={(#2,#3)}]
      \shade[top color=i6colorscheme2,bottom color=i6colorscheme1]
        (-4,-2.5) to[out=180,in=270] (-6,0) to[out= 90,in=180] (-4, 2.5) --
        ( 7, 2.5) to[out=180,in= 90] ( 5,0) to[out=270,in=180] ( 7,-2.5);
        \node at (0,0) {\large \bf #1};
    \end{scope}
}

\tikzfading[name=fade right,
  left color=red!100, right color=red!20]

\begin{document}
  \begin{frame}{}

  % \input{palette} % A palette of used colors. Used for development.

  \vskip -.5cm

  \begin{tikzpicture}[>=latex]

  \def\rdfy{33};
  \def\tcodx{15};
  \def\tcody{10};
  \def\codesx{-47.5};

  \def\colWidth{39};
  \def\colOneX{-28};
  \def\colTwoX{13.75};

  \shade[top color=i6colorscheme3,bottom color=i6colorscheme4]
    (3,41) --
    (5,\rdfy+1) -- (8,\rdfy+1) -- (8,\rdfy+2) -- (10,\rdfy) -- (8,\rdfy-2) -- (8,\rdfy-1) -- (5,\rdfy-1) --
    (5,\tcody+1) -- (8,\tcody+1) -- (8,\tcody+2) -- (10,\tcody) -- (8,\tcody-2) -- (8,\tcody-1) -- (5,\tcody-1) -- (3,3.5);

  \shade[top color=i6colorscheme3,bottom color=i6colorscheme4,rounded corners=1.5cm]
    (-28.5,15.5) -- (-21,15.5) -- (-21,41) -- (7,41) --
    (7,3.5) -- (-21,3.5) -- (-21,10.5) -- (-28.5,10.5);

  \shade[top color=i6colorscheme2,bottom color=i6colorscheme3,rounded corners=1.5cm]
    (-20,14.5)  rectangle (5,40);

  \fill[color=white,fill opacity=.5] (-26.5,33.5)  -- (-22.5,33.5) to[out=0,in=180] (-18.5,39) -- (-15.5,39) --
                                     (-15.5,26.75) -- (-18.5,26.75) to[out=180,in=0] (-22.5,28.5) -- (-26.5,28.5);

  \fill[color=white,fill opacity=.5] (-27.5,24.5)  -- (-25.5,24.5) to[out=0,in=180] (-19.5,39) -- (-15.5,39) --
                                     (-15.5,26.75) -- (-19.5,26.75) to[out=180,in=0] (-23.5,19.5) -- (-27.5,19.5);

  \shade[top color=white,bottom color=i6colorscheme2,rounded corners=1.5cm]
    (-19,26.75) rectangle (3,39);

  \node [rotate=90] at (6,32.75) {\large \bf Level 2};
  \node [rotate=90] at (4,32.75) {\large \bf Level 1};
  \node [rotate=90] at (2,32.75) {\large \bf Level 0};

    \node at (-8.5,32.5) {%
      \begin{minipage}{20cm}
          \normalsize 
          \begin{itemize}
            \item lattice and symmetry \\
              \vskip 0.25cm
              \begin{spacing}{1}
                \minibox{
                  \smalltag{\_cell\_length\_\{a,b,c\}} \\
                  \smalltag{\_cell\_angle\_\{alpha,beta,gamma\}} \\
                  \smalltag{\_symmetry\_space\_group\_name\_\{H-M,Hall\}} \\
                  \smalltag{...}
                }
              \end{spacing}
            \item atomic coordinates \\
              \vskip 0.25cm
              \begin{spacing}{1}
                \minibox{
                  \smalltag{\_atom\_site\_fract\_\{x,y,z\}} \\
                  \smalltag{...}
                }
              \end{spacing}
            \item bibliography reference \\
              \vskip 0.25cm
              \begin{spacing}{1}
                \minibox{
                  \smalltag{\_journal\_\{name\_full,paper\_doi\}} \\
                  \smalltag{...}
                }
              \end{spacing}
          \end{itemize}
      \end{minipage}
    };

    \node at (-8.5,20.5) {%
      \begin{minipage}{20cm}
          \begin{itemize}
            \item computational setup \& parameters \\
              \vskip 0.25cm
              \begin{spacing}{1}
                \minibox{
                  \smalltag{\_tcod\_software\_\{package,compiler,library\}} \\
                  \smalltag{\_dft\_\{XC\_functional,pseudopotential\}\_type} \\
                  \smalltag{\_dft\_kinetic\_energy\_cutoff\_wavefunctions} \\
                  \smalltag{...}
                }
              \end{spacing}
            \item residual forces on atoms and cell \\
              \vskip 0.25cm
              \begin{spacing}{1}
                \minibox{
                  \smalltag{\_tcod\_atom\_site\_residual\_force\_fract\_\{x,y,z\}} \\
                  \smalltag{...}
                }
              \end{spacing}
            \item code-specific convergence criteria \\
              \vskip 0.25cm
              \begin{spacing}{1}
                \minibox{
                  \smalltag{\_dft\_cell\_\{energy,density,potential\}\_conv} \\
                  \smalltag{...}
                }
              \end{spacing}
          \end{itemize}
      \end{minipage}
    };

    \node at (-8.5,9) {%
      \begin{minipage}{20cm}
          \begin{itemize}
            \item input scripts and files \\
              \vskip 0.25cm
              \begin{spacing}{1}
                \minibox{
                  \smalltag{\_tcod\_file\_\{name,URI,contents,role,interpreter\}} \\
                  \smalltag{...}
                }
              \end{spacing}
            \item command line \\
              \vskip 0.25cm
              \begin{spacing}{1}
                \minibox{
                  \smalltag{\_tcod\_computation\_\{command,environment\}} \\
                  \smalltag{...}
                }
              \end{spacing}
            \item output logs of the code \\
              \vskip 0.25cm
              \begin{spacing}{1}
                \minibox{
                  \smalltag{\_tcod\_computation\_\{log\_file,stdout,stderr\}} \\
                  \smalltag{...}
                }
              \end{spacing}
          \end{itemize}
      \end{minipage}
    };

    \begin{scope}[shift={(\tcodx,\tcody)},scale=3]
      \shade[left color=i6colorscheme2,right color=i6colorscheme4] (0,-1) ellipse (1.5 and 0.75);
      \shade[left color=i6colorscheme2,right color=i6colorscheme4] (-1.5,1) rectangle (1.5,-1);
      \shade[left color=i6colorscheme4,right color=i6colorscheme2] (0,1) ellipse (1.5 and 0.75);
      \node at (0,-0.5) {\bf \Large TCOD};
    \end{scope}

    \begin{scope}[shift={(15,\rdfy)},scale=1]
      \shade[top color=white,bottom color=i6colorscheme2]
        ( 3, 3) -- ( 3, 1) to[out=  0,in= 90] ( 4, 0) to[out=270,in=  0] ( 3,-1) --
        ( 3,-3) -- ( 1,-3) to[out=270,in=  0] ( 0,-4) to[out=180,in=270] (-1,-3) --
        (-3,-3) -- (-3,-1) to[out=  0,in=270] (-2, 0) to[out= 90,in=  0] (-3, 1) --
        (-3, 3) -- (-1, 3) to[out=270,in=180] ( 0, 2) to[out=  0,in=270] ( 1, 3) --
        ( 3, 3);
      \node at (0,0) {\bf \Large RDF};
      \foreach \x in {225,240,...,495} \draw[line width=10,color=i6colorscheme4,->] (\x:5) -- (\x:7.5);
    \end{scope}

    \fill[color=white,fill opacity=.5]
        (\codesx,39) -- (\codesx+3,39) to[out=0,in=180] (\codesx+11,33.5) -- (-35,33.5) --
        (-35,28.5) -- (\codesx+11,28.5) to[out=180,in=0] (\codesx+3,17) -- (\codesx,17);

    \fill[color=white,fill opacity=.5]
        (\codesx,33) -- (\codesx+3,33) to[out=0,in=180] (\codesx+10,24.5) -- (-35,24.5) --
        (-35,19.5) -- (\codesx+10,19.5) to[out=180,in=0] (\codesx+3,17) -- (\codesx,17);

    \fill[color=white,fill opacity=.5]
        (\codesx,21) -- (\codesx+3,21) to[out=0,in=180] (\codesx+9,15.5) -- (-35,15.5) --
        (-35,10.5) -- (\codesx+9,10.5) to[out=180,in=0] (\codesx+3,5) -- (\codesx,5);

    \compenv{ASE}{-31}{31};
    \compenv{pymatgen}{-32}{22};
    \compenv{AiiDA}{-33}{13};

    \begin{scope}[shift={(\codesx,37)}]
      \code{LAMMPS}{0};           % ASE only
      \code{ABINIT}{1};           % ASE and pymatgen
      \code{VASP}{2};             % ASE and pymatgen
      \code{NWChem}{3};           % all three
      \code{Quantum ESPRESSO}{4}; % pymatgen and AiiDA
      \code{YAMBO}{5};            % AiiDA only
    \end{scope}

    \draw[line width=10,color=i6colorscheme4,rounded corners=1.5cm,dashed,->]
         (15,\tcody-6.5) -- (15,2) -- (-5,2) (-13,2) -- (-33,2) -- (-33,9.5);
    \node (reproduction) at (-9,2) {\emph{reproduction}};

    \coordinate (anchor) at (-14,2);

    % Boxes above the center picture

    \node [above left = 40 and 0.5 of anchor] {%
      \begin{minipage}{\colWidth cm}
        \begin{block}{Abstract}
          \vspace{-1cm}
          \begin{multicols}{2}
            \justify
            \small
            \input{abstract-for-poster}
          \end{multicols}
          \vspace{-0.5cm}
        \end{block}
      \end{minipage}
    };

    \node [above right = 40 and 0.5 of anchor] {%
      \begin{minipage}{\colWidth cm}
        \begin{block}{CIF dictionaries}
          \input{dictionaries}
        \end{block}
      \end{minipage}
    };

    \begin{scope}[shift={($(anchor)+(21,57.25)$)}]
      \fill[color=i6colorscheme2,rounded corners]
        (-15,-1) rectangle (-7,0);
      \fill[color=i6colorscheme3,rounded corners]
        ( -4,-1) rectangle ( 4,0);
      \fill[color=i6colorscheme4,rounded corners]
        (  7,-1) rectangle (15,0);

      \node at (-11,-.5) {\footnotesize Level 0};
      \node at (  0,-.5) {\footnotesize Level 1};
      \node at ( 11,-.5) {\footnotesize Level 2};

      \shade[left color=white,right color=i6colorscheme4]
        (-18,-2.5) -- (13,-2.5) -- (13,-1.5) -- (18,-4) --
        ( 13,-6.5) -- (13,-5.5) -- (-18,-5.5);

      \node at (0,-4) {%
          \begin{minipage}[c]{20cm}
            \footnotesize
            \centering
            Quantity of machine-readable data \\
            Reproducibility
          \end{minipage}
        };
    \end{scope}

    % Boxes below the center picture

    \node [below left = 0.5 and 0.5 of anchor] (bottomleft) {%
      \begin{minipage}{\colWidth cm}
        \begin{block}{AiiDA}
          \input{aiida}
        \end{block}
      \end{minipage}
    };

    \node [below right = 0.5 and 0.5 of anchor] (bottomright) {%
      \begin{minipage}{\colWidth cm}
        \begin{block}{TCOD}
          \input{tcod}
        \end{block}

        \begin{block}{Bibliography}
          \scriptsize
          \bibliography{bibliography,local}
        \end{block}

      \end{minipage}
    };

  \begin{scope}[shift={($(bottomright.south)+(0,-2.8)$)}]
    \node (rect) [rectangle,fill=white,inner sep=0] at (16.9,0) {\includegraphics[scale=1.5]{images/jmp-url.eps}};
    \node at (8.5,0) {%
      \begin{minipage}{10cm}
        \raggedleft \scriptsize Online version of the poster: \url{http://j.mp/1K110ro}
      \end{minipage}
    };
    \node at (-11,0) {%
      \begin{minipage}{19cm}
        \raggedright This research is funded by the SCIEX~Fellowship~grant~No.~13.169
      \end{minipage}
    };
  \end{scope}

  \draw[line width=3,color=i6colorscheme4,rounded corners=1.5cm,dashed] (-35.5,-0.25)
        node [circle,fill=i6colorscheme4,minimum width=3,inner sep=3] {} -- (-35.5,13)
        node [circle,fill=i6colorscheme4,minimum width=3,inner sep=3] {};

  \draw[line width=3,color=i6colorscheme4,rounded corners=1.5cm,dashed] (\tcodx+10,-0.25)
        node [circle,fill=i6colorscheme4,minimum width=3,inner sep=3] {} -- (\tcodx+10,\tcody-1.45) -- (\tcodx+3,\tcody-1.45)
        node [circle,fill=i6colorscheme4,minimum width=3,inner sep=3] {};

  \draw[line width=3,color=i6colorscheme4,rounded corners=1.5cm,dashed] (\tcodx+10,43.5)
        node [circle,fill=i6colorscheme4,minimum width=3,inner sep=3] {} -- (\tcodx+10,20) -- (6,20)
        node [circle,fill=i6colorscheme4,minimum width=3,inner sep=3] {};

  \end{tikzpicture}

  \end{frame}

\end{document}
