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 200 : void BConds<Field, Dim>::findBCNeighbors(Field& field) {
21 1560 : for (auto& bc : bc_m) {
22 1360 : bc->findBCNeighbors(field);
23 : }
24 200 : Kokkos::fence();
25 200 : field.getCommunicator().barrier();
26 200 : }
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 0 : void BConds<Field, Dim>::assignGhostToPhysical(Field& field) {
39 0 : for (auto& bc : bc_m) {
40 0 : bc->assignGhostToPhysical(field);
41 : }
42 0 : Kokkos::fence();
43 0 : field.getCommunicator().barrier();
44 0 : }
45 :
46 : template <typename Field, unsigned Dim>
47 : bool BConds<Field, Dim>::changesPhysicalCells() const {
48 : for (const auto& bc : bc_m) {
49 : if (bc->changesPhysicalCells()) {
50 : return true;
51 : }
52 : }
53 : return false;
54 : }
55 : } // namespace ippl
|