Geophysical Inversion and Modelling Library v1.5.4
Loading...
Searching...
No Matches
GIMLI::Region Class Reference

Public Member Functions

 Region (SIndex marker, RegionManager *parent, bool single=false)
 
 Region (SIndex marker, const Mesh &mesh, RegionManager *parent)
 
 Region (SIndex marker, const Mesh &mesh, SIndex cellMarker, RegionManager *parent)
 
 Region (const Region &region)
 
Regionoperator= (const Region &region)
 
void setMarker (SIndex marker)
 
SIndex marker () const
 
void resize (const Mesh &mesh, SIndex cellMarker)
 
void resize (const std::vector< Cell * > &cells)
 
void markBackground (bool background)
 
void setBackground (bool background=true)
 
bool isBackground () const
 
void markSingle (bool issingle)
 
void setSingle (bool background=true)
 
bool isSingle () const
 
bool isInParaDomain () const
 
Index parameterCount () const
 
Index startParameter () const
 
Index endParameter () const
 
void setConstraintType (Index type)
 
Index constraintType () const
 
Index constraintCount () const
 
void fillConstraints (RSparseMapMatrix &C, Index startConstraintsID)
 
void setConstraintWeights (double bc)
 
void setConstraintWeights (const RVector &cw)
 
const RVectorconstraintWeights ()
 
void fillConstraintWeights (RVector &vec, Index constraintStart)
 
void _createConstraintWeights ()
 
void setZWeight (double zw)
 
double zWeight () const
 
void setFixValue (double val)
 
double fixValue () const
 
void fillBoundaryNorm (std::vector< RVector3 > &vnorm, Index boundCount)
 
void fillBoundarySize (RVector &vec, Index boundStart)
 
void fillStartModel (RVector &vec)
 
void fillModelControl (RVector &vec)
 
const std::vector< Boundary * > & boundaries () const
 
const std::vector< Cell * > & cells () const
 
std::vector< Cell * > & cells ()
 
void countParameter (Index start)
 
bool isPermuted () const
 
void permuteParameterMarker (const IndexArray &p)
 
const IndexArrayparaIds () const
 
void setStartModel (const RVector &start)
 
void setStartModel (double start)
 
void setStartValue (double start)
 
void setModelControl (double val)
 
void setModelControl (const RVector &vec)
 
double modelControl ()
 
void setTransModel (Trans< RVector > &tM)
 
Trans< RVector > * transModel ()
 
void setLowerBound (double lb)
 
void setUpperBound (double ub)
 
void setParameters (double start, double lb, double ub, std::string transString="")
 
void setModelTransStr_ (const std::string &val)
 
void setModelControlStr_ (const std::string &val)
 
void setStartModelStr_ (const std::string &val)
 
void setZWeightStr_ (const std::string &val)
 
void setFixValueStr_ (const std::string &val)
 
void setConstraintTypeStr_ (const std::string &val)
 
void setLowerBoundStr_ (const std::string &val)
 
void setUpperBoundStr_ (const std::string &val)
 
void setSingleStr_ (const std::string &val)
 
void setBackgroundStr_ (const std::string &val)
 

Protected Member Functions

void init_ ()
 
void copy_ (const Region &region)
 

Protected Attributes

SIndex marker_
 
RegionManagerparent_
 
std::vector< Cell * > cells_
 
std::vector< Boundary * > bounds_
 
bool isBackground_
 
bool isSingle_
 
bool isPermuted_
 
bool _isInParaDomain
 
IndexArray paraIDs_
 
Index parameterCount_
 
Index startParameter_
 
Index endParameter_
 
Index constraintType_
 
RVector startModel_
 
double modelControl_
 
RVector constraintWeights_
 
double zWeight_
 
double fixValue_
 
double mcDefault_
 
double startDefault_
 
double lowerBound_
 
double upperBound_
 
Trans< RVector > * tM_
 
bool ownsTrans_
 
std::string transString_
 

Member Function Documentation

◆ _createConstraintWeights()

void GIMLI::Region::_createConstraintWeights ( )

Helper method that convert cWeight parameter into individual constraintsWeights depending on the associated boundary norm. At the moment only zWeight is considered.

z-component

rather linear for bigger angles

References _createConstraintWeights(), constraintCount(), constraintType(), and GIMLI::Boundary::norm().

Referenced by _createConstraintWeights(), and constraintWeights().

◆ boundaries()

const std::vector< Boundary * > & GIMLI::Region::boundaries ( ) const
inline

Returns read_only acccess to the boundaries of this region

Referenced by GIMLI::RegionManager::loadMap().

◆ constraintCount()

Index GIMLI::Region::constraintCount ( ) const

Returns number of constraints defined for this region, For single region return 1,
for constraintstype == 0 return amount of parameter cells,
else return amount of inner boundaries

References constraintCount(), and parameterCount().

Referenced by _createConstraintWeights(), constraintCount(), setConstraintWeights(), and setConstraintWeights().

◆ constraintType()

Index GIMLI::Region::constraintType ( ) const
inline

Return constraint type for this region.

Referenced by _createConstraintWeights().

◆ constraintWeights()

const RVector & GIMLI::Region::constraintWeights ( )

Return constraint weights as RVector (default RVector(constraintCount, 1.0)

References _createConstraintWeights(), and constraintWeights().

Referenced by constraintWeights(), and fillConstraintWeights().

◆ endParameter()

Index GIMLI::Region::endParameter ( ) const
inline

Return the last parameter id by means of a global count, defined in countParameter called from RegionManager

◆ fillConstraints()

void GIMLI::Region::fillConstraints ( RSparseMapMatrix & C,
Index startConstraintsID )

Fill given constraints matrix with local constraints. For single region (startConstraintsID, startParameter_) = 1,
for constraintstype == 0 fill (startConstraintsID + i, startParameter_ + i) = 1, i=1..constraintCount()
else fill (startConstraintsID + i, Boundary_i_leftNeightbourParameterID) = 1, (startConstraintsID + i, Boundary_i_rightNeightbourParameterID) = -1, i = 1..nBoundaries.

References fillConstraints(), GIMLI::Boundary::leftCell(), and marker().

Referenced by fillConstraints().

◆ fillConstraintWeights()

void GIMLI::Region::fillConstraintWeights ( RVector & vec,
Index constraintStart )

Fill global constraints weight vector started at constraintStart.

References constraintWeights(), fillConstraintWeights(), and GIMLI::Vector< ValueType >::setVal().

Referenced by fillConstraintWeights().

◆ isBackground()

bool GIMLI::Region::isBackground ( ) const
inline

Return true if this region is a parameter region

Referenced by GIMLI::RegionManager::fillConstraints(), and GIMLI::RegionManager::setInterRegionConstraint().

◆ isInParaDomain()

bool GIMLI::Region::isInParaDomain ( ) const
inline

Return true if the cells of this region are part of the primary paradomain.

◆ isPermuted()

bool GIMLI::Region::isPermuted ( ) const
inline

Are the parameter indecies are ascending or permuted.

◆ isSingle()

bool GIMLI::Region::isSingle ( ) const
inline

Return true if this region is a single parameter region

Referenced by GIMLI::RegionManager::fillConstraints().

◆ markBackground()

void GIMLI::Region::markBackground ( bool background)
inline

Mark this region to be a background region, need RegionManger::recount

◆ marker()

SIndex GIMLI::Region::marker ( ) const
inline

Return the region marker id.

Referenced by fillConstraints(), resize(), and setMarker().

◆ markSingle()

void GIMLI::Region::markSingle ( bool issingle)
inline

Mark this region to be a single parameter region, need RegionManger::recount

Referenced by setSingle().

◆ paraIds()

const IndexArray & GIMLI::Region::paraIds ( ) const
inline

Return all parameter indices of this region.

◆ parameterCount()

Index GIMLI::Region::parameterCount ( ) const
inline

Return number of parameters for this region, 1 on single region

Referenced by constraintCount().

◆ permuteParameterMarker()

void GIMLI::Region::permuteParameterMarker ( const IndexArray & p)

Permute parameter indecies.

References permuteParameterMarker().

Referenced by permuteParameterMarker().

◆ resize() [1/2]

void GIMLI::Region::resize ( const Mesh & mesh,
SIndex cellMarker )

Set new parameter cells, i.e. update the related mesh and all sizes.

References GIMLI::Mesh::findCellByMarker(), GIMLI::Boundary::leftCell(), marker(), and resize().

Referenced by resize(), and resize().

◆ resize() [2/2]

void GIMLI::Region::resize ( const std::vector< Cell * > & cells)

Set new parameter cells, i.e. update the related mesh and all sizes. Only for single region.

References resize().

◆ setBackground()

void GIMLI::Region::setBackground ( bool background = true)

Set this region to be a background region. Forces the regionmanager to recount all regions.

References setBackground().

Referenced by setBackground(), and setFixValue().

◆ setConstraintType()

void GIMLI::Region::setConstraintType ( Index type)

Set the constraint type for this region available(0, 1)

References setConstraintType().

Referenced by setConstraintType().

◆ setConstraintWeights() [1/2]

void GIMLI::Region::setConstraintWeights ( const RVector & cw)

Set region wide variable constraints weight from RVector cw. If this method is called background is forced to false.

References constraintCount(), and setConstraintWeights().

◆ setConstraintWeights() [2/2]

void GIMLI::Region::setConstraintWeights ( double bc)

Set region wide constant constraints weight, (default = 1). If this method is called background is forced to false.

References constraintCount(), and setConstraintWeights().

Referenced by setConstraintWeights(), and setConstraintWeights().

◆ setFixValue()

void GIMLI::Region::setFixValue ( double val)

Set fixed value for background regions that will not part of any value prolongation.

References setBackground(), and setFixValue().

Referenced by setFixValue().

◆ setLowerBound()

void GIMLI::Region::setLowerBound ( double lb)

set lower parameter bound for region

References setLowerBound().

Referenced by setLowerBound().

◆ setMarker()

void GIMLI::Region::setMarker ( SIndex marker)
inline

Set the region marker id

References marker().

◆ setParameters()

void GIMLI::Region::setParameters ( double start,
double lb,
double ub,
std::string transString = "" )

set start and upper/lower bounds for region

References setParameters(), and setStartModel().

Referenced by setParameters().

◆ setSingle()

void GIMLI::Region::setSingle ( bool background = true)

Set this region to be a single parameter region. Forces the regionmanager to recount all regions.

References markSingle(), and setSingle().

Referenced by setSingle().

◆ setStartModel() [1/2]

void GIMLI::Region::setStartModel ( const RVector & start)

Set the values of start for the start model of this region.

References setStartModel().

Referenced by setParameters(), setStartModel(), setStartModel(), and setStartValue().

◆ setStartModel() [2/2]

void GIMLI::Region::setStartModel ( double start)

Set the value of start into the start model vector for this region.

References setStartModel().

◆ setStartValue()

void GIMLI::Region::setStartValue ( double start)
inline

DEPRECATED use setStartModel

DEPRECATED use setStartModel

References setStartModel().

◆ setUpperBound()

void GIMLI::Region::setUpperBound ( double ub)

set lower parameter bound for region

References setUpperBound().

Referenced by setUpperBound().

◆ setZWeight()

void GIMLI::Region::setZWeight ( double zw)
inline

Set Region-Wide horizontal(z) weighting parameter for anisotropic smoothing
1 - isotrope, 0 – no vertical smoothing

◆ startParameter()

Index GIMLI::Region::startParameter ( ) const
inline

Return the first parameter id by means of a global count, defined in countParameter called from RegionManager

Referenced by GIMLI::RegionManager::fillConstraints().

◆ transModel()

Trans< RVector > * GIMLI::Region::transModel ( )
inline

Return a cumulative transform function based on transform functions for each region. Return NULL if no region is defined.

◆ zWeight()

double GIMLI::Region::zWeight ( ) const
inline

Return Region-Wide horizontal(z)-weighting parameter