atomes 1.1.16
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
init_p.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: 'init_p.c'
24*
25* Contains:
26*
27
28 - The functions to initialize an atomes project
29
30*
31* List of functions:
32
33 void init_curves_and_calc (project * this_proj);
34 void init_project (gboolean alloc_box);
35
36*/
37
38#include "global.h"
39#include "bind.h"
40#include "callbacks.h"
41#include "interface.h"
42#include "project.h"
43#include "curve.h"
44#include "glview.h"
45#include "glwindow.h"
46
54void init_curves_and_calc (project * this_proj)
55{
56 int i;
57 for (i=0; i<NGRAPHS; i++)
58 {
59 this_proj -> runok[i] = FALSE;
60 this_proj -> initok[i] = FALSE;
61 this_proj -> visok[i] = FALSE;
62 }
63}
64
72void init_project (gboolean alloc_box)
73{
74 int i;
75 project * new_proj = g_malloc0 (sizeof*proj);
76 nprojects ++;
77 activep = nprojects - 1;
78 new_proj -> id = activep;
79 new_proj -> name = g_strdup_printf("%s%2d", "Project N°", activep);
80
81 new_proj -> delta[RI] = new_proj -> delta[CH] = 1.0;
82 new_proj -> min[RI] = new_proj -> min[CH] = 1;
83 new_proj -> delta[SP] = 2.0;
84 for (i=0; i<5; i++) new_proj -> rsparam[i][1] = 10;
85 new_proj -> csparam[5] = 10;
86 new_proj -> rsearch[0] = -1;
87 new_proj -> rsearch[1] = new_proj -> csearch = 500;
88
89 new_proj -> tfile = -1;
90 new_proj -> newproj = TRUE;
91 new_proj -> steps = 1;
92 new_proj -> xcor = 1;
93 new_proj -> tunit = -1;
94
95 new_proj -> sk_advanced[0] = 1.0;
96 new_proj -> sk_advanced[1] = 15.0;
97
98 new_proj -> coord = g_malloc0 (sizeof*new_proj -> coord);
99 if (alloc_box) new_proj -> cell.box = g_malloc0(sizeof*new_proj -> cell.box);
100
102 init_curves_and_calc (new_proj);
103 new_proj -> numwid = -1;
104 if (nprojects == 1)
105 {
106 workzone.first = g_malloc0 (sizeof*workzone.first);
107 workzone.first = new_proj;
108 workzone.last = g_malloc0 (sizeof*workzone.last);
109 }
110 else
111 {
112 new_proj -> prev = workzone.last;
113 workzone.last -> next = new_proj;
114 }
115 workzone.last = new_proj;
116 active_project_changed (new_proj -> id);
118 new_proj -> newproj = FALSE;
119}
Binding to the Fortran90 subroutines.
Callback declarations for main window.
Variable declarations for the curve widget Functions for interactions with the curve widget.
int activep
Definition global.c:159
int nprojects
Definition global.c:158
Global variable declarations Global convenience function declarations Global data structure defin...
workspace workzone
Definition project.c:46
project * proj
void remove_edition_actions()
remove all edition actions
Definition gui.c:422
#define NGRAPHS
#define RI
Definition global.h:328
#define min(a, b)
Definition global.h:81
#define SP
Definition global.h:330
#define CH
Definition global.h:329
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
Function declarations for the creation of the OpenGL window.
void init_curves_and_calc(project *this_proj)
for a project reset analysis, curves, data to not performed
Definition init_p.c:54
void init_project(gboolean alloc_box)
initialize a new project
Definition init_p.c:72
Messaging function declarations.
void prep_calc_actions()
prepare analysis widgets
Definition update_p.c:58
Function declarations for reading atomes project file Function declarations for saving atomes proje...
void active_project_changed(int id)
change the active project
Definition update_p.c:175
project * last
Definition global.h:1045
project * first
Definition global.h:1044
atom_search * csearch
Definition w_search.c:2718