Code: Select all
def par_gap_create(self,gid_one,cellone_section,gid_two,celltwo_section,gmax):
'''create gap junction between two cells, that works with parallel simulations'''
if(pc.gid_exists(gid_one)):
self.par_gap_create1(gid_one, cellone_section, self.gap_src_gid + 1, self.gap_src_gid, gmax)
if(pc.gid_exists(gid_two)):
self.par_gap_create1(gid_two, celltwo_section, self.gap_src_gid, self.gap_src_gid + 1, gmax)
self.gap_src_gid += 2
def par_gap_create1(self,gid,cellsection,target_src_gid,source_src_gid,gmax):
'''create individual gap junction'''
cell=pc.gid2cell(gid)
if(cellsection==0): #let cellsection==0 specify that the gap junction be located on the soma; can add other sections in future
gapj = h.gGapPar(cell.soma(0.5))
self.par_gaps.append(gapj)
pc.target_var(gapj._ref_vgap, target_src_gid)
pc.source_var(cell.soma(0.5)._ref_v, source_src_gid)
gapj.g=gmax
if(cellsection != 0):
pass