#! /usr/bin/env python # def p00_dim_num ( prob ): #*****************************************************************************80 # ## P00_DIM_NUM returns the spatial dimension for any problem. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 28 June 2015 # # Author: # # John Burkardt # # Parameters: # # Input, integer PROB, the problem index. # # Output, integer DIM_NUM, the spatial dimension of the # dependent variables. # if ( prob == 1 ): dim_num = p01_dim_num ( ) elif ( prob == 2 ): dim_num = p02_dim_num ( ) elif ( prob == 3 ): dim_num = p03_dim_num ( ) elif ( prob == 4 ): dim_num = p04_dim_num ( ) elif ( prob == 5 ): dim_num = p05_dim_num ( ) elif ( prob == 6 ): dim_num = p06_dim_num ( ) elif ( prob == 7 ): dim_num = p07_dim_num ( ) elif ( prob == 8 ): dim_num = p08_dim_num ( ) else: print ( '' ) print ( 'P00_DIM_NUM - Fatal error!' ) print ( ' Unexpected input value of PROB.' ) exit ( 'P00_DIM_NUM - Fatal error!' ) return dim_num def p01_dim_num ( ): #*****************************************************************************80 # ## P01_DIM_NUM returns the spatial dimension for problem p01. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 28 June 2015 # # Author: # # John Burkardt # # Parameters: # # Output, integer DIM_NUM, the spatial dimension of the # dependent variables. # dim_num = 2 return dim_num def p02_dim_num ( ): #*****************************************************************************80 # ## P02_DIM_NUM returns the spatial dimension for problem p02. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 28 June 2015 # # Author: # # John Burkardt # # Parameters: # # Output, integer DIM_NUM, the spatial dimension of the # dependent variables. # dim_num = 2 return dim_num def p03_dim_num ( ): #*****************************************************************************80 # ## P03_DIM_NUM returns the spatial dimension for problem p03. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 28 June 2015 # # Author: # # John Burkardt # # Parameters: # # Output, integer DIM_NUM, the spatial dimension of the # dependent variables. # dim_num = 2 return dim_num def p04_dim_num ( ): #*****************************************************************************80 # ## P04_DIM_NUM returns the spatial dimension for problem p04. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 28 June 2015 # # Author: # # John Burkardt # # Parameters: # # Output, integer DIM_NUM, the spatial dimension of the # dependent variables. # dim_num = 2 return dim_num def p05_dim_num ( ): #*****************************************************************************80 # ## P05_DIM_NUM returns the spatial dimension for problem p05. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 28 June 2015 # # Author: # # John Burkardt # # Parameters: # # Output, integer DIM_NUM, the spatial dimension of the # dependent variables. # dim_num = 2 return dim_num def p06_dim_num ( ): #*****************************************************************************80 # ## P06_DIM_NUM returns the spatial dimension for problem p06. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 28 June 2015 # # Author: # # John Burkardt # # Parameters: # # Output, integer DIM_NUM, the spatial dimension of the # dependent variables. # dim_num = 2 return dim_num def p07_dim_num ( ): #*****************************************************************************80 # ## P07_DIM_NUM returns the spatial dimension for problem p07. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 28 June 2015 # # Author: # # John Burkardt # # Parameters: # # Output, integer DIM_NUM, the spatial dimension of the # dependent variables. # dim_num = 2 return dim_num def p08_dim_num ( ): #*****************************************************************************80 # ## P08_DIM_NUM returns the spatial dimension for problem p08. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 28 June 2015 # # Author: # # John Burkardt # # Parameters: # # Output, integer DIM_NUM, the spatial dimension of the # dependent variables. # dim_num = 2 return dim_num def p00_dim_num_test ( ): #*****************************************************************************80 # ## P00_DIM_NUM_TEST tests P00_DIM_NUM. # # Licensing: # # This code is distributed under the GNU LGPL license. # # Modified: # # 28 June 2015 # # Author: # # John Burkardt # import platform from p00_prob_num import p00_prob_num print ( '' ) print ( 'P00_DIM_NUM_TEST' ) print ( ' Python version: %s' % ( platform.python_version ( ) ) ) print ( ' P00_DIM_NUM returns the spatial dimension for any problem.' ) print ( '' ) print ( ' Problem Dimension' ) print ( '' ) prob_num = p00_prob_num ( ) for prob in range ( 1, prob_num + 1 ): dim_num = p00_dim_num ( prob ) print ( ' %7d %9d' % ( prob, dim_num ) ) # # Terminate. # print ( '' ) print ( 'P00_DIM_NUM_TEST:' ) print ( ' Normal end of execution.' ) return if ( __name__ == '__main__' ): from timestamp import timestamp timestamp ( ) p00_dim_num_test ( ) timestamp ( )