gstlearn  1.0.0
CCC
FracList Class Reference

#include <FracList.hpp>

Inheritance diagram for FracList:
AStringable

Public Member Functions

 FracList (int ndisc=1000, bool flag_check=true, double low0=EPSILON8, double low1=EPSILON6, double eps=EPSILON3)
 
 FracList (const FracList &r)
 
FracListoperator= (const FracList &r)
 
virtual ~FracList ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 Interface for AStringable. More...
 
int getNFracs () const
 
int simulate (const FracEnviron &envir, bool flag_sim_layer, bool flag_sim_fract, int seed, bool verbose, const VectorDouble &elevations=VectorDouble())
 
void addDescription (const FracDesc &description=FracDesc())
 
MatrixRectangular fractureExport () const
 
MatrixRectangular layinfoExport () const
 
int fractureToBlock (DbGrid *dbgrid, double xmax, VectorDouble &permtab, double perm_mat, double perm_bench, int ndisc=1000., const NamingConvention &namconv=NamingConvention("Fractures"))
 
VectorDouble fractureToWell (int nval, const VectorDouble &well, double xmax, const VectorDouble &permtab, int *nint, int *ncol)
 
int fractureWellToBlock (DbGrid *dbgrid, int col_perm, int col_fluid, int flag_fluid, double val_fluid, const VectorDouble &wellout, int nval, int ndisc=1000., bool verbose=false)
 
VectorDouble fractureExtractLength (int ifam, double cote, double dcote)
 
VectorDouble fractureExtractDist (int ifam, double cote, double dcote)
 
void setFamily (int i, int ifam)
 
void setOrient (int i, double orient)
 
void addPoint (int i, double xx, double yy)
 
- Public Member Functions inherited from AStringable
 AStringable ()
 
 AStringable (const AStringable &r)
 
AStringableoperator= (const AStringable &r)
 
virtual ~AStringable ()
 
virtual void display (const AStringFormat *strfmt=nullptr) const final
 
virtual void display (int level) const final
 

Static Public Member Functions

static FracListfractureImport (const VectorDouble &frac_segs, const VectorDouble &layinfo=VectorDouble(), int nfamilies=0)
 

Private Member Functions

int _getRank (int ifam, int shift) const
 
void _setMemLayer (int i, double value)
 
void _setMemTheta1 (int i, int ifam, double value)
 
void _setMemTheta2 (int i, int ifam, double value)
 
void _setMemPropsur (int i, int ifam, double value)
 
void _setMemFrac (int i, int ifam, double value)
 
void _setMemTotal (int i, int ifam, double value)
 
double _getMemLayer (int i)
 
VectorDouble _layersManage (const FracEnviron &envir, double *y0)
 
VectorDouble _layersRead (const VectorDouble &elevations, double *y0)
 
int _fracAdd (int ifrac, int ifam, double xx, double cote, double thick, double orient, double *xp)
 
void _checkFractureIntersect (double cote, int ifrac0)
 
bool _belongToLayer (const FracDesc &desc, double cote, double *xd, double *yd, double *xe, double *ye)
 
double _layerIntensity (const FracFamily &family, double thick)
 
void _generateDensity (const FracEnviron &envir, const FracFamily &family, int ifam, double cote, VectorDouble &denstab)
 
void _correctDensity (const FracFamily &family, int ifam, double cote, VectorDouble &denstab)
 
double _deriveIntensity (double theta1, double thetap, double propsur)
 
double _extendFractures (const FracFamily &family, int ifam, double cote, double thick, VectorDouble &denstab)
 
bool _sameFaultSide (const FracEnviron &envir, int ifault0, double x0)
 
double _densityUpdate (const FracFault &fault, int side, int ifam, double cote, double xx)
 
double _densityCumulate (const VectorDouble &denstab)
 
bool _noRoomForMoreFracture (const VectorDouble &denstab) const
 
void _updateRepulsion (double x0, double range, VectorDouble &denstab)
 
bool _fractureInterrupt (const FracFamily &family, const FracDesc &desc, double thick)
 
double _faultAbscissae (const FracFault &fault, double cote)
 
double _cubic (double h)
 
double _fractureExtension (const FracDesc &desc, double cote, double dcote)
 
int _simulateFractures (const FracEnviron &envir, const FracFamily &family, int ifam, double cote, double thick, double theta, VectorDouble &denstab)
 
int _getDiscretizedRank (double cumdens, const VectorDouble &denstab)
 
int _getEndPointCount () const
 
bool _isValidDisc (int idisc)
 
void _plungeSegment (DbGrid *dbgrid, int iptr, double delta, double value, double x1, double y1, double x2, double y2)
 
void _welloutAdd (VectorDouble &wellout, double x, double y, int ifrac, int ip, int family, double perm)
 
void _trajAdd (VectorDouble &traj, double x, double y)
 
void _plungeSegmentGradual (DbGrid *dbgrid, int iptr, double delta, VectorDouble &traj, double perm1, double perm2, double range)
 

Private Attributes

std::vector< FracDesc_descs
 
MatrixRectangular _layinfo
 
int _nlayers
 
int _ndisc
 
bool _flagCheck
 
double _low0
 
double _low1
 
double _xorigin
 
double _step
 
double _eps
 
bool _verbose
 

Constructor & Destructor Documentation

◆ FracList() [1/2]

FracList::FracList ( int  ndisc = 1000,
bool  flag_check = true,
double  low0 = EPSILON8,
double  low1 = EPSILON6,
double  eps = EPSILON3 
)

◆ FracList() [2/2]

FracList::FracList ( const FracList r)

◆ ~FracList()

FracList::~FracList ( )
virtual

Member Function Documentation

◆ _belongToLayer()

bool FracList::_belongToLayer ( const FracDesc desc,
double  cote,
double *  xd,
double *  yd,
double *  xe,
double *  ye 
)
private

Search for the segment of a fracture belonging to the current layer

Returns
1 if the segment belongs to the layer; 0 otherwise
Parameters
[in]descDescription structure
[in]coteOrdinate of the fracture starting point
[in]xdAbscissae of the first end-point
[in]ydOrdinate of the first end-point
[in]xeAbscissae of the second end-point
[in]yeOrdinate of the second end-point

◆ _checkFractureIntersect()

void FracList::_checkFractureIntersect ( double  cote,
int  ifrac0 
)
private

Check fracture against the other ones and possibly intersect the current one

Parameters
[in]coteOrdinate of the fracture starting point
[in]ifrac0Rank of the current fracture

◆ _correctDensity()

void FracList::_correctDensity ( const FracFamily family,
int  ifam,
double  cote,
VectorDouble denstab 
)
private

Correct density due to fractures of previous families (if any)

Parameters
[in]familyFamily structure
[in]ifamRank of the family
[in]coteOrdinate of the fracture starting point
[in]denstabDiscretization density array

◆ _cubic()

double FracList::_cubic ( double  h)
private

Calculate the attenuation according to a cubic covariance shape

Returns
Returned value
Parameters
[in]hNormalized distance

◆ _densityCumulate()

double FracList::_densityCumulate ( const VectorDouble denstab)
private

Calculate the cumulated density

Returns
Total cumulated density
Parameters
[in]denstabDiscretized density array

◆ _densityUpdate()

double FracList::_densityUpdate ( const FracFault fault,
int  side,
int  ifam,
double  cote,
double  xx 
)
private

Project the contribution of a density attached to a fault

Returns
Density shape due to the Fault
Parameters
[in]faultFault structure
[in]side-1 for left and +1 for right
[in]ifamRank of the family
[in]coteOrdinate of the fracture starting point
[in]xxDiscretization abscissae
Remarks
The density shape function is analoguous to the Cubic Covariance

◆ _deriveIntensity()

double FracList::_deriveIntensity ( double  theta1,
double  thetap,
double  propsur 
)
private

Derive the intensity of the current layer given the survival

Returns
Layer actual intensity
Parameters
[in]theta1Apparent layer intensity
[in]thetapIntensity of the previous layer
[in]propsurActual survival proportion

◆ _extendFractures()

double FracList::_extendFractures ( const FracFamily family,
int  ifam,
double  cote,
double  thick,
VectorDouble denstab 
)
private

Extend already existing fractures

Returns
The proportion of survival
Parameters
[in]familyFamily structure
[in]ifamRank of the family
[in]coteOrdinate of the fracture starting point
[in]thickThickness of the layer
[in]denstabDiscretization density array

◆ _faultAbscissae()

double FracList::_faultAbscissae ( const FracFault fault,
double  cote 
)
private

Calculate the abscissae of a fault at a given elevation

Returns
The fault abscissae
Parameters
[in]faultFault structure
[in]coteOrdinate of the fracture starting point

◆ _fracAdd()

int FracList::_fracAdd ( int  ifrac,
int  ifam,
double  xx,
double  cote,
double  thick,
double  orient,
double *  xp 
)
private

Add a fracture

Returns
Rank of the fracture
Parameters
[in]ifracRank of the fracture (if old) or -1 for a new one
[in]ifamRank of the family
[in]xxAbscissae of the starting point
[in]coteOrdinate of the fracture starting point
[in]thickThickness of the layer
[in]orientOrientation
[out]xpAbscissae of the ending point

◆ _fractureExtension()

double FracList::_fractureExtension ( const FracDesc desc,
double  cote,
double  dcote 
)
private

Calculate the fracture extension

Returns
The fracture extension
Parameters
[in]descCurrent fracture description
[in]coteSelected layer or TEST for all layers
[in]dcoteTolerance on the layer elevation

◆ _fractureInterrupt()

bool FracList::_fractureInterrupt ( const FracFamily family,
const FracDesc desc,
double  thick 
)
private

Check if the fracture must be interrupted

Returns
1 if the fracture must be interrupted
Parameters
[in]familyFamily structure
[in]descCurrent fracture description
[in]thickThickness of the current layer

◆ _generateDensity()

void FracList::_generateDensity ( const FracEnviron envir,
const FracFamily family,
int  ifam,
double  cote,
VectorDouble denstab 
)
private

Generate the density along the scene

Parameters
[in]envirEnviron structure
[in]familyFamily structure
[in]ifamRank of the family
[in]coteOrdinate of the fracture starting point
[out]denstabDiscretization density array

◆ _getDiscretizedRank()

int FracList::_getDiscretizedRank ( double  cumdens,
const VectorDouble denstab 
)
private

Get the rank of the discretized cell

Returns
Rank of the discretized cell where the cumulated density reaches
the target density
Parameters
[in]cumdensTarget cumulated density
[in]denstabDiscretized density array

◆ _getEndPointCount()

int FracList::_getEndPointCount ( ) const
private

◆ _getMemLayer()

double FracList::_getMemLayer ( int  i)
inlineprivate

◆ _getRank()

int FracList::_getRank ( int  ifam,
int  shift 
) const
inlineprivate

◆ _isValidDisc()

bool FracList::_isValidDisc ( int  idisc)
private

◆ _layerIntensity()

double FracList::_layerIntensity ( const FracFamily family,
double  thick 
)
private

Derive the intensity of the current layer

Returns
Layer intensity
Parameters
[in]familyFamily structure
[in]thickLayer thickness

◆ _layersManage()

VectorDouble FracList::_layersManage ( const FracEnviron envir,
double *  y0 
)
private

Generate the series of layers

Returns
The vector of layer thicknesses
Parameters
[in]envirPointer to the Environ structure
[in]y0Ordinate of the origin
Remarks
The origin is calculated so that a layer edge is located at 0.

◆ _layersRead()

VectorDouble FracList::_layersRead ( const VectorDouble elevations,
double *  y0 
)
private

Read the series of layers

Parameters
[in]elevationsArray of elevations to be read
[out]y0Ordinate of the origin

◆ _noRoomForMoreFracture()

bool FracList::_noRoomForMoreFracture ( const VectorDouble denstab) const
private

Calculate the cumulated density

Returns
True if there is no more room for fractures
Parameters
[in]denstabDiscretized density array

◆ _plungeSegment()

void FracList::_plungeSegment ( DbGrid dbgrid,
int  iptr,
double  delta,
double  value,
double  x1,
double  y1,
double  x2,
double  y2 
)
private

Plunge a segment in a block Db

Parameters
[in]dbgridDb structure
[in]iptrPointer to the Perm variable
[in]deltaIncrement
[in]valueValue assigned to the fracture segment
[in]x1First coordinate of the first point
[in]y1Second coordinate of the first point
[in]x2First coordinate of the second point
[in]y2Second coordinate of the second point

◆ _plungeSegmentGradual()

void FracList::_plungeSegmentGradual ( DbGrid dbgrid,
int  iptr,
double  delta,
VectorDouble traj,
double  perm1,
double  perm2,
double  range 
)
private

Plunge a segment painted with gradually changing permeability in a block Db

Parameters
[in]dbgridDb structure
[in]iptrPointer to the Perm variable
[in]deltaIncrement
[in]trajVector describing the trajectory
[in]perm1Permeability at origin of curvilinear distance
[in]perm2Permeability at range of curvilinear distance
[in]rangeRange of the permeability change

◆ _sameFaultSide()

bool FracList::_sameFaultSide ( const FracEnviron envir,
int  ifault0,
double  x0 
)
private

Check that the current discretization point is not separated from the current fault by other main faults

Returns
The discretized point is not separated by another fault
Parameters
[in]envirEnviron structure
[in]ifault0Rank of the target fault
[in]x0Location of the discretized point

◆ _setMemFrac()

void FracList::_setMemFrac ( int  i,
int  ifam,
double  value 
)
inlineprivate

◆ _setMemLayer()

void FracList::_setMemLayer ( int  i,
double  value 
)
inlineprivate

◆ _setMemPropsur()

void FracList::_setMemPropsur ( int  i,
int  ifam,
double  value 
)
inlineprivate

◆ _setMemTheta1()

void FracList::_setMemTheta1 ( int  i,
int  ifam,
double  value 
)
inlineprivate

◆ _setMemTheta2()

void FracList::_setMemTheta2 ( int  i,
int  ifam,
double  value 
)
inlineprivate

◆ _setMemTotal()

void FracList::_setMemTotal ( int  i,
int  ifam,
double  value 
)
inlineprivate

◆ _simulateFractures()

int FracList::_simulateFractures ( const FracEnviron envir,
const FracFamily family,
int  ifam,
double  cote,
double  thick,
double  theta,
VectorDouble denstab 
)
private

Simulate the fractures

Returns
Number of fracture created in this layer
Parameters
[in]envirEnviron structure
[in]familyFamily structure
[in]ifamRank of the family
[in]coteOrdinate of the fracture starting point
[in]thickThickness of the layer
[in]thetaIntensity of the layer
[in]denstabDiscretized density array
                                                            F

◆ _trajAdd()

void FracList::_trajAdd ( VectorDouble traj,
double  x,
double  y 
)
private

Add a sample to the trajectory

Parameters
[in]trajArray for storing the trajectory
[in]xFirst coordinate
[in]ySecond coordinate

◆ _updateRepulsion()

void FracList::_updateRepulsion ( double  x0,
double  range,
VectorDouble denstab 
)
private

Update the discretized intensity array to account for repulsion

Parameters
[in]x0Abscissae of the fracture
[in]rangeRange for the repulsion
[in,out]denstabDiscretized density array
Remarks
We first designate the central cell of the discretized density
array where the new fault is located
The density of the central cell is set to LOW0
The density of the peripheral cells is set to LOW1
A cell is peripheral if located in the 'range' of the central one

◆ _welloutAdd()

void FracList::_welloutAdd ( VectorDouble wellout,
double  x,
double  y,
int  ifrac,
int  ip,
int  family,
double  perm 
)
private

Add an end point to the wellout array

Parameters
[in]welloutArray provided as input
[in]xAscissae of the intersection
[in]yOrdinate of the intersection
[in]ifracRank of the fracture (starting from 1)
[in]ipRank of the segment (starting from 1)
[in]familyFamily to which the fracture belongs
[in]permAssigned permeability or TEST

◆ addDescription()

void FracList::addDescription ( const FracDesc description = FracDesc())

◆ addPoint()

void FracList::addPoint ( int  i,
double  xx,
double  yy 
)
inline

◆ fractureExport()

MatrixRectangular FracList::fractureExport ( ) const

Export the Fractures

◆ fractureExtractDist()

VectorDouble FracList::fractureExtractDist ( int  ifam,
double  cote,
double  dcote 
)

Extract the fracture interdistances

Returns
The returned array
Parameters
[in]ifamRank of the family or ITEST for all
[in]coteSelected layer or TEST for all layers
[in]dcoteTolerance on the layer elevation

◆ fractureExtractLength()

VectorDouble FracList::fractureExtractLength ( int  ifam,
double  cote,
double  dcote 
)

Extract the array of fracture lengths

Returns
The returned array
Parameters
[in]ifamRank of the family or ITEST for all
[in]coteSelected layer or TEST for all layers
[in]dcoteTolerance on the layer elevation

◆ fractureImport()

FracList * FracList::fractureImport ( const VectorDouble frac_segs,
const VectorDouble layinfo = VectorDouble(),
int  nfamilies = 0 
)
static

Import the Fractures

Returns
Pointer to the FracList structure
Parameters
[in]frac_segsArray of fracture segments
[in]layinfoArray of layer information
[in]nfamiliesNumber of families

◆ fractureToBlock()

int FracList::fractureToBlock ( DbGrid dbgrid,
double  xmax,
VectorDouble permtab,
double  perm_mat,
double  perm_bench,
int  ndisc = 1000.,
const NamingConvention namconv = NamingConvention("Fractures") 
)

Plunge a subset of the simulated fractures into a block

Returns
Error return code
Parameters
[in,out]dbgridDb structure
[in]xmaxMaximum extension along horizontal axis
[in]permtabPermabilities per family (starting from 0)
[in]perm_matPermability for the matrix
[in]perm_benchPermability along the bench edge
[in]ndiscNumber of discretization steps
[in]namconvNaming convention

◆ fractureToWell()

VectorDouble FracList::fractureToWell ( int  nval,
const VectorDouble well,
double  xmax,
const VectorDouble permtab,
int *  nint,
int *  ncol 
)

Plunge a well line in a set of fractures

Returns
Array of the intersections (should be checked against NULL)
Parameters
[in]nvalNumber of well information
[in]wellArray giving the well trajectory
[in]xmaxMaximum extension along horizontal axis
[in]permtabPermabilities per family (starting from 0) Optional
[out]nintNumber of intersections
[out]ncolNumber of attributes per intersection
Remarks
Output array must be freed by the calling function

◆ fractureWellToBlock()

int FracList::fractureWellToBlock ( DbGrid dbgrid,
int  col_perm,
int  col_fluid,
int  flag_fluid,
double  val_fluid,
const VectorDouble wellout,
int  nval,
int  ndisc = 1000.,
bool  verbose = false 
)

Plunge a line trajectory and the modified permeabilities within an existing block

Returns
Error return code
Parameters
[in,out]dbgridDb structure
[in]col_permExisting attribute for permeability (or ITEST)
[in]col_fluidExisting attribute for fluid (or ITEST)
[in]flag_fluid1 for performing the Fluid filling
[in]val_fluidValue assigned to the fluid
[in]welloutPointer to the new wellout information
[in]nvalNumber of values for wellout informations
[in]ndiscNumber of discretization steps
[in]verboseVerbose flag

◆ getNFracs()

int FracList::getNFracs ( ) const
inline

◆ layinfoExport()

MatrixRectangular FracList::layinfoExport ( ) const
inline

◆ operator=()

FracList & FracList::operator= ( const FracList r)

◆ setFamily()

void FracList::setFamily ( int  i,
int  ifam 
)
inline

◆ setOrient()

void FracList::setOrient ( int  i,
double  orient 
)
inline

◆ simulate()

int FracList::simulate ( const FracEnviron envir,
bool  flag_sim_layer,
bool  flag_sim_fract,
int  seed,
bool  verbose,
const VectorDouble elevations = VectorDouble() 
)

Simulate a set of fractures

Parameters
[in]envirEnviron structure
[in]flag_sim_layerTRUE for simulating layers FALSE if they are read
[in]flag_sim_fractTRUE for simulating the fractures FALSE establish the layers and the main faults
[in]elevationsArray of elevations (used if flag_sim_layer=F)
[in]seedSeed for the random number generator
[in]verboseVerbose option

◆ toString()

String FracList::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

Interface for AStringable.

Reimplemented from AStringable.

Member Data Documentation

◆ _descs

std::vector<FracDesc> FracList::_descs
private

◆ _eps

double FracList::_eps
private

◆ _flagCheck

bool FracList::_flagCheck
private

◆ _layinfo

MatrixRectangular FracList::_layinfo
private

◆ _low0

double FracList::_low0
private

◆ _low1

double FracList::_low1
private

◆ _ndisc

int FracList::_ndisc
private

◆ _nlayers

int FracList::_nlayers
private

◆ _step

double FracList::_step
private

◆ _verbose

bool FracList::_verbose
private

◆ _xorigin

double FracList::_xorigin
private

The documentation for this class was generated from the following files: