Skip to content

Commit

Permalink
Merge pull request igfuw#293 from pdziekan/courant_assert_fix
Browse files Browse the repository at this point in the history
fix the assert for abs(courant_x)<=1 in pred_corr
  • Loading branch information
pdziekan authored Sep 26, 2017
2 parents 7022d99 + a7ab6f0 commit 90072f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/particles_init.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ namespace libcloudphxx
if (!courant_y.is_null()) pimpl->sync(courant_y, pimpl->courant_y);
if (!courant_z.is_null()) pimpl->sync(courant_z, pimpl->courant_z);

// check if courants arent greater than 1 since it would break the predictor-corrector (halo of size 1 only)
// check if courants arent greater than 1 since it would break the predictor-corrector (halo of size 1 in the x direction)
assert(pimpl->opts_init.adve_scheme != as_t::pred_corr || (courant_x.is_null() || ((*(thrust::min_element(pimpl->courant_x.begin(), pimpl->courant_x.end()))) >= real_t(-1.) )) );
assert(pimpl->opts_init.adve_scheme != as_t::pred_corr || (courant_x.is_null() || ((*(thrust::max_element(pimpl->courant_x.begin(), pimpl->courant_x.end()))) <= real_t(-1.) )) );
assert(pimpl->opts_init.adve_scheme != as_t::pred_corr || (courant_x.is_null() || ((*(thrust::max_element(pimpl->courant_x.begin(), pimpl->courant_x.end()))) <= real_t( 1.) )) );

if (pimpl->opts_init.chem_switch)
for (int i = 0; i < chem_gas_n; ++i)
Expand Down
4 changes: 2 additions & 2 deletions src/particles_step.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ namespace libcloudphxx
pimpl->sync(courant_z, pimpl->courant_z);
pimpl->sync(rhod, pimpl->rhod);

// check if courants are greater than 1 since it would break the predictor-corrector (halo of size 1 only)
// check if courants are greater than 1 since it would break the predictor-corrector (halo of size 1 in the x direction)
assert(pimpl->opts_init.adve_scheme != as_t::pred_corr || (courant_x.is_null() || ((*(thrust::min_element(pimpl->courant_x.begin(), pimpl->courant_x.end()))) >= real_t(-1.) )) );
assert(pimpl->opts_init.adve_scheme != as_t::pred_corr || (courant_x.is_null() || ((*(thrust::max_element(pimpl->courant_x.begin(), pimpl->courant_x.end()))) <= real_t(-1.) )) );
assert(pimpl->opts_init.adve_scheme != as_t::pred_corr || (courant_x.is_null() || ((*(thrust::max_element(pimpl->courant_x.begin(), pimpl->courant_x.end()))) <= real_t( 1.) )) );

if (pimpl->opts_init.chem_switch){
for (int i = 0; i < chem_gas_n; ++i){
Expand Down

0 comments on commit 90072f5

Please sign in to comment.