Changeset 4837
- Timestamp:
- Nov 21, 2007, 4:10:37 AM (17 years ago)
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/config.py
r4815 r4837 1 """Module where global pyvolution model parameters are set1 """Module where global ANUGA model parameters and default values are set 2 2 """ 3 3 4 5 #FIXME (Ole): Temporary access to global config file 6 from anuga_config import epsilon, default_boundary_tag 7 8 #FIXME (Ole): More of these may need to be moved to anuga_config.py 9 time_format = '%d/%m/%y %H:%M:%S' 10 11 min_timestep = 1.0e-6 #Should be computed based on geometry 12 max_timestep = 1.0e+3 13 #This is how: 14 #Define maximal possible speed in open water v_max, e.g. 500m/s (soundspeed?) 15 #Then work out minimal internal distance in mesh r_min and set 16 #min_timestep = r_min/v_max 17 # 18 #Max speeds are calculated in the flux function as 19 # 20 #lambda = v +/- sqrt(gh) 21 # 22 # so with 500 m/s, h ~ 500^2/g = 2500 m well out of the domain of the 23 # shallow water wave equation 24 # 25 #The actual soundspeed can be as high as 1530m/s 26 #(see http://staff.washington.edu/aganse/public.projects/clustering/clustering.html), 27 #but that would only happen with h>225000m in this equation. Why ? 28 #The maximal speed we specify is really related to the max speed 29 #of surface pertubation 30 # 4 #-------------------- 5 # Numerical constants 6 #-------------------- 7 epsilon = 1.0e-12 # Smallest number - used for safe division 8 max_float = 1.0e36 # Largest number - used to initialise (max, min) ranges 31 9 32 10 33 #v_max = 100 #For use in domain_ext.c 34 sound_speed = 500 11 #------------------------------------------- 12 # Standard filenames, directories and system 13 # parameters used by ANUGA 14 #------------------------------------------- 15 pmesh_filename = '.\\pmesh' 16 version_filename = 'stored_version_info.py' 17 default_datadir = '.' 18 time_format = '%d/%m/%y %H:%M:%S' 19 umask = 002 # Controls file and directory permission created by anuga 20 default_boundary_tag = 'exterior' 21 22 # Major revision number for use with create_distribution 23 # and update_anuga_user_guide 24 major_revision = '1.0beta' 35 25 36 26 37 max_smallsteps = 50 #Max number of degenerate steps allowed b4 trying first order 38 39 manning = 0.03 #Manning's friction coefficient 40 #g = 9.80665 #Gravity 27 #------------------- 28 # Physical constants 29 #------------------- 30 manning = 0.03 # Manning's friction coefficient 31 #g = 9.80665 # Gravity - FIXME reinstate this and fix unit tests. 41 32 g = 9.8 42 33 #g(phi) = 9780313 * (1 + 0.0053024 sin(phi)**2 - 0.000 0059 sin(2*phi)**2) micro m/s**2, where phi is the latitude 43 34 #The 'official' average is 9.80665 44 45 46 47 35 48 36 eta_w = 3.0e-3 #Wind stress coefficient … … 51 39 52 40 53 #Betas [0;1] control the allowed steepness of gradient for second order 54 #extrapolations. Values of 1 allow the steepes gradients while 55 #lower values are more conservative. Values of 0 correspond to 56 #1'st order extrapolations. 41 #----------------------------------------------------- 42 # Limiters - used with linear reconstruction of vertex 43 # values from centroid values 44 #----------------------------------------------------- 45 46 # Betas [0;1] control the allowed steepness of gradient for second order 47 # extrapolations. Values of 1 allow the steepes gradients while 48 # lower values are more conservative. Values of 0 correspond to 49 # 1'st order extrapolations. 57 50 # 58 51 # Large values of beta_h may cause simulations to require more timesteps … … 67 60 # Can you please let me know if you disagree? 68 61 69 70 #There are separate betas for the w, uh, vh and h limiters 71 # 72 #Good values are: 73 74 62 # There are separate betas for the w, uh, vh and h limiters 75 63 # I think these are better SR but they conflict with the unit tests! 76 64 beta_w = 1.0 … … 102 90 103 91 104 CFL = 1.0 #FIXME (ole): Is this in use yet?? 105 #(Steve) yes, change domain.CFL to 106 #make changes 92 #------------- 93 # Timestepping 94 #------------- 107 95 96 CFL = 1.0 # CFL condition assigned to domain.CFL - controls timestep size 97 108 98 # Choose type of timestepping, 109 99 timestepping_method = 'euler' # 1st order euler … … 119 109 protect_against_isolated_degenerate_timesteps = False 120 110 121 pmesh_filename = '.\\pmesh' 122 version_filename = 'stored_version_info.py' 111 112 min_timestep = 1.0e-6 # Minimal timestep accepted in ANUGA 113 max_timestep = 1.0e+3 114 max_smallsteps = 50 # Max number of degenerate steps allowed b4 trying first order 115 116 #Perhaps minimal timestep could be based on the geometry as follows: 117 #Define maximal possible speed in open water v_max, e.g. 500m/s (soundspeed?) 118 #Then work out minimal internal distance in mesh r_min and set 119 #min_timestep = r_min/v_max 120 # 121 #Max speeds are calculated in the flux function as 122 # 123 #lambda = v +/- sqrt(gh) 124 # 125 # so with 500 m/s, h ~ 500^2/g = 2500 m well out of the domain of the 126 # shallow water wave equation 127 # 128 #The actual soundspeed can be as high as 1530m/s 129 #(see http://staff.washington.edu/aganse/public.projects/clustering/clustering.html), 130 #but that would only happen with h>225000m in this equation. Why ? 131 #The maximal speed we specify is really related to the max speed 132 #of surface pertubation 133 # 134 #v_max = 100 #For use in domain_ext.c 135 #sound_speed = 500 123 136 124 137 125 import os, sys 138 #--------------------------------------------------- 139 # Ranges specific to the shallow water wave equation 140 # These control maximal and minimal values of 141 # quantities 142 #--------------------------------------------------- 126 143 127 if sys.platform == 'win32': 128 default_datadir = '.' 129 else: 130 default_datadir = '.' 144 # Water depth below which it is considered to be 0 in the model 145 minimum_allowed_height = 1.0e-3 131 146 132 133 use_extensions = True #Try to use C-extensions 134 #use_extensions = False #Do not use C-extensions 135 136 use_psyco = True #Use psyco optimisations 137 #use_psyco = False #Do not use psyco optimisations 138 139 140 optimise_dry_cells = True # Exclude dry and still cells from flux computation 141 142 optimised_gradient_limiter = True # Use hardwired gradient limiter 143 144 #Specific to shallow water W.E. 145 minimum_allowed_height = 1.0e-3 #Water depth below which it is considered to be 0 in the model 147 # Water depth below which it is *stored* as 0 148 minimum_storable_height = 1.0e-5 146 149 147 150 # FIXME (Ole): Redefine this parameter to control maximal speeds in general … … 151 154 # Too large (100) creates 'flopping' water 152 155 # Too small (0) creates 'creep' 156 157 maximum_froude_number = 100.0 # To be used in limiters. 153 158 154 159 155 maximum_froude_number = 100.0 # To be used in limiters. 160 #------------------------------------------------------------ 161 # Performance parameters used to invoke various optimisations 162 #------------------------------------------------------------ 156 163 157 minimum_storable_height = 1.0e-5 # Water depth below which it is *stored* as 0 164 use_extensions = True # Use C-extensions 165 use_psyco = True # Use psyco optimisations 166 167 optimise_dry_cells = True # Exclude dry and still cells from flux computation 168 optimised_gradient_limiter = True # Use hardwired gradient limiter 158 169 159 170 points_file_block_line_size = 500 # Number of lines read in from a points file 160 171 # when blocking 161 172 162 umask = 002 # used to set file and directory permission created by anuga163 173 164 max_float = 1.0e36 # Largest number. Used to initialise (max, min) ranges. 174 175 176 177 165 178 -
create_distribution.py
r4802 r4837 36 36 37 37 38 # Define main version manually39 # major_revision = '1.0beta'40 41 38 # line separator 42 39 lsep = '----------------------------------------------------------------------' … … 54 51 distro_filename = 'anuga-%s.tgz' %revision 55 52 56 # Create area directory 53 #----------------------------------- 54 # Create directory for this release. 55 # It will be named like 56 # anuga_release_1.0beta_4824 57 #----------------------------------- 57 58 release_dir = '~/anuga_release_%s' %revision 58 59 s = 'mkdir %s' %release_dir … … 63 64 pass 64 65 65 66 # Export a clean directory tree from the working copy to a temporary dir 66 #----------------------------------------------------- 67 # Create temporary area for svn to export source files 68 #----------------------------------------------------- 67 69 distro_dir = mktemp() 68 70 s = 'mkdir %s' %distro_dir … … 70 72 system(s) 71 73 72 73 74 #-------------------------------- 75 # Get the ANUGA core source files 76 #-------------------------------- 74 77 s = 'svn export -r %d anuga_core/source/anuga %s/anuga' %(svn_revision, 75 78 distro_dir) … … 83 86 #----------------------------- 84 87 # Get validation_files as well 85 88 #----------------------------- 86 89 s = 'mkdir %s/anuga_validation' %distro_dir 87 90 system(s) … … 93 96 94 97 s = 'svn export anuga_validation/solitary_waves %s/anuga_validation/solitary_waves'\ 95 %(distro_dir) 96 print s 97 system(s) 98 98 %(distro_dir) p 99 rint s 100 system(s) 99 101 100 102 s = 'svn export anuga_validation/automated_validation_tests %s/anuga_validation/automated_validation_tests'\ … … 103 105 system(s) 104 106 105 106 # FIXME: Other validations in here!!! 107 108 109 #----------------------------- 107 # FIXME: Other validations in here as they appear! 108 109 110 #--------------------------- 110 111 # Get demos from user manual 111 112 #s = 'mkdir %s/anuga_demos' %distro_dir 113 #system(s) 114 112 #--------------------------- 115 113 s = 'svn export anuga_core/documentation/user_manual/demos %s/anuga_demos'\ 116 114 %(distro_dir) … … 118 116 system(s) 119 117 120 121 118 #------------------ 122 119 # Zip everything up 120 #------------------ 123 121 s = 'cd %s;tar cvfz %s *' %(distro_dir, distro_filename) 124 122 print s 125 123 system(s) 126 124 125 #---------------------------- 127 126 # Move distro to release area 127 #---------------------------- 128 128 s = '/bin/mv %s/*.tgz %s' %(distro_dir, release_dir) 129 129 print s 130 130 system(s) 131 131 132 #--------- 132 133 # Clean up 134 #--------- 133 135 s = '/bin/rm -rf %s/*' %(distro_dir) 134 136 print s … … 141 143 #----------------------------- 142 144 # Copy and rename anuga_viewer 145 #----------------------------- 143 146 s = '/bin/cp ./anuga_core/source/anuga_viewer/distros/anuga_viewer_1.0.tgz %s/anuga_viewer-%s.tgz' %(distro_dir, revision) 144 147 print s 145 148 system(s) 146 149 147 150 #---------------------------- 148 151 # Move viewer to release area 152 #---------------------------- 149 153 s = '/bin/mv %s/*.tgz %s' %(distro_dir, release_dir) 150 154 print s … … 153 157 154 158 155 #----------------------------- 156 # Hey, why not compile and bundle up the LaTeX documentation as well157 159 #---------------------------------------------- 160 # Compile and bundle up the LaTeX documentation 161 #---------------------------------------------- 158 162 print 159 163 print lsep … … 178 182 179 183 180 #----------------------------- 181 184 #---------------------------- 185 # Print list of release files 186 #---------------------------- 182 187 print 'Done' 183 188 print … … 190 195 print 191 196 197 198 #------------------------------------- 199 # Copy release to various destinations 200 #------------------------------------- 192 201 answer = raw_input('Do you want to upload this to sourceforge? Y/N [Y]') 193 202 if answer.lower() != 'n': 194 203 195 #------------------------------196 204 print 'Uploading to sourceforge' 197 198 205 199 206 import os, os.path … … 262 269 263 270 264 265 271 # Copy to the ANU 266 272 #s = 'rsync -avz %s/* ole@datamining.anu.edu.au:public_html/software/anuga/%s' %(release_dir, 'anuga_%s' %revision)
Note: See TracChangeset
for help on using the changeset viewer.