Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 5c5117de authored by frey_m's avatar frey_m
Browse files

Merge branch 'master' into 'master'

Master

See merge request !57
parents e42df099 cdcc735c
No related branches found
No related tags found
1 merge request!57Master
...@@ -238,7 +238,7 @@ const double& AmrParticleBase<PLayout>::domainMapping(bool inverse) { ...@@ -238,7 +238,7 @@ const double& AmrParticleBase<PLayout>::domainMapping(bool inverse) {
// if ( !this->DestroyList.empty() ) { // if ( !this->DestroyList.empty() ) {
// this->performDestroy(true); // this->performDestroy(true);
// } // }
Vector_t rmin = Vector_t(0.0, 0.0, 0.0); Vector_t rmin = Vector_t(0.0, 0.0, 0.0);
Vector_t rmax = Vector_t(0.0, 0.0, 0.0); Vector_t rmax = Vector_t(0.0, 0.0, 0.0);
...@@ -248,7 +248,8 @@ const double& AmrParticleBase<PLayout>::domainMapping(bool inverse) { ...@@ -248,7 +248,8 @@ const double& AmrParticleBase<PLayout>::domainMapping(bool inverse) {
* transformed to the local frame such that this * transformed to the local frame such that this
* particle lies on the origin (0, 0, 0). * particle lies on the origin (0, 0, 0).
*/ */
if ( this->getTotalNum() == 1 ) { if ( this->getTotalNum() == 1 ||
(rmin == Vector_t(0.0, 0.0, 0.0) && rmax == Vector_t( 0.0, 0.0, 0.0)) ) {
rmin = Vector_t(-1.0, -1.0, -1.0); rmin = Vector_t(-1.0, -1.0, -1.0);
rmax = Vector_t( 1.0, 1.0, 1.0); rmax = Vector_t( 1.0, 1.0, 1.0);
} }
...@@ -259,7 +260,7 @@ const double& AmrParticleBase<PLayout>::domainMapping(bool inverse) { ...@@ -259,7 +260,7 @@ const double& AmrParticleBase<PLayout>::domainMapping(bool inverse) {
*/ */
rmin *= gamma; rmin *= gamma;
rmax *= gamma; rmax *= gamma;
Vector_t tmp = Vector_t(std::max( std::abs(rmin[0]), std::abs(rmax[0]) ), Vector_t tmp = Vector_t(std::max( std::abs(rmin[0]), std::abs(rmax[0]) ),
std::max( std::abs(rmin[1]), std::abs(rmax[1]) ), std::max( std::abs(rmin[1]), std::abs(rmax[1]) ),
std::max( std::abs(rmin[2]), std::abs(rmax[2]) ) std::max( std::abs(rmin[2]), std::abs(rmax[2]) )
...@@ -267,7 +268,6 @@ const double& AmrParticleBase<PLayout>::domainMapping(bool inverse) { ...@@ -267,7 +268,6 @@ const double& AmrParticleBase<PLayout>::domainMapping(bool inverse) {
scale = std::max( tmp[0], tmp[1] ); scale = std::max( tmp[0], tmp[1] );
scale = std::max( scale, tmp[2] ); scale = std::max( scale, tmp[2] );
} else { } else {
// inverse Lorentz transform // inverse Lorentz transform
gamma = 1.0 / gamma; gamma = 1.0 / gamma;
...@@ -309,7 +309,7 @@ template<class PLayout> ...@@ -309,7 +309,7 @@ template<class PLayout>
void AmrParticleBase<PLayout>::getLocalBounds_m(Vector_t &rmin, Vector_t &rmax) { void AmrParticleBase<PLayout>::getLocalBounds_m(Vector_t &rmin, Vector_t &rmax) {
const size_t localNum = this->getLocalNum(); const size_t localNum = this->getLocalNum();
if (localNum == 0) { if (localNum == 0) {
double max = std::numeric_limits<double>::max(); double max = 1e10;
rmin = Vector_t( max, max, max); rmin = Vector_t( max, max, max);
rmax = Vector_t(-max, -max, -max); rmax = Vector_t(-max, -max, -max);
return; return;
......
...@@ -33,16 +33,19 @@ public: ...@@ -33,16 +33,19 @@ public:
bool isNaN = false; bool isNaN = false;
for (int j = 0; j < 3; ++j) { for (int j = 0; j < 3; ++j) {
if (std::isnan(bunch->R[i](j)) || if (std::isnan(bunch->R[i](j)) ||
std::isnan(bunch->P[i](j))) { std::isnan(bunch->P[i](j)) ||
std::abs(bunch->R[i](j)) > 1.0e20 ||
std::abs(bunch->P[i](j)) > 1.0e20) {
isNaN = true; isNaN = true;
break; break;
} }
} }
if ( !isGood || isNaN) { bool isBad = (!isGood || isNaN);
if ( isBad ) {
bunch->Bin[i] = -1; bunch->Bin[i] = -1;
} }
return !isGood; return isBad;
}; };
protected: protected:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment