atomes 1.1.14
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
initchain.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
23/*
24* This file: 'initchain.c'
25*
26* Contains:
27*
28
29 - The functions collecting chain(s) data from Fortran90
30 - The functions allocating chain(s) data from Fortran90
31
32*
33* List of functions:
34
35 void send_chains_opengl_ (int * st, int * ta, int * ri, int nchain[* ta]);
36 void send_atom_chains_id_opengl_ (int * st, int * at, int * ta, int * num, int nchain[* num]);
37 void allocate_all_chains_ (int * st, int * ta, int * nring);
38
39*/
40
41#include "global.h"
42#include "interface.h"
43#include "bind.h"
44#include "color_box.h"
45#include "glwindow.h"
46
57void send_chains_opengl_ (int * st, int * ta, int * ri, int nchain[* ta])
58{
59 int i;
60 for (i=0; i< * ta; i++)
61 {
62 active_glwin -> all_chains[* st][* ta - 1][* ri][i] = nchain[i] - 1;
63 }
64}
65
77void send_atom_chains_id_opengl_ (int * st, int * at, int * ta, int * num, int nchain[* num])
78{
79 if (nchain != NULL)
80 {
81 int i;
82 active_project -> atoms[* st][* at].chain[* ta - 1] = allocint(* num + 1);
83 active_project -> atoms[* st][* at].chain[* ta - 1][0] = * num;
84 for (i=0; i < * num; i++)
85 {
86 active_project -> atoms[* st][* at].chain[* ta - 1][i+1] = nchain[i] - 1;
87 }
88 }
89}
90
100void allocate_all_chains_ (int * st, int * ta, int * nring)
101{
102 active_glwin -> all_chains[* st][* ta - 1] = allocdint (* nring, * ta);
103 active_glwin -> num_chains[* st][* ta - 1] = * nring;
104}
Binding to the Fortran90 subroutines.
Structure definitions for color management Function declarations for color management.
atom * ta
Definition d_measures.c:70
int atoms[NUM_STYLES][2]
int ** allocdint(int xal, int yal)
allocate an int ** pointer
Definition global.c:342
int * allocint(int val)
allocate an int * pointer
Definition global.c:326
Global variable declarations Global convenience function declarations Global data structure defin...
glwin * active_glwin
Definition project.c:53
project * active_project
Definition project.c:47
Function declarations for the creation of the OpenGL window.
void send_atom_chains_id_opengl_(int *st, int *at, int *ta, int *num, int nchain[*num])
allocate atom chains data from Fortran90 information
Definition initchain.c:77
void send_chains_opengl_(int *st, int *ta, int *ri, int nchain[*ta])
getting the chain data elemnts from Fortran90
Definition initchain.c:57
void allocate_all_chains_(int *st, int *ta, int *nring)
allocate chains data from Fortran90 information
Definition initchain.c:100
Messaging function declarations.