int inputs::input_reader ( char *  input_file_name )

The function that reads in the input file.

Function that reads the input file.

Parameters:
input_file_name: Name of input file to be read.
Author:
Rochan R. Upadhyay
Parameters:
input_file_name: Name of the input file
Date:
10/12/2010
Author:
Rochan R. Upadhyay
Parameters:
input_file_name: Name of the input file
Date:
05/19/2011

Function header. Note that this function is a member of the inputs class. Therefore the scope inputs:: must be used. The function is called with the name of the input file that is to be read.

 int inputs::input_reader(char* input_file_name)
{ 

Initialize the GetPot object ifile with the input file to be read. Return an error message if file does not exist.

 GetPot ifile(input_file_name);       
        if(ifile.size() <= 1){
 printf("non-existent or empty file\n");
 return 0;} 

Read in variables pi and kb. According to GetPOt format, the name of the variable that appears in the file is enclosed within " ", a default for the value of the parameter is also entered.

 pi = ifile("pi", 3.14159265);
 kb = ifile("kb", 1.38e-23); 

Read in other variables. Note that in the input file they come under the section [Solver_parameters]. Therefore while reading we use ifile("Solver_parameters/time_step",). Note that the variable dt is called time_step in the input file and hence that name is used within " ". It is possible to asssign different names in this file and the input file. Usually more descriptive names are preferred in the input file.

 dt = ifile("Solver_parameters/time_step", 0.);
 num_steps = ifile("Solver_parameters/num_steps", 0);
 verbose_mode = ifile("Solver_parameters/verbose_mode", 0);
 print_interval = ifile("Solver_parameters/print_interval", 0);
 mu_g = ifile("Solver_parameters/log_geometric_mean",0.);
 std_g = ifile("Solver_parameters/standard_dev",0.); 

Read in additional variables that appear in the input file in the section [Model_Parameters]

 rho = ifile("Model_Parameters/density",0.0);
 dia = ifile("Model_Parameters/monomer_diameter",0.0);
 visc = ifile("Model_Parameters/viscosity",0.0);
 Tgas = ifile("Model_Parameters/Tgas",0.0);
 init_num = ifile("Model_Parameters/init_number",0.0); 

 All Classes Files Functions Variables Typedefs Friends Defines