Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set geometry earlier in picmi #2745

Merged
merged 2 commits into from
Jan 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 28 additions & 19 deletions Python/pywarpx/picmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,13 @@ def init(self, kw):
self.potential_zmin = kw.pop('warpx_potential_lo_z', None)
self.potential_zmax = kw.pop('warpx_potential_hi_z', None)

# Geometry
# Set these as soon as the information is available
# (since these are needed to determine which shared object to load)
pywarpx.geometry.dims = 'RZ'
pywarpx.geometry.prob_lo = self.lower_bound # physical domain
pywarpx.geometry.prob_hi = self.upper_bound

def initialize_inputs(self):
pywarpx.amr.n_cell = self.number_of_cells

Expand All @@ -432,10 +439,6 @@ def initialize_inputs(self):
assert self.lower_bound[0] >= 0., Exception('Lower radial boundary must be >= 0.')
assert self.bc_rmin != 'periodic' and self.bc_rmax != 'periodic', Exception('Radial boundaries can not be periodic')

# Geometry
pywarpx.geometry.dims = 'RZ'
pywarpx.geometry.prob_lo = self.lower_bound # physical domain
pywarpx.geometry.prob_hi = self.upper_bound
pywarpx.warpx.n_rz_azimuthal_modes = self.n_azimuthal_modes

# Boundary conditions
Expand Down Expand Up @@ -478,6 +481,13 @@ def init(self, kw):
self.potential_zmin = kw.pop('warpx_potential_lo_z', None)
self.potential_zmax = kw.pop('warpx_potential_hi_z', None)

# Geometry
# Set these as soon as the information is available
# (since these are needed to determine which shared object to load)
pywarpx.geometry.dims = '1'
pywarpx.geometry.prob_lo = self.lower_bound # physical domain
pywarpx.geometry.prob_hi = self.upper_bound

def initialize_inputs(self):
pywarpx.amr.n_cell = self.number_of_cells

Expand All @@ -488,11 +498,6 @@ def initialize_inputs(self):
pywarpx.amr.blocking_factor = self.blocking_factor
pywarpx.amr.blocking_factor_x = self.blocking_factor_x

# Geometry
pywarpx.geometry.dims = '1'
pywarpx.geometry.prob_lo = self.lower_bound # physical domain
pywarpx.geometry.prob_hi = self.upper_bound

# Boundary conditions
pywarpx.boundary.field_lo = [BC_map[bc] for bc in [self.bc_xmin]]
pywarpx.boundary.field_hi = [BC_map[bc] for bc in [self.bc_xmax]]
Expand Down Expand Up @@ -531,6 +536,13 @@ def init(self, kw):
self.potential_zmin = kw.pop('warpx_potential_lo_z', None)
self.potential_zmax = kw.pop('warpx_potential_hi_z', None)

# Geometry
# Set these as soon as the information is available
# (since these are needed to determine which shared object to load)
pywarpx.geometry.dims = '2'
pywarpx.geometry.prob_lo = self.lower_bound # physical domain
pywarpx.geometry.prob_hi = self.upper_bound

def initialize_inputs(self):
pywarpx.amr.n_cell = self.number_of_cells

Expand All @@ -543,11 +555,6 @@ def initialize_inputs(self):
pywarpx.amr.blocking_factor_x = self.blocking_factor_x
pywarpx.amr.blocking_factor_y = self.blocking_factor_y

# Geometry
pywarpx.geometry.dims = '2'
pywarpx.geometry.prob_lo = self.lower_bound # physical domain
pywarpx.geometry.prob_hi = self.upper_bound

# Boundary conditions
pywarpx.boundary.field_lo = [BC_map[bc] for bc in [self.bc_xmin, self.bc_ymin]]
pywarpx.boundary.field_hi = [BC_map[bc] for bc in [self.bc_xmax, self.bc_ymax]]
Expand Down Expand Up @@ -592,6 +599,13 @@ def init(self, kw):
self.potential_zmin = kw.pop('warpx_potential_lo_z', None)
self.potential_zmax = kw.pop('warpx_potential_hi_z', None)

# Geometry
# Set these as soon as the information is available
# (since these are needed to determine which shared object to load)
pywarpx.geometry.dims = '3'
pywarpx.geometry.prob_lo = self.lower_bound # physical domain
pywarpx.geometry.prob_hi = self.upper_bound

def initialize_inputs(self):
pywarpx.amr.n_cell = self.number_of_cells

Expand All @@ -606,11 +620,6 @@ def initialize_inputs(self):
pywarpx.amr.blocking_factor_y = self.blocking_factor_y
pywarpx.amr.blocking_factor_z = self.blocking_factor_z

# Geometry
pywarpx.geometry.dims = '3'
pywarpx.geometry.prob_lo = self.lower_bound # physical domain
pywarpx.geometry.prob_hi = self.upper_bound

# Boundary conditions
pywarpx.boundary.field_lo = [BC_map[bc] for bc in [self.bc_xmin, self.bc_ymin, self.bc_zmin]]
pywarpx.boundary.field_hi = [BC_map[bc] for bc in [self.bc_xmax, self.bc_ymax, self.bc_zmax]]
Expand Down