ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
CylindricalLBVelocityProfile.cpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2016-2022 The ESPResSo project
3 *
4 * This file is part of ESPResSo.
5 *
6 * ESPResSo is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * ESPResSo is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
21
22#include "system/System.hpp"
23#include "utils_histogram.hpp"
24
25#include <utils/Histogram.hpp>
27
28#include <vector>
29
30namespace Observables {
31
33 boost::mpi::communicator const &comm) const {
34 auto &system = System::get_system();
35 auto &lb = system.lb;
36 lb.ghost_communication_vel();
37
38 if (lb_sanity_checks.mismatch(*system.box_geo, lb)) {
40 }
41
42 auto velocities = lb.get_coupling_interpolated_velocities(sampling_positions);
44 std::vector<Utils::Vector3d> local_velocities{};
45 local_velocities.reserve(velocities.size());
46
47 for (auto const &vel : velocities) {
49 vel, transform_params->axis(), *pos_shifted_it);
50 local_velocities.emplace_back(vel_cyl);
52 }
53
55 detail::gather(comm, sampling_positions_cyl, local_velocities);
56
57 if (comm.rank() != 0) {
58 return {};
59 }
60
62 detail::accumulate(histogram, global_positions, global_velocities);
63 return detail::normalize_by_bin_size(histogram);
64}
65
66} // namespace Observables
void calculate_sampling_positions(auto const &box_geo, auto const &lb) const
std::vector< double > operator()(boost::mpi::communicator const &comm) const override
std::shared_ptr< Utils::CylindricalTransformationParameters > transform_params
bool mismatch(BoxGeometry const &box_geo, LB::Solver const &solver) const
Histogram in cylindrical coordinates.
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
Convert coordinates from the Cartesian system to the cylindrical system.
System & get_system()
Vector3d transform_vector_cartesian_to_cylinder(Vector3d const &vec, Vector3d const &axis, Vector3d const &pos)
Vector transformation from Cartesian to cylindrical coordinates.