Hello, I am trying to implement a parallel normalization function. Right now I have something like this:

*rc, zc = mesh.cellCenters**
**dv = 2.0*pi*rc*dr*dz # cylindrical mesh**
**
**
**def normalize(rho):**
**    factor = 1.0 / ((rho*dv).globalValue).sum()**
****
**    for i in range(rho.shape[0]):**
**        rho[i] = rho[i]*factor*

Is there an efficient way I can do this where I don't need to reference the individual cells (and all the associated MPI communication for each node)? Can the summations for the normalizing factor be on each node then collected? I am very new to parallel FiPy and would love any feedback.

Thanks,
-Mike Waters





_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to