void user_post_process ( double  time,
size_t  dimension,
size_t  num_points,
double  y[] 
)

Function that post processes the moments to obtain final quantities of interest.

! Function where the user enters computes quantities of interest from the solution.

External function to compute user defined post processor routines.

Author:
Rochan R. Upadhyay
Parameters:
time: Time during simulation
y: C style vector that contains quadrature points and weights. Contains the moments if called with moments.

In this example the moments equations are solved and this function is called by passing the quadrature points at a particular time. The quantities of interest in this example are the first four moments. Therefore there is a step where the quadrature weights-points are converted to moments.

Date:
10/12/2010

Open a file called output.txt

 FILE *fp;       
       fp = fopen("output.txt", "a");
       if(fp == NULL) {
       perror("failed to open output.txt");
       return;
       } 

Print to stdout. Note that the vectors in this example contain the moments in the order [ M_0,...,M_{2*num_points-1}]. The moments are printed out.

Print to first six moments stdout if verbose mode is chosen.

 if(verbose_mode == 1){
 printf("%.5e %10.5e %10.5e %10.5e %10.5e,%10.5e %10.5e \n",  
         time, y[0],y[1],y[2],y[3],y[4],y[5]);} 

Print to the same to file output.txt. Note that new lines are added to this file as time progresses. This also means that before a new simulation is started, the file output.txt must be deleted. Otherwise new lines are added at the bottom of the existing file.

 fprintf(fp,"%.5e %10.5e %10.5e %10.5e %10.5e %10.5e %10.5e \n",  
                time, y[0],y[1],y[2],y[3],y[4],y[5]);

fclose(fp);

Return control to the calling routines.

 return;    
 } 

All Classes Files Functions Variables Typedefs Friends Defines