IPPL API Reference
Independent Parallel Particle Layer C++ API
Loading...
Searching...
No Matches
BConds.h
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#ifndef IPPL_FIELD_BC_H
7#define IPPL_FIELD_BC_H
8
9#include <array>
10#include <iostream>
11#include <memory>
12
13#include "Field/BcTypes.h"
14
15namespace ippl {
22 template <typename Field, unsigned Dim>
23 class BConds {
24 public:
26 using container = std::array<std::shared_ptr<bc_type>, 2 * Dim>;
27 using iterator = typename container::iterator;
28 using const_iterator = typename container::const_iterator;
29
30 BConds() = default;
31 ~BConds() = default;
32
33 void findBCNeighbors(Field& field);
34 void apply(Field& field);
35 void assignGhostToPhysical(Field& field);
36
37 bool changesPhysicalCells() const;
38 virtual void write(std::ostream&) const;
39
40 const std::shared_ptr<bc_type>& operator[](const int& i) const noexcept { return bc_m[i]; }
41
42 std::shared_ptr<bc_type>& operator[](const int& i) noexcept { return bc_m[i]; }
43
44 private:
45 container bc_m;
46 };
47
48 template <typename Field, unsigned Dim>
49 inline std::ostream& operator<<(std::ostream& os, const BConds<Field, Dim>& bc) {
50 bc.write(os);
51 return os;
52 }
53} // namespace ippl
54
55#include "Field/BConds.hpp"
56
57#endif
Definition BConds.h:23
Definition Field.h:18
Definition BcTypes.h:43
Definition Archive.h:20