IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
BConds.h
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//
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);
36
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:
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
constexpr unsigned Dim
Definition Archive.h:20
std::ostream & operator<<(std::ostream &os, const BConds< Field, Dim > &bc)
Definition BConds.h:49
bool changesPhysicalCells() const
Definition BConds.hpp:47
void findBCNeighbors(Field &field)
Definition BConds.hpp:20
detail::BCondBase< Field > bc_type
Definition BConds.h:25
virtual void write(std::ostream &) const
Definition BConds.hpp:8
~BConds()=default
void assignGhostToPhysical(Field &field)
Definition BConds.hpp:38
BConds()=default
void apply(Field &field)
Definition BConds.hpp:29
std::array< std::shared_ptr< bc_type >, 2 *Dim > container
Definition BConds.h:26
std::shared_ptr< bc_type > & operator[](const int &i) noexcept
Definition BConds.h:42
const std::shared_ptr< bc_type > & operator[](const int &i) const noexcept
Definition BConds.h:40
typename container::const_iterator const_iterator
Definition BConds.h:28
typename container::iterator iterator
Definition BConds.h:27