atomes 1.1.16
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
project.c
Go to the documentation of this file.
1/* This file is part of the 'atomes' software
2
3'atomes' is free software: you can redistribute it and/or modify it under the terms
4of the GNU Affero General Public License as published by the Free Software Foundation,
5either version 3 of the License, or (at your option) any later version.
6
7'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9See the GNU General Public License for more details.
10
11You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12If not, see <https://www.gnu.org/licenses/>
13
14Copyright (C) 2022-2024 by CNRS and University of Strasbourg */
15
22/*
23* This file: 'project.c'
24*
25* Contains:
26*
27
28 - Project management functions
29
30*
31* List of functions:
32
33 void save_pos_ (int * nat, int lot[* nat], int * num, double xpos[* num], double ypos[* num], double zpos[* num]);
34 void send_steps_ (int * steps);
35
36 project * get_project_by_id (int p);
37
38*/
39
40#include "global.h"
41#include "glview.h"
42#include "callbacks.h"
43#include "interface.h"
44#include "bind.h"
45
55
68void save_pos_ (int * nat, int lot[* nat], int * num, double xpos[* num], double ypos[* num], double zpos[* num])
69{
70 int i, j, k;
71
72 k = 0;
73
74 for ( i=0 ; i < active_project -> steps ; i++ )
75 {
76 for (j=0; j < active_project -> natomes; j++)
77 {
78 active_project -> atoms[i][j].x = xpos[k];
79 active_project -> atoms[i][j].y = ypos[k];
80 active_project -> atoms[i][j].z = zpos[k];
81 active_project -> atoms[i][j].sp = lot[j]-1;
82 active_project -> atoms[i][j].id = j;
83 active_project -> atoms[i][j].show[0] = TRUE;
84 active_project -> atoms[i][j].show[1] = TRUE;
85 active_project -> atoms[i][j].label[0] = FALSE;
86 active_project -> atoms[i][j].label[1] = FALSE;
87 if (active_glwin == NULL)
88 {
89 active_project -> atoms[i][j].pick[0] = FALSE;
90 }
91 else if (! active_image -> selected[0] -> selected)
92 {
93 active_project -> atoms[i][j].pick[0] = FALSE;
94 }
95 active_project -> atoms[i][j].cloned = FALSE;
96 k++;
97 }
98 }
99}
100
108void send_steps_ (int * steps)
109{
110 active_project -> steps = * steps;
111}
112
121{
122 project * tmp = workzone.first;
123 int i;
124 for (i=0; i<nprojects; i++)
125 {
126 if (tmp -> id == p) return tmp;
127 if (tmp -> next != NULL) tmp = tmp -> next;
128 }
129 return NULL;
130}
Binding to the Fortran90 subroutines.
Callback declarations for main window.
int atoms[NUM_STYLES][2]
int nprojects
Definition global.c:158
Global variable declarations Global convenience function declarations Global data structure defin...
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
Messaging function declarations.
workspace workzone
Definition project.c:46
glwin * active_glwin
Definition project.c:53
void send_steps_(int *steps)
retrieve the number of MD steps from Fortran90
Definition project.c:108
coord_info * active_coord
Definition project.c:49
cell_info * active_cell
Definition project.c:50
chemical_data * active_chem
Definition project.c:48
box_info * active_box
Definition project.c:51
project * opengl_project
Definition project.c:54
void save_pos_(int *nat, int lot[*nat], int *num, double xpos[*num], double ypos[*num], double zpos[*num])
retrieve atomic coordinates from Fortran90
Definition project.c:68
project * active_project
Definition project.c:47
image * active_image
Definition project.c:52
project * get_project_by_id(int p)
get project pointer using id number
Definition project.c:120
Definition glwin.h:875
Definition glwin.h:277
int id
Definition global.h:941
project * first
Definition global.h:1044