Skip to content

Commit fe9667e

Browse files
New search neighborhood: SearchAnnulusStratigraphic to perform lateral searches along a given stratigraphic interval (index W) in GeoGrids.
1 parent d1bcef0 commit fe9667e

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

GammaRay.pro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ SOURCES += main.cpp\
5353
geostats/contactanalysis.cpp \
5454
geostats/mcmcdataimputation.cpp \
5555
geostats/searchannulus.cpp \
56+
geostats/searchannulusstratigraphic.cpp \
5657
geostats/searchsphericalshell.cpp \
5758
geostats/searchverticaldumbbell.cpp \
5859
geostats/searchwasher.cpp \
@@ -337,6 +338,7 @@ HEADERS += mainwindow.h \
337338
geostats/contactanalysis.h \
338339
geostats/mcmcdataimputation.h \
339340
geostats/searchannulus.h \
341+
geostats/searchannulusstratigraphic.h \
340342
geostats/searchsphericalshell.h \
341343
geostats/searchverticaldumbbell.h \
342344
geostats/searchwasher.h \
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#include "searchannulusstratigraphic.h"
2+
3+
#include "domain/geogrid.h"
4+
5+
SearchAnnulusStratigraphic::SearchAnnulusStratigraphic(double innerRadius, double outerRadius, GeoGrid* geoGrid) :
6+
SearchAnnulus( innerRadius, outerRadius ),
7+
m_geoGrid( geoGrid )
8+
{}
9+
10+
bool SearchAnnulusStratigraphic::isInside(double centerX, double centerY, double centerZ,
11+
double x, double y, double z) const
12+
{
13+
//determine the stratigraphic intervals corresponding to the
14+
//reference location and to the query location
15+
uint I, J, refK, queryK;
16+
m_geoGrid->XYZtoIJK(centerX, centerY, centerZ, I, J, refK);
17+
m_geoGrid->XYZtoIJK(x, y, z, I, J, queryK);
18+
19+
//if both locations don't lie in the same stratigraphic interval, return a miss.
20+
if( refK != queryK )
21+
return false;
22+
23+
//if the locations belong to the same stratigraphic interval, do the same geometric in/out
24+
//test as in SeachAnnulus for 2D datasets.
25+
return SearchAnnulus::isInside( centerX, centerY, centerZ, x, y, z );
26+
}

geostats/searchannulusstratigraphic.h

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#ifndef SEARCHANNULUSSTRATIGRAPHIC_H
2+
#define SEARCHANNULUSSTRATIGRAPHIC_H
3+
4+
#include "geostats/searchannulus.h"
5+
6+
class GeoGrid;
7+
8+
/**
9+
* The SearchAnnulusStratigraphic class represents a search neighborhood with the shape of an annulus (2D ring)
10+
* along a given stratigraphic interval (topological index K) of a geological grid (class GeoGrid).
11+
* Being 2D, this search neighborhood is recommended for usage with 2D data sets.
12+
*/
13+
class SearchAnnulusStratigraphic : public SearchAnnulus
14+
{
15+
public:
16+
SearchAnnulusStratigraphic( double innerRadius, double outerRadius, GeoGrid* geoGrid );
17+
18+
/** Move constructor. */
19+
SearchAnnulusStratigraphic( SearchAnnulusStratigraphic&& right_hand_side );
20+
21+
22+
////-------------SearchNeighborhood interface------------------------------------------
23+
/**
24+
* @note As this search neighborhood is 2D, the z coordinates are ignored in the test.
25+
*/
26+
virtual bool isInside(double centerX, double centerY, double centerZ,
27+
double x, double y, double z ) const;
28+
////-------------------------------------------------------------------------------------
29+
30+
31+
GeoGrid* m_geoGrid;
32+
};
33+
34+
#endif // SEARCHANNULUSSTRATIGRAPHIC_H

0 commit comments

Comments
 (0)