1.4.0
CCC
 
spill.cpp File Reference
#include "geoslib_old_f.h"
#include "Basic/Utilities.hpp"
#include "Db/Db.hpp"
#include "Db/DbGrid.hpp"
#include "Basic/String.hpp"
#include <string.h>

Classes

struct  SPIMG
 

Functions

static double st_htop_evaluate ()
 
static void st_get_coordinates (const double *pt_out, int *ix, int *iy, SPIMG *image=SPIMG_OUT, bool flag_center=false)
 
static void st_dump (bool flagMain, const String &title, double *pt_out, SPIMG *image)
 
static void st_blank_center (SPIMG *image)
 
static void st_copy_center (int mode, int iatt, SPIMG *image, double defval)
 
static void st_extract_center (SPIMG *image, int iatt)
 
static void st_change (double *pt_out, double value)
 
static void st_convert (double hspill)
 
static SPIMGst_image_free (SPIMG *image)
 
static SPIMGst_image_alloc (double value)
 
static void st_heap_add (double *p)
 
static double * st_heap_del (void)
 
static int st_traite (double *pt_out, double *pt_vois)
 
static void st_print ()
 
static void st_final_stats (double hspill, int ix0, int iy0)
 
int spill_point (DbGrid *dbgrid, int ind_depth, int ind_data, int option, bool flag_up, int verbose_step, double hmax, double *h, const double *th, int *ix0, int *iy0)
 

Variables

static int SX
 
static int SY
 
static int TX
 
static int TY
 
static int TXY
 
static int SXY
 
static int STEP = 0
 
static int Hsize = 0
 
static double ** Heap
 
static double HMAX
 
static double HINIT
 
static double HTOP
 
static double BIGVAL
 
static int Offset_mark_out
 
static int Offset_out_in
 
static int SIGNE
 
static int OPTION
 
static int VERBOSE_STEP
 
static DbGridDB
 
static SPIMGSPIMG_OUT = nullptr
 
static SPIMGSPIMG_IN = nullptr
 
static SPIMGSPIMG_MARK = nullptr
 
static double * PT_SPILL = nullptr
 

Function Documentation

◆ spill_point()

int spill_point ( DbGrid dbgrid,
int  ind_depth,
int  ind_data,
int  option,
bool  flag_up,
int  verbose_step,
double  hmax,
double *  h,
const double *  th,
int *  ix0,
int *  iy0 
)

Evaluates the spill point

Returns
Error return code
- Memory problem
- Maximum Reservoir Thickness violation when turning UNKNOWN into
INSIDE
Parameters
[in]dbgridGrid Db structure
[in]ind_depthRank of the variable containing the depth
[in]ind_dataRank of the variable containing the data
[in]option0 for 4-connectivity; 1 for 8-connectivity
[in]flag_upTRUE when working in elevation; 0 in depth
[in]verbose_stepStep for verbose flag
[in]hmaxmaximum reservoir thickness (FFFF not used)
[out]helevation of the spill point
[out]thmaximum reservoir thickness
[out]ix0location of the spill point grid node along X
[out]iy0location of the spill point grid node along Y
Remarks
The variable 'ind_data', which contains the constraints, must
be set to:
0 for an idle node
1 for a node located outside the reservoir
2 for a node belonging to the reservoir
The numbering of the grid node corresponding to the spill point
must start with 1

◆ st_blank_center()

static void st_blank_center ( SPIMG image)
static

Blanks the center of the image

Parameters
[in,out]imageSPIMG structure to be initialized

◆ st_change()

static void st_change ( double *  pt_out,
double  value 
)
static

◆ st_convert()

static void st_convert ( double  hspill)
static

Converts the final image into the following codes: SURFACE_INSIDE, SURFACE_OUTSIDE, SURFACE_BELOW or SURFACE_UNKNOWN

Parameters
[in]hspillspill elevation

◆ st_copy_center()

static void st_copy_center ( int  mode,
int  iatt,
SPIMG image,
double  defval 
)
static

Loads the center of the image from an input array

Parameters
[in]modeType of information
  • 0 : for the height variable
  • 1 : for the data variable
[in]iattRank of the attribute
[in]defvalDefault value
[in,out]imageSPIMG structure to be initialized

◆ st_dump()

static void st_dump ( bool  flagMain,
const String title,
double *  pt_out,
SPIMG image 
)
static

Prints the current output flag array

Parameters
[in]flagMainTRUE if it is called from a main level
[in]titleTitle for the dump (main level)
[in]pt_outDesignation of the target node in 'out' (if provided)
[in]imageImage containing the information to be displayed

◆ st_extract_center()

static void st_extract_center ( SPIMG image,
int  iatt 
)
static

Extracts an output array from the the center of the image

Parameters
[in]imageSPIMG structure
[out]iattRank of the output attribute

◆ st_final_stats()

static void st_final_stats ( double  hspill,
int  ix0,
int  iy0 
)
static

◆ st_get_coordinates()

static void st_get_coordinates ( const double *  pt_out,
int *  ix,
int *  iy,
SPIMG image = SPIMG_OUT,
bool  flag_center = false 
)
static

Returns the coordinates of a point, given its pointer in 'out'

Parameters
[in]pt_outAddress in the image
[in]imageIMAGE structure
[in]flag_centerWhen TRUE, coordinates are epressed in central image
[out]ixLocation of the spill point grid node along X
[out]iyLocation of the spill point grid node along Y

◆ st_heap_add()

static void st_heap_add ( double *  p)
static

Add an element to the Heap Sort Pile

Parameters
[in]ppointer to the element to be added

◆ st_heap_del()

static double* st_heap_del ( void  )
static

Return the first element of the Heap Sort Pile and delete it

Returns
Pointer to the first element of the Heap Sort Pile

◆ st_htop_evaluate()

static double st_htop_evaluate ( )
static

Evaluates the highest elevation within the reservoir

◆ st_image_alloc()

static SPIMG* st_image_alloc ( double  value)
static

Procedure to allocates a NEW image The bitmap of the new image is set to zero

Returns
Pointer to the new image
Parameters
[in]valueconventional value for initialization

◆ st_image_free()

static SPIMG* st_image_free ( SPIMG image)
static

Procedure to free an already existig image

Returns
Pointer to the image freed (NULL)
Parameters
[in]imagepointer to the image to be freed

◆ st_print()

static void st_print ( )
static

◆ st_traite()

static int st_traite ( double *  pt_out,
double *  pt_vois 
)
static

Checks if a current element can be processed according to its neighborhood status

Returns
Flag indicating the end of the procedure:
1 : the current element and its neighboring one have
Remarks
two different status
2 : the maximum reservoir thickness has been reached
Parameters
[in]pt_outpointer to the current element
[in]pt_voispointer to the neighboring element

Variable Documentation

◆ BIGVAL

double BIGVAL
static

◆ DB

DbGrid* DB
static

◆ Heap

double** Heap
static

◆ HINIT

double HINIT
static

◆ HMAX

double HMAX
static

◆ Hsize

int Hsize = 0
static

◆ HTOP

double HTOP
static

◆ Offset_mark_out

int Offset_mark_out
static

◆ Offset_out_in

int Offset_out_in
static

◆ OPTION

int OPTION
static

◆ PT_SPILL

double* PT_SPILL = nullptr
static

◆ SIGNE

int SIGNE
static

◆ SPIMG_IN

SPIMG* SPIMG_IN = nullptr
static

◆ SPIMG_MARK

SPIMG* SPIMG_MARK = nullptr
static

◆ SPIMG_OUT

SPIMG* SPIMG_OUT = nullptr
static

◆ STEP

int STEP = 0
static

◆ SX

int SX
static

◆ SXY

int SXY
static

◆ SY

int SY
static

◆ TX

int TX
static

◆ TXY

int TXY
static

◆ TY

int TY
static

◆ VERBOSE_STEP

int VERBOSE_STEP
static