/* =========================== PNP_in_C: header file ===============================*/typedef char B;    typedef short W;typedef long L;typedef unsigned char UB;    typedef unsigned short UW;typedef unsigned long UL;typedef W BOOL;typedef float SF;typedef double DF;/*-------------------------- PNP semaphore structure --------------------------------    - a simple pointer points to a profile array (dimension Ngrid)     or an ion-related numerical array (dimension Nions)   - a double pointer points to a pointer array (index: ion#) of ion-specific profiles*/typedef struct {/*-- specification of memory used as PNP workspace */B *memory;               /* pointer to base of used memory              */L nbytes;                /* number of bytes in memory                   *//*-- descriptive arrays (not used in PNP computations)                  */DF *Radius;              /* radius of pore               Angstrom       *//*-- basic dimensions */L Nions;                 /* number of ions in system     --             */L Ngrid;                 /* number of gridpoints         --             *//*-- arrays submitted to PNP solver */DF *X;                    /* long-axis coordinate         Angstrom       */DF *Area;                 /* area of diffusion front      Angstrom**2    */DF *F;                    /* fixed charge, signed         M              */DF *EPS;                  /* rel dielectric permittivity  --             */DF **Ds;                  /* diffusion coefficients       cm**2/s        */DF **E0s;                 /* basal free energies          eV             */DF *Z;                    /* signed valencies             --             */DF *CL;                   /* left boundary conc's         M              */DF *CR;                   /* right boundary conc's        M              *//*-- scalars submitted to PNP solver */DF Celsius;               /* temperature                  Celsius        */DF VM;                    /* transmembrane voltage        V              */L MaxIter;                /* (Gummel) iteration limit     --             */DF Tolerance;             /* tolerance                    kT/e           */BOOL verbose;             /* monitor iteration                           *//*-- function for computing total concentrations */void (*comp_TC)();/*-- arrays computed by PNP solver */DF **Cs;                  /* free concentrations          Cscale         */DF **TCs;                 /* total concentrations         Cscale         */DF *V;                    /* voltage                      kT/e           */DF **Es;                  /* el + basal free energies     kT             */DF *FLUX;                 /* fluxes                       ions/s         *//*-- scalars computed by PNP solver */DF Cscale;                /* concentration standard       M              */DF NetCurrent;            /* net pore current             pA             */DF kT;                    /* kB*T                         AVs            */DF kT_e;                  /* kB*T/e0                      V              *//*-- temporary arrays used by PNP solver */DF *H;DF *WA, *WB, *WC, *WR, *WU, *WT, *owa, *owb, *owc;DF *al1, *al2, *al3, *bt1, *bt2, *bt3;} PNP_SMP;/*------------------- Natural Constants (from Atkin's Physical Ch*emistry, 3rd ed) */#define  Boltzmann      1.38066e-23            /* AVs/Kelvin	*/#define  e0             1.60219e-19			   /* As            */#define  epsilon0       8.85419e-12            /* As/(Vm)       */#define  Angstrom       1.0e-10                /* m             */#define  Liter          1.0E-3                 /* m**3          */#define  Celsius0       273.15                 /* Kelvin        */#define  Avogadro       6.02205e23             /* 1/gmol        */#define  cm2            1.0e-4                 /* m**2          */#define  Pi             3.141592653589793      /* --            */#define  pA             1.0e-12                /* A             *//*----------------------- prototypes of front end functions -----------------------*//*-- PNP1 */PNP_SMP  *build_PNP_ws(L nions, L ngrid, void *allocator());void      init_PNP_var(PNP_SMP *smp);BOOL      solve_PNP(PNP_SMP *smp);/*-- PNP2 */PNP_SMP  *build_cyl_geom(L nions, L ngrid, DF poreradius, DF porelength,            void *allocator());PNP_SMP  *build_cab_geom(L nions, L npore, DF poreradius, DF *lengths,            void comp_L_angle(), void comp_R_angle(), void *allocator(),            void deallocator(), L *indices, L *dimensions);