Anna,
to compute values of the electric field at the receivers I follow the strategy
of ASPECT code as you suggested
To do this I sum the current_point_values across processors and divide by the
number of processors that contain point p as following
// Reduce all collected values into local Vector
Utilities::MPI::sum(current_point_values[p], mpi_communicator,
current_point_values[p]);
// Normalize in cases where points are claimed by multiple processors
if (n_procs > 1)
current_point_values[p] /= n_procs;
Now to compute magnetic field I need to do similar things but with
current_point_gradients[p], which are std::vector<Tensor<1, dim> >(dim + dim).
Unfortunately, Utilities::MPI::sum does not exist for such type.
Could you please advice me what is the best way to do this for the gradients?
You could either write a function like Utilities::MPI::sum for vector<Tensor>,
seeing how this is done for vector<double>. Or you could just put all of the
dim*N components of the N tensors in your vector<Tensor> into a
vector<double>, call MPI::sum(), and then put things back into the
vector<Tensor>. The latter is probably the simpler approach.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email: bange...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/
--
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.