Skip to content

Add XCrySDen xsf file reader and writer #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cajfisher
Copy link
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
Copy link
Collaborator

ovhpa commented Sep 10, 2022

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

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

@@ -101,6 +101,7 @@ gint write_gmf(gchar *, struct model_pak *);
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
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

@@ -142,6 +143,7 @@ gint read_marvin(gchar *, struct model_pak *);
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
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

@@ -189,6 +191,7 @@ gint read_qe_out_frame(FILE *, struct model_pak *);
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
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 on lines +59 to +61
/****************************************/
/* set up the recognized file type list */
/****************************************/
Copy link
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

@@ -438,6 +438,7 @@ printf("new dipole: %f\n", data->gulp.sdipole);
sprintf(txt, "New surface dipole: %f\n", data->gulp.sdipole);
gui_text_show(STANDARD, txt);

gui_refresh(GUI_MODEL_PROPERTIES);
Copy link
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

@@ -3050,18 +3051,21 @@ if (CEDIT.apd_core->shell)
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
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

break;

case COORD_Y:
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
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

break;

case COORD_Z:
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
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 on lines +1 to +5
/*
Copyright (C) 2000 by Sean David Fleming

sean@ivec.org

Copy link
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 ;)

@@ -60,7 +60,7 @@ GDIS, SGINFO, SYMMETRY, GPERIODIC, ELEM_EDIT, POVRAY, GENSURF,
ABOUT, ANIM, PLOTS, SURF, DISPLAY, GEOMETRY, SPATIAL, TASKMAN, MANUAL, SETUP,
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
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

@@ -10,7 +10,7 @@ SRC = main.c model.c coords.c connect.c matrix.c module.c task.c \
ff.c ff_gulp.c test.c \
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
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
Copy link
Collaborator

ovhpa commented Sep 12, 2022

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