Correct Input Streams for parallel programming

Hi dear openLB - guys, I have another question:

In order to get my structures into the palabos lattice, I wrote my own code to import it.
My input files were simple textfiles with zeros and ones, which I stored into a simple 2d bool array.

As in the example cylinder2d.cpp I then overloaded the operator() from the DomanFunctionalxD like


virtual bool operator() (plint iX, plint iY, plint iZ) const {	// overloaded operator() from Mother Class DomainFunctional3D
    if (iX >= data->Get_cx0() and iX <= data->Get_cx1() and
      iY >= data->Get_cy0() and iY <= data->Get_cy1() and
      iZ >= data->Get_cz0() and iZ <= data->Get_cz1()) {
      return data->Get_array(iX-data->Get_cx0(), iY-data->Get_cy0(), iZ-data->Get_cz0());
	}
      else return false;

and then in the main programm the structure can be placed with


defineDynamics(lattice, lattice.getBoundingBox(),
		new Set3DStructure<T>(struct1, 10,10,10),
		new BounceBack<T,DESCRIPTOR>);

As you can see, the code is already for 3D, were I started doing the same.

I didn’t use the classes offered by Palabos to import structures, because I need to make some changes to them, which was much easier with the simple bool matrix (2D or 3D) than that scalarfield. Also, with this simple approach, I can place the structure (or several different structures) whereever I want inside the much bigger lattice,… the list goes on.

Now in 2D all was fine - since the lattice was small and worked fine on a single machine, but for 3D I need full parallel-capability of my code - and that import part isn’t.

I’ve read about the Input streams and wondered how to correctly apply this for the 3D bool matrix.

Is it enough to read the textfile line by line, copy everything into the matrix and when it is done, use the broadcast - command ?
Because the example suggests that every single variable is broadcasted before used, therefore every value which is read (every single 0 or 1 ??) has to be broadcasted before it is stored into the matrix ?