Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

nosh.h

Go to the documentation of this file.
00001 
00072 #ifndef _NOSH_H_
00073 #define _NOSH_H_
00074 
00075 /* Generic headers */
00076 #include "maloc/maloc.h"
00077 #include "apbs/vhal.h"
00078 
00079 /* Headers specific to this file */
00080 #include "apbs/pbeparm.h"
00081 #include "apbs/mgparm.h"
00082 #include "apbs/femparm.h"
00083 #include "apbs/apolparm.h"
00084 #include "apbs/valist.h"
00085 
00088 #define NOSH_MAXMOL 20
00089 
00092 #define NOSH_MAXCALC 20
00093 
00096 #define NOSH_MAXPRINT 20
00097 
00100 #define NOSH_MAXPOP 20
00101 
00106 enum eNOsh_MolFormat {
00107     NMF_PQR=0,  
00108     NMF_PDB=1,  
00109     NMF_XML=2   
00110 };
00111 
00116 typedef enum eNOsh_MolFormat NOsh_MolFormat;
00117 
00122 enum eNOsh_CalcType {
00123     NCT_MG=0,  
00124     NCT_FEM=1, 
00125         NCT_APOL=2 
00126 };
00127 
00132 typedef enum eNOsh_CalcType NOsh_CalcType;
00133 
00138 enum eNOsh_ParmFormat {
00139     NPF_FLAT=0,  
00140     NPF_XML=1    
00141 };
00142 
00147 typedef enum eNOsh_ParmFormat NOsh_ParmFormat;
00148 
00153 enum eNOsh_PrintType {
00154     NPT_ENERGY=0, 
00155     NPT_FORCE=1, 
00156         NPT_ELECENERGY, 
00157     NPT_ELECFORCE, 
00158         NPT_APOLENERGY, 
00159     NPT_APOLFORCE 
00160 };
00161 
00166 typedef enum eNOsh_PrintType NOsh_PrintType;
00167 
00173 struct sNOsh_calc {
00174         MGparm *mgparm;         
00175         FEMparm *femparm;       
00176         PBEparm *pbeparm;       
00177         APOLparm *apolparm;             
00178         NOsh_CalcType calctype; 
00179 };
00180 
00185 typedef struct sNOsh_calc NOsh_calc;
00186 
00192 struct sNOsh {
00193         
00194         NOsh_calc *calc[NOSH_MAXCALC];  
00197     int ncalc;  
00199         NOsh_calc *elec[NOSH_MAXCALC];  
00202     int nelec;  
00205         NOsh_calc *apol[NOSH_MAXCALC];  
00208     int napol;  
00211     int ispara;  
00212     int proc_rank;  
00213     int proc_size;  
00214     int bogus;  
00218     int elec2calc[NOSH_MAXCALC];  
00226         int apol2calc[NOSH_MAXCALC];  
00228     int nmol;  
00229     char molpath[NOSH_MAXMOL][VMAX_ARGLEN];   
00230     NOsh_MolFormat molfmt[NOSH_MAXMOL];  
00231         Valist *alist[NOSH_MAXMOL];  
00233     int gotparm;  
00234     char parmpath[VMAX_ARGLEN];   
00235     NOsh_ParmFormat parmfmt;  
00236     int ndiel;  
00237     char dielXpath[NOSH_MAXMOL][VMAX_ARGLEN];  
00239     char dielYpath[NOSH_MAXMOL][VMAX_ARGLEN];  
00241     char dielZpath[NOSH_MAXMOL][VMAX_ARGLEN];  
00243     Vdata_Format dielfmt[NOSH_MAXMOL];  
00244     int nkappa;  
00245     char kappapath[NOSH_MAXMOL][VMAX_ARGLEN]; 
00246     Vdata_Format kappafmt[NOSH_MAXMOL];  
00247     int ncharge;  
00248     char chargepath[NOSH_MAXMOL][VMAX_ARGLEN];   
00249     Vdata_Format chargefmt[NOSH_MAXMOL];  
00250     int nprint;  
00251     NOsh_PrintType printwhat[NOSH_MAXPRINT];  
00253     int printnarg[NOSH_MAXPRINT];  
00254     int printcalc[NOSH_MAXPRINT][NOSH_MAXPOP]; 
00255     int printop[NOSH_MAXPRINT][NOSH_MAXPOP];  
00257     int parsed;  
00258     char elecname[NOSH_MAXCALC][VMAX_ARGLEN]; 
00260         char apolname[NOSH_MAXCALC][VMAX_ARGLEN]; 
00262 };
00263 
00268 typedef struct sNOsh NOsh;
00269 
00270 /* ///////////////////////////////////////////////////////////////////////////
00271    // Class NOsh: Inlineable methods (mcsh.c)
00273 #if !defined(VINLINE_NOSH)
00281 char* NOsh_getMolpath(NOsh *thee, int imol);
00282 
00290 char* NOsh_getDielXpath(NOsh *thee, int imap);
00291 
00299 char* NOsh_getDielYpath(NOsh *thee, int imap);
00300 
00308 char* NOsh_getDielZpath(NOsh *thee, int imap);
00309 
00317 char* NOsh_getKappapath(NOsh *thee, int imap);
00318 
00326 char* NOsh_getChargepath(NOsh *thee, int imap);
00327 
00335 NOsh_calc* NOsh_getCalc(NOsh *thee, int icalc);
00336 
00344 int NOsh_getDielfmt(NOsh *thee, int imap);
00345 
00353 int NOsh_getKappafmt(NOsh *thee, int imap);
00354 
00362 int NOsh_getChargefmt(NOsh *thee, int imap);
00363 
00364 #else
00365 
00366 #   define NOsh_getMolpath(thee, imol) ((thee)->molpath[(imol)])
00367 #   define NOsh_getDielXpath(thee, imol) ((thee)->dielXpath[(imol)])
00368 #   define NOsh_getDielYpath(thee, imol) ((thee)->dielYpath[(imol)])
00369 #   define NOsh_getDielZpath(thee, imol) ((thee)->dielZpath[(imol)])
00370 #   define NOsh_getKappapath(thee, imol) ((thee)->kappapath[(imol)])
00371 #   define NOsh_getChargepath(thee, imol) ((thee)->chargepath[(imol)])
00372 #   define NOsh_getCalc(thee, icalc) ((thee)->calc[(icalc)])
00373 #   define NOsh_getDielfmt(thee, imap) ((thee)->dielfmt[(imap)])
00374 #   define NOsh_getKappafmt(thee, imap) ((thee)->kappafmt[(imap)])
00375 #   define NOsh_getChargefmt(thee, imap) ((thee)->chargefmt[(imap)])
00376 
00377 #endif
00378 
00379 
00380 /* ///////////////////////////////////////////////////////////////////////////
00381    // Class NOsh: Non-inlineable methods (mcsh.c)
00383 
00391 NOsh_PrintType NOsh_printWhat(NOsh *thee, int iprint);
00392 
00402 char* NOsh_elecname(NOsh *thee, int ielec);
00403 
00411 int NOsh_elec2calc(NOsh *thee, int icalc);
00412 
00420 int NOsh_apol2calc(NOsh *thee, int icalc);
00421 
00429 int NOsh_printNarg(NOsh *thee, int iprint);
00430 
00439 int NOsh_printOp(NOsh *thee, int iprint, int iarg);
00440 
00451 int NOsh_printCalc(NOsh *thee, int iprint, int iarg);
00452 
00462 NOsh* NOsh_ctor(int rank, int size);
00463 
00470 NOsh_calc* NOsh_calc_ctor(
00471                                                           NOsh_CalcType calcType
00472                                                           );
00473 
00480 int NOsh_calc_copy(
00481                                                         NOsh_calc *thee,
00482                                                         NOsh_calc *source
00483                                                         );
00484 
00490 void  NOsh_calc_dtor(NOsh_calc **thee);
00491 
00502 int   NOsh_ctor2(NOsh *thee, int rank, int size);
00503 
00509 void  NOsh_dtor(NOsh **thee);
00510 
00516 void  NOsh_dtor2(NOsh *thee);
00517 
00526 int   NOsh_parseInput(NOsh *thee, Vio *sock);
00527 
00537 int   NOsh_parseInputFile(NOsh *thee, char *filename);
00538 
00548 int NOsh_setupElecCalc(
00549                                                         NOsh *thee, 
00550                                                         Valist *alist[NOSH_MAXMOL] 
00551                                                         );
00552 
00562 int NOsh_setupApolCalc(
00563                                                                 NOsh *thee, 
00564                                                                 Valist *alist[NOSH_MAXMOL] 
00565                                                                 );
00566 
00567 #endif 
00568 
00569 

Generated on Thu Jul 12 11:49:45 2007 for APBS by doxygen 1.3.4