ESPResSo 3.2.0-11-g9950804-git
Extensible Simulation Package for Soft Matter Research
modes.h
Go to the documentation of this file.
00001 /*
00002   Copyright (C) 2010,2011,2012,2013 The ESPResSo project
00003   Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010 
00004     Max-Planck-Institute for Polymer Research, Theory Group
00005   
00006   This file is part of ESPResSo.
00007   
00008   ESPResSo is free software: you can redistribute it and/or modify
00009   it under the terms of the GNU General Public License as published by
00010   the Free Software Foundation, either version 3 of the License, or
00011   (at your option) any later version.
00012   
00013   ESPResSo is distributed in the hope that it will be useful,
00014   but WITHOUT ANY WARRANTY; without even the implied warranty of
00015   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016   GNU General Public License for more details.
00017   
00018   You should have received a copy of the GNU General Public License
00019   along with this program.  If not, see <http://www.gnu.org/licenses/>. 
00020 */
00021 #ifndef MODES_H
00022 #define MODES_H
00023 
00024 /** \file modes.h
00025 
00026     PLEASE INSERT DESCRIPTION
00027 */
00028 
00029 #include "utils.h"
00030 #include "statistics.h"
00031 
00032 #ifdef FFTW
00033 
00034 #ifdef _Complex_I
00035 #warning the complex data type is predefined on your system, hoping it is compatible to a double[2]
00036 #endif
00037 #include <fftw3.h>
00038 #define FFTW_REAL(x) (((double *)(x))[0])
00039 #define FFTW_IMAG(x) (((double *)(x))[1])
00040 
00041 /** The full 3d grid for mode analysis */
00042 extern int mode_grid_3d[3];
00043 /** Integer labels for grid axes compared to real axes*/
00044 extern int xdir;
00045 extern int ydir;
00046 extern int zdir;
00047 
00048 /** Enumerated constant indicating a Lipid in the top leaflet*/
00049 #define LIPID_UP 0
00050 /** Enumerated constant indicating a Lipid in the bottom leaflet*/
00051 #define LIPID_DOWN 1
00052 /** Enumerated constant indicating a Lipid that has left the bilayer
00053     but may have become incorporated into a periodic image bilayer */
00054 #define LIPID_STRAY 2
00055 /** Enumerated constant indicating a Lipid that has left the bilayer
00056     and truly floating in space */
00057 #define REAL_LIPID_STRAY 3
00058 /** The atom type corresponding to a lipid head group */
00059 #define LIPID_HEAD_TYPE 0
00060 
00061 /** Flag to indicate when the mode_grid is changed */
00062 extern int mode_grid_changed;
00063 
00064 /** Parameter indicating distance beyond which a lipid is said to have
00065     left the membrane the default value is set in \ref modes.c */
00066 extern double stray_cut_off;
00067 
00068 /* Exported Functions */
00069 /* switch_fluc == 1 comuptes height grid
00070                == 0 thickness.
00071 */
00072 int modes2d(fftw_complex* result, int switch_fluc );
00073 void map_to_2dgrid();
00074 /** 
00075     This routine performs a simple check to see whether a lipid is
00076     oriented up or down or if it has escaped the bilayer.  In order
00077     for this routine to work it is essential that the lipids head
00078     groups are of atom type LIPID_HEAD_TYPE
00079 
00080     \param id The particle identifier
00081     \param partCfg An array of sorted particles
00082 
00083     \param zref The average z position of all particles. This is used
00084     to check for stray lipids
00085 
00086     \param director director
00087     \param refdir is a vector indicating the direction indicating
00088     up. This is usually the zaxis. If it is not the z axis then lipids
00089     will not be returned as stray.
00090  */
00091 int lipid_orientation( int id, Particle* partCfg , double zref, double director[3],double refdir[3]);
00092 
00093 /**
00094    This routine calculates the orientational order parameter for a
00095    lipid bilayer.  It also calculates the direction of orientation for
00096    all lipids and places them in stored_dirs.
00097 */
00098 int orient_order(double* result, double* stored_dirs);
00099 
00100 /* Get the list of lipid orientations */
00101 int get_lipid_orients(IntList* l_orient);
00102 
00103 /**
00104    Calculate the average height of lipids or average thickness for each value in a grid
00105    switch_fluc == 1: height_grid
00106    switch_fluc == 0: thickness
00107    The output is written in *height_grid no matter what the argument is.
00108 */
00109 int calc_fluctuations ( double* height_grid, int switch_fluc );
00110 
00111 /** 
00112     Calculate a  vertical density profile for each of the specified beadtypes
00113 
00114     \param beadids The list of bead types for which profiles will be generated
00115     \param hrange The vertical range from the bilayer midplane over which the profiles are calculated
00116     \param density_profile The pre-allocated density profile into which data is written
00117     \param usegrid switch to determine whether grid should be used
00118  */
00119 int bilayer_density_profile ( IntList *beadids, double hrange , DoubleList *density_profile, int usegrid );
00120 int bilayer_density_profile_sphere (IntList *beadids, double rrange , DoubleList *density_profile, double radius, double center[3]);
00121 
00122 
00123 #endif
00124 
00125 #endif