aboutsummaryrefslogtreecommitdiff
path: root/Source/Utils/WarpXAlgorithmSelection.H
blob: bc8a653ab7c3f2b02c6630c5028073fb52f2afe3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/* Copyright 2019 David Grote, Luca Fedeli, Remi Lehe
 * Yinjian Zhao
 *
 * This file is part of WarpX.
 *
 * License: BSD-3-Clause-LBNL
 */
#ifndef UTILS_WARPXALGORITHMSELECTION_H_
#define UTILS_WARPXALGORITHMSELECTION_H_

#include <AMReX_ParmParse.H>
#include <string>

/**
  * \brief struct to determine the computational medium, i.e., vacuum or material/macroscopic
           default is vacuum.
  */
struct MediumForEM {
    enum {
        Vacuum = 0,
        Macroscopic = 1
    };
};

/**
  * \brief struct to select algorithm for macroscopic Maxwell solver
           LaxWendroff (semi-implicit) represents sigma*E = sigma*0.5*(E^(n) + E^(n+1))
           Backward Euler (fully-implicit) represents sigma*E = sigma*E^(n+1)
           default is Backward Euler as it is more robust.
  */
struct MacroscopicSolverAlgo {
    enum {
        BackwardEuler = 0,
        LaxWendroff = 1
    };
};

struct MaxwellSolverAlgo {
    enum {
        Yee = 0,
        CKC = 1,
        PSATD = 2
    };
};

struct ElectrostaticSolverAlgo {
    enum {
        None = 0,
        Relativistic = 1,
        LabFrame = 2
    };
};

struct ParticlePusherAlgo {
    enum {
        Boris = 0,
        Vay = 1,
        HigueraCary = 2
    };
};

struct CurrentDepositionAlgo {
    enum {
         Esirkepov = 0,
         Direct = 1,
         Vay = 2
    };
};

struct ChargeDepositionAlgo {
    // Only the Standard algorithm is implemented
    enum {
         Standard = 0
    };
};

struct GatheringAlgo {
    enum {
         EnergyConserving = 0,
         MomentumConserving
    };
};

/** Strategy to compute weights for use in load balance.
 */
struct LoadBalanceCostsUpdateAlgo {
    enum {
        Timers    = 0, //!< load balance according to in-code timer-based weights (i.e., with  `costs`)
        Heuristic = 1, /**< load balance according to weights computed from number of cells
                             and number of particles per box (i.e., with `costs_heuristic`)*/
        GpuClock  = 2
    };
};

/** Field boundary conditions at the domain boundary
 */
struct FieldBoundaryType {
    enum {
        PML = 0,
        Periodic = 1,
        PEC = 2,     //!< perfect electric conductor (PEC) with E_tangential=0
        PMC = 3      //!< perfect magnetic conductor (PMC) with B_tangential=0
    };
};

/** Particle boundary conditions at the domain boundary
 */
struct ParticleBoundaryType {
    enum {
        Absorbing = 0,     //!< particles crossing domain boundary are removed
        Open = 1,          //!< particles cross domain boundary leave with damped j
        Reflecting = 2,     //!< particles are reflected
        Periodic = 3
    };
};

int
GetAlgorithmInteger( amrex::ParmParse& pp, const char* pp_search_key );

/** Select BC Type for fields, if field=true
 *  else select BCType for particles.
 */
int
GetBCTypeInteger( std::string BCType, bool field );

#endif // UTILS_WARPXALGORITHMSELECTION_H_