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 
19  // If true, an adiabatic wall condition is used (no polarization, n_i=0, n_e!=0)
20  // in the axisymmetric solver; this is an experimental option and should
21  // be used together with sml_sheath_mode=1 and sml_sheath_init_pot_factor=0.
27  bool use_pade;
28 
29  // Simple 00
31 
32  // Bias potential
34 
35 
37 
38  public:
39 
44 
46 
48 
50 
51 
52  // Poisson axisym
53 
54  View<double*,CLayout,DeviceType> get_initial_guess_axisym(const Simulation<DeviceType>& sml, const Grid<DeviceType>& grid, const View<double*,CLayout,DeviceType>& cden00_1d) const;
55 
56  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;
57 
58  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;
59 
60  // Poisson turb
61  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;
62 
63  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;
64 
65 
66  // Ampere
67  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;
68 
69  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;
70 
71  void control_variate(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  // General
78  void solve_algorithm(int ipc, Simulation<DeviceType> &sml, const Grid<DeviceType> &grid,
80  Charges& charges, Plasma& plasma,
81  const VelocityGrid& vgrid, const DomainDecomposition<DeviceType>& pol_decomp,
82  Smoothing& smoothing, const PerturbedBField<DeviceType>& perturbed_B_field) const;
83 
84  void solve_for_fields(int ipc, Simulation<DeviceType> &sml, const Grid<DeviceType> &grid,
86  Charges& charges, Plasma& plasma,
87  const VelocityGrid& vgrid, const DomainDecomposition<DeviceType>& pol_decomp,
88  Smoothing& smoothing, const PerturbedBField<DeviceType>& perturbed_B_field) const;
89 };
90 
91 #endif
Definition: bias_potential.hpp:7
Definition: magnetic_field.hpp:12
Definition: NamelistReader.hpp:199
Definition: perturbed_B_field.hpp:12
Definition: plasma.hpp:13
Definition: simple00_solver.hpp:7
Definition: sml.hpp:10
Definition: solver.hpp:15
Definition: solvers.hpp:15
Solver axisym_poisson
Definition: solvers.hpp:40
Solver turb_poisson
Definition: solvers.hpp:41
bool heuristic_priv_pot
Definition: solvers.hpp:22
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:174
Solvers()
Definition: solvers.hpp:45
bool poisson_0m_full_geo
Definition: solvers.hpp:24
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:109
Simple00Solver simple00
Definition: solvers.hpp:30
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:255
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:33
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:76
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:27
Solver ampere
Definition: solvers.hpp:42
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:398
bool poisson_use_bc
(XGCa only) False: 00-bc is phi=0 everywhere; true: 00-boundary
Definition: solvers.hpp:25
void update(const Simulation< DeviceType > &sml, const MagneticField< DeviceType > &magnetic_field, const Grid< DeviceType > &grid, Plasma &plasma)
Definition: solvers.cpp:350
bool helmholtz_spectral
Whether to solve Helmholtz-type equations with toroidally spectral solver.
Definition: solvers.hpp:26
bool poisson_adia_wall
EXPERIMENTAL! DON'T USE UNLESS ADVISED BY AN EXPERT.
Definition: solvers.hpp:18
Solver ampere_cv
Definition: solvers.hpp:43
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:247
Definition: magnetic_field.F90:1
logical false
Definition: module.F90:103
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:1541
SolverSetting
Definition: solver_settings.hpp:4
Definition: charge.hpp:66
Definition: electric_field.hpp:76
Definition: smoothing.hpp:10
Definition: velocity_grid.hpp:8