WarpX
Toggle main menu visibility
Loading...
Searching...
No Matches
Source
Particles
Resampling
ResamplingTrigger.H
Go to the documentation of this file.
1
/* Copyright 2019-2020 Neil Zaim
2
*
3
* This file is part of WarpX.
4
*
5
* License: BSD-3-Clause-LBNL
6
*/
7
#ifndef WARPX_RESAMPLING_TRIGGER_H_
8
#define WARPX_RESAMPLING_TRIGGER_H_
9
10
#include <
ablastr/utils/text/IntervalsParser.H
>
11
12
#include <
AMReX_REAL.H
>
13
14
#include <limits>
15
#include <string>
16
23
class
ResamplingTrigger
24
{
25
public
:
26
30
ResamplingTrigger
() =
default
;
31
36
explicit
ResamplingTrigger
(
const
std::string& species_name);
37
45
bool
triggered
(
int
timestep,
amrex::Real
global_numparts)
const
;
46
52
void
initialize_global_numcells
()
const
;
53
54
private
:
55
// Intervals that define predetermined timesteps at which resampling is performed for all
56
// species.
57
ablastr::utils::text::IntervalsParser
m_resampling_intervals
;
58
59
// Average number of particles per cell above which resampling is performed for a given species
60
amrex::Real
m_max_avg_ppc
= std::numeric_limits<amrex::Real>::max();
61
62
//Total number of simulated cells, summed over all mesh refinement levels.
63
mutable
amrex::Real
m_global_numcells
=
amrex::Real
(0.0);
64
65
mutable
bool
m_initialized
=
false
;
66
};
67
68
#endif
//WARPX_RESAMPLING_TRIGGER_H_
AMReX_REAL.H
IntervalsParser.H
ResamplingTrigger::m_resampling_intervals
ablastr::utils::text::IntervalsParser m_resampling_intervals
Definition
ResamplingTrigger.H:57
ResamplingTrigger::m_max_avg_ppc
amrex::Real m_max_avg_ppc
Definition
ResamplingTrigger.H:60
ResamplingTrigger::triggered
bool triggered(int timestep, amrex::Real global_numparts) const
A method that returns true if resampling should be done for the considered species at the considered ...
Definition
ResamplingTrigger.cpp:30
ResamplingTrigger::ResamplingTrigger
ResamplingTrigger()=default
Default constructor of the ResamplingTrigger class.
ResamplingTrigger::m_initialized
bool m_initialized
Definition
ResamplingTrigger.H:65
ResamplingTrigger::initialize_global_numcells
void initialize_global_numcells() const
A method that initializes the member m_global_numcells. It is only called once (the first time trigge...
Definition
ResamplingTrigger.cpp:39
ResamplingTrigger::m_global_numcells
amrex::Real m_global_numcells
Definition
ResamplingTrigger.H:63
ablastr::utils::text::IntervalsParser
This class is a parser for multiple slices of the form x,y,z,... where x, y and z are slices of the f...
Definition
IntervalsParser.H:105
amrex::Real
amrex_real Real
Generated by
1.17.0