Commit 2bb697ff authored by Gaurav Saxena's avatar Gaurav Saxena
Browse files

Added parallel code for : initialization of solver, forward elimination and...

Added parallel code for : initialization of solver, forward elimination and backward substitution. Needs to be checked...this is just the first attempt at adding parallel code. DO NOT FORGET to comment out the sequential code for (1) forward elimination (2) backward substitution. The part of the code to be commented out is clearly marked with comments.
parent 4601f4e3
This diff is collapsed.
......@@ -93,6 +93,11 @@ void diffusion_decay_solver__constant_coefficients_explicit_uniform_mesh( Microe
return;
}
/*----------------------------------------------------------*/
/* WRITING PARALLEL VERSION OF THIS FUNCTION IN */
/* BioFVM_parallel.cpp */
/* DO NOT CHANGE THIS VERSION */
/*----------------------------------------------------------*/
void diffusion_decay_solver__constant_coefficients_LOD_3D( Microenvironment& M, double dt )
{
if( M.mesh.uniform_mesh == false || M.mesh.Cartesian_mesh == false )
......@@ -108,33 +113,30 @@ void diffusion_decay_solver__constant_coefficients_LOD_3D( Microenvironment& M,
std::cout << std::endl << "Using method " << __FUNCTION__ << " (implicit 3-D LOD with Thomas Algorithm) ... "
<< std::endl << std::endl;
/*-------------------------------------------------------------*/
/* This part changes in parallelization as x_coordinates */
/* are of size of local_x_nodes. Each line of Voxels going */
/* x_coordinates */
/* are of size local_x_nodes (see function resize() */
/* of class Cartesian Mesh in BioFVM_parallel.cpp. */
/* Each line of Voxels going */
/* from left to right forms a tridiagonal system of Equations */
/* Why do we declare just two arrays ? Why not 2 arrays for */
/* every x-line ? */
/*-------------------------------------------------------------*/
M.thomas_denomx.resize( M.mesh.x_coordinates.size() , M.zero ); //sizeof(x_coordinates) = local_x_nodes, denomx is the main diagonal elements
M.thomas_cx.resize( M.mesh.x_coordinates.size() , M.zero ); //Both b and c of tridiagonal matrix are equal, hence just one array needed (maybe)
M.thomas_cx.resize( M.mesh.x_coordinates.size() , M.zero ); //Both b and c of tridiagonal matrix are equal, hence just one array needed
/*-------------------------------------------------------------*/
/* This part changes in parallelization as y_coordinates */
/* are of size of local_y_nodes. Each line of Voxels going */
/* y_coordinates are of size of local_y_nodes. */
/* Each line of Voxels going */
/* from bottom to top forms a tridiagonal system of Equations */
/* Why do we declare just two arrays ? Why not 2 arrays for */
/* every y-line ? */
/*-------------------------------------------------------------*/
M.thomas_denomy.resize( M.mesh.y_coordinates.size() , M.zero );
M.thomas_cy.resize( M.mesh.y_coordinates.size() , M.zero );
/*-------------------------------------------------------------*/
/* This part changes in parallelization as z_coordinates */
/* are of size of local_z_nodes. Each line of Voxels going */
/* z_coordinates are of size of local_z_nodes. */
/* Each line of Voxels going */
/* from front to back forms a tridiagonal system of Equations */
/* Why do we declare just two arrays ? Why not 2 arrays for */
/* every z-line ? Also in 1-D Z decomposition, these lines */
/* In 1-D Z decomposition, these lines */
/* are going to be split over multiple processes. */
/*-------------------------------------------------------------*/
......@@ -275,7 +277,9 @@ void diffusion_decay_solver__constant_coefficients_LOD_3D( Microenvironment& M,
/* begin at i=1 but for other processes, calculation will begin at */
/* i=0 AND we need to pass the value of last thomas_cz[i-1] in */
/* in every process to next process. */
/* I think this will just be a single double value. */
/* I think this will just be a single double value - NO */
/* thomas_cz[i] is a vector in itself, so we will need to send */
/* thomas_cz[i][0] to thomas_cz[i].size()-1 to receiver */
/*-------------------------------------------------------------------*/
for( int i=1 ; i <= M.mesh.z_coordinates.size()-1 ; i++ )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment