Seyed,

after having just a quick glance over your approach there seem to be some 
more issues you can easily stumble upon:
- n_vertices() only gives you the number of vertices for one process, not 
the global one. In particular, you can't rely on the fact that this is the 
same for all processes. Furthermore, you (probably) don't initialize all 
the values of your struct. This might be the reason for the large numbers 
you are observing.
- You seem to rely on a specific numbering of the degrees of freedom in 
FEValues. In particular, you are assuming that you have only nodal values 
at the cell vertices. This can only be true for Q1 elements. Furthermore, 
you rely on the fact that after a local dof for the x-component, a local 
dof for the y-component is stored. This is an unsafe assumption. The proper 
way of doing this is to use an appropriate Quadrature object that is 
initialized with support points at the points you are interested in. Have a 
look at the FAQ [1,2].
- You seem to first calculate the maximum for each vertex across all the 
processes and after that the maximum over all vertices. It would probably 
be easier to first find the maximum value and location on each process and 
after that just compare this one value across all the processes. This would 
probably also avoid your problems with large numbers.

Else I can just agree with Wolfgang, learning how to debug is a crucial 
point if you ever want to build working software.

Best,
Daniel

[1] 
https://github.com/dealii/dealii/wiki/Frequently-Asked-Questions#how-do-i-access-values-of-discontinuous-elements-at-vertices
 

[2] 
https://github.com/dealii/dealii/wiki/Frequently-Asked-Questions#how-to-get-the-mapped-position-of-support-points-of-my-element

Am Dienstag, 7. März 2017 16:55:47 UTC+1 schrieb Seyed Ali Mohseni:
>
> Dear all,
>
> With MPI_Allreduce it works like a charm. Thank you very much everyone.
>
> Especially Prof. Bangerth and Daniel.
>
> Kind regards,
> S. A. Mohseni
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to