WarpX
ElectrostaticSolver.H
Go to the documentation of this file.
1 /* Copyright 2021 Modern Electron
2  *
3  * This file is part of WarpX.
4  *
5  * License: BSD-3-Clause-LBNL
6  */
7 #ifndef ELECTROSTATICSOLVER_H_
8 #define ELECTROSTATICSOLVER_H_
9 
10 #include "Utils/WarpXUtil.H"
11 
12 #include <AMReX_Parser.H>
13 #include <AMReX_REAL.H>
14 
16 
18 
19  amrex::Real t;
20  amrex::ParserExecutor<4> potential_eb;
21 
22  AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
23  amrex::Real operator() (const amrex::Real x, const amrex::Real z) const noexcept
24  {
25  return potential_eb(x, 0.0, z, t);
26  }
27 
28  AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
29  amrex::Real operator() (const amrex::Real x, const amrex::Real y, const amrex::Real z) const noexcept
30  {
31  return potential_eb(x, y, z, t);
32  }
33 };
34 
36 
37 public:
38  std::string potential_eb_str = "0";
39  // TODO add handling of domain boundaries as well
40 
41  void buildParsers ()
42  {
43  potential_eb_parser = makeParser(potential_eb_str, {"x", "y", "z", "t"});
44 
45  potential_eb = potential_eb_parser.compile<4>();
46  }
47 
48  PhiCalculatorEB getPhiEB (amrex::Real t) const noexcept
49  {
51  }
52 
53  amrex::ParserExecutor<4> potential_eb;
54 
55 private:
56 
58 
59 };
60 
61 }
62 #endif
PhiCalculatorEB getPhiEB(amrex::Real t) const noexcept
Definition: ElectrostaticSolver.H:48
def x
Definition: read_lab_particles.py:25
amrex::ParserExecutor< 4 > potential_eb
Definition: ElectrostaticSolver.H:20
def z
Definition: read_lab_particles.py:26
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real operator()(const amrex::Real x, const amrex::Real z) const noexcept
Definition: ElectrostaticSolver.H:23
Definition: ElectrostaticSolver.H:17
Parser makeParser(std::string const &parse_function, amrex::Vector< std::string > const &varnames)
Initialize an amrex::Parser object from a string containing a math expression.
Definition: WarpXUtil.cpp:298
amrex::Real t
Definition: ElectrostaticSolver.H:19
amrex::ParserExecutor< 4 > potential_eb
Definition: ElectrostaticSolver.H:53
void buildParsers()
Definition: ElectrostaticSolver.H:41
Definition: ElectrostaticSolver.H:15
amrex::Parser potential_eb_parser
Definition: ElectrostaticSolver.H:57
Definition: ElectrostaticSolver.H:35
Definition: GetExternalFields.H:15