Trying to fix segfault in WriteBlobStates in tests/BlobAnalyzeParallel

This commit is contained in:
James E McClure 2015-06-05 07:35:55 -04:00
parent d75b8b5327
commit ca55d4d96c

View File

@ -38,7 +38,7 @@ inline void WriteBlobStates(TwoPhase TCAT, double D, double porosity){
pw = TCAT.paw_global; pw = TCAT.paw_global;
aws = TCAT.aws; aws = TCAT.aws;
// Compute the averages over the entire non-wetting phsae // Compute the averages over the entire non-wetting phsae
for (a=0; a<(int)TCAT.BlobAverages.size(1); a++){ for (a=0; a<TCAT.nblobs_global; a++){
vol_n += TCAT.BlobAverages(0,a); vol_n += TCAT.BlobAverages(0,a);
pan += TCAT.BlobAverages(2,a)*TCAT.BlobAverages(0,a); pan += TCAT.BlobAverages(2,a)*TCAT.BlobAverages(0,a);
awn += TCAT.BlobAverages(3,a); awn += TCAT.BlobAverages(3,a);
@ -54,7 +54,7 @@ inline void WriteBlobStates(TwoPhase TCAT, double D, double porosity){
// Compute the pore voume (sum of wetting an non-wetting phase volumes) // Compute the pore voume (sum of wetting an non-wetting phase volumes)
PoreVolume=TCAT.wp_volume_global + nwp_volume; PoreVolume=TCAT.wp_volume_global + nwp_volume;
// Subtract off portions of non-wetting phase in order of size // Subtract off portions of non-wetting phase in order of size
for (a=TCAT.BlobAverages.size(1)-1; a>0; a--){ for (a=TCAT.nblobs_global-1; a>0; a--){
// Subtract the features one-by-one // Subtract the features one-by-one
vol_n -= TCAT.BlobAverages(0,a); vol_n -= TCAT.BlobAverages(0,a);
pan -= TCAT.BlobAverages(2,a)*TCAT.BlobAverages(0,a); pan -= TCAT.BlobAverages(2,a)*TCAT.BlobAverages(0,a);