Skip to content

Commit

Permalink
🐛 assign base number.
Browse files Browse the repository at this point in the history
  • Loading branch information
Drewniok committed Nov 6, 2023
1 parent 1ac90ac commit 8ab467f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/fiction/algorithms/simulation/sidb/quickexact.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,14 @@ class quickexact_impl
static_assert(has_siqad_coord_v<ChargeLyt>, "ChargeLyt is not based on SiQAD coordinates");
static_assert(is_charge_distribution_surface_v<ChargeLyt>, "ChargeLyt is not a charge distribution surface");

if (base_number == required_simulation_base_number::THREE)
{
charge_lyt.assign_base_number(3);
}
else
{
charge_lyt.assign_base_number(2);
}
charge_layout.assign_physical_parameters(params.physical_parameters);
charge_layout.assign_all_charge_states(sidb_charge_state::NEUTRAL);
charge_layout.assign_dependent_cell(all_sidbs_in_lyt_without_negative_preassigned_ones[0]);
Expand Down
18 changes: 18 additions & 0 deletions test/algorithms/simulation/sidb/quickexact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1405,3 +1405,21 @@ TEMPLATE_TEST_CASE(
Catch::Matchers::WithinAbs(-5.0592576221, physical_constants::POP_STABILITY_ERR));
}
}

TEMPLATE_TEST_CASE(
"QuickExact simulation of two SiDBs placed directly next to each other with non-realistic relative permittivity", "[quickexact]",
(cell_level_layout<sidb_technology, clocked_layout<cartesian_layout<siqad::coord_t>>>),
(charge_distribution_surface<cell_level_layout<sidb_technology, clocked_layout<cartesian_layout<siqad::coord_t>>>>))
{
TestType lyt{};
lyt.assign_cell_type({1, 3, 0}, TestType::cell_type::NORMAL);
lyt.assign_cell_type({2, 3, 0}, TestType::cell_type::NORMAL);

const quickexact_params<TestType> params{sidb_simulation_parameters{2, -0.32, 1.0e-3},
quickexact_params<TestType>::automatic_base_number_detection::OFF};

const auto simulation_results = quickexact<TestType>(lyt, params);

CHECK(simulation_results.charge_distributions.empty());
}

0 comments on commit 8ab467f

Please sign in to comment.