aboutsummaryrefslogtreecommitdiff
path: root/Source/Parallelization/GuardCellManager.cpp
diff options
context:
space:
mode:
authorGravatar Hannah Klion <klion@lbl.gov> 2021-10-25 12:07:27 -0700
committerGravatar GitHub <noreply@github.com> 2021-10-25 12:07:27 -0700
commit3f9824216276c9b12569b56e431b1be14c58a23d (patch)
tree2fa798598eda1a5c4b33e6c1969c77276c1ea387 /Source/Parallelization/GuardCellManager.cpp
parent7341fa0eda39368b1c6f2cf6d6dc20462fd6c3fc (diff)
downloadWarpX-3f9824216276c9b12569b56e431b1be14c58a23d.tar.gz
WarpX-3f9824216276c9b12569b56e431b1be14c58a23d.tar.zst
WarpX-3f9824216276c9b12569b56e431b1be14c58a23d.zip
Spatially vary temperature in momentum initialization (#2357)
* Add GetTemperature class - Object that can be called with signature GetTemperature(x,y,z) to get temperature at coordinates x,y,z - Can take either a constant temperature or a parser, to be passed in from the input param file * Further develop GetTemperature - Rename GetTemperature to TemperatureInit - TemperatureInit is a union of TemperatureInitParser and TemperatureInitConstant, modeled after the InjectorMomentum class - InjectorMomentum will take a TemperatureInit object where it needs a temperature, rather than a constant value. It will be able to call TemperatureInit->getTemperature(x,y,z), regardless of the temperature type * finish renaming GetTemperature to TemperatureInit * InjectorMomentum now takes TemperatureInit object - For Maxwell-Boltzmann and Maxwell-Juttner distributions, InjectorMomentum takes a pointer to TemperatureInit rather than a single amrex::Real * Pass TemperatureInit to InjectorMomentum by reference - Pass TemperatureInit to InjectorMomentum by reference - Removed copy constructor deletion - Fixed some other compilation errors * Prevent copy constructors for TemperatureInit * Add PlastmaInjector::parseTemperature - parseTemperature reads temperature parameters and creates a TemperatureInit object that contains the information - parseTemperature returns a unique pointer to the TemperatureInit object, which is then passed directly to the InjectorMomentum constructor * InjectorMomentum takes unique pointer to TemperatureInit - Boltzmann and Juttner InjectorMomentum types take a unique pointer to Temperature Init - Adjusted initializers to move instead of copy, where required - Added a blank destructor for Object, which may not actually be necessary, but currently needed for compilation. * Fix bug and pass TemperatureInit by reference - Fixed bug where the parser in TemperatureInit was going out of scope before we were done using the executor. This has been fixed by making the parser a member of the PlasmaInjector class so it won't be prematurely garbage collected. This should be temporary until the refactor of TemperatureInit - TemperatureInit is no longer a union, and is instead just a struct whose first member indicates the type - The PlasmaInjector method that reads the temperature parameters is now void. It takes a TemperatureInit object by reference and does the real initialization. * Restructure how temperature data are stored - TemperatureInit renamed to TemperatureProperties - Temperature data is stored in an instance of TemperatureProperties, a smart pointer to which is owned by PlasmaInjector. - TemperatureProperties is initialized with a reference to parameters, and owns the temperature function parser, if used. - GetTemperature is a functor that takes three doubles (x, y, and z coordinates) and returns the initial temperature at that location. This is either a constant or a parser evaluated at (x,y,z), depending on input parameters. - InjectorMomentum takes a const reference to GetTemperature in its constructor when needed and stores a copy. The compiled parser will remain in scope because it is owned by TemperatureProperties, which is in turn owned by PlasmaInjector. * Fix compilation bugs - Fix some include file names - Add TemperatureProperties.cpp to CMake - Fix some class names * update list of .cpp files in Make.package * Split GetTemperature implementations implementations into .cpp * update include statements * fix default constant temperature * add documentation for new runtime params * add further documentation * added test for spatially varying temeperature * update comments on tests * remove empty destructor for Object in InjectorMomentum * reset benchmark for initial_distribution because added check for spatially-varying temp * Moved GetTemperature::operator() to header file since that seems to help GPU compilation on my local machine * make position arguments to GetTemperature const * LaTeXify new documentation Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Add const where applicable Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * renamed TemperatureInitType members to avoid collisions with MacroparameterInitType * Update Examples/Tests/initial_distribution/analysis_distribution.py Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Add comment to document why h_mom_temp is a PlasmaInjector member * Add warning/abort messages if temperature is out of MJ or MB range * Theta is now mandatory * update documentation * negative theta values not allowed * Remove theta>0.01 warning in getMomentum and fix GPU compile issues Co-authored-by: Hannah Klion <hannah.klion@gmail.com> Co-authored-by: Tools <warpx@lbl.gov> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Diffstat (limited to 'Source/Parallelization/GuardCellManager.cpp')
0 files changed, 0 insertions, 0 deletions