Branch data Line data Source code
1 : : // Class BConds
2 : : // This is the container class for the field BCs.
3 : : // It calls the findBCNeighbors and apply in the
4 : : // respective BC classes to apply field BCs
5 : : //
6 : : namespace ippl {
7 : : template <typename Field, unsigned Dim>
8 : 0 : void BConds<Field, Dim>::write(std::ostream& os) const {
9 : 0 : os << "BConds: (" << std::endl;
10 : 0 : const_iterator it = bc_m.begin();
11 [ # # ]: 0 : for (; it != bc_m.end() - 1; ++it) {
12 : 0 : (*it)->write(os);
13 : 0 : os << "," << std::endl;
14 : : }
15 : 0 : (*it)->write(os);
16 : 0 : os << std::endl << ")";
17 : 0 : }
18 : :
19 : : template <typename Field, unsigned Dim>
20 : 192 : void BConds<Field, Dim>::findBCNeighbors(Field& field) {
21 [ + + ]: 1536 : for (auto& bc : bc_m) {
22 : 1344 : bc->findBCNeighbors(field);
23 : : }
24 [ + - + - ]: 192 : Kokkos::fence();
25 : 192 : field.getCommunicator().barrier();
26 : 192 : }
27 : :
28 : : template <typename Field, unsigned Dim>
29 : 146 : void BConds<Field, Dim>::apply(Field& field) {
30 [ + + ]: 1166 : for (auto& bc : bc_m) {
31 : 1020 : bc->apply(field);
32 : : }
33 [ + - + - ]: 146 : Kokkos::fence();
34 : 146 : field.getCommunicator().barrier();
35 : 146 : }
36 : :
37 : : template <typename Field, unsigned Dim>
38 : : bool BConds<Field, Dim>::changesPhysicalCells() const {
39 : : for (const auto& bc : bc_m) {
40 : : if (bc->changesPhysicalCells()) {
41 : : return true;
42 : : }
43 : : }
44 : : return false;
45 : : }
46 : : } // namespace ippl
|