79{
80 const std::size_t local_size = data.size();
81 std::vector<std::size_t> local_sizes = {local_size};
82 if (is_distributed)
84 const std::size_t
count = std::accumulate(local_sizes.begin(), local_sizes.end(), 0);
86
87
88 std::vector<OutType> theta_i(local_size);
89
90
91 for (processor_id_type r = 0; r < local_sizes.size(); ++r)
92 for (std::size_t i = 0; i < local_sizes[r]; ++i)
93 {
94 this->
_calc.initializeCalculator();
95 for (std::size_t il = 0; il < local_size; ++il)
96 if (i != il || r != rank)
97 this->
_calc.updateCalculator(data[il]);
98 this->
_calc.finalizeCalculator(is_distributed);
99 if (r == rank)
100 theta_i[i] = this->
_calc.getValue();
101 }
102
103
104 OutType theta_dot = std::accumulate(theta_i.begin(), theta_i.end(), OutType());
105 if (is_distributed)
108
109
110 std::vector<OutType> num_den(2);
111 for (const auto & jk : theta_i)
112 {
115 }
116 if (is_distributed)
118
119 mooseAssert(num_den[1] != OutType(), "The acceleration denomenator must not be zero.");
120 return num_den[0] / (6 * std::pow(num_den[1], 3. / 2.));
121}
void allgather(const T &send_data, std::vector< T, A > &recv_data) const
const Parallel::Communicator & _communicator
processor_id_type processor_id() const
uint8_t processor_id_type