Skip to content

Commit

Permalink
updates for fusion and fft
Browse files Browse the repository at this point in the history
  • Loading branch information
k-wolfinger committed Aug 11, 2024
1 parent a9734e8 commit 4cb1c4b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
5 changes: 5 additions & 0 deletions Python/pywarpx/picmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,9 @@ def init(self, kw):

def solver_initialize_inputs(self):

# Open BC means FieldBoundaryType::Open for electrostatic sims, rather than perfectly-matched layer
BC_map['open'] = 'open'

self.grid.grid_initialize_inputs()

if self.relativistic:
Expand All @@ -1249,6 +1252,8 @@ def solver_initialize_inputs(self):
pywarpx.boundary.potential_hi_x = self.grid.potential_xmax
pywarpx.boundary.potential_hi_y = self.grid.potential_ymax
pywarpx.boundary.potential_hi_z = self.grid.potential_zmax

pywarpx.warpx.poisson_solver = self.method


class GaussianLaser(picmistandard.PICMI_GaussianLaser):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ BackgroundMCCCollision::BackgroundMCCCollision (std::string const& collision_nam
// create a vector of ScatteringProcess objects from each scattering
// process name
for (const auto& scattering_process : scattering_process_names) {
std::cout << scattering_process << std::endl;
// std::cout << scattering_process << std::endl;
const std::string kw_cross_section = scattering_process + "_cross_section";
std::string cross_section_file;
pp_collision_name.query(kw_cross_section.c_str(), cross_section_file);
Expand Down
20 changes: 14 additions & 6 deletions Source/Particles/PhysicalParticleContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,17 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp
mass_from_source |= plasma_injector->queryMass(mass);
}

std::string physical_species_s;
const bool species_is_specified = pp_species_name.query("species_type", physical_species_s);
// This is a bad fix for our local runs: discrepancy between warpx (species_type) and
// pyenv picmi (particle_type) -- not sure how to make the transition sooooo
// for now make sure the species_name matches the species_type we want
std::string physical_species_s = species_name;
const bool species_is_specified = 1; // pp_species_name.query("species_type", physical_species_s);
// const bool species_is_specified = pp_species_name.query("particle_type", physical_species_s);
// const bool species_is_specified_old = pp_species_name.contains("species_type");
// const bool species_is_specified = pp_species_name.contains("particle_type");
// std::cout << species_name << std::endl;
// std::cout << physical_species_s << std::endl;
// std::cout << species_is_specified_old << std::endl;
// std::cout << species_is_specified << std::endl;
if (species_is_specified) {
const auto physical_species_from_string = species::from_string( physical_species_s );
Expand All @@ -303,29 +311,29 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp
if (charge_is_specified && species_is_specified) {
ablastr::warn_manager::WMRecordWarning("Species",
"Both '" + species_name + ".charge' and " +
species_name + ".species_type' are specified.\n" +
species_name + ".particle_type' are specified.\n" +
species_name + ".charge' will take precedence.\n");
}
if (mass_is_specified && species_is_specified) {
ablastr::warn_manager::WMRecordWarning("Species",
"Both '" + species_name + ".mass' and " +
species_name + ".species_type' are specified.\n" +
species_name + ".particle_type' are specified.\n" +
species_name + ".mass' will take precedence.\n");
}

WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
charge_from_source ||
charge_is_specified ||
species_is_specified,
"Need to specify at least one of species_type or charge for species '" +
"Need to specify at least one of particle_type or charge for species '" +
species_name + "'."
);

WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
mass_from_source ||
mass_is_specified ||
species_is_specified,
"Need to specify at least one of species_type or mass for species '" +
"Need to specify at least one of particle_type or mass for species '" +
species_name + "'."
);

Expand Down

0 comments on commit 4cb1c4b

Please sign in to comment.