void Communicator::receiveDiffusionFromNeighbor(int nrow, int ncol) { int nsi = siteIndexOf(nrow, ncol); if ( nsi != -1 ) { int nr = rankOfSite(nsi); if ( nr == parameters.rank() ) { // if the other site is on the same processor // it has already given it to us directly } #ifdef MPI else { if (parameters.outputMPIMessages) { site->node->outputcontroller->log( "receive diffusion from [%i][%i]\n", nr, nsi); } // will these come in the right order from the sites on node nr? const char *in_blip = receiveDiffusionBlip(nr); addDiffusion(in_blip, nr); } #endif //MPI } // end if not off the edge of the grid }
/*! This method adds the diffusion matrix times the coefficient (whose default value is 1.0) to the matrix passed in argument. @Remark The matrix is NOT finalized, you have to call globalAssemble outside this method when the matrix is finished. */ inline void addDiffusion (matrix_ptrType matrix, const Real& coefficient = 1.0) { addDiffusion (matrix, coefficient, 0, 0); }