Page 387 - TransAT_Tutorial_Manual
P. 387
TransAT Tutorial Manual 9.2. Forced Convection in an Isothermal Pipe
streamwise output.cxx function structure The streamwise output function can be split
into 3 distinct parts
• Part 1: header inclusions and variable declarations
• Part 2: computation
• Part 3: data gathering and writing
Part 1 is the preamble where all the classes and variables used in the function are imported and
declared. In Part 2, the bulk temperature and the Nusselt number are computed on each block
on each processor. In Part 3, the data from each processor is grouped and sorted on one processor
then written to a file.
Part 1: header inclusions and variable declarations The inclusion of headers allow-
ing access to parallel computing function (mpi.h header file), TransAT data (cppinterface.h header
file) and to the TransAT toolbox for parallel post-processing (toolbox.h header file) in the stream-
wise output function is necessary in this case
#include "mpi.h"
#include"cppinterface.h"
#include <toolbox.h>
The parallel toolbox contains functions that allow gathering and sorting the data from all the
processors and writing it to a file. It takes pointers to vectors as arguments. Hence, the bulk
temperature and the Nusselt number are stored using the following pointers:
// Pointers to vectors storing data on each processor
std::vector <double>* x_local = new std::vector <double> ();
std::vector <double>* Nu_local = new std::vector <double> ();
std::vector <double>* Tbulk_local = new std::vector <double> ();
// Pointers to vectors storing gathered data
std::vector <double>* x_global;
std::vector <double>* Nu_global;
std::vector <double>* Tbulk_global;
More information can be found on the TransAT parallel toolbox in the Parallel Post-processing
section of the TransAT User Manual .
c
Ascomp AG Switzerland 377 Version 5.7

