atomes 1.1.15
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
read_cif.c File Reference

Functions to read CIF files. More...

#include "global.h"
#include "bind.h"
#include "interface.h"
#include "project.h"
#include "atom_edit.h"
#include "cbuild_edit.h"
#include "readers.h"
#include <ctype.h>
+ Include dependency graph for read_cif.c:

Go to the source code of this file.

Functions

int get_atom_id_from_periodic_table (atom_search *asearch)
 get atom Z from selection in the periodic table
 
double get_z_from_periodic_table (gchar *lab)
 get Z from atom label
 
void get_origin (space_group *spg)
 get space group origin matrices
 
void compute_lattice_properties (cell_info *cell)
 compute lattice parameters following cell description
 
int test_lattice (builder_edition *cbuilder, cell_info *cif_cell)
 test lattice parameters
 
int read_space_group (builder_edition *cbuilder, int spg)
 read space group N°spg data from file
 
void get_wyck_char (float val, int ax, int bx)
 convert wyckoff value to string
 
space_groupduplicate_space_group (space_group *spg)
 duplicate space ground information
 
int build_crystal (gboolean visible, project *this_proj, gboolean to_wrap, gboolean show_clones, cell_info *cell, GtkWidget *widg)
 build crystal
 
distance distance_3d (cell_info *cell, int mdstep, atom *at, atom *bt)
 distance between atom a and b in 3D
 
void sort (int dim, int *tab)
 sort, nim to max, a table by integer value
 
gchar * get_cif_word (gchar *mot)
 get string from CIF file, EOL can be ugly
 
float get_atom_coord (gchar *line, int mid)
 read atom coordinates from CIF file
 
gchar * get_atom_label (gchar *line, int lid)
 read atom label from CIF file
 
int get_atom_wyckoff (gchar *line, int wid)
 read Wyckoff position from CIF file
 
G_MODULE_EXPORT void set_cif_to_insert (GtkComboBox *box, gpointer data)
 change the object to insert at an empty cif position
 
gboolean get_missing_object_from_user ()
 get missing atomic number in CIF file from the user
 
void file_get_to_line (int line_id)
 reach line in CIF file
 
int cif_get_value (gchar *kroot, gchar *keyw, int linec, int lstart, gchar **cif_word, gboolean rec_val, gboolean all_ligne, gboolean in_loop)
 read pattern in CIF file
 
int cif_file_get_data_in_loop (int linec, int lid)
 get the number of "_" motifs in a line
 
int cif_file_get_number_of_atoms (int linec, int lid, int nelem)
 get the number of atom(s) in a CIF file
 
void check_for_to_lab (int ato, gchar *stlab)
 check atom label
 
gboolean cif_file_get_atoms_data (int lin, int cid[8])
 get atoms data from the CIF file
 
int get_loop_line_id (int linec, int lid)
 reach a line in the CIF file
 
int get_loop_line_for_key (gchar *key_a, gchar *key_b, int linec)
 search a string
 
gboolean cif_get_atomic_coordinates (int linec)
 read the atomic coordinates from the CIF file
 
int cif_file_get_number_of_positions (int linec, int lid)
 get the number of symmetry positions
 
gboolean cif_get_symmetry_positions (int linec)
 read the symmetry positions from the CIF file
 
int get_space_group_from_hm (gchar *hmk)
 retrieve space group using the HM Key
 
gchar * get_string_from_origin (space_group *spg)
 get the space group origin from its name
 
int get_setting_from_hm (gchar *hmk, int end)
 Getting the space group parameters using the HM Key.
 
int group_info_from_hm_key (int spg, gchar *key_hm)
 get the space group information using the HM key from the CIF file
 
gboolean cif_get_cell_data (int linec)
 get the cell data from the CIF file
 
int cif_get_space_group (int linec)
 get the space group from the CIF file
 
int open_cif_file (int linec)
 open CIF file
 

Variables

gchar * wnpos [3]
 
gchar * tmp_pos
 
FILE * cifp
 
char * line_ptr
 
int * keylines = NULL
 
int cif_loop_id
 
gchar * cif_coord_opts [40][2]
 
GtkWidget ** img_cif
 
atom_searchcif_search = NULL
 
atomic_objectcif_object = NULL
 

Detailed Description

Functions to read CIF files.

Author
Sébastien Le Roux sebas.nosp@m.tien.nosp@m..lero.nosp@m.ux@i.nosp@m.pcms..nosp@m.unis.nosp@m.tra.f.nosp@m.r

Definition in file read_cif.c.

Function Documentation

◆ build_crystal()

int build_crystal ( gboolean visible,
project * this_proj,
gboolean to_wrap,
gboolean show_clones,
cell_info * cell,
GtkWidget * widg )
extern

build crystal

Parameters
visibleis the crystal builder window visible ?
this_projthe target project
to_wrapwrap or not atomic coordinates in the unit cell
show_clonesshow / hide clone(s)
cellthe cell info that contains the crystal description
widgthe GtkWidget sending the signal

Definition at line 907 of file cbuild_action.c.

◆ check_for_to_lab()

void check_for_to_lab ( int ato,
gchar * stlab )

check atom label

Parameters
atoAtom id
stlabLabel read in the CIF file

Definition at line 685 of file read_cif.c.

◆ cif_file_get_atoms_data()

gboolean cif_file_get_atoms_data ( int lin,
int cid[8] )

get atoms data from the CIF file

Parameters
linLine to reach
cidpositions on the line for the data to read

Definition at line 735 of file read_cif.c.

◆ cif_file_get_data_in_loop()

int cif_file_get_data_in_loop ( int linec,
int lid )

get the number of "_" motifs in a line

Parameters
linecTotal number of lines
lidLine to reach

Definition at line 562 of file read_cif.c.

◆ cif_file_get_number_of_atoms()

int cif_file_get_number_of_atoms ( int linec,
int lid,
int nelem )

get the number of atom(s) in a CIF file

Parameters
linecTotal number of lines
lidLine to reach
nelemNumber of element(s) the line

Definition at line 623 of file read_cif.c.

◆ cif_file_get_number_of_positions()

int cif_file_get_number_of_positions ( int linec,
int lid )

get the number of symmetry positions

Parameters
linecTotal number of lines
lidLine to reach

Definition at line 1085 of file read_cif.c.

◆ cif_get_atomic_coordinates()

gboolean cif_get_atomic_coordinates ( int linec)

read the atomic coordinates from the CIF file

Parameters
linecTotal number of lines

Definition at line 909 of file read_cif.c.

◆ cif_get_cell_data()

gboolean cif_get_cell_data ( int linec)

get the cell data from the CIF file

Parameters
linecTotal number of lines

Definition at line 1450 of file read_cif.c.

◆ cif_get_space_group()

int cif_get_space_group ( int linec)

get the space group from the CIF file

Parameters
linecTotal number of lines

Definition at line 1495 of file read_cif.c.

◆ cif_get_symmetry_positions()

gboolean cif_get_symmetry_positions ( int linec)

read the symmetry positions from the CIF file

Parameters
linecTotal number of lines

Definition at line 1167 of file read_cif.c.

◆ cif_get_value()

int cif_get_value ( gchar * kroot,
gchar * keyw,
int linec,
int lstart,
gchar ** cif_word,
gboolean rec_val,
gboolean all_ligne,
gboolean in_loop )

read pattern in CIF file

Parameters
krootString root (first part)
keywString root (first part)
linecTotal number of lines
lstartLine to reach
cif_wordpointer to store the data read
rec_valRecord position on the line
all_ligneBrowse all line (1/0)
in_loopMore than one identical key string (1/0)

Definition at line 407 of file read_cif.c.

◆ compute_lattice_properties()

void compute_lattice_properties ( cell_info * cell)
extern

compute lattice parameters following cell description

Parameters
cellthe target cell description

Definition at line 193 of file cbuild_action.c.

◆ distance_3d()

distance distance_3d ( cell_info * cell,
int mdstep,
atom * at,
atom * bt )
extern

distance between atom a and b in 3D

Parameters
cellunit cell
mdstepthe MD step
atatom a
btatom b

Definition at line 81 of file ogl_utils.c.

◆ duplicate_space_group()

space_group * duplicate_space_group ( space_group * spg)
extern

duplicate space ground information

Parameters
spgthe space group to duplicate

Definition at line 565 of file cbuild_action.c.

◆ file_get_to_line()

void file_get_to_line ( int line_id)

reach line in CIF file

Parameters
line_idLine to reach

Definition at line 385 of file read_cif.c.

◆ get_atom_coord()

float get_atom_coord ( gchar * line,
int mid )

read atom coordinates from CIF file

Parameters
linethe string that contains the data
midthe position to reach on the line

Definition at line 209 of file read_cif.c.

◆ get_atom_id_from_periodic_table()

int get_atom_id_from_periodic_table ( atom_search * asearch)
extern

get atom Z from selection in the periodic table

Parameters
asearchtarget atom search, if any

Definition at line 672 of file w_periodic.c.

◆ get_atom_label()

gchar * get_atom_label ( gchar * line,
int lid )

read atom label from CIF file

Parameters
linethe string that contains the data
lidthe position to reach on the line

Definition at line 232 of file read_cif.c.

◆ get_atom_wyckoff()

int get_atom_wyckoff ( gchar * line,
int wid )

read Wyckoff position from CIF file

Parameters
linethe string that contains the data
widthe position to reach on the line

Definition at line 260 of file read_cif.c.

◆ get_cif_word()

gchar * get_cif_word ( gchar * mot)

get string from CIF file, EOL can be ugly

Parameters
motthe string that was read in the file

Definition at line 194 of file read_cif.c.

◆ get_loop_line_for_key()

int get_loop_line_for_key ( gchar * key_a,
gchar * key_b,
int linec )

search a string

Parameters
key_aString root (first part)
key_bString end (second part)
linecTotal number of lines

Definition at line 894 of file read_cif.c.

◆ get_loop_line_id()

int get_loop_line_id ( int linec,
int lid )

reach a line in the CIF file

Parameters
linecTotal number of lines
lidLine to reach

Definition at line 839 of file read_cif.c.

◆ get_missing_object_from_user()

gboolean get_missing_object_from_user ( )

get missing atomic number in CIF file from the user

Definition at line 327 of file read_cif.c.

◆ get_origin()

void get_origin ( space_group * spg)
extern

get space group origin matrices

Parameters
spgthe target space group

Definition at line 146 of file cbuild_action.c.

◆ get_setting_from_hm()

int get_setting_from_hm ( gchar * hmk,
int end )

Getting the space group parameters using the HM Key.

Parameters
hmkthe HM key
endUse origin (number of possible SP origins), or not (-1)

Definition at line 1280 of file read_cif.c.

◆ get_space_group_from_hm()

int get_space_group_from_hm ( gchar * hmk)

retrieve space group using the HM Key

Parameters
hmk

Definition at line 1196 of file read_cif.c.

◆ get_string_from_origin()

gchar * get_string_from_origin ( space_group * spg)

get the space group origin from its name

Parameters
spgSpace group

Definition at line 1250 of file read_cif.c.

◆ get_wyck_char()

void get_wyck_char ( float val,
int ax,
int bx )
extern

convert wyckoff value to string

Parameters
valthe target value
axaxis id, x = 0, y = 1, z = 2
bxaxis label 0 = "x", 1 = "y", 2 = "z"

Definition at line 139 of file cbuild_info.c.

◆ get_z_from_periodic_table()

double get_z_from_periodic_table ( gchar * lab)
extern

get Z from atom label

Parameters
labthe atomic label

Definition at line 304 of file w_library.c.

◆ group_info_from_hm_key()

int group_info_from_hm_key ( int spg,
gchar * key_hm )

get the space group information using the HM key from the CIF file

Parameters
spgSpace group
key_hmHM key

Definition at line 1368 of file read_cif.c.

◆ open_cif_file()

int open_cif_file ( int linec)

open CIF file

Parameters
linecTotal number of lines

Definition at line 1728 of file read_cif.c.

◆ read_space_group()

int read_space_group ( builder_edition * cbuilder,
int spg )
extern

read space group N°spg data from file

Parameters
cbuilderthe target builder edition
spgthe space group id

Definition at line 771 of file cbuild_edit.c.

◆ set_cif_to_insert()

G_MODULE_EXPORT void set_cif_to_insert ( GtkComboBox * box,
gpointer data )

change the object to insert at an empty cif position

Parameters
boxthe GtkComboBox sending the signal
datathe associated data pointer

Definition at line 292 of file read_cif.c.

◆ sort()

void sort ( int dim,
int * tab )
extern

sort, nim to max, a table by integer value

Parameters
dimthe number of value
tabthe table to sort

Definition at line 380 of file glview.c.

◆ test_lattice()

int test_lattice ( builder_edition * cbuilder,
cell_info * cif_cell )
extern

test lattice parameters

Parameters
cbuilderthe builder edition with the lattice parameters
cif_cellthe cell information when testing CIF file

Definition at line 312 of file cbuild_action.c.

Variable Documentation

◆ cif_coord_opts

gchar* cif_coord_opts[40][2]

Definition at line 96 of file read_cif.c.

◆ cif_loop_id

int cif_loop_id

Definition at line 94 of file read_cif.c.

◆ cif_object

atomic_object* cif_object = NULL

Definition at line 282 of file read_cif.c.

◆ cif_search

atom_search* cif_search = NULL

Definition at line 281 of file read_cif.c.

◆ cifp

FILE* cifp

Definition at line 91 of file read_cif.c.

◆ img_cif

GtkWidget** img_cif

Definition at line 280 of file read_cif.c.

◆ keylines

int* keylines = NULL

Definition at line 93 of file read_cif.c.

◆ line_ptr

char* line_ptr

Definition at line 92 of file read_cif.c.

◆ tmp_pos

gchar* tmp_pos
extern

Definition at line 72 of file cbuild_action.c.

◆ wnpos

gchar* wnpos[3]
extern

Definition at line 74 of file cbuild_info.c.