diff --git a/.readthedocs.yml b/.readthedocs.yml index 436586e51..3da9bc771 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -4,7 +4,19 @@ # # License: BSD-3-Clause-LBNL -requirements_file: Docs/requirements.txt +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +sphinx: + configuration: Docs/source/conf.py + +python: + install: + - requirements: Docs/requirements.txt formats: - htmlzip diff --git a/Examples/Tests/circuits/inputs_resonator b/Examples/Tests/circuits/inputs_resonator new file mode 100644 index 000000000..da48ba145 --- /dev/null +++ b/Examples/Tests/circuits/inputs_resonator @@ -0,0 +1,132 @@ +################################ +####### GENERAL PARAMETERS ###### +################################# + +# do not modify these +geometry.dims = 3 +warpx.verbose = 1 +amr.max_level = 0 +amr.blocking_factor = 1024 + +# stop at max_step or 100 periods, whichever occurs first +max_step = 100000 +stop_time = 100 * wavelength/c +warpx.cfl = 0.9 + +# number of cells in each direction +my_constants.ncells = 40 +amr.n_cell = ncells ncells ncells +amr.max_grid_size = ncells + +# physical size of domain in [m] +my_constants.Ldomain = 0.02 +geometry.prob_lo = -Ldomain/2 -Ldomain/2 -Ldomain/2 +geometry.prob_hi = Ldomain/2 Ldomain/2 Ldomain/2 + +# define grid spacing in each direction +my_constants.dx = Ldomain/ncells +my_constants.dy = Ldomain/ncells +my_constants.dz = Ldomain/ncells + +# define a 'small' grid spacing +my_constants.smalldx = dx/100 +my_constants.smalldy = dy/100 +my_constants.smalldz = dz/100 + +boundary.field_lo = pml pml pml +boundary.field_hi = pml pml pml + +################################# +############ NUMERICS ########### +################################# + +algo.em_solver_medium = macroscopic # vacuum/macroscopic + +algo.macroscopic_sigma_method = laxwendroff # laxwendroff or backwardeuler + +################################# +############ FIELDS ############# +################################# + +# length of cubic cavity +my_constants.Lcavity = 1.e-2 + +# thickness of metal +my_constants.tmetal = 1.e-3 + +# excitation parameters +# speed of light +my_constants.c = 299792458. +my_constants.wavelength = 1.e-2 +my_constants.f = c/wavelength +my_constants.BW = 2/f +my_constants.t0 = 2.e-10 + +# conductivity of metal +# 5.8e7 = copper +my_constants.sigma = 5.8e3 + +my_constants.pi = 3.14159265359 +my_constants.epsilon_0 = 8.8541878128e-12 +my_constants.mu_0 = 1.25663706212e-06 + +macroscopic.epsilon_function(x,y,z) = "epsilon_0" +macroscopic.mu_function(x,y,z) = "mu_0" + +macroscopic.sigma_function(x,y,z) = "sigma * ( +( (x>-Lcavity/2-tmetal) * (x<-Lcavity/2) * (y>-Lcavity/2-tmetal) * (y-Lcavity/2-tmetal) * (zLcavity/2) * (x-Lcavity/2-tmetal) * (y-Lcavity/2-tmetal) * (z-Lcavity/2-tmetal) * (x-Lcavity/2-tmetal) * (y<-Lcavity/2) * (z>-Lcavity/2-tmetal) * (z-Lcavity/2-tmetal) * (xLcavity/2) * (y-Lcavity/2-tmetal) * (z-Lcavity/2-tmetal) * (x-Lcavity/2-tmetal) * (y-Lcavity/2-tmetal) * (z<-Lcavity/2) ) or +( (x>-Lcavity/2-tmetal) * (x-Lcavity/2-tmetal) * (yLcavity/2) * (zLcavity/4-smalldx) * (xLcavity/4-smalldy) * (yLcavity/4-smalldz) * (zdoCollisions( cur_time, dt[0] ); + //mypc->doCollisions( cur_time, dt[0] ); ExecutePythonCallback("aftercollisions"); #ifdef WARPX_QED doQEDEvents(); diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp index 5c9215368..000082fca 100644 --- a/Source/Initialization/WarpXInitData.cpp +++ b/Source/Initialization/WarpXInitData.cpp @@ -394,12 +394,18 @@ WarpX::InitData () ComputeDt(); WarpX::PrintDtDxDyDz(); InitFromScratch(); + if (WarpX::em_solver_medium==1) { + m_macroscopic_properties->InitData(); + } InitDiagnostics(); } else { InitFromCheckpoint(); WarpX::PrintDtDxDyDz(); + if (WarpX::em_solver_medium==1) { + m_macroscopic_properties->InitData(); + } PostRestart(); reduced_diags->InitData(); } @@ -414,9 +420,6 @@ WarpX::InitData () BuildBufferMasks(); - if (WarpX::em_solver_medium==1) { - m_macroscopic_properties->InitData(); - } if (WarpX::yee_coupled_solver_algo == CoupledYeeSolver::MaxwellLondon) { amrex::Print() << " calling london \n"; diff --git a/Source/Particles/Make.package b/Source/Particles/Make.package index 58cbe11a9..0ea82298d 100644 --- a/Source/Particles/Make.package +++ b/Source/Particles/Make.package @@ -15,7 +15,7 @@ include $(WARPX_HOME)/Source/Particles/Gather/Make.package include $(WARPX_HOME)/Source/Particles/Sorting/Make.package include $(WARPX_HOME)/Source/Particles/ParticleCreation/Make.package include $(WARPX_HOME)/Source/Particles/ElementaryProcess/Make.package -include $(WARPX_HOME)/Source/Particles/Collision/Make.package +#include $(WARPX_HOME)/Source/Particles/Collision/Make.package include $(WARPX_HOME)/Source/Particles/Filter/Make.package include $(WARPX_HOME)/Source/Particles/Resampling/Make.package diff --git a/Source/Particles/MultiParticleContainer.H b/Source/Particles/MultiParticleContainer.H index 59815d150..52766b5bc 100644 --- a/Source/Particles/MultiParticleContainer.H +++ b/Source/Particles/MultiParticleContainer.H @@ -172,7 +172,7 @@ public: const amrex::MultiFab& Ex, const amrex::MultiFab& Ey, const amrex::MultiFab& Ez, const amrex::MultiFab& Bx, const amrex::MultiFab& By, const amrex::MultiFab& Bz); - void doCollisions (amrex::Real cur_time, amrex::Real dt); + //void doCollisions (amrex::Real cur_time, amrex::Real dt); /** * \brief This function loops over all species and performs resampling if appropriate. @@ -357,7 +357,7 @@ protected: std::vector lasers_names; - std::unique_ptr collisionhandler; + //std::unique_ptr collisionhandler; //! instead of depositing (current, charge) on the finest patch level, deposit to the coarsest grid std::vector m_deposit_on_main_grid; diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp index e397d1aa8..4e30eb2b7 100644 --- a/Source/Particles/MultiParticleContainer.cpp +++ b/Source/Particles/MultiParticleContainer.cpp @@ -120,7 +120,7 @@ MultiParticleContainer::MultiParticleContainer (AmrCore* amr_core) pc_tmp = std::make_unique(amr_core); // Setup particle collisions - collisionhandler = std::make_unique(this); + //collisionhandler = std::make_unique(this); } @@ -933,12 +933,14 @@ MultiParticleContainer::doFieldIonization (int lev, } } +/* void MultiParticleContainer::doCollisions ( Real cur_time, amrex::Real dt ) { WARPX_PROFILE("MultiParticleContainer::doCollisions()"); collisionhandler->doCollisions(cur_time, dt, this); } +*/ void MultiParticleContainer::doResampling (const int timestep) {