WarpX
ThetaImplicitEM.H
Go to the documentation of this file.
1 /* Copyright 2024 Justin Angus
2  *
3  * This file is part of WarpX.
4  *
5  * License: BSD-3-Clause-LBNL
6  */
7 #ifndef THETA_IMPLICIT_EM_H_
8 #define THETA_IMPLICIT_EM_H_
9 
11 
12 #include <AMReX_Array.H>
13 #include <AMReX_MultiFab.H>
14 #include <AMReX_REAL.H>
15 
16 #include "ImplicitSolver.H"
17 
54 {
55 public:
56 
57  ThetaImplicitEM() = default;
58 
59  ~ThetaImplicitEM() override = default;
60 
61  // Prohibit Move and Copy operations
62  ThetaImplicitEM(const ThetaImplicitEM&) = delete;
66 
67  void Define ( WarpX* a_WarpX ) override;
68 
69  void PrintParameters () const override;
70 
71  void OneStep ( amrex::Real a_time,
72  amrex::Real a_dt,
73  int a_step ) override;
74 
75  void ComputeRHS ( WarpXSolverVec& a_RHS,
76  const WarpXSolverVec& a_E,
77  amrex::Real a_time,
78  amrex::Real a_dt,
79  int a_nl_iter,
80  bool a_from_jacobian ) override;
81 
82  [[nodiscard]] amrex::Real theta () const { return m_theta; }
83 
84 private:
85 
89  amrex::Real m_theta = 0.5;
90 
100 
108 
112  void UpdateWarpXFields ( const WarpXSolverVec& a_E,
113  amrex::Real a_time,
114  amrex::Real a_dt );
115 
120  void FinishFieldUpdate ( amrex::Real a_new_time );
121 
122 };
123 
124 #endif
Definition: ImplicitSolver.H:24
Definition: ThetaImplicitEM.H:54
void Define(WarpX *a_WarpX) override
Read user-provided parameters that control the implicit solver. Allocate internal arrays for intermed...
Definition: ThetaImplicitEM.cpp:14
amrex::Real m_theta
Time-biasing parameter for fields used on RHS to advance system.
Definition: ThetaImplicitEM.H:89
ThetaImplicitEM()=default
WarpXSolverVec m_Eold
Definition: ThetaImplicitEM.H:99
void OneStep(amrex::Real a_time, amrex::Real a_dt, int a_step) override
Advance fields and particles by one time step using the specified implicit algorithm.
Definition: ThetaImplicitEM.cpp:82
WarpXSolverVec m_E
Solver vectors to be used in the nonlinear solver to solve for the electric field E....
Definition: ThetaImplicitEM.H:99
void PrintParameters() const override
Definition: ThetaImplicitEM.cpp:61
ThetaImplicitEM & operator=(const ThetaImplicitEM &)=delete
ThetaImplicitEM(ThetaImplicitEM &&)=delete
~ThetaImplicitEM() override=default
amrex::Vector< std::array< std::unique_ptr< amrex::MultiFab >, 3 > > m_Bold
B is a derived variable from E. Need to save Bold to update B during the iterative nonlinear solve fo...
Definition: ThetaImplicitEM.H:107
amrex::Real theta() const
Definition: ThetaImplicitEM.H:82
void ComputeRHS(WarpXSolverVec &a_RHS, const WarpXSolverVec &a_E, amrex::Real a_time, amrex::Real a_dt, int a_nl_iter, bool a_from_jacobian) override
Computes the RHS of the equation corresponding to the specified implicit algorithm....
Definition: ThetaImplicitEM.cpp:125
void FinishFieldUpdate(amrex::Real a_new_time)
Nonlinear solver is for the time-centered values of E. After the solver, need to use m_E and m_Eold t...
Definition: ThetaImplicitEM.cpp:158
void UpdateWarpXFields(const WarpXSolverVec &a_E, amrex::Real a_time, amrex::Real a_dt)
Update the E and B fields owned by WarpX.
Definition: ThetaImplicitEM.cpp:144
ThetaImplicitEM(const ThetaImplicitEM &)=delete
ThetaImplicitEM & operator=(ThetaImplicitEM &&)=delete
Definition: WarpX.H:85
This is a wrapper class around a Vector of array of pointers to MultiFabs that contains basic math op...
Definition: WarpXSolverVec.H:48