67 double ND = 1.72e9*sqrt(pow(formulas.
T0,3.0)/formulas.
n);
71 double nu_ei = nuei_wp * formulas.
wp;
75 double numh = size_t(static_cast<int>(dt_out/CLF))+1;
76 double h = dt_out/
static_cast<double>(numh);
80 std::cout<<
"------- ---------------- */*/*/*/*/* ---------------- -------\n";
81 std::cout<<
"------- ,-----. ,---. ,--. ,--.,--. ,--.,--. ,--. -------\n";
82 std::cout<<
"-------' .-. '' .-' | '--' || | | || ,'.| | -------\n";
83 std::cout<<
"-------| | | |`. `-. | .--. || | | || |' ' | -------\n";
84 std::cout<<
"-------' '-' '.-' || | | |' '-' '| | ` | -------\n";
85 std::cout<<
"------- `-----' `-----' `--' `--' `-----' `--' `--' -------\n";
86 std::cout<<
"------- ---------------- */*/*/*/*/* ---------------- -------\n";
91 std::cout <<
"---------------- OSHUN Beta - 1D 3P ---------------- \n";
92 std::cout <<
" Particle-in-Cell and Kinetic Simulation Center \n";
93 std::cout <<
"------------------- UCLA - 2017 -------------------- \n";
95 std::cout <<
"----------------- Reference Units ------------------ \n";
96 std::cout <<
"normalizing density = " << formulas.
n <<
" / cc \n";
97 std::cout <<
"plasma frequency = " << formulas.
wp <<
" Hz \n";
98 std::cout <<
"background ions - Z = " << formulas.
Zeta <<
" \n";
99 std::cout <<
"normalizing magnetic field = " << formulas.
B0 <<
" T \n";
100 std::cout <<
"Reference Temperature = " << formulas.
T0 <<
" eV \n";
104 std::cout <<
"Corresponding e-i log Lambda = " << formulas.
LOGei(1.0,pow(
Input::List().pth_ref,2.0),formulas.
Zeta) <<
" \n";
105 std::cout <<
"Corresponding e-i collision frequency = " << nu_ei <<
" Hz \n";
106 std::cout <<
"Corresponding tau_e-i / tau_p = " << 1.0/nuei_wp <<
" \n";
110 std::cout <<
"Corresponding e-e log Lambda = " << formulas.
LOGee(1.0,pow(
Input::List().pth_ref,2.0)) <<
" \n";
111 std::cout <<
"Corresponding e-e collision frequency = " << 1.0/formulas.
Tau_e(1.0,pow(
Input::List().pth_ref,2.0)) <<
" Hz \n";
116 std::cout <<
"-------------- Simulation parameters -------------- \n";
117 std::cout <<
"skin depth (normalizing distance) = " << formulas.
skindepth*1e6 <<
" microns \n";
118 std::cout <<
"plasma period (normalizing time) = " << 1.0/formulas.
wp*1e15 <<
" fs \n";
119 std::cout <<
"Time step (normalizing time) = " << h <<
" plasma periods \n";
125 return 1.0/formulas.
wp*1e15;
129 int main(
int argc,
char** argv) {
131 MPI_Init(&argc,&argv);
157 double numh = size_t(static_cast<int>(dt_out/CLF))+1;
158 double h = dt_out/
static_cast<double>(numh);
161 if (PE.
RANK() == 0) {
185 output( Y, grid, tout_start, PE );
186 output.
distdump(Y, grid, tout_start, PE );
233 std::cout <<
"\n Need collisions for implicit E field solver. \n Exiting. \n";
237 for (
size_t t_out(tout_start + 1); t_out < n_outsteps + 1; ++t_out) {
239 for (
Clock W(t_out - 1, dt_out, CLF); W.
tick() < W.numh(); ++W) {
254 Y = RK(Y, W.h(),&impE_p1_Functor);
256 eim.advance(&RK, Y, collide,&impE_p2_Functor);
257 Y = RK(Y, W.h(),&impE_p2_Functor);
260 for (
size_t s(0); s < Y.Species(); ++s)
262 Bfield.implicit(Y.DF(s),Y.EMF().Bx(),Y.EMF().By(),Y.EMF().Bz(),W.h());
263 Y.DF(s) = Y.DF(s).Filterp();
269 Y = RK(Y, W.h(), &HydroFunc);
279 if (!(PE.
RANK())) cout <<
" \n Output #" << t_out <<
"\n";
280 output(Y, grid, t_out, PE);
284 output.
distdump(Y, grid, t_out, PE);
300 for (
size_t t_out(tout_start + 1); t_out < n_outsteps + 1; ++t_out) {
301 for (
Clock W(t_out - 1, dt_out, CLF); W.
tick() < W.numh(); ++W) {
314 Y = RK(Y, W.h(), &rkF);
316 for (
size_t s(0); s < Y.Species(); ++s)
318 Bfield.implicit(Y.DF(s),Y.EMF().Bx(),Y.EMF().By(),Y.EMF().Bz(),W.h());
319 Y.DF(s) = Y.DF(s).Filterp();
326 Y = RK(Y, W.h(), &HydroFunc);
331 if (!(PE.
RANK())) cout <<
" \n Output #" << t_out <<
"\n";
332 output(Y, grid, t_out, PE);
336 output.
distdump(Y, grid, t_out, PE);
362 std::cout <<
"\n Need collisions for implicit E field solver. \n Exiting. \n";
366 for (
size_t t_out(tout_start + 1); t_out < n_outsteps + 1; ++t_out) {
368 for (
Clock W(t_out - 1, dt_out, CLF); W.
tick() < W.numh(); ++W) {
386 eim.advance(&RK, Y, collide,
394 Y = RK(Y, W.h(), &HydroFunc);
405 if (!(PE.
RANK())) cout <<
" \n Output #" << t_out <<
"\n";
406 output(Y, grid, t_out, PE);
410 output.
distdump(Y, grid, t_out, PE);
427 for (
size_t t_out(tout_start + 1); t_out < n_outsteps + 1; ++t_out) {
428 for (
Clock W(t_out - 1, dt_out, CLF); W.
tick() < W.numh(); ++W) {
445 Y = RK(Y, W.h(), &rkF);
452 Y = RK(Y, W.h(), &HydroFunc);
458 if (!(PE.
RANK())) cout <<
" \n Output #" << t_out <<
"\n";
460 output(Y, grid, t_out, PE);
464 output.
distdump(Y, grid, t_out, PE);
467 Re.Write(PE.
RANK(), t_out, Y);
473 cout <<
"Simulation took "<< difftime(tend, tstart) <<
" second(s)."<< endl;
Underlying data structures.
void applyexternalfields(Grid_Info &grid, State1D &Y, double time)
int main(int argc, char **argv)
Export Files - Declarations.
const vector< double > mass
void initialize(State1D &Y, Grid_Info &grid)
void Neighbor_Communications(State1D &Y)
Collisions - Declarations.
Functors for various time-integration methodds - Declarations.
void Neighbor_ImplicitE_Communications(State1D &Y)
void distdump(const State1D &Y, const Grid_Info &grid, const size_t tout, const Parallel_Environment_1D &PE)
double startmessages(State1D &Y)
void advance(State1D &Y, const Clock &W)
Grid Setup - Declaration.
const vector< size_t > Np
Fields, Distributions, Harmonics, States - Declarations.
const Algorithms::AxisBundle< double > axis
void applytravelingwave(Grid_Info &grid, State1D &Y, double time)
size_t Nx(size_t i) const
const vector< double > charge