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

nosh.h

Go to the documentation of this file.
00001 
00060 #ifndef _NOSH_H_
00061 #define _NOSH_H_
00062 
00063 /* Generic headers */
00064 #include "maloc/maloc.h"
00065 #include "apbs/vhal.h"
00066 
00067 /* Headers specific to this file */
00068 #include "apbs/pbeparm.h"
00069 #include "apbs/mgparm.h"
00070 #include "apbs/femparm.h"
00071 #include "apbs/apolparm.h"
00072 #include "apbs/valist.h"
00073 
00076 #define NOSH_MAXMOL 20
00077 
00080 #define NOSH_MAXCALC 20
00081 
00084 #define NOSH_MAXPRINT 20
00085 
00088 #define NOSH_MAXPOP 20
00089 
00094 enum eNOsh_MolFormat {
00095     NMF_PQR=0,  
00096     NMF_PDB=1,  
00097     NMF_XML=2   
00098 };
00099 
00104 typedef enum eNOsh_MolFormat NOsh_MolFormat;
00105 
00110 enum eNOsh_CalcType {
00111     NCT_MG=0,  
00112     NCT_FEM=1, 
00113         NCT_APOL=2 
00114 };
00115 
00120 typedef enum eNOsh_CalcType NOsh_CalcType;
00121 
00126 enum eNOsh_ParmFormat {
00127     NPF_FLAT=0,  
00128     NPF_XML=1    
00129 };
00130 
00135 typedef enum eNOsh_ParmFormat NOsh_ParmFormat;
00136 
00141 enum eNOsh_PrintType {
00142     NPT_ENERGY=0, 
00143     NPT_FORCE=1, 
00144         NPT_ELECENERGY, 
00145     NPT_ELECFORCE, 
00146         NPT_APOLENERGY, 
00147     NPT_APOLFORCE 
00148 };
00149 
00154 typedef enum eNOsh_PrintType NOsh_PrintType;
00155 
00161 struct sNOsh_calc {
00162         MGparm *mgparm;         
00163         FEMparm *femparm;       
00164         PBEparm *pbeparm;       
00165         APOLparm *apolparm;             
00166         NOsh_CalcType calctype; 
00167 };
00168 
00173 typedef struct sNOsh_calc NOsh_calc;
00174 
00180 struct sNOsh {
00181         
00182         NOsh_calc *calc[NOSH_MAXCALC];  
00185     int ncalc;  
00187         NOsh_calc *elec[NOSH_MAXCALC];  
00190     int nelec;  
00193         NOsh_calc *apol[NOSH_MAXCALC];  
00196     int napol;  
00199     int ispara;  
00200     int proc_rank;  
00201     int proc_size;  
00202     int bogus;  
00206     int elec2calc[NOSH_MAXCALC];  
00214         int apol2calc[NOSH_MAXCALC];  
00216     int nmol;  
00217     char molpath[NOSH_MAXMOL][VMAX_ARGLEN];   
00218     NOsh_MolFormat molfmt[NOSH_MAXMOL];  
00219         Valist *alist[NOSH_MAXMOL];  
00221     int gotparm;  
00222     char parmpath[VMAX_ARGLEN];   
00223     NOsh_ParmFormat parmfmt;  
00224     int ndiel;  
00225     char dielXpath[NOSH_MAXMOL][VMAX_ARGLEN];  
00227     char dielYpath[NOSH_MAXMOL][VMAX_ARGLEN];  
00229     char dielZpath[NOSH_MAXMOL][VMAX_ARGLEN];  
00231     Vdata_Format dielfmt[NOSH_MAXMOL];  
00232     int nkappa;  
00233     char kappapath[NOSH_MAXMOL][VMAX_ARGLEN]; 
00234     Vdata_Format kappafmt[NOSH_MAXMOL];  
00235     int ncharge;  
00236     char chargepath[NOSH_MAXMOL][VMAX_ARGLEN];   
00237     Vdata_Format chargefmt[NOSH_MAXMOL];  
00238         int nmesh;  
00239         char meshpath[NOSH_MAXMOL][VMAX_ARGLEN];   
00240     Vdata_Format meshfmt[NOSH_MAXMOL];  
00241     int nprint;  
00242     NOsh_PrintType printwhat[NOSH_MAXPRINT];  
00244     int printnarg[NOSH_MAXPRINT];  
00245     int printcalc[NOSH_MAXPRINT][NOSH_MAXPOP]; 
00246     int printop[NOSH_MAXPRINT][NOSH_MAXPOP];  
00248     int parsed;  
00249     char elecname[NOSH_MAXCALC][VMAX_ARGLEN]; 
00251         char apolname[NOSH_MAXCALC][VMAX_ARGLEN]; 
00253 };
00254 
00259 typedef struct sNOsh NOsh;
00260 
00261 /* ///////////////////////////////////////////////////////////////////////////
00262    // Class NOsh: Inlineable methods (mcsh.c)
00264 #if !defined(VINLINE_NOSH)
00272 char* NOsh_getMolpath(NOsh *thee, int imol);
00273 
00281 char* NOsh_getDielXpath(NOsh *thee, int imap);
00282 
00290 char* NOsh_getDielYpath(NOsh *thee, int imap);
00291 
00299 char* NOsh_getDielZpath(NOsh *thee, int imap);
00300 
00308 char* NOsh_getKappapath(NOsh *thee, int imap);
00309 
00317 char* NOsh_getChargepath(NOsh *thee, int imap);
00318 
00326 NOsh_calc* NOsh_getCalc(NOsh *thee, int icalc);
00327 
00335 int NOsh_getDielfmt(NOsh *thee, int imap);
00336 
00344 int NOsh_getKappafmt(NOsh *thee, int imap);
00345 
00353 int NOsh_getChargefmt(NOsh *thee, int imap);
00354 
00355 #else
00356 
00357 #   define NOsh_getMolpath(thee, imol) ((thee)->molpath[(imol)])
00358 #   define NOsh_getDielXpath(thee, imol) ((thee)->dielXpath[(imol)])
00359 #   define NOsh_getDielYpath(thee, imol) ((thee)->dielYpath[(imol)])
00360 #   define NOsh_getDielZpath(thee, imol) ((thee)->dielZpath[(imol)])
00361 #   define NOsh_getKappapath(thee, imol) ((thee)->kappapath[(imol)])
00362 #   define NOsh_getChargepath(thee, imol) ((thee)->chargepath[(imol)])
00363 #   define NOsh_getCalc(thee, icalc) ((thee)->calc[(icalc)])
00364 #   define NOsh_getDielfmt(thee, imap) ((thee)->dielfmt[(imap)])
00365 #   define NOsh_getKappafmt(thee, imap) ((thee)->kappafmt[(imap)])
00366 #   define NOsh_getChargefmt(thee, imap) ((thee)->chargefmt[(imap)])
00367 
00368 #endif
00369 
00370 
00371 /* ///////////////////////////////////////////////////////////////////////////
00372    // Class NOsh: Non-inlineable methods (mcsh.c)
00374 
00382 NOsh_PrintType NOsh_printWhat(NOsh *thee, int iprint);
00383 
00393 char* NOsh_elecname(NOsh *thee, int ielec);
00394 
00402 int NOsh_elec2calc(NOsh *thee, int icalc);
00403 
00411 int NOsh_apol2calc(NOsh *thee, int icalc);
00412 
00420 int NOsh_printNarg(NOsh *thee, int iprint);
00421 
00430 int NOsh_printOp(NOsh *thee, int iprint, int iarg);
00431 
00442 int NOsh_printCalc(NOsh *thee, int iprint, int iarg);
00443 
00453 NOsh* NOsh_ctor(int rank, int size);
00454 
00461 NOsh_calc* NOsh_calc_ctor(
00462                                                           NOsh_CalcType calcType
00463                                                           );
00464 
00471 int NOsh_calc_copy(
00472                                                         NOsh_calc *thee,
00473                                                         NOsh_calc *source
00474                                                         );
00475 
00481 void  NOsh_calc_dtor(NOsh_calc **thee);
00482 
00493 int   NOsh_ctor2(NOsh *thee, int rank, int size);
00494 
00500 void  NOsh_dtor(NOsh **thee);
00501 
00507 void  NOsh_dtor2(NOsh *thee);
00508 
00517 int   NOsh_parseInput(NOsh *thee, Vio *sock);
00518 
00528 int   NOsh_parseInputFile(NOsh *thee, char *filename);
00529 
00539 int NOsh_setupElecCalc(
00540                                                         NOsh *thee, 
00541                                                         Valist *alist[NOSH_MAXMOL] 
00542                                                         );
00543 
00553 int NOsh_setupApolCalc(
00554                                                                 NOsh *thee, 
00555                                                                 Valist *alist[NOSH_MAXMOL] 
00556                                                                 );
00557 
00558 #endif 
00559 
00560 

Generated on Tue Apr 15 13:53:14 2008 for APBS by doxygen 1.3.4