#! /usr/bin/env/python # import necessary modulees import polyadcirc.run_framework.subdomain as subdom import polyadcirc.run_framework.fulldomain as fulldom import glob import polyadcirc.run_framework.plotADCIRC as pa adcirc_dir = '/h1/lgraham/workspace' fulldomain = fulldom.fulldomain(adcirc_dir+'/ADCIRC_landuse/Inlet/inputs/tides') subdomain = subdom.subdomain(adcirc_dir+'/ADCIRC_landuse/Inlet_subdomain/inputs/tides') subdomain.set_fulldomain(fulldomain) num_procs = 2 fulldomain.update() subdomain.update() # Compare subdomain and fulldomain results ts_names = ['fort.63', 'fort.64'] nts_names = ['maxele.63','maxvel.63', 'tinun.63','elemaxdry.63'] subdomain.update_sub2full_map() ts_error, nts_error, time_obs, ts_data, nts_data = subdomain.compare_to_fulldomain(ts_names, nts_names) subdomain.get_Triangulation(path = subdomain.path) pa.ts_pcolor(ts_data, time_obs, subdomain, path = subdomain.path) pa.nts_pcolor(nts_data, subdomain, path = subdomain.path) pa.ts_quiver(ts_data, time_obs, subdomain, path = subdomain.path)
#! /usr/bin/env/python # import necessary modulees import polyadcirc.run_framework.subdomain as subdom import polyadcirc.run_framework.fulldomain as fulldom import polyadcirc.run_framework.random_manningsn as rmn import polyadcirc.pyADCIRC.volume as vol import numpy as np import scipy.io as sio adcirc_dir = '/h1/lgraham/workspace' fulldomain = fulldom.fulldomain(adcirc_dir+'/ADCIRC_landuse/Inlet/inputs/tides') subdomain = subdom.subdomain(adcirc_dir+'/ADCIRC_landuse/Inlet_subdomain/inputs/tides') subdomain.set_fulldomain(fulldomain) # The following steps correspond to Table 1 in Subdomain ADICRC v.50 User Guide # Step 1a Generate Sudomain # subdomain.circle(0, 0, 3000) # subdomain.setup() # Read in fort.14, fort.15 data to subdomain and fulldomain objects fulldomain.update() subdomain.update() # Read in and mapping between subdomain and fulldomain subdomain.update_sub2full_map() # Get list of elements in the subdomain in terms of fulldomain element numbers elements = subdomain.sub2full_element.values() # Get fort.63 data fort63, time_obs = rmn.get_ts_sr(fulldomain.path, 'fort.63')
#! /usr/bin/env/python # import necessary modules import polyadcirc.run_framework.subdomain as subdom import polyadcirc.run_framework.fulldomain as fulldom import glob adcirc_dir = '/work/01837/lcgraham/v50_subdomain/work' fulldomain = fulldom.fulldomain(adcirc_dir+'/fulldomain') subdomain = subdom.subdomain(adcirc_dir+'/subdomain') subdomain.set_fulldomain(fulldomain) num_procs = 2 # check to see if shape file exists, if not make it if len(glob.glob(subdomain.path+'/shape.*14')) <= 0: subdomain.ellipse([40824.6, 98559.5], [98559.5, 40824,6], 60000) # The following steps correspond to Table 1 in Subdomain ADICRC v.50 User Guide # Step 1a Generate Sudomain subdomain.setup() # Step 1b Generate Full Domain Control File subdomain.genfull() # Step 2 Run ADCIRC on the full domain fulldomain.update() if subdomain.check_fulldomain(): disp = "Output files ``fort.06*`` exist, but running ADCIRC on fulldomain" print disp+"anyway." else: print "Output files ``fort.06*`` do not exist, running ADCIRC on fulldomain." fulldomain.run(num_procs, adcirc_dir) # Step 3 Exract Subdomain Boundary Conditions subdomain.update()