source: issm/oecreview/Archive/12321-12677/ISSM-12442-12443.diff@ 12679

Last change on this file since 12679 was 12679, checked in by Mathieu Morlighem, 13 years ago

Added 12321-12677

File size: 15.0 KB
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model.py

     
    1 #module imports {{{
    2 from mesh import mesh
    3 from mask import mask
    4 from geometry import geometry
    5 from constants import constants
    6 from surfaceforcings import surfaceforcings
    7 from basalforcings import basalforcings
    8 from materials import materials
    9 from friction import friction
    10 from flowequation import flowequation
    11 from timestepping import timestepping
    12 from initialization import initialization
    13 from rifts import rifts
    14 from debug import debug
    15 from verbose import verbose
    16 from settings import settings
    17 from solver import solver
    18 from none import none
    19 from balancethickness import balancethickness
    20 from diagnostic import diagnostic
    21 from groundingline import groundingline
    22 from hydrology import hydrology
    23 from prognostic import prognostic
    24 from thermal import thermal
    25 from steadystate import steadystate
    26 from transient import transient
    27 from autodiff import autodiff
    28 from flaim import flaim
    29 from inversion import inversion
    30 from qmu import qmu
    31 from radaroverlay import radaroverlay
    32 from miscellaneous import miscellaneous
    33 from private import private
    34 #}}}
    35 class model:
    36         #properties
    37         def __init__(self):
    38                 # {{{ Properties
    39                 self.mesh             = mesh()
    40                 self.mask             = mask()
    41                 self.geometry         = geometry()
    42                 self.constants        = constants()
    43                 self.surfaceforcings  = surfaceforcings()
    44                 self.basalforcings    = basalforcings()
    45                 self.materials        = materials()
    46                 self.friction         = friction()
    47                 self.flowequation     = flowequation()
    48                 self.timestepping     = timestepping()
    49                 self.initialization   = initialization()
    50                 self.rifts            = rifts()
    51 
    52                 self.debug            = debug()
    53                 self.verbose          = verbose()
    54                 self.settings         = settings()
    55                 self.solver           = solver()
    56                 self.cluster          = none()
    57 
    58                 self.balancethickness = balancethickness()
    59                 self.diagnostic       = diagnostic()
    60                 self.groundingline    = groundingline()
    61                 self.hydrology        = hydrology()
    62                 self.prognostic       = prognostic()
    63                 self.thermal          = thermal()
    64                 self.steadystate      = steadystate()
    65                 self.transient        = transient()
    66 
    67                 self.autodiff         = autodiff()
    68                 self.flaim            = flaim()
    69                 self.inversion        = inversion()
    70                 self.qmu              = qmu()
    71 
    72                 self.results          = [];
    73                 self.radaroverlay     = radaroverlay()
    74                 self.miscellaneous    = miscellaneous()
    75                 self.private          = private()
    76                 #}}}
    77         def __repr__(obj):
    78                 # {{{ Display
    79 
    80                 #print "Here %s the number: %d" % ("is", 37)
    81                 string="%19s: %-22s -- %s" % ("mesh","[%s,%s]" % ("1x1",obj.mesh.__class__.__name__),"mesh properties")
    82                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("mask","[%s,%s]" % ("1x1",obj.mask.__class__.__name__),"defines grounded and floating elements"))
    83                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("geometry","[%s,%s]" % ("1x1",obj.geometry.__class__.__name__),"surface elevation, bedrock topography, ice thickness,..."))
    84                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("constants","[%s,%s]" % ("1x1",obj.constants.__class__.__name__),"physical constants"))
    85                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("surfaceforcings","[%s,%s]" % ("1x1",obj.surfaceforcings.__class__.__name__),"surface forcings"))
    86                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("basalforcings","[%s,%s]" % ("1x1",obj.basalforcings.__class__.__name__),"bed forcings"))
    87                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("materials","[%s,%s]" % ("1x1",obj.materials.__class__.__name__),"material properties"))
    88                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("friction","[%s,%s]" % ("1x1",obj.friction.__class__.__name__),"basal friction/drag properties"))
    89                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("flowequation","[%s,%s]" % ("1x1",obj.flowequation.__class__.__name__),"flow equations"))
    90                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("timestepping","[%s,%s]" % ("1x1",obj.timestepping.__class__.__name__),"time stepping for transient models"))
    91                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("initialization","[%s,%s]" % ("1x1",obj.initialization.__class__.__name__),"initial guess/state"))
    92                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("rifts","[%s,%s]" % ("1x1",obj.rifts.__class__.__name__),"rifts properties'"))
    93                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("debug","[%s,%s]" % ("1x1",obj.debug.__class__.__name__),"debugging tools (valgrind, gprof"))
    94                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("verbose","[%s,%s]" % ("1x1",obj.verbose.__class__.__name__),"verbosity level in solve"))
    95                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("settings","[%s,%s]" % ("1x1",obj.settings.__class__.__name__),"settings properties"))
    96                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("solver","[%s,%s]" % ("1x1",obj.solver.__class__.__name__),"PETSc options for each solution'"))
    97                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("cluster","[%s,%s]" % ("1x1",obj.cluster.__class__.__name__),"cluster parameters (number of cpus...)"))
    98                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("balancethickness","[%s,%s]" % ("1x1",obj.balancethickness.__class__.__name__),"parameters for balancethickness solution"))
    99                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("diagnostic","[%s,%s]" % ("1x1",obj.diagnostic.__class__.__name__),"parameters for diagnostic solution"))
    100                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("groundingline","[%s,%s]" % ("1x1",obj.groundingline.__class__.__name__),"parameters for groundingline solution"))
    101                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("hydrology","[%s,%s]" % ("1x1",obj.hydrology.__class__.__name__),"parameters for hydrology solution"))
    102                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("prognostic","[%s,%s]" % ("1x1",obj.prognostic.__class__.__name__),"parameters for prognostic solution"))
    103                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("thermal","[%s,%s]" % ("1x1",obj.thermal.__class__.__name__),"parameters for thermal solution"))
    104                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("steadystate","[%s,%s]" % ("1x1",obj.steadystate.__class__.__name__),"parameters for steadystate solution"))
    105                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("transient","[%s,%s]" % ("1x1",obj.transient.__class__.__name__),"parameters for transient solution"))
    106                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("autodiff","[%s,%s]" % ("1x1",obj.autodiff.__class__.__name__),"automatic differentiation parameters"))
    107                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("flaim","[%s,%s]" % ("1x1",obj.flaim.__class__.__name__),"flaim parameters"))
    108                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("inversion","[%s,%s]" % ("1x1",obj.inversion.__class__.__name__),"parameters for inverse methods"))
    109                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("qmu","[%s,%s]" % ("1x1",obj.qmu.__class__.__name__),"dakota properties"))
    110                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("results","[%s,%s]" % ("1x1",obj.results.__class__.__name__),"model results'"))
    111                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("radaroverlay","[%s,%s]" % ("1x1",obj.radaroverlay.__class__.__name__),"radar image for plot overlay"))
    112                 string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("miscellaneous","[%s,%s]" % ("1x1",obj.miscellaneous.__class__.__name__),"miscellaneous fields"))
    113                 return string;
    114                  #}}}
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/m/classes/model/model.py

     
     1#module imports {{{
     2from mesh import mesh
     3from mask import mask
     4from geometry import geometry
     5from constants import constants
     6from surfaceforcings import surfaceforcings
     7from basalforcings import basalforcings
     8from materials import materials
     9from friction import friction
     10from flowequation import flowequation
     11from timestepping import timestepping
     12from initialization import initialization
     13from rifts import rifts
     14from debug import debug
     15from verbose import verbose
     16from settings import settings
     17from solver import solver
     18from none import none
     19from balancethickness import balancethickness
     20from diagnostic import diagnostic
     21from groundingline import groundingline
     22from hydrology import hydrology
     23from prognostic import prognostic
     24from thermal import thermal
     25from steadystate import steadystate
     26from transient import transient
     27from autodiff import autodiff
     28from flaim import flaim
     29from inversion import inversion
     30from qmu import qmu
     31from radaroverlay import radaroverlay
     32from miscellaneous import miscellaneous
     33from private import private
     34#}}}
     35class model:
     36        #properties
     37        def __init__(self):
     38                # {{{ Properties
     39                self.mesh             = mesh()
     40                self.mask             = mask()
     41                self.geometry         = geometry()
     42                self.constants        = constants()
     43                self.surfaceforcings  = surfaceforcings()
     44                self.basalforcings    = basalforcings()
     45                self.materials        = materials()
     46                self.friction         = friction()
     47                self.flowequation     = flowequation()
     48                self.timestepping     = timestepping()
     49                self.initialization   = initialization()
     50                self.rifts            = rifts()
     51
     52                self.debug            = debug()
     53                self.verbose          = verbose()
     54                self.settings         = settings()
     55                self.solver           = solver()
     56                self.cluster          = none()
     57
     58                self.balancethickness = balancethickness()
     59                self.diagnostic       = diagnostic()
     60                self.groundingline    = groundingline()
     61                self.hydrology        = hydrology()
     62                self.prognostic       = prognostic()
     63                self.thermal          = thermal()
     64                self.steadystate      = steadystate()
     65                self.transient        = transient()
     66
     67                self.autodiff         = autodiff()
     68                self.flaim            = flaim()
     69                self.inversion        = inversion()
     70                self.qmu              = qmu()
     71
     72                self.results          = [];
     73                self.radaroverlay     = radaroverlay()
     74                self.miscellaneous    = miscellaneous()
     75                self.private          = private()
     76                #}}}
     77        def __repr__(obj):
     78                # {{{ Display
     79
     80                #print "Here %s the number: %d" % ("is", 37)
     81                string="%19s: %-22s -- %s" % ("mesh","[%s,%s]" % ("1x1",obj.mesh.__class__.__name__),"mesh properties")
     82                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("mask","[%s,%s]" % ("1x1",obj.mask.__class__.__name__),"defines grounded and floating elements"))
     83                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("geometry","[%s,%s]" % ("1x1",obj.geometry.__class__.__name__),"surface elevation, bedrock topography, ice thickness,..."))
     84                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("constants","[%s,%s]" % ("1x1",obj.constants.__class__.__name__),"physical constants"))
     85                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("surfaceforcings","[%s,%s]" % ("1x1",obj.surfaceforcings.__class__.__name__),"surface forcings"))
     86                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("basalforcings","[%s,%s]" % ("1x1",obj.basalforcings.__class__.__name__),"bed forcings"))
     87                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("materials","[%s,%s]" % ("1x1",obj.materials.__class__.__name__),"material properties"))
     88                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("friction","[%s,%s]" % ("1x1",obj.friction.__class__.__name__),"basal friction/drag properties"))
     89                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("flowequation","[%s,%s]" % ("1x1",obj.flowequation.__class__.__name__),"flow equations"))
     90                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("timestepping","[%s,%s]" % ("1x1",obj.timestepping.__class__.__name__),"time stepping for transient models"))
     91                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("initialization","[%s,%s]" % ("1x1",obj.initialization.__class__.__name__),"initial guess/state"))
     92                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("rifts","[%s,%s]" % ("1x1",obj.rifts.__class__.__name__),"rifts properties'"))
     93                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("debug","[%s,%s]" % ("1x1",obj.debug.__class__.__name__),"debugging tools (valgrind, gprof"))
     94                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("verbose","[%s,%s]" % ("1x1",obj.verbose.__class__.__name__),"verbosity level in solve"))
     95                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("settings","[%s,%s]" % ("1x1",obj.settings.__class__.__name__),"settings properties"))
     96                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("solver","[%s,%s]" % ("1x1",obj.solver.__class__.__name__),"PETSc options for each solution'"))
     97                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("cluster","[%s,%s]" % ("1x1",obj.cluster.__class__.__name__),"cluster parameters (number of cpus...)"))
     98                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("balancethickness","[%s,%s]" % ("1x1",obj.balancethickness.__class__.__name__),"parameters for balancethickness solution"))
     99                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("diagnostic","[%s,%s]" % ("1x1",obj.diagnostic.__class__.__name__),"parameters for diagnostic solution"))
     100                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("groundingline","[%s,%s]" % ("1x1",obj.groundingline.__class__.__name__),"parameters for groundingline solution"))
     101                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("hydrology","[%s,%s]" % ("1x1",obj.hydrology.__class__.__name__),"parameters for hydrology solution"))
     102                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("prognostic","[%s,%s]" % ("1x1",obj.prognostic.__class__.__name__),"parameters for prognostic solution"))
     103                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("thermal","[%s,%s]" % ("1x1",obj.thermal.__class__.__name__),"parameters for thermal solution"))
     104                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("steadystate","[%s,%s]" % ("1x1",obj.steadystate.__class__.__name__),"parameters for steadystate solution"))
     105                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("transient","[%s,%s]" % ("1x1",obj.transient.__class__.__name__),"parameters for transient solution"))
     106                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("autodiff","[%s,%s]" % ("1x1",obj.autodiff.__class__.__name__),"automatic differentiation parameters"))
     107                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("flaim","[%s,%s]" % ("1x1",obj.flaim.__class__.__name__),"flaim parameters"))
     108                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("inversion","[%s,%s]" % ("1x1",obj.inversion.__class__.__name__),"parameters for inverse methods"))
     109                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("qmu","[%s,%s]" % ("1x1",obj.qmu.__class__.__name__),"dakota properties"))
     110                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("results","[%s,%s]" % ("1x1",obj.results.__class__.__name__),"model results'"))
     111                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("radaroverlay","[%s,%s]" % ("1x1",obj.radaroverlay.__class__.__name__),"radar image for plot overlay"))
     112                string="%s\n%s" % (string,"%19s: %-22s -- %s" % ("miscellaneous","[%s,%s]" % ("1x1",obj.miscellaneous.__class__.__name__),"miscellaneous fields"))
     113                return string;
     114                 #}}}
Note: See TracBrowser for help on using the repository browser.