/DFT_Cachannel module | project |================================ DFT_Cachannel ================================ | | constructs a DFT model of the Ca channel 500 dict dup begin | DFT_Cachannel /pchem_data 200 dict def /pnp_data 200 dict def /channel { DFT_Cachannel begin } bind def /_channel { end } bind def /geom { DFT_geom begin } bind def /_geom { end } bind def /pchem { pchem_data begin DFT_pchem begin } bind def /_pchem { end end } bind def /pnp { pnp_data begin DFT_pnp begin } bind def /_pnp { end end } bind def /brent { Brent begin } def /_brent { end } def /db { db_makers begin } bind def /_db { end } bind def /exper { Ca_experiments begin } bind def /_exper { end } bind def |------------------------- operator extensions ----------------------------- |---------------------------- find the maximal absolute value in an array | use: array | max /maximum { 0.0 0.0 3 -1 roll extrema abs exch abs 2 copy lt { exch } if pop } bind def |----------------------------- make a subarray that excludes grid boundaries | full_grid_array | interior_grid_subarray /interior { dup 1 exch length 2 sub getinterval } bind def |----------------------------- make index of last array element | array | array last_index /last { dup length 1 sub } bind def |----- Natural constants (from Atkins' Physical Chemistry, 3rd ed) ---------- /Boltzmann 1.38066E-23 def | AVs/Kelvin /e0 1.60219E-19 def | As /epsilon0 8.85419E-12 def | As/(Vm) /Celsius0 273.15 def | Kelvin /Avogadro 6.02205E26 def | 1/kg_mol /Pi 3.141592653589793 def | -- /Angstrom 1e-10 def | m /epsilonW 78.4 def | of water |========================= Level 0: Geometry ================================= |-- default geometry is similar to N&E, 1998 except for SPM-like pore proper /Poreradius 3.5e-10 def /Lengths def /Xslice 0.2e-10 def |-- compute atrial angle profile | 10% increasing to 45 degree, straight to 90%, then increasing to 90 degree /comp_angle { /cax name cax 0 cax length 10 div getinterval Pi 2.5 mul mul pop Pi 4.0 div cax cax length 10 div dup cax length exch dup add sub getinterval copy pop cax cax length dup 10 div sub cax length 10 div getinterval 0.9 sub Pi 2.5 mul mul Pi 4.0 div add pop cax } bind def /comp_L_angle { comp_angle } bind def /comp_R_angle { comp_angle } bind def /comp_P_radius { Poreradius exch copy pop } bind def /L0 { /L0save layer { geom build_pab_geom _geom } stopped /L0save _layer { stop } if } bind def |================= Level 1: Classification of particles =================== |-- default species: 4 mobile, 1 confined species /Nmobile 4 def /Nconfined 1 def /L1 { /L1save layer { /Nspecies Nmobile Nconfined add def pchem pchem_data build_pchem Nspecies make_bulkdict channel /Lbulk name _channel Nspecies make_bulkdict channel /Rbulk name _channel Nspecies make_bulkdict channel /Ref name _channel _pchem 0.0 selfFac copy pop |-- information on where to confine particles | idx_confined is a list, one element for each confined particle | for each confined particle, there is a list with a | starting index and the interval length over which it is confined Nconfined 1 ge { /idx_confined [ Nconfined { 2 list } repeat ] def /total_confined Nconfined list def } if } stopped /L1save _layer { stop } if } bind def |================== Level 2: flavors of channel, particles ================= |-------- Natural constants of particles [ Z diam Ghydr D ] | Diameters (diam) are in Angstrom, Hydration Gibbs energies (Ghydr) in J, | aqueous diffusion coefficient is in m^2/s. | | Ionic diameters are Pauling type for coordination# 6 /SPECIESdict 30 dict dup begin /H2O [ 0.0 2.80 0.0 2.13e-9 ] def /Li [ 1.0 1.48 -529.4e6 1.03e-9 ] def /Na [ 1.0 2.04 -423.7e6 1.33e-9 ] def /Na22 [ 1.0 2.04 -423.7e6 1.33e-9 ] def /K [ 1.0 2.76 -351.9e6 1.96e-9 ] def /Rb [ 1.0 2.98 -329.3e6 2.07e-9 ] def /Csion [ 1.0 3.4 -306.1e6 2.06e-9 ] def /Mg [ 2.0 1.44 -1931.4e6 0.71e-9 ] def /Ca [ 2.0 2.0 -1608.3e6 0.79e-9 ] def /Ba [ 2.0 2.72 -1351.7e6 0.85e-9 ] def /TMA [ 1.0 5.6 -160e6 1.19e-9 ] def /TEA [ 1.0 8.0 0.0 0.0 ] def /Cl [ -1.0 3.62 -304.0e6 2.03e-9 ] def | VI /Ox [ -0.5 2.80 ] def | VI (-2) /COO [ -1.0 4.4 ] def /CH2 [ 0.0 3.74 ] def | from vol_dif of Glu - Asp /Lys [ 1.0 5.0 ] def | represents -CH2-NH3+ | /Lys [ 1.0 3.0 ] def | represents -NH3+ only /OH [ 0.0 2.8 ] def | hydroxyl group end def |---------------- Default parameters and operators ------------------------- /SPECIES [ /H2O /Ca /Na /Cl /Ox ] def /poreDs def /refCOMP def /Celsius 25.0 def /Noxygens 8.0 def /OxLength 4.0e-10 def /OxHold 1.0 def /epsilonP epsilonW def /MSAradius 0.0 def /LengthREF 2.0e-10 def |-- specific smearing procedures /smear_pore { /kion name /nion name Cs kion get /C name nion C Indices 2 get Dimensions 2 get geom smear_volume _geom } bind def /smear_middle { /kion name /nion name Cs kion get /C name nion C Indices 2 get Dimensions 2 get 4 div add Dimensions 2 get 2 div geom smear_volume _geom } bind def |-- checks if given particle # is confined particle | particle # in SPECIES | bool /isconfined { dup Nmobile ge exch Nmobile Nconfined add lt and } bind def |------------- establish hydration energies of mobile ions /comp_E0s_mobile { 0 1 Nmobile 1 sub { /kspecies name EPS E0s kspecies get copy epsilonW sub EPS div epsilonW 1.0 sub div Ghydr kspecies get Avogadro div kT div mul pop } for } bind def |-- get the range of confinement for a species | kspecies | index dimension /confinedrange { idx_confined exch Nmobile sub get { } forall } bind def |-- specifics of Ox confining /make_confined { Ox isconfined { [ Indices 2 get Dimensions 2 get ] idx_confined Ox Nmobile sub put Noxygens total_confined Ox Nmobile sub put 1.0 Noxygens div selfFac Ox put /tapercount idx_confined Ox Nmobile sub get 1 get OxLength Xslice div /l ctype sub 2 div def /taperlength Xslice tapercount mul def /flatcount idx_confined Ox Nmobile sub get 1 get tapercount 2 mul sub def E0s Ox get idx_confined Ox Nmobile sub get 0 get tapercount add flatcount add tapercount taperlength Angstrom div OxHold mul tapercount div dup ramp pop pop E0s Ox get idx_confined Ox Nmobile sub get 0 get tapercount E0s Ox get idx_confined Ox Nmobile sub get dup 0 get exch 1 get add 1 sub get taperlength Angstrom div OxHold mul tapercount div neg ramp pop pop } if } bind def |-- smear oxygens uniformly over range (considering variation of radius) /old_smear_confined { Ox isconfined { 0.0 Cs Ox get copy pop Noxygens Avogadro div Cs Ox get Ox confinedrange geom smear_volume _geom } if } bind def |-- like above, but considering also E0 of confined oxygens /smear_confined { Ox isconfined { 0.0 Cs Ox get copy pop /interv { Ox confinedrange getinterval } def E0s Ox get /E0 name /left_E0 E0 idx_confined Ox Nmobile sub get 0 get get def left_E0 WA interv copy E0 interv sub exp WB interv copy DX interv mul Area interv mul integrateRS last get -1 pwr Cs Ox get interv copy WA interv mul Noxygens mul Avogadro div pop } if } bind def /L2 { /L2save layer { | - establish thermodynamic temperature /kT Boltzmann Celsius0 Celsius add mul def /kT_e kT e0 div def | - establish species attributes 0 1 Nspecies 1 sub { /kspecies name SPECIES kspecies get dup kspecies def SPECIESdict exch get /speciesdesc name speciesdesc 0 get Z kspecies put speciesdesc 1 get Angstrom mul SIGMA kspecies put kspecies Nmobile lt { speciesdesc 2 get Ghydr kspecies put speciesdesc 3 get bathDs kspecies put } if } for | - establish piecewise constant EPS and apply Gauss filter | - hydration energies of mobile species are Born-scaled by EPS and | stored as E0's | - E0s of confined species are nulled epsilonW WA copy pop epsilonP WA poreproper copy pop LengthREF WA EPS Gaussfilter epsilonW Lbulk /EPS put epsilonW Rbulk /EPS put comp_E0s_mobile 0 1 Nconfined 1 sub { Nmobile add /kspecies name 0.0 E0s kspecies get copy pop } for | - the aqueous diffusion coefficients of mobile species are spread | over the baths, and poreDs are spread uniformly over the pore, | then the Gauss filter is applied 0 1 Nmobile 1 sub { /kspecies name bathDs kspecies get WA copy pop poreDs kspecies get WA poreproper copy pop LengthREF WA lg Ds kspecies get Gaussfilter Ds kspecies get 10.0 ln mul exp pop } for | - make the charge profile(s) make_confined | - build the DFT and pnp pchem pchem_data build_DFT _pchem pnp pnp_data build_pnp _pnp } stopped /L2save _layer { stop } if } bind def |=========================== Level 3: first guess ========================= | | - finds a first guess that is needed for using the solver for the | first time following parameter changes other than CL, CR, or VM only | - needs CL, CR, and VM | - primes confined species densities (see 'smear_confined') | - sets up the reference for ES computations in the DFT | |--------------- balance bath for electroneutrality | CL or CR /ion | -- /balance { mkact /ion name /C name 0.0 Z 0 C length getinterval WA copy C mul add C ion get Z ion get mul sub Z ion get neg div C ion put } bind def /L3 { /sVM VM kT_e div def /V Vs 0 get def sVM V leftabath copy pop 0.0 V rightabath copy pop | - establish MSA bulk values on boundaries, for the DFT false Lbulk /contflag put CL 0.0 Lbulk /Cs get copy copy pop Lbulk dup pchem comp_bulk_HS comp_bulk_ES _pchem false Rbulk /contflag put CR 0.0 Rbulk /Cs get copy copy pop Rbulk dup pchem comp_bulk_HS comp_bulk_ES _pchem | - make confined particle Cs and prime their Us smear_confined 0 1 Nconfined 1 sub { Nmobile add /kspecies name Cs kspecies get Us kspecies get copy kspecies confinedrange getinterval ln pop } for |-- set up refCs of solvent(s) in baths 0 1 Nmobile 1 sub { /kspecies name Z kspecies get 0 eq { 0.0 refCs kspecies get copy pop CL kspecies get refCs kspecies get leftabath copy pop CR kspecies get refCs kspecies get rightabath copy pop } if } for | - make refCs of confined species from Gauss-filtered Cs Nmobile 1 Nspecies 1 sub { /kspecies name LengthREF Cs kspecies get refCs kspecies get Gaussfilter } for | - compute refCs of mobile species and refEXs_es of all species make_DFTref | - prime all EXs_es to equal the refEXs_es 0 1 Nspecies 1 sub { /kspecies name refEXs_es kspecies get EXs_es kspecies get copy pop } for | - prime the Cs of charged mobile species as a piecewise constant profile | using refCOMP to control relative densities in the pore | - prime pore solvent density such that the packing fraction is no less | than that of the baths | - prime EXs_hs by computing the HS aspect of the DFT for the initial Cs 0.0 WA poreproper copy Nmobile 1 Nspecies 1 sub { /kspecies name Cs kspecies get poreproper WB poreproper copy Z kspecies get mul add } for pop 0 1 Nmobile 1 sub { /kspecies name /C Cs kspecies get def CL kspecies get C leftabath copy pop CR kspecies get C rightabath copy pop 0 1 Dimensions 2 get 1 sub { /knode name Z kspecies get 0 eq Z kspecies get WA poreproper knode get mul 0 gt or { 0.0 } | co-ion or solvent { WA poreproper knode get abs refCOMP kspecies get mul Z kspecies get abs div } ifelse C poreproper knode put } for } for 0.0 SIGMA 0 Nmobile getinterval WA copy 3 pwr CL mul add /pfB name Indices 2 get 1 Indices 2 get Dimensions 2 get add 1 sub { /knode name 0.0 0 1 Nspecies 1 sub { /kspecies name SIGMA kspecies get 3 pwr Cs kspecies get knode get mul add } for /pfP name pfB pfP gt { pfB pfP sub SIGMA H2O get 3 pwr div } { 0.0 } ifelse Cs H2O get knode put } for pchem comp_EXs _pchem |-- determine Donnan potentials at pore mouths 0.0 Nmobile 1 Nspecies 1 sub { /kspecies name Cs kspecies get poreproper dup length 2 div get Z kspecies get mul add } for /SF name pchem brent solve_DonnanL begin { /DonnanC CL def /brenttolerance 1e-10 def /guessfactor 0.25 def 0.0 -40.0 40.0 1 guessbracbrent } stopped brentmess exch end _brent _pchem { toconsole stop } { pop } ifelse /VdonnanL name pchem brent solve_DonnanR begin { /DonnanC CR def /brenttolerance 1e-10 def /guessfactor 0.25 def 0.0 -40.0 40.0 1 guessbracbrent } stopped brentmess exch end _brent _pchem { toconsole stop } { pop } ifelse /VdonnanR name |-- prime V, Us in pore V poreproper 0 V poreproper length sVM VdonnanL add dup neg VdonnanR add V poreproper length 1 sub div ramp pop pop 0 1 Nmobile 1 sub { /kspecies name CL kspecies get ln Us kspecies get leftabath copy V leftabath WA leftabath copy Z kspecies get mul add E0s kspecies get leftabath add EXs kspecies get leftabath add pop CR kspecies get ln Us kspecies get rightabath copy V rightabath WA rightabath copy Z kspecies get mul add E0s kspecies get rightabath add EXs kspecies get rightabath add pop Us kspecies get poreproper dup length 0 exch Us kspecies get 0 get Us kspecies get last get Us kspecies get 0 get sub Us kspecies get poreproper length 1 sub div ramp pop pop Us kspecies get V WA copy Z kspecies get mul sub E0s kspecies get sub EXs kspecies get sub pop Z kspecies get 0 ne { LengthREF Us kspecies get WA Gaussfilter WA Us kspecies get copy pop } if } for LengthREF V WA Gaussfilter WA V copy pop Vs { V exch copy pop } forall } bind def |=================== Level 4: refinements of pore flavors ====================== | | - compute EPS profile tied to density of water (and E0s profiles of | mobile species) | epsilonP - value corresponding to zero water density | | - compute Ds profiles to track density of water | poreDs - array of diffusion coefficients for pore | | - compute reference density profiles _refCs_ for the DFT (smearing | confined species with a Gaussian filter) | LengthREF - characteristic length of screening used in spatial | filtering of reference densities | refCOMP - array giving the fractions in which each mobile | species is to be used as countercharge of the | confined species | /L4 { Cs H2O get EPS copy Cs H2O get 0 get div 2 pwr epsilonW epsilonP sub mul epsilonP add pop comp_E0s_mobile 0 1 Nmobile 1 sub { /kspecies name Ds kspecies get 0 get lg poreDs kspecies get lg sub Cs H2O get 0 get div Cs H2O get Ds kspecies get copy exch mul poreDs kspecies get lg add 10.0 ln mul exp pop } for 0 1 Nmobile 1 sub { /kspecies name Z kspecies get 0 eq { Cs kspecies get refCs kspecies get copy pop } if } for Nmobile 1 Nspecies 1 sub { /kspecies name LengthREF Cs kspecies get refCs kspecies get Gaussfilter } for make_DFTref } bind def |-------------------------- make reference for DFT ---------------------------- | - computes refCs of mobile species excluding solvents | - computes refEXs of all species using bulk MSA /make_DFTref { 0.0 WA copy dup /f name Nmobile 1 Nspecies 1 sub { /kspecies name refCs kspecies get WB copy Z kspecies get mul add } for pop /bL 0.0 def /bR 0.0 def 0 1 Nmobile 1 sub { /kspecies name Z kspecies get 0 gt { CL kspecies get Z kspecies get mul bL add /bL name CR kspecies get Z kspecies get mul bR add /bR name } if } for false 0 1 Ngrid 1 sub { /knode name f knode get abs bL gt { pop true exit } if 0 1 Nmobile 1 sub { /kspecies name f knode get 0 eq Z kspecies get 0 ne and { CL kspecies get refCs kspecies get knode put } if Z kspecies get f knode get mul dup 0 gt { bL f knode get abs sub bL div CL kspecies get mul Z kspecies get abs div refCs kspecies get knode put } if 0 lt { f knode get abs refCOMP kspecies get mul bL f knode get abs sub bL div CL kspecies get mul add Z kspecies get abs div refCs kspecies get knode put } if } for } for not { (\n*** Submerged fixed charge! ***) toconsole stop } if /k1 knode def false Ngrid 1 sub -1 0 { /knode name f knode get abs bR gt { pop true exit } if 0 1 Nmobile 1 sub { /kspecies name f knode get 0 eq Z kspecies get 0 ne and { CR kspecies get refCs kspecies get knode put } if Z kspecies get f knode get mul dup 0 gt { bR f knode get abs sub bR div CR kspecies get mul Z kspecies get abs div refCs kspecies get knode put } if 0 lt { f knode get abs refCOMP kspecies get mul bR f knode get abs sub bR div CR kspecies get mul add Z kspecies get abs div refCs kspecies get knode put } if } for } for not { (\n*** Submerged fixed charge! ***) toconsole stop } if /k2 knode def k1 1 k2 { /knode name 0 1 Nmobile 1 sub { /kspecies name Z kspecies get f knode get mul dup 0 gt { 0.0 refCs kspecies get knode put } if 0 lt { f knode get abs refCOMP kspecies get mul Z kspecies get abs div refCs kspecies get knode put } if } for } for comp_refEXs } bind def |----------- compute reference ES excess potentials for the DFT | (including boundaries) /comp_refEXs { false Ref /contflag put 0 1 Ngrid 1 sub { /knode name 0 1 Nspecies 1 sub { /kspecies name refCs kspecies get knode get Ref /Cs get kspecies put } for EPS knode get Ref /EPS put Ref pchem comp_bulk_ES _pchem Ref /Gamma get 2.0 mul -1 pwr refMSAradius knode put 0 1 Nspecies 1 sub { /kspecies name Ref /EXs_es get kspecies get refEXs_es kspecies get knode put } for } for } bind def |------------- apply spatial Gaussian filter to profile | length_in_m source dest | -- /Gaussfilter { /dest name /src name SystemLength div /filterlength name src 0 get dest 0 put src last get dest last put /window filterlength 5.0 mul def 1 1 src length 2 sub { /kcenter name X kcenter get /Xcenter name /sumw 1.0 def src kcenter get kcenter 1 sub -1 0 { /knode name X knode get /Xnode name Xcenter window sub Xnode gt { exit } if Xnode Xcenter sub filterlength div dup mul -0.5 mul exp dup sumw add /sumw name src knode get mul add } for kcenter 1 add 1 Ngrid 1 sub { /knode name X knode get /Xnode name Xcenter window add Xnode lt { exit } if Xnode Xcenter sub filterlength div dup mul -0.5 mul exp dup sumw add /sumw name src knode get mul add } for sumw div dest kcenter put } for } bind def |==================== Level 5: insert new CL, CR ====================== | | - works in new boundary conditions CL, CR, updating Us profiles | - make DFT reference /L5 { 0 1 Nmobile 1 sub { /kspecies name CL kspecies get ln Us kspecies get 0 put CR kspecies get ln Us kspecies get last put } for |-- set up refCs of solvent(s) in baths 0 1 Nmobile 1 sub { /kspecies name Z kspecies get 0 eq { 0.0 refCs kspecies get copy pop CL kspecies get refCs kspecies get leftabath copy pop CR kspecies get refCs kspecies get rightabath copy pop } if } for | - establish boundary HS variables for the DFT false Lbulk /contflag put CL 0.0 Lbulk /Cs get copy copy pop Lbulk dup pchem comp_bulk_HS comp_bulk_ES _pchem false Rbulk /contflag put CR 0.0 Rbulk /Cs get copy copy pop Rbulk dup pchem comp_bulk_HS comp_bulk_ES _pchem make_DFTref } bind def |=========================== Level 6: solve the PNP/DFT ======================= | - establishes new VM and solves /L6 { VM kT_e div /sVM name Vs { sVM exch 0 put } forall |-- solve pnp_dft pnp solve_pnp_dft _pnp pnp NetCurrent _ pop _pnp } bind def |===================== Level 7: extract a profile data base ====================| requires a solution of the DFT/PNP to exist in 'channel'; | returns the dictionary of the data base | -- | db_dict /sbsnames { [ /Poreradius /Xslice /Lengths /SystemLength /Indices /Dimensions /Ngrid /Nspecies /Nmobile /Nconfined /SPECIES /Z /SIGMA /bathDs /Ghydr /Celsius /kT /kT_e /selfFac /Poisson_counter Nconfined 1 ge { /idx_confined /total_confined /OxLength /OxHold } if /Noxygens /poreDs /epsilonP /refCOMP /MSAradius /LengthREF /CL /CR /VM /FLUX /NetCurrent ] } def /L7 { 100 dict dup begin sbsnames { dup find 0 transcribe def } forall DX Ngrid /s array copy /DX name X Ngrid /s array copy /X name Area dup length /s array copy /Area name XP dup length /s array copy /XP name Radius dup length /s array copy /Radius name EPS Ngrid /s array copy /EPS name [ Ds { Ngrid /s array copy } forall ] /Ds name [ E0s { Ngrid /s array copy } forall ] /E0s name [ refCs { Ngrid /s array copy } forall ] /refCs name [ refEXs_es { Ngrid /s array copy } forall ] /refEXs_es name refMSAradius dup length /s array copy /refMSAradius name [ EXs_es { Ngrid /s array copy } forall ] /EXs_es name [ EXs_hs { Ngrid /s array copy } forall ] /EXs_hs name [ Cs { Ngrid /s array copy } forall ] /Cs name [ Vs { Ngrid /s array copy } forall ] /Vs name end } bind def |========================= L8: build a super data base ======================= | | /sdb_name /generator_name comment | -- (sdb -> module) | | The sdb has the entries: | | /comment - string that you give | /profiles - list of the profile data bases generated | /L8 { /comment name mkact /generator name module 50 dict dup begin comment /comment name [ generator ] /profiles name end _module } bind def |------------------------ generator: iV ------------------------------------- /firstV -0.1 def /stepV 0.01 def /lastV 0.1 def /backto null def | remember to assign this to a module name /g_iV { backto L9 0.0 stepV lastV { channel /VM name L6 L7 _channel } for backto L9 stepV neg dup firstV { channel /VM name L6 L7 _channel } for } bind def |------------------------- generator: CR_Ca iVs ----------------------------- /firstCa -9.0 def | define initial backto for this concentration /stepCa 1.0 def /lastCa -1.0 def /g_CR_Ca_iVs { backto /backto1 userdict begin savemodule end firstCa stepCa lastCa { channel 10.0 exch pwr CR Ca put CR /Cl balance _channel /backto1 L9 channel 0.0 /VM name L5 L6 L7 _channel /backto1 forgetmodule /DFT_Cachannel /backto1 userdict begin savemodule end stepV stepV lastV { channel /VM name L6 L7 _channel } for /backto1 L9 stepV neg dup firstV { channel /VM name L6 L7 _channel } for } for /backto1 forgetmodule } bind def |------------------------- generator: sel_iVs ----------------------------- | define 'backto' for eps 10 and 10 mM external divalent /selSPECIES [ [ /H2O /Ca /Csion /Cl /Ox ] [ /H2O /Ba /Csion /Cl /Ox ] [ /H2O /Ba /Li /Cl /Ox ] [ /H2O /Ba /Na /Cl /Ox ] [ /H2O /Ba /K /Cl /Ox ] ] def /selPoreDs [ ] def /selCR def /selCL def /g_sel_iVs { 0 1 selSPECIES length 1 sub { /ksel name channel selSPECIES ksel get /SPECIES name selPoreDs ksel get poreDs copy pop L2 selCR CR copy /Cl balance selCL CL copy /Cl balance /VM 0.0 def L3 backto L9 L6 L4 L6 L7 _channel /DFT_Cachannel /backto1 userdict begin savemodule end stepV stepV lastV { channel /VM name L6 L7 _channel } for /backto1 L9 stepV neg dup firstV { channel /VM name L6 L7 _channel } for } for /backto1 forgetmodule } bind def |===================== L9: load solution from saved module =================== | | /saved_name | -- (restored Vs and Us) | /L9 { userdict exch get dup /Us get Us load /Vs get Vs load } bind def /load { 0 3 1 roll { 3 1 roll exch 2 copy 5 2 roll get exch copy pop 1 add exch } forall pop pop } bind def |============================ Miscellaneous ================================== |-------------------------------- default reporters settings /warpF def /profilesof [ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 ] def /xVsof [ 0 1 2 3 4 ] def /xcsof [ 0 1 2 ] def |-------------------------------- concatenate db lists | into one db list for reporters | [ dbs ] [ dbs ] ... #_of_lists | [ all dbs in order listed ] /db_concat { /Nlist name [ Nlist 1 add 1 roll ] [ exch { { } forall } forall ] } bind def /is_species { /iion name false SPECIES { iion eq { pop true exit } if } forall } bind def |-------------------------------- continuation nicknames |--- concentration continuation /c_cont { L5 L6 } bind def |--- voltage continuation /v_cont { L6 } bind def |-- refinement /refine { L4 } bind def end _module