XGCa
solvers.hpp
Go to the documentation of this file.
1 #ifndef SOLVERS_HPP
2 #define SOLVERS_HPP
3 
4 #include "plasma.hpp"
5 #include "electric_field.hpp"
6 #include "perturbed_B_field.hpp"
7 #include "charge.hpp"
8 #include "sml.hpp"
9 #include "solver_settings.hpp"
10 #include "step_trigger.hpp"
11 #include "simple00_solver.hpp"
12 #include "bias_potential.hpp"
13 #include "solver.hpp"
14 
15 class Solvers{
17 
20  bool use_pade;
21 
22  // Simple 00
24 
25  // Bias potential
27 
28 
30 
31  public:
32 
37 
39 
41 
43 
44 
45  // Poisson axisym
46 
47  View<double*,CLayout,DeviceType> get_initial_guess_axisym(const Simulation<DeviceType>& sml, const Grid<DeviceType>& grid, const View<double*,CLayout,DeviceType>& cden00_1d) const;
48 
49  View<double*,CLayout,HostType> solve_for_E(const Simulation<DeviceType>& sml, const DomainDecomposition<DeviceType>& pol_decomp, const MagneticField<DeviceType>& magnetic_field, const Grid<DeviceType>& grid, Plasma& plasma, Smoothing& smoothing, const Charges& charges, SolverSetting solver_setting) const;
50 
51  void solve_poisson_axisym(const Simulation<DeviceType>& sml, const MagneticField<DeviceType>& magnetic_field, const Grid<DeviceType>& grid, const DomainDecomposition<DeviceType>& pol_decomp, Smoothing& smoothing, Plasma& plasma, const Charges& charges, SolverSetting solver_setting, ElectricField<DeviceType>& electric_field) const;
52 
53  // Poisson turb
54  void solve_poisson_turb(const Simulation<DeviceType>& sml, const MagneticField<DeviceType>& magnetic_field, const Grid<DeviceType>& grid, const DomainDecomposition<DeviceType>& pol_decomp, Smoothing& smoothing, Plasma& plasma, const Charges& charges, int ipc, SolverSetting solver_setting, const ElectricField<DeviceType>& electric_field, const PerturbedBField<DeviceType>& perturbed_B_field) const;
55 
56  void solve(const Grid<DeviceType>& grid, const DomainDecomposition<DeviceType>& pol_decomp, const MagneticField<DeviceType>& magnetic_field, Smoothing& smoothing, const View<double*,CLayout,HostType>& rhs, const View<double*,CLayout,HostType>& dpot_double) const;
57 
58 
59  // Ampere
60  void solve_ampere(const Simulation<DeviceType>& sml, const MagneticField<DeviceType>& magnetic_field, const Grid<DeviceType>& grid, const DomainDecomposition<DeviceType>& pol_decomp, Plasma& plasma, const Charges& charges, Smoothing& smoothing, int ipc, bool is_cv_solve, ElectricField<DeviceType> &electric_field, const PerturbedBField<DeviceType>& perturbed_B_field) const;
61 
62  void solve(const Grid<DeviceType>& grid, const DomainDecomposition<DeviceType>& pol_decomp, const MagneticField<DeviceType>& magnetic_field, Smoothing& smoothing, const View<double*,CLayout,HostType>& rhs, const View<double*,CLayout,HostType>& rhs2, const View<double*,CLayout,HostType>& dpot_double, bool is_cv_solve) const;
63 
64  void control_variate(int ipc, Simulation<DeviceType> &sml, const Grid<DeviceType> &grid,
66  Charges& charges, Plasma& plasma,
67  const VelocityGrid& vgrid, const DomainDecomposition<DeviceType>& pol_decomp,
68  Smoothing& smoothing, const PerturbedBField<DeviceType>& perturbed_B_field) const;
69 
70  // General
71  void solve_algorithm(int ipc, Simulation<DeviceType> &sml, const Grid<DeviceType> &grid,
73  Charges& charges, Plasma& plasma,
74  const VelocityGrid& vgrid, const DomainDecomposition<DeviceType>& pol_decomp,
75  Smoothing& smoothing, const PerturbedBField<DeviceType>& perturbed_B_field) const;
76 
77  void solve_for_fields(int ipc, Simulation<DeviceType> &sml, const Grid<DeviceType> &grid,
79  Charges& charges, Plasma& plasma,
80  const VelocityGrid& vgrid, const DomainDecomposition<DeviceType>& pol_decomp,
81  Smoothing& smoothing, const PerturbedBField<DeviceType>& perturbed_B_field) const;
82 };
83 
84 #endif
Definition: bias_potential.hpp:7
Definition: magnetic_field.hpp:12
Definition: NamelistReader.hpp:193
Definition: perturbed_B_field.hpp:12
Definition: plasma.hpp:13
Definition: simple00_solver.hpp:7
Definition: sml.hpp:9
Definition: solver.hpp:15
Definition: solvers.hpp:15
Solver axisym_poisson
Definition: solvers.hpp:33
Solver turb_poisson
Definition: solvers.hpp:34
void solve_for_fields(int ipc, Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, ElectricField< DeviceType > &electric_field, Charges &charges, Plasma &plasma, const VelocityGrid &vgrid, const DomainDecomposition< DeviceType > &pol_decomp, Smoothing &smoothing, const PerturbedBField< DeviceType > &perturbed_B_field) const
Definition: solve_algorithm.cpp:183
Solvers()
Definition: solvers.hpp:38
bool poisson_0m_full_geo
Definition: solvers.hpp:18
void solve_algorithm(int ipc, Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, ElectricField< DeviceType > &electric_field, Charges &charges, Plasma &plasma, const VelocityGrid &vgrid, const DomainDecomposition< DeviceType > &pol_decomp, Smoothing &smoothing, const PerturbedBField< DeviceType > &perturbed_B_field) const
Definition: solve_algorithm.cpp:110
Simple00Solver simple00
Definition: solvers.hpp:23
void solve_poisson_turb(const Simulation< DeviceType > &sml, const MagneticField< DeviceType > &magnetic_field, const Grid< DeviceType > &grid, const DomainDecomposition< DeviceType > &pol_decomp, Smoothing &smoothing, Plasma &plasma, const Charges &charges, int ipc, SolverSetting solver_setting, const ElectricField< DeviceType > &electric_field, const PerturbedBField< DeviceType > &perturbed_B_field) const
Definition: solve_poisson_turb.cpp:264
void solve_ampere(const Simulation< DeviceType > &sml, const MagneticField< DeviceType > &magnetic_field, const Grid< DeviceType > &grid, const DomainDecomposition< DeviceType > &pol_decomp, Plasma &plasma, const Charges &charges, Smoothing &smoothing, int ipc, bool is_cv_solve, ElectricField< DeviceType > &electric_field, const PerturbedBField< DeviceType > &perturbed_B_field) const
Definition: solve_ampere.cpp:206
void init_solvers(const Simulation< DeviceType > &sml, const MagneticField< DeviceType > &magnetic_field, const Grid< DeviceType > &grid, Plasma &plasma)
Definition: solvers.cpp:261
BiasPotential bias_potential
Definition: solvers.hpp:26
void control_variate(int ipc, Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const MagneticField< DeviceType > &magnetic_field, ElectricField< DeviceType > &electric_field, Charges &charges, Plasma &plasma, const VelocityGrid &vgrid, const DomainDecomposition< DeviceType > &pol_decomp, Smoothing &smoothing, const PerturbedBField< DeviceType > &perturbed_B_field) const
Definition: solve_algorithm.cpp:77
View< double *, CLayout, DeviceType > get_initial_guess_axisym(const Simulation< DeviceType > &sml, const Grid< DeviceType > &grid, const View< double *, CLayout, DeviceType > &cden00_1d) const
Definition: solve_poisson_axisym.cpp:30
bool use_pade
Use Pade approximation for short wavelengths.
Definition: solvers.hpp:20
Solver ampere
Definition: solvers.hpp:35
bool initialized
Definition: solvers.hpp:16
void solve_poisson_axisym(const Simulation< DeviceType > &sml, const MagneticField< DeviceType > &magnetic_field, const Grid< DeviceType > &grid, const DomainDecomposition< DeviceType > &pol_decomp, Smoothing &smoothing, Plasma &plasma, const Charges &charges, SolverSetting solver_setting, ElectricField< DeviceType > &electric_field) const
Definition: solve_poisson_axisym.cpp:416
void update(const Simulation< DeviceType > &sml, const MagneticField< DeviceType > &magnetic_field, const Grid< DeviceType > &grid, Plasma &plasma)
Definition: solvers.cpp:348
bool helmholtz_spectral
Whether to solve Helmholtz-type equations with toroidally spectral solver.
Definition: solvers.hpp:19
Solver ampere_cv
Definition: solvers.hpp:36
void solve(const Grid< DeviceType > &grid, const DomainDecomposition< DeviceType > &pol_decomp, const MagneticField< DeviceType > &magnetic_field, Smoothing &smoothing, const View< double *, CLayout, HostType > &rhs, const View< double *, CLayout, HostType > &dpot_double) const
Definition: solve.cpp:13
View< double *, CLayout, HostType > solve_for_E(const Simulation< DeviceType > &sml, const DomainDecomposition< DeviceType > &pol_decomp, const MagneticField< DeviceType > &magnetic_field, const Grid< DeviceType > &grid, Plasma &plasma, Smoothing &smoothing, const Charges &charges, SolverSetting solver_setting) const
Definition: solve_poisson_axisym.cpp:265
Definition: magnetic_field.F90:1
logical false
Definition: module.F90:102
subroutine plasma(grid, itr, p, dene_out, deni_out, Te_out, Ti_out, Vparai_out, ignore_vacuum)
Calculate the plasma density, temperature, and parallel velocity for a point in triangle itr using pl...
Definition: neutral_totalf.F90:1548
SolverSetting
Definition: solver_settings.hpp:4
Definition: charge.hpp:66
Definition: electric_field.hpp:76
Definition: smoothing.hpp:10
Definition: velocity_grid.hpp:8