Commit 5529c63a authored by Pierre Aubert's avatar Pierre Aubert
Browse files

Same results without matrices copy

parent 7901258d
......@@ -20,7 +20,7 @@ OptionParser createOptionParser(){
parser.setExampleShortOption("naive_gray_scott -k 0.062 -f 0.03 -n 100 -r 1080 -c 1920 -o outputFile.hdf5");
float killRate(0.054f), feedRate(0.014f);
size_t nbImage(100lu), nbRow(1080lu), nbCol(1920lu);
size_t nbImage(100lu), nbRow(100lu), nbCol(200lu);
parser.addOption("killrate", "k", killRate, "rate of the process which converts V into P");
parser.addOption("feedrate", "f", feedRate, "rate of the process which feeds U and drains U, V and P");
parser.addOption("nbimage", "n", nbImage, "number of images to be created");
......@@ -106,28 +106,14 @@ bool simulateImage(size_t nbRow, size_t nbCol, size_t nbImage, size_t nbExtraSte
for(size_t i(0lu); i < nbImage; ++i){
progress.print();
for(size_t j(0lu); j < nbExtraStep; ++j){
float * matInputU = tmpU2;
float * matInputV = tmpV2;
float * matOutputU = tmpU1;
float * matOutputV = tmpV1;
// if(i%2lu == 0lu){
matInputU = tmpU1;
matInputV = tmpV1;
matOutputU = tmpU2;
matOutputV = tmpV2;
// }
naive_propagation(matOutputU, matOutputV, matInputU, matInputV, nbRow, nbCol,
naive_propagation(tmpU2, tmpV2, tmpU1, tmpV1, nbRow, nbCol,
matDeltaSquare, nbStencilRow, nbStencilCol,
diffudionRateU, diffusionRateV, feedRate, killRate, dt);
fullMat.setRow(i, matOutputV);
fullMat.setRow(i, tmpV2);
///Let's swap the pointer
// swapValue(tmpU1, tmpU2);
// swapValue(tmpV1, tmpV2);
tmpInU = tmpOutU;
tmpInV = tmpOutV;
swapValue(tmpU1, tmpU2);
swapValue(tmpV1, tmpV2);
}
}
progress.finish();
......
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