Changeset 4837


Ignore:
Timestamp:
Nov 21, 2007, 4:10:37 AM (16 years ago)
Author:
ole
Message:

Cleanup of config and comments

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 set
     1"""Module where global ANUGA model parameters and default values are set
    22"""
    33
    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#--------------------
     7epsilon = 1.0e-12 # Smallest number - used for safe division
     8max_float = 1.0e36 # Largest number - used to initialise (max, min) ranges
    319
    3210
    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#-------------------------------------------
     15pmesh_filename = '.\\pmesh'
     16version_filename = 'stored_version_info.py'
     17default_datadir = '.'
     18time_format = '%d/%m/%y %H:%M:%S'
     19umask = 002  # Controls file and directory permission created by anuga
     20default_boundary_tag = 'exterior'
     21
     22# Major revision number for use with create_distribution
     23# and update_anuga_user_guide
     24major_revision = '1.0beta'
    3525
    3626
    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#-------------------
     30manning = 0.03  # Manning's friction coefficient
     31#g = 9.80665    # Gravity - FIXME reinstate this and fix unit tests.
    4132g = 9.8
    4233#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
    4334#The 'official' average is 9.80665
    44 
    45 
    46 
    4735
    4836eta_w = 3.0e-3 #Wind stress coefficient
     
    5139
    5240
    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.
    5750#
    5851# Large values of beta_h may cause simulations to require more timesteps
     
    6760# Can you please let me know if you disagree?
    6861
    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
    7563# I think these are better SR but they conflict with the unit tests!
    7664beta_w      = 1.0
     
    10290
    10391
    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#-------------
    10795
     96CFL = 1.0  # CFL condition assigned to domain.CFL - controls timestep size
     97     
    10898# Choose type of timestepping,
    10999timestepping_method = 'euler' # 1st order euler
     
    119109protect_against_isolated_degenerate_timesteps = False
    120110
    121 pmesh_filename = '.\\pmesh'
    122 version_filename = 'stored_version_info.py'
     111
     112min_timestep = 1.0e-6 # Minimal timestep accepted in ANUGA
     113max_timestep = 1.0e+3
     114max_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
    123136
    124137
    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#---------------------------------------------------
    126143
    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
     145minimum_allowed_height = 1.0e-3
    131146
    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
     148minimum_storable_height = 1.0e-5
    146149
    147150# FIXME (Ole): Redefine this parameter to control maximal speeds in general
     
    151154                            # Too large (100) creates 'flopping' water
    152155                            # Too small (0) creates 'creep'
     156                           
     157maximum_froude_number = 100.0 # To be used in limiters.
    153158
    154159
    155 maximum_froude_number = 100.0 # To be used in limiters.
     160#------------------------------------------------------------
     161# Performance parameters used to invoke various optimisations
     162#------------------------------------------------------------
    156163
    157 minimum_storable_height = 1.0e-5 # Water depth below which it is *stored* as 0
     164use_extensions = True # Use C-extensions
     165use_psyco = True # Use psyco optimisations
     166
     167optimise_dry_cells = True # Exclude dry and still cells from flux computation
     168optimised_gradient_limiter = True # Use hardwired gradient limiter
    158169
    159170points_file_block_line_size = 500 # Number of lines read in from a points file
    160171                                  # when blocking
    161172
    162 umask = 002  # used to set file and directory permission created by anuga
    163173
    164 max_float = 1.0e36 # Largest number. Used to initialise (max, min) ranges.
     174
     175
     176
     177
    165178   
  • create_distribution.py

    r4802 r4837  
    3636
    3737
    38 # Define main version manually
    39 # major_revision = '1.0beta'
    40 
    4138# line separator
    4239lsep = '----------------------------------------------------------------------'
     
    5451distro_filename = 'anuga-%s.tgz' %revision
    5552
    56 # Create area directory
     53#-----------------------------------
     54# Create directory for this release.
     55# It will be named like
     56#        anuga_release_1.0beta_4824
     57#-----------------------------------
    5758release_dir = '~/anuga_release_%s' %revision
    5859s = 'mkdir %s' %release_dir
     
    6364    pass
    6465
    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#-----------------------------------------------------
    6769distro_dir = mktemp()
    6870s = 'mkdir %s' %distro_dir
     
    7072system(s)
    7173
    72 
    73 
     74#--------------------------------
     75# Get the ANUGA core source files
     76#--------------------------------
    7477s = 'svn export -r %d anuga_core/source/anuga %s/anuga' %(svn_revision,
    7578                                                          distro_dir)
     
    8386#-----------------------------
    8487# Get validation_files as well
    85 
     88#-----------------------------
    8689s = 'mkdir %s/anuga_validation' %distro_dir
    8790system(s)
     
    9396
    9497s = '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
     99rint s
     100system(s)
    99101
    100102s = 'svn export anuga_validation/automated_validation_tests %s/anuga_validation/automated_validation_tests'\
     
    103105system(s)
    104106
    105 
    106 # FIXME: Other validations in here!!!
    107 
    108 
    109 #-----------------------------
     107# FIXME: Other validations in here as they appear!
     108
     109
     110#---------------------------
    110111# Get demos from user manual
    111 
    112 #s = 'mkdir %s/anuga_demos' %distro_dir
    113 #system(s)
    114 
     112#---------------------------
    115113s = 'svn export anuga_core/documentation/user_manual/demos %s/anuga_demos'\
    116114    %(distro_dir)
     
    118116system(s)
    119117
    120 
    121118#------------------
    122119# Zip everything up
     120#------------------
    123121s = 'cd %s;tar cvfz %s *' %(distro_dir, distro_filename)
    124122print s
    125123system(s)
    126124
     125#----------------------------
    127126# Move distro to release area
     127#----------------------------
    128128s = '/bin/mv %s/*.tgz %s' %(distro_dir, release_dir)
    129129print s
    130130system(s)
    131131
     132#---------
    132133# Clean up
     134#---------
    133135s = '/bin/rm -rf %s/*' %(distro_dir)
    134136print s
     
    141143#-----------------------------
    142144# Copy and rename anuga_viewer
     145#-----------------------------
    143146s = '/bin/cp ./anuga_core/source/anuga_viewer/distros/anuga_viewer_1.0.tgz %s/anuga_viewer-%s.tgz' %(distro_dir, revision)
    144147print s
    145148system(s)
    146149
    147 
     150#----------------------------
    148151# Move viewer to release area
     152#----------------------------
    149153s = '/bin/mv %s/*.tgz %s' %(distro_dir, release_dir)
    150154print s
     
    153157
    154158
    155 #-----------------------------
    156 # Hey, why not compile and bundle up the LaTeX documentation as well
    157 
     159#----------------------------------------------
     160# Compile and bundle up the LaTeX documentation
     161#----------------------------------------------
    158162print
    159163print lsep
     
    178182
    179183
    180 #-----------------------------
    181 
     184#----------------------------
     185# Print list of release files
     186#----------------------------
    182187print 'Done'
    183188print
     
    190195print
    191196
     197
     198#-------------------------------------
     199# Copy release to various destinations
     200#-------------------------------------
    192201answer = raw_input('Do you want to upload this to sourceforge? Y/N [Y]')
    193202if answer.lower() != 'n':
    194203   
    195     #------------------------------
    196204    print 'Uploading to sourceforge'
    197 
    198205
    199206    import os, os.path
     
    262269
    263270
    264    
    265271    # Copy to the ANU
    266272    #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.