On 08/30/2016 03:21 PM, Ronghai Wu wrote:
在 2016年8月30日星期二 UTC+2上午11:39:11，Robert Cimrman写道：
On 08/29/2016 03:04 PM, Ronghai Wu wrote:
Thanks, and sorry for the delay feedback. It took me some time to learn
and the parallel examples work for me. However, since I couple sfepy
fipy, the fipy will automatically portioning mesh once running with mpi.
have to figure out a way to let subdomains be the same for sfepy and
You can replace the call to pl.partition_mesh() with a function that returns the fipy partitioning - it should return cell_tasks = an array containing a task (partition) number (starting from 0) for each element in the mesh.
Thanks for your suggestion. I tried several times and think it is better to pass the whole (global) mesh and values from fipy to sfepy, the let sfepy do its own partitioning, solve mechanical equlibrium equation, then pass the whole (global) stress and strain to fipy. But I have some questions about the parallel solving in sfepy: (1) In the interactive linear elasticity example , the residual will print out during solving, but not in the parallel example . In this case, how could we judge if the solution converges and if the precision is good enough?
You can pass any petsc options to the parallel examples. To see the convergence, pass
-snes_monitor -snes_converged_reason -ksp_monitor
- check the docstring of  for other useful options.
(2) In the interactive linear elasticity example , we can have access to the displacement, stress and strain arrays by
vec = pb.solve() strain = pb.evaluate('ev_cauchy_strain.2.Omega(u)', mode='el_avg') stress = pb.evaluate('ev_cauchy_stress.2.Omega(u)', mode='el_avg')
Can I get access to the whole (global) displacement, stress and strain arrays in parallel example?
Yes, after the call to pl.create_gather_to_zero() you have the whole solution vector in the task 0 (sol = psol_full[...].copy()....). Then you can evaluate global strain and stress as usual.
 http://sfepy.org/doc/tutorial.html#interactive-example-linear-elasticity  http://sfepy.org/doc-devel/examples/multi_physics/biot_parallel_interactive....