Commit 2bc58961 authored by Lukas Riedel's avatar Lukas Riedel

Set xGlobalIndex in getBCindex without erroneous calculation

This fixes #34
parent af162122
......@@ -308,14 +308,21 @@ namespace Dorie{
unsigned int index = 0;
if(dim==2){
const unsigned int xGlobalIndex=(int)((bcSide-eps)/2);
// determine along which axis spatial resoultion applies
unsigned int xGlobalIndex;
if (bcSide == BC::North || bcSide == BC::South)
xGlobalIndex = 0;
if (bcSide == BC::West || bcSide == BC::East)
xGlobalIndex = 1;
// run along axis
auto it=spatialResolution[bcSide].begin();
while(*it<xGlobal[xGlobalIndex]){
it++; index++;
if(it==spatialResolution[bcSide].end())
DUNE_THROW(Exception,"BC spatial query exceeds the last segment!");
}
}
} // dim == 2
else{
unsigned int x0,x1,sr0,sr1;
if(bcSide==BC::North){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment