IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
BConds.hpp
Go to the documentation of this file.
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//
6namespace ippl {
7 template <typename Field, unsigned Dim>
8 void BConds<Field, Dim>::write(std::ostream& os) const {
9 os << "BConds: (" << std::endl;
10 const_iterator it = bc_m.begin();
11 for (; it != bc_m.end() - 1; ++it) {
12 (*it)->write(os);
13 os << "," << std::endl;
14 }
15 (*it)->write(os);
16 os << std::endl << ")";
17 }
18
19 template <typename Field, unsigned Dim>
21 for (auto& bc : bc_m) {
22 bc->findBCNeighbors(field);
23 }
24 Kokkos::fence();
25 field.getCommunicator().barrier();
26 }
27
28 template <typename Field, unsigned Dim>
30 for (auto& bc : bc_m) {
31 bc->apply(field);
32 }
33 Kokkos::fence();
34 field.getCommunicator().barrier();
35 }
36
37 template <typename Field, unsigned Dim>
39 for (auto& bc : bc_m) {
40 bc->assignGhostToPhysical(field);
41 }
42 Kokkos::fence();
43 field.getCommunicator().barrier();
44 }
45
46 template <typename Field, unsigned Dim>
48 for (const auto& bc : bc_m) {
49 if (bc->changesPhysicalCells()) {
50 return true;
51 }
52 }
53 return false;
54 }
55} // namespace ippl
Definition Archive.h:20
auto & getCommunicator() const
Definition BareField.h:131
bool changesPhysicalCells() const
Definition BConds.hpp:47
void findBCNeighbors(Field &field)
Definition BConds.hpp:20
virtual void write(std::ostream &) const
Definition BConds.hpp:8
void assignGhostToPhysical(Field &field)
Definition BConds.hpp:38
void apply(Field &field)
Definition BConds.hpp:29
container bc_m
Definition BConds.h:45
typename container::const_iterator const_iterator
Definition BConds.h:28