WarpX
Toggle main menu visibility
Loading...
Searching...
No Matches
Source
Particles
ParticleBoundaryBuffer.H
Go to the documentation of this file.
1
/* Copyright 2021 Andrew Myers
2
*
3
* This file is part of WarpX.
4
*
5
* License: BSD-3-Clause-LBNL
6
*/
7
#ifndef WARPX_PARTICLEBOUNDARYBUFFER_H_
8
#define WARPX_PARTICLEBOUNDARYBUFFER_H_
9
10
#include "
Particles/MultiParticleContainer_fwd.H
"
11
#include "
Particles/WarpXParticleContainer.H
"
12
#include "Utils/export.H"
13
14
#include <
ablastr/fields/MultiFabRegister.H
>
15
16
#include <vector>
17
18
22
class
WARPX_EXPORT
ParticleBoundaryBuffer
23
{
24
public
:
25
ParticleBoundaryBuffer
();
26
27
~ParticleBoundaryBuffer
() =
default
;
28
30
ParticleBoundaryBuffer
(
const
ParticleBoundaryBuffer
&) =
delete
;
32
ParticleBoundaryBuffer
& operator= (
const
ParticleBoundaryBuffer
& ) =
delete
;
33
35
ParticleBoundaryBuffer
(
ParticleBoundaryBuffer
&& ) =
default
;
37
ParticleBoundaryBuffer
& operator= (
ParticleBoundaryBuffer
&& ) =
default
;
38
39
int
numSpecies
()
const
{
return
static_cast<
int
>
(
getSpeciesNames
().size()); }
40
41
const
std::vector<std::string>& getSpeciesNames()
const
;
42
43
void
gatherParticlesFromDomainBoundaries (
MultiParticleContainer
& mypc,
amrex::Real
cur_time);
44
void
gatherParticlesFromEmbeddedBoundaries (
45
MultiParticleContainer
& mypc,
ablastr::fields::MultiLevelScalarField
const
& distance_to_eb,
46
amrex::Real
cur_time
47
);
48
49
void
redistribute ();
50
void
clearParticles ();
51
void
clearParticles (
int
i);
52
53
void
printNumParticles ()
const
;
54
55
int
getNumParticlesInContainer(
const
std::string& species_name,
int
boundary,
bool
local);
56
57
WarpXParticleContainer::Base
& getParticleBuffer(
const
std::string& species_name,
int
boundary);
58
59
WarpXParticleContainer::Base
* getParticleBufferPointer(
const
std::string& species_name,
int
boundary);
60
61
static
constexpr
int
numBoundaries
() {
62
return
AMREX_SPACEDIM*2
63
#ifdef AMREX_USE_EB
64
+ 1
65
#endif
66
;
67
}
68
69
bool
isDefinedForAnySpecies
(
int
const
ibuffer) {
return
(
m_do_any_boundary
[ibuffer] != 0);}
70
71
std::string
boundaryName
(
int
const
ibuffer) {
return
m_boundary_names
[ibuffer];}
72
73
private
:
74
// over boundary, then number of species
75
std::vector<std::vector<WarpXParticleContainer::Base> >
m_particle_containers
;
76
77
// over boundary, then number of species
78
std::vector<std::vector<int> >
m_do_boundary_buffer
;
79
80
// over boundary
81
std::vector<int>
m_do_any_boundary
;
82
std::vector<std::string>
m_boundary_names
;
83
84
mutable
std::vector<std::string>
m_species_names
;
85
};
86
87
#endif
/*WARPX_PARTICLEBOUNDARYBUFFER_H_*/
MultiFabRegister.H
MultiParticleContainer_fwd.H
WarpXParticleContainer.H
MultiParticleContainer
Definition
MultiParticleContainer.H:69
ParticleBoundaryBuffer::boundaryName
std::string boundaryName(int const ibuffer)
Definition
ParticleBoundaryBuffer.H:71
ParticleBoundaryBuffer::numSpecies
int numSpecies() const
Definition
ParticleBoundaryBuffer.H:39
ParticleBoundaryBuffer::getSpeciesNames
const std::vector< std::string > & getSpeciesNames() const
Definition
ParticleBoundaryBuffer.cpp:364
ParticleBoundaryBuffer::ParticleBoundaryBuffer
ParticleBoundaryBuffer()
Definition
ParticleBoundaryBuffer.cpp:231
ParticleBoundaryBuffer::~ParticleBoundaryBuffer
~ParticleBoundaryBuffer()=default
ParticleBoundaryBuffer::m_species_names
std::vector< std::string > m_species_names
Definition
ParticleBoundaryBuffer.H:84
ParticleBoundaryBuffer::ParticleBoundaryBuffer
ParticleBoundaryBuffer(const ParticleBoundaryBuffer &)=delete
ParticleBoundaryBuffer::m_particle_containers
std::vector< std::vector< WarpXParticleContainer::Base > > m_particle_containers
Definition
ParticleBoundaryBuffer.H:75
ParticleBoundaryBuffer::isDefinedForAnySpecies
bool isDefinedForAnySpecies(int const ibuffer)
Definition
ParticleBoundaryBuffer.H:69
ParticleBoundaryBuffer::ParticleBoundaryBuffer
ParticleBoundaryBuffer(ParticleBoundaryBuffer &&)=default
ParticleBoundaryBuffer::m_do_any_boundary
std::vector< int > m_do_any_boundary
Definition
ParticleBoundaryBuffer.H:81
ParticleBoundaryBuffer::m_do_boundary_buffer
std::vector< std::vector< int > > m_do_boundary_buffer
Definition
ParticleBoundaryBuffer.H:78
ParticleBoundaryBuffer::numBoundaries
static constexpr int numBoundaries()
Definition
ParticleBoundaryBuffer.H:61
ParticleBoundaryBuffer::m_boundary_names
std::vector< std::string > m_boundary_names
Definition
ParticleBoundaryBuffer.H:82
WarpXParticleContainer::Base
amrex::ParticleContainerPureSoA< PIdx::nattribs, 0, amrex::PolymorphicArenaAllocator > Base
Definition
WarpXParticleContainer.H:199
amrex::Real
amrex_real Real
ablastr::fields::MultiLevelScalarField
amrex::Vector< ScalarField > MultiLevelScalarField
Definition
MultiFabRegister.H:210
Generated by
1.17.0