Code Monkey home page Code Monkey logo

liam-deacon / cleed Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 3.0 26.59 MB

Computational package for Low Energy Electron Diffraction using ML optimisation algorithms

License: Other

CMake 2.71% C 62.54% C++ 2.30% Fortran 0.03% Makefile 4.64% Shell 0.61% M4 0.10% TeX 0.03% NSIS 0.03% Batchfile 0.05% Objective-C 0.49% Python 19.96% HTML 2.00% CSS 0.11% JavaScript 0.31% C# 1.01% Pascal 0.91% Ruby 0.19% DIGITAL Command Language 0.23% Roff 1.73%
low-energy-electron-diffraction optimization-algorithms amoeba nelder-mead-algorithm nelder-mead-simplex genetic-algorithm thermal-annealing

cleed's Introduction

CLEED package

Introduction

CLEED is a computational package for Low Energy Electron Diffraction (LEED) IV analysis. It fits experimental IV data curves with those simulated by the cleed program and a 'goodness' of fit is made with the R-Factor program crfac. Optimisation of the input parameters is performed by csearch.

A (still rather incomplete) documentation of the program package can be found in 'doc/CLEED_Manual.pdf', but it is probably best to send me an email, with all input files, to [email protected] when you encounter any problems (I am sure you will ...)

Installation

In order to target as many different systems in the simplest way the CLEED package has been developed using CMake as a dependency tracking and makefile generation program. CMake is available on all major desktop platforms and a GUI is also available for Windows users.

Use the following command in order to install CLEED for your system:

cd /path/to/cleed/source
cmake -G <generator-name> --build build/ -i
cd build/
<make> install

Where is the target platform e.g. "Unix Makefiles" or "MinGW Makefiles". is usually "make" (Unix/GNU Linux) or "mingw32-make" (Windows). The '-i' option is voluntary, but is useful if you wish to be lead through the setup in a step-by-step fashion.

Note Windows users will require MinGW installed (other compiler tool chains such as MSVC and CYGWIN have not been tested).

If you are unable to compile the programs, pre-compiled packages are also available.

Getting Started

On other operating systems check the compatibility of the trigonometric functions and data type used for real in "real.h" (in directory INCLUDE)

We have had a few problems on OSs different from DEC alpha with the symmetrised version of CLEED (cleed_sym), therefore this is currently not supported in this distribution, but the non-symmetrised version should be running okay.

A set of sample input files for Er/Si(111) (no expt. IV curves), Benzene on Ru(0001) and O and Cu/Ni(111) can be found in under SIER, RUBENZ, NIO and NICU in the 'examples/' directory of the CLEED installation.

There are three files for each search (in addition to phase shifts and experimental data) which have to be created by the user:

<bul_file> *.bul Bulk geometry and non-geometric parameters

<inp_file> *.inp Specifies start geometry for the search and search parameters (symmetry etc.)

<ctr_file> *.ctr Specifies correspondence between theoretical and experimental IV curves.

A detailed description of the file format can be found in 'doc/CLEED_Manual.pdf', but it is probably easiest to use one of the sample input files and modify it. All other files are created by the programs. The search can be monitored through the *.log file; at each point of the search the current best fit geometries and IV curves can be found in *.rmin and *.pmin.

These files are all described in the CLEED manual.

The phase shift input must have the same format as for the VanHove/Tong programs with a first line added that contains the number of energies and lmax. For each type of atoms there must be a separate file in the directory 'phase/' called .phs. The directory is passed to the LEED program through the environment variable CLEED_PHASE.

Before starting any program 3 environment variables have to be set:

CLEED_PHASE (see above) CSEARCH_LEED (path to executable LEED-IV program: normally cleed_nsym) CSEARCH_RFAC (path to executable R factor program: crfac)

A shell script doing this can be found in 'bin/set_env' (again, the directory path of the parent directory must be changed in this file). For users with a Python interpreter installed, the script 'set_env.py' allows much more sophisticated setups, for more details see:

set_env.py --help

The search is started by:

csearch -i <inp_file>

'csearch' is a master program that calls the LEED-IV program (cleed_nsym) and the R factor program (crfac) to calculate IV curves and R factors for a given trial structure and optimises the geometry parameters of the surface geometry in order to minimise the R factor using the simplex method (other search methods are currently tested).

The LEED-IV program can be called outside the search by

cleed_nsym -i <par_file> -b <bul_file> -o <res_file> > <out_file>

<par_file> is usually created by the search program. It contains only the positions of the overlayer atoms that are optimised during the search. An example is given in 'examples/NIO'. The LEED-IV program produces a lot of control output (written to stdout). Therefore it is best to redirect stdout to a file using the '>' command. It is best to check the LEED-IV program separately first, after you have made any alterations to the input file.

In order to test the R factor program separately, call it by:

crfac -c <ctr_file> -t <output_file_from_cleed>

On Linux machines, for the search it is recommended to use the 'nohup' command together with '&' which runs the search in the background:

nohup csearch -i <inp_file> > <out_file> 2> <err_file> &

In the NiO111_2x2O example each iteration takes about 90-100s (2.4 GHz Linux PC), the final R factor after convergence should be around 0.1322 and it takes around 183 iteration to get there from the start geometry specified in Ni111_2x2O.inp (see attached *.log file).

The example in NICU leads to an R factor of 0.0633 after 63 iterations (ca 15s cpu time per iteration).

All information necessary to restart the search at the current position is stored in *.ver. If the search stops for any reason, e.g. because it has reached the limit of iterations (currently 2000), it can be restarted by:

nohup csearch -i <inp_file> -v <ver_file> 1> <out_file> 2> <err_file> &

GOOD LUCK

-- Georg Held --

cleed's People

Contributors

liam-deacon avatar liamdeacon avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cleed's Issues

Compile Issues On "master" and "stable"

Hello,

I was interested in using this program for my research and was attempting to compile it. The instructions for compiling could use some updating, as there were a number of package prerequisites I didn't have on my system, and cmake no longer accepts -i as an option, which led to a whole lot of other weirdness.

Even after getting those difficulties sorted out, it appeared that the package was not in a state so that it could be compiled. The first compile complained that lattice.c didn't have a main function or defined variables. The second compile revealed that a variable was likely renamed from "eng" to "energy" in one file, but not another. The current hurdle is that eng is being referenced as if it were a struct, but the compiler doesn't think that it should be. At this point, I began to question whether it was worth chasing down all of these threads.

I would really appreciate if you could provide a version of the program which compiles for you, just so I can know that the issues I'm experiencing are because of something wrong with my installation, and not because the project wasn't in a working state to begin with.

I also tried installing via pip, but it said "No matching distribution found for cleed"

I can provide more details of the issues I experienced, if that would be helpful for you.

Thanks in advance for your help,
Karl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.