I have some "print" statements. How do I execute them only on one process, say the one with rank 0 ?
I am modifying a Function like this
up1.vector()[:] += 0.01 * uppert.vector().array()
This gives error in parallel
RuntimeError: index must belong to this process, cannot index
off-process entries in a GenericVector
How can I make this correct for parallel computations ?
I read initial conditions from a file
ups = Function(self.X)
File("steady.xml") >> ups.vector()
Will this work correctly in parallel if steady.xml was generated by a serial run ?