-
Notifications
You must be signed in to change notification settings - Fork 16
Description
From @wrfox
...
if(pop == HE_population){
init_npt(non_neutralizing_population, pos, p, {jx, jy, jz}, npt);
npt.n *= HE_ratio;
...
Better is for all the case-specific code should be in init_npt.
Therefore, init_npt should return the correct density of HE particles to add. It should not need to be modified in setupParticles.
Second, there should not need to be a “non_neutralizing_population” variable
Second, I propose the pseudo-code should do the loop in the following order to handle the FIXME:
// positive charges
For each population pop
if (pop == Neutralizing population)
Continue
call init_npt (pop, …)
If npt.kind.q < 0
continue
// else positive charge
n_in_cell = get_n_in_cell ...
n_q_in_cell += kinds_[npt.kind].q * n_in_cell;
inject..
end
// negative charges
For each population pop
if (pop == Neutralizing population)
Continue
call init_npt (pop, …)
If npt.kind.q >= 0
continue
// else negative charge
n_in_cell = get_n_in_cell
// make sure don’t add non-neutralizable amount
if n_q_in_cell + kinds_[npt.kind].q * n_in_cell < 0
n_in_cell = -n_q_in_cell / kinds_[npt.kind].q;
n_q_in_cell += kinds_[npt.kind].q * n_in_cell;
inject..
end
// now add neutralizing population
call init_npt (neutralizing population, …)
n_in_cell = -n_q_in_cell / kinds_[npt.kind].q;
assert (n_in_cell >= 0) !!!!
inject...
Thanks!
Will
On Sep 8, 2020, at 9:40 PM, jcd496 notifications@github.com wrote:
I see that his build failed, idk though. It builds fine on summit with spack
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Originally posted by @wrfox in #122 (comment)