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

bad indexing when some species have no Tvib #15

Merged
merged 1 commit into from Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/collide.cpp
Expand Up @@ -662,7 +662,7 @@ template < int NEARCP > void Collide::collisions_group()
for (jgroup = igroup; jgroup < ngroups; jgroup++) {
attempt = attempt_collision(icell,igroup,jgroup,volume);
nattempt = static_cast<int> (attempt);

if (nattempt) {
gpair[npair][0] = igroup;
gpair[npair][1] = jgroup;
Expand Down
16 changes: 12 additions & 4 deletions src/compute_tvib_grid.cpp
Expand Up @@ -401,23 +401,25 @@ double ComputeTvibGrid::post_process_grid(int index, int onecell, int nsample,
for (int icell = lo; icell < hi; icell++) {
evib = emap[0];
count = evib+1;

for (isp = 0; isp < nsp; isp++) {
ispecies = t2s[evib];
theta = species[ispecies].vibtemp[0];
if (theta == 0.0 || etally[icell][count] == 0.0) {
tspecies[isp] = 0.0;
evib += 2;
count = evib+1;
continue;
}
ibar = etally[icell][evib] / (etally[icell][count] * boltz * theta);
if (ibar == 0.0) {
tspecies[isp] = 0.0;
evib += 2;
count = evib+1;
continue;
}
tspecies[isp] = theta / (log(1.0 + 1.0/ibar));
//denom = boltz * etally[icell][count] * ibar * log(1.0 + 1.0/ibar);
//tspecies[isp] = etally[icell][evib] / denom;

evib += 2;
count = evib+1;
}
Expand Down Expand Up @@ -457,17 +459,20 @@ double ComputeTvibGrid::post_process_grid(int index, int onecell, int nsample,
theta = species[ispecies].vibtemp[imode];
if (theta == 0.0 || etally[icell][count] == 0.0) {
tspecies_mode[isp][imode] = 0.0;
evib += 2;
count = evib+1;
continue;
}
ibar = etally[icell][evib] / etally[icell][count];
if (ibar == 0.0) {
tspecies_mode[isp][imode] = 0.0;
evib += 2;
count = evib+1;
continue;
}
tspecies_mode[isp][imode] = theta / (log(1.0 + 1.0/ibar));
//denom = boltz * etally[icell][count] * ibar * log(1.0 + 1.0/ibar);
//tspecies_mode[isp][imode] = etally[icell][evib] / denom;

evib += 2;
count = evib+1;
}
Expand Down Expand Up @@ -511,17 +516,20 @@ double ComputeTvibGrid::post_process_grid(int index, int onecell, int nsample,
theta = species[ispecies].vibtemp[imode];
if (theta == 0.0 || etally[icell][count] == 0.0) {
tspecies_mode[isp][imode] = 0.0;
evib += 2*maxmode;
count = evib+1;
continue;
}
ibar = etally[icell][evib] / etally[icell][count];
if (ibar == 0.0) {
tspecies_mode[isp][imode] = 0.0;
evib += 2*maxmode;
count = evib+1;
continue;
}
tspecies_mode[isp][imode] = theta / (log(1.0 + 1.0/ibar));
//denom = boltz * etally[icell][count] * ibar * log(1.0 + 1.0/ibar);
//tspecies_mode[isp][imode] = etally[icell][evib] / denom;

evib += 2*maxmode;
count = evib+1;
}
Expand Down