Charcoal/Code Architecture

ParticleDisperser (PD)
This class embodies the two functions (Q and X) from

"Quantifying the source area of macroscopic charcoal wtih a particle dispersal model" Matthew Edwards Peters, Philip Edward Higuera Science Direct Quaternary Research 67 (2007)pp 304-310

as well as all of the necessary variables that go along with the functions. The class also contains a vector of vectors that is used to store the calculated concentrations, as well as the helper functions necessary to calculate the concentrations.

Important functions included in this class are:

MakeConcentrations: this function initialized the vector of vectors which contain the calculated concentrations and then calculates the concentrations across the range x=0 to x=XRange, and y=-YRange to y=YRange.

Kai: calculates the concentration of charcoal at point (x,y), where x and y are state variables

Q: a helper function for Kai

XI: calculates xi, which is used for the starting value of an integral, and other internal uses

ParticleDispersManager (PDM)
This class creates the appropriate number of ParticleDispersers to handle the data set(s) in a given file, and uses these to produce the data across a x and y range given in the data set file.

Important functions included in this class are:

ManageHead: for managing the head node and its communication with non head noded

ManageNonHead: for managing the non head nodes and their communication with the head node.

CreatConcentrations(int index): calls MakeConcentrations(int index) function of the PD identified by index

WriteDataToFile: delegates the writing of data to other functions which write the data in specific formats.

RunTrapazoid: runs the code from the example Trapazoid.C (which can be found on this wiki at Trapezoid_Tutorial) More specifically, the function will approximate segments of the integral and store these segments to be assembled later.

WaitForData: has slightly different effects depending on if it is called on the head node or a non head node, but essentially this function calls MPI_recv and then acts on the information recieved.

SendData: on a non head node, this function notifies the head node that it is done and can calculate something more. On the head node, the index of the next data set to be calculated is sent to a node.