setToConstant Problem

Hi guys,

 I am using the "particle" package inside Palabos to do LB simulation. Since the visualization part of Palabos is not completed, and my visualization task is not quite hard, I decided to do it on my own. My strategy is simple: create a box which contained the particles and give a certain value of that box and write it for the VTK output.

 At first let me give a short description of my case: the particles are generated randomly in the inlet domain, and then move with the fluid. (Actually my code is based on particlesInTube, so the particle generation part is exactly the same)

 For visualization part, what I did is the following:
    // in a for loop              
    [i]for(unsigned i=0;i<posVect.size();++i){	// posVect is a vector of Array<T,3>, which contains all particle positions  	 
buff = posVect.at(i);
// step 1: create Box named "particle_domain" around each particle	
particle_domain.x0 = (int)floor(buff[0]);
particle_domain.x1 = (int)ceil(buff[0]);
particle_domain.y0 = (int)floor(buff[1]);
particle_domain.y1 = (int)ceil(buff[1]);
particle_domain.z0 = (int)floor(buff[2]);
particle_domain.z1 = (int)ceil(buff[2]);

// step 2: set a constant value of the particle_domain for VTKvisualization 
setToConstant(field, particle_domain, value); // may be here is the problem
}[/i]

    I know that Palabos is not in favor of writing "space-for loop" in the end-usr applications, so I did it by means of functional (inherited from BoxProcessingFunctional3D_S, because in the end, for VTK output, the particle position should be a Multi-ScalarField) and use "applyProcessingFunctional" to act like a function. 

    [To be honest, since I got the wrong results, I just put all the codes to the main function and to see what is going on, unfortunately, I got the same wrong results as using functional.]

    [b]The problem is[/b] : when I did parallel running, I can only visualize part of the particles not all of them. Results are stated as follows:
           [center]Number of Processors                        Particles show in Paraview
                          1                                                                ALL (good results)
                          2                                                                ALL
                          3                                                                ALL
                          4                                                                1/2 (only the right half of all the particles)
                          6                                                                1/2 (the same results as 4 processors)
                          8                                                                1/4 (only the lower-right quarter of all the particles)[/center]

   By the way, the CPU platform is Intel Xeon E5345 @2.33GHz with 8 threads.

   I do not know if I did something wrong here, but the parallel run with more than 4 processors seems to be not corrected when it comes to VTK visualization. 

   Anybody can help me at this point? I'd really appreciate it!

   Many thanks in advance!

2012.1.25