else: bnd.NELEM3 = bnd.NELEM2 # 3D structures if slf.NPLAN > 1: bnd.IPOB3 = np.ravel( np.add( np.repeat(bnd.IPOB2, slf.NPLAN).reshape((bnd.NPOIN2, slf.NPLAN)), bnd.NPOIN2 * np.arange(slf.NPLAN)).T) bnd.IKLE3 = \ np.repeat(bnd.NPOIN2*np.arange(slf.NPLAN-1),bnd.NELEM2*bnd.NDP3).reshape((bnd.NELEM2*(slf.NPLAN-1),bnd.NDP3)) + \ np.tile(np.add(np.tile(bnd.IKLE2,2),np.repeat(bnd.NPOIN2*np.arange(2),bnd.NDP2)),(slf.NPLAN-1,1)) else: bnd.IPOB3 = bnd.IPOB2 bnd.IKLE3 = bnd.IKLE2 # Mesh coordinates bnd.MESHX = geo.MESHX[BOR - 1] bnd.MESHY = geo.MESHY[BOR - 1] print ' +> writing header' # Write header bnd.appendHeaderSLF() # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< # ~~~~ writes BND core ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ print ' +> setting variables' # TIME and DATE extraction bndDATES = slf.DATETIME bndTIMES = slf.tags['times'] bnd.tags['times'] = slf.tags['times'] # VARIABLE extraction
ini.NDP2 = 3 ini.NDP3 = 6 ini.NPOIN2 = geo.NPOIN2 ini.NPOIN3 = geo.NPOIN2*ini.NPLAN ini.NELEM2 = geo.NELEM2 ini.NELEM3 = ini.NELEM2*(ini.NPLAN-1) print ' +> setting connectivity' ini.IKLE3 = \ np.repeat(geo.NPOIN2*np.arange(ini.NPLAN-1),geo.NELEM2*ini.NDP3).reshape((geo.NELEM2*(ini.NPLAN-1),ini.NDP3)) + \ np.tile(np.add(np.tile(geo.IKLE2,2),np.repeat(geo.NPOIN2*np.arange(2),geo.NDP2)),(ini.NPLAN-1,1)) ini.IPOB3 = np.ravel(np.add(np.repeat(geo.IPOB2,ini.NPLAN).reshape((geo.NPOIN2,ini.NPLAN)),geo.NPOIN2*np.arange(ini.NPLAN)).T) ini.IPARAM = [0,0,0,0,0,0,ini.NPLAN,0,0,0] # Mesh coordinates ini.MESHX = geo.MESHX ini.MESHY = geo.MESHY print ' +> writing header' # Write header ini.appendHeaderSLF() # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< # ~~~~ writes INI core ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ print ' +> setting variables' # TIME and DATE extraction iniDATES = slf.DATETIME iniTIMES = slf.tags['times'] ini.tags['times'] = slf.tags['times'] # VARIABLE extraction
slf2d.VARINDEX = range(slf2d.NVAR) slf2d.VARNAMES.append('BOTTOM ') slf2d.VARUNITS.append('M ') #print ' +> Set SELAFIN sizes' slf2d.NPLAN = 1 slf2d.NDP2 = 3 slf2d.NDP3 = 3 slf2d.NPOIN2 = n slf2d.NPOIN3 = n slf2d.NELEM2 = e slf2d.NELEM3 = e slf2d.IPARAM = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0] #print ' +> Set SELAFIN mesh' slf2d.MESHX = x slf2d.MESHY = y #print ' +> Set SELAFIN IPOBO' junkIPOB = np.zeros(n - len(b)) junkIPOB = junkIPOB.astype(np.int16) slf2d.IPOB2 = np.hstack((b, junkIPOB)) slf2d.IPOB3 = slf2d.IPOB2 #print ' +> Set SELAFIN IKLE' slf2d.IKLE2 = ikle slf2d.IKLE3 = ikle #print ' +> Set SELAFIN times and cores' # these two lists are empty after constructor is instantiated slf2d.tags['cores'].append(0)
atm.IPOB2 = geo.IPOB2 atm.IPOB3 = np.ravel( np.add( np.repeat(geo.IPOB2, atm.NPLAN).reshape((geo.NPOIN2, atm.NPLAN)), geo.NPOIN2 * np.arange(atm.NPLAN)).T) else: atm.NELEM3 = geo.NELEM2 atm.IKLE2 = geo.IKLE2 atm.IKLE3 = geo.IKLE3 atm.IPOB2 = geo.IPOB2 atm.IPOB3 = geo.IPOB3 atm.IPARAM = [0, 0, 0, 0, 0, 0, atm.NPLAN, 0, 0, 0] # Mesh coordinates atm.MESHX = geo.MESHX atm.MESHY = geo.MESHY print ' +> writing header' # Write header atm.appendHeaderSLF() # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< # ~~~~ writes ATM core ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ print ' +> setting variables' # TIME and DATE extraction atmDATES = slf.DATETIME atmTIMES = slf.tags['times'] atm.tags['times'] = slf.tags['times'] # VARIABLE extraction
slf2d.VARINDEX = range(slf2d.NVAR) slf2d.VARNAMES.append('BOTTOM ') slf2d.VARUNITS.append('M ') #print ' +> Set SELAFIN sizes' slf2d.NPLAN = 1 slf2d.NDP2 = 3 slf2d.NDP3 = 3 slf2d.NPOIN2 = n slf2d.NPOIN3 = n slf2d.NELEM2 = e slf2d.NELEM3 = e slf2d.IPARAM = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0] #print ' +> Set SELAFIN mesh' slf2d.MESHX = x slf2d.MESHY = y #print ' +> Set SELAFIN IPOBO' junkIPOB = np.zeros(n-len(b)) junkIPOB = junkIPOB.astype(np.int16) slf2d.IPOB2 = np.hstack((b,junkIPOB)) slf2d.IPOB3 = slf2d.IPOB2 #print ' +> Set SELAFIN IKLE' slf2d.IKLE2 = ikle slf2d.IKLE3 = ikle #print ' +> Set SELAFIN times and cores' # these two lists are empty after constructor is instantiated slf2d.tags['cores'].append(0)