From d9ac64ff9b0e1ac364dc5117bab6eabf178936d2 Mon Sep 17 00:00:00 2001 From: Camille Woicekowska <61211168+camille12225@users.noreply.github.com> Date: Thu, 15 Jun 2023 10:31:17 -0700 Subject: Added external field loading from file to picmi.py (#3945) * Added external field loading from file to picmi.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update Python/pywarpx/picmi.py Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com> * Added documentation * Removed init, documentation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Updated picmi version in requirements.txt * Updated picmi version in setup.py * Updated picmi version in requirements.txt * Updated name of call to picmi class * Adapted CI test for PICMI field loading from file * Added PICMI input script * Added .json file with new file name * fixed small errors * Fixed error in input script * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Removed old comments from code * fixed import, spacing in input script * fixed spacing * cleaned up input script * fixed typo * removed blocking factor * fixed name of test * correct ion species name * Added initial field to sim object --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Roelof Groenewald <40245517+roelof-groenewald@users.noreply.github.com> --- Python/pywarpx/picmi.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Python/pywarpx/picmi.py') diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index 621757132..0f0426ca6 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -1175,6 +1175,15 @@ class LaserAntenna(picmistandard.PICMI_LaserAntenna): ) / constants.c +class LoadInitialField(picmistandard.PICMI_LoadGriddedField): + def initialize_inputs(self): + pywarpx.warpx.read_fields_from_path = self.read_fields_from_path + if self.load_E: + pywarpx.warpx.E_ext_grid_init_style = 'read_from_file' + if self.load_B: + pywarpx.warpx.B_ext_grid_init_style = 'read_from_file' + + class AnalyticInitialField(picmistandard.PICMI_AnalyticAppliedField): def init(self, kw): self.mangle_dict = None -- cgit v1.2.3