Skip to content

Add XCrySDen xsf file reader and writer#52

Open
cajfisher wants to merge 5 commits into
arohl:masterfrom
cajfisher:xsf
Open

Add XCrySDen xsf file reader and writer#52
cajfisher wants to merge 5 commits into
arohl:masterfrom
cajfisher:xsf

Conversation

@cajfisher

Copy link
Copy Markdown
Contributor

Adds functionality for xsf format files, including animation files, used by XCrySDen, aenet, and other packages.

Refreshes bonds in model window when atom coordinates changed in Model:Editing box (same as already done for groups of selected atoms).
Enables reading and writing of structures in xsf format (including animation files)
Examples of single frame and animated xsf structures from XCrySDen website.
@ovhpa ovhpa self-assigned this Sep 4, 2022
@ovhpa

ovhpa commented Sep 10, 2022

Copy link
Copy Markdown
Collaborator

Hi,
I will review the XCrysDen file reader on this PR.

  • gcc and other compilers (icc, clang)
  • valgrind / libasan memory checks
  • static analysis
  • review

Comment thread src/file.h
gint write_planes(gchar *, struct model_pak *);
gint write_marvin(gchar *, struct model_pak *);
gint write_xml(gchar *, struct model_pak *);
gint write_xsf(gchar *, struct model_pak *);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already in PR #48

Comment thread src/file.h
gint read_mvnout(gchar *, struct model_pak *);
gint read_sout(gchar *, struct model_pak *);
gint read_xml(gchar *, struct model_pak *);
gint read_xsf(gchar *, struct model_pak *);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already in PR #48

Comment thread src/file.h
gint read_xyz_frame(FILE *, struct model_pak *);
gint read_dlpoly_frame(FILE *, struct model_pak *);
gint read_dmol_frame(FILE *, struct model_pak *);
gint read_xsf_frame(FILE *, struct model_pak *);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already in PR #48

Comment thread src/file.c
Comment on lines +59 to +61
/****************************************/
/* set up the recognized file type list */
/****************************************/

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already in PR #48

Comment thread src/gui_edit.c
sprintf(txt, "New surface dipole: %f\n", data->gulp.sdipole);
gui_text_show(STANDARD, txt);

gui_refresh(GUI_MODEL_PROPERTIES);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already in PR #48

Comment thread src/gui_edit.c
text = gtk_entry_get_text(GTK_ENTRY(CEDIT.apd_x));
CEDIT.apd_core->x[0] = str_to_float(text);
coords_compute(model);
connect_refresh(model);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already in PR #48

Comment thread src/gui_edit.c
text = gtk_entry_get_text(GTK_ENTRY(CEDIT.apd_y));
CEDIT.apd_core->x[1] = str_to_float(text);
coords_compute(model);
connect_refresh(model);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already in PR #48

Comment thread src/gui_edit.c
text = gtk_entry_get_text(GTK_ENTRY(CEDIT.apd_z));
CEDIT.apd_core->x[2] = str_to_float(text);
coords_compute(model);
connect_refresh(model);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already in PR #48

Comment thread src/file_xsf.c
Comment on lines +1 to +5
/*
Copyright (C) 2000 by Sean David Fleming

sean@ivec.org

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace with your own header ;)

Comment thread src/interface.h
FILE_SELECT, FILE_LOAD, FILE_SAVE, FILE_SAVE_AS,
NODATA, DATA, BIOSYM, CIF, FDF, GULP, MONTY, MARVIN, MORPH,
META_DATA, XML, XTL, XYZ, MOL2,
META_DATA, XML, XSF, XTL, XYZ, MOL2,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already in PR #48

Comment thread src/makefile.src
file.c file_cif.c file_gulp.c file_gmf.c file_marvin.c file_xtl.c \
file_arc.c file_xyz.c file_fdf.c file_vasp.c file_gms.c file_diff.c file_xml.c \
file_abinit.c file_pdb.c file_povray.c file_nwchem.c file_castep.c \
file_abinit.c file_pdb.c file_povray.c file_nwchem.c file_castep.c file_xsf.c \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already in PR #48

@ovhpa

ovhpa commented Sep 12, 2022

Copy link
Copy Markdown
Collaborator

Hi,
I finish reviewing, and almost everything looks OK.
I have just one little problem:
On animation, usually, I can turn the system to any orientation and the animation will be displayed given that point of view (POV), for ex:
ex_00

However, when doing an animation of a xsf file, the orientation is reset at the first new frame displayed. For ex:
ex01
Or in the ZnS case:
ex02

Do you think you can fix that?

Best,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants