mdcore  0.1.5
/home/pedro/work/mdcore/src/part.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002  * This file is part of mdcore.
00003  * Coypright (c) 2010 Pedro Gonnet (pedro.gonnet@durham.ac.uk)
00004  * 
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU Lesser General Public License as published
00007  * by the Free Software Foundation, either version 3 of the License, or
00008  * (at your option) any later version.
00009  * 
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU Lesser General Public License
00016  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017  * 
00018  ******************************************************************************/
00019 
00020 
00021 /* error codes */
00022 #define part_err_ok                     0
00023 #define part_err_null                   -1
00024 #define part_err_malloc                 -2
00025 
00026 
00027 /* particle flags */
00028 #define part_flag_none                  0
00029 #define part_flag_frozen                1
00030 #define part_flag_ghost                 2
00031 
00032 
00033 /* default values */
00034 
00035 
00037 extern int part_err;
00038 
00039 
00046 struct part {
00047 
00049     FPTYPE x[4] __attribute__ ((aligned (16)));
00050 
00052     FPTYPE v[4] __attribute__ ((aligned (16)));
00053 
00055     FPTYPE f[4] __attribute__ ((aligned (16)));
00056     
00058     float q;
00059     
00061     int id, vid;
00062     
00064     short int type;
00065     
00067     unsigned short int flags;
00068     
00069     };
00070     
00071 
00072 
00074 struct part_type {
00075 
00077     int id;
00078     
00080     double mass, imass, charge;
00081     
00083     double eps, rmin;
00084     
00086     char name[64], name2[64];
00087     
00088     };
00089 
00090 
00091 /* associated functions */
00092 int part_init ( struct part *p , int vid , int type , unsigned int flags );
 All Data Structures Files Functions Variables Typedefs Enumerator Defines