Geophysical Inversion and Modelling Library  v1.5.0
GIMLI::RegionManager Class Reference
+ Collaboration diagram for GIMLI::RegionManager:

Public Member Functions

 RegionManager (bool verbose=true)
 
RegionManageroperator= (const RegionManager &rm)
 
void setVerbose (bool verbose)
 
bool verbose () const
 
void clear ()
 
void setMesh (const Mesh &mesh, bool holdRegionInfos=false)
 
const Meshmesh () const
 
MeshpMesh ()
 
RegionaddRegion (SIndex marker)
 
RegionaddRegion (SIndex marker, const Mesh &mesh)
 
RegionaddRegion (SIndex marker, const Mesh &mesh, SIndex cellMarker)
 
const std::map< SIndex, Region * > & regions () const
 
std::map< SIndex, Region * > * regions ()
 
Index regionCount () const
 
IVector regionIdxs () const
 
Regionregion (SIndex marker)
 
bool regionExists (SIndex marker)
 
void loadMap (const std::string &fname)
 
void saveMap (const std::string &fname)
 
void setParameterCount (Index count)
 
Index parameterCount () const
 
Index constraintCount () const
 
Index interRegionConstraintsCount () const
 
RVector createStartModel ()
 
void fillStartModel (RVector &vec)
 
void fillStartVector (RVector &vec)
 
RVector createStartVector ()
 
RVector createModelControl ()
 
void fillModelControl (RVector &vec)
 
RVector constraintWeights ()
 
void fillConstraintWeights (RVector &vec)
 
void fillConstraints (RSparseMapMatrix &C)
 
void setZWeight (double z)
 
void setConstraintType (Index type)
 
void fillBoundarySize (RVector &vec)
 
const MeshparaDomain () const
 
MeshparaDomain ()
 
std::vector< RVector3boundaryNorm () const
 
void permuteParameterMarker (const IVector &p)
 
void createParaDomain_ ()
 
void recountParaMarker_ ()
 
TransCumulative< RVector > * transModel ()
 
void setLocalTransFlag (bool flag)
 
bool haveLocalTrans () const
 
void setInterRegionConstraint (SIndex a, SIndex b, double weight)
 
const std::map< std::pair< SIndex, SIndex >, double > interRegionConstraints () const
 
void setInterfaceConstraint (SIndex marker, double weight)
 
const std::map< SIndex, double > interfaceConstraints () const
 
void findInterRegionInterfaces ()
 

Protected Member Functions

void copy_ (const RegionManager &rm)
 
RegioncreateRegion_ (SIndex marker, const Mesh &mesh, SIndex cellMarker)
 
RegioncreateSingleRegion_ (SIndex marker, const std::vector< Cell * > &cells)
 
IVector allRegionMarker_ (bool excludeBoundary=false) const
 

Protected Attributes

bool verbose_
 
bool isPermuted_
 
Index parameterCount_
 
Meshmesh_
 
MeshparaDomain_
 
std::map< SIndex, Region * > regionMap_
 
std::map< std::pair< SIndex, SIndex >, std::list< Boundary * > > interRegionInterfaceMap_
 
std::map< std::pair< SIndex, SIndex >, double > interRegionConstraints_
 
std::map< SIndex, double > interfaceConstraints_
 
RVector _cWeights
 
double interRegionConstraintZWeights_
 
TransCumulative< RVectorlocalTrans_
 
bool haveLocalTrans_
 
bool localTransHaveChanges_
 

Member Function Documentation

◆ addRegion() [1/2]

Region * GIMLI::RegionManager::addRegion ( SIndex  marker)

Add an new single region.

References createSingleRegion_(), and region().

Referenced by GIMLI::TTModellingWithOffset::TTModellingWithOffset().

◆ addRegion() [2/2]

Region * GIMLI::RegionManager::addRegion ( SIndex  marker,
const Mesh mesh,
SIndex  cellMarker 
)

Add an external region to the RegionManager.

References createRegion_(), and region().

◆ constraintCount()

Index GIMLI::RegionManager::constraintCount ( ) const

Return global amount of constraints

References GIMLI::x().

Referenced by fillConstraints(), and GIMLI::RInversion::run().

◆ constraintWeights()

RVector GIMLI::RegionManager::constraintWeights ( )

Return constraint weights. They are created together with the constraints matrix

Referenced by GIMLI::RInversion::checkConstraints().

◆ createModelControl()

RVector GIMLI::RegionManager::createModelControl ( )

Create and fill global model-weight vector

References fillModelControl(), and parameterCount().

◆ createRegion_()

Region * GIMLI::RegionManager::createRegion_ ( SIndex  marker,
const Mesh mesh,
SIndex  cellMarker 
)
protected

Fill interRegionInterfaceMap_

Internal method to create a region. The method is called from setMesh()

References region(), and GIMLI::Region::resize().

Referenced by addRegion().

◆ createSingleRegion_()

Region * GIMLI::RegionManager::createSingleRegion_ ( SIndex  marker,
const std::vector< Cell * > &  cells 
)
protected

Internal method to create a single parameter region. The method is called from setMesh()

References region(), and GIMLI::Region::resize().

Referenced by addRegion().

◆ createStartModel()

RVector GIMLI::RegionManager::createStartModel ( )

Create starting model by iterating over all regions.

References fillStartModel(), and parameterCount().

◆ createStartVector()

RVector GIMLI::RegionManager::createStartVector ( )
inline

DEPRECATED use setStartModel

◆ fillConstraints()

void GIMLI::RegionManager::fillConstraints ( RSparseMapMatrix C)

◆ fillConstraintWeights()

void GIMLI::RegionManager::fillConstraintWeights ( RVector vec)

Fill global constraints-weight vector. DEPRECATED

◆ fillModelControl()

void GIMLI::RegionManager::fillModelControl ( RVector vec)

Fill global model-weight vector

** no regions: fill 0th-order constraints

References parameterCount(), GIMLI::Vector< ValueType >::resize(), and GIMLI::x().

Referenced by GIMLI::RInversion::checkConstraints(), and createModelControl().

◆ fillStartModel()

void GIMLI::RegionManager::fillStartModel ( RVector vec)

Fill vec with starting model values by iterating over all regions.

References parameterCount(), GIMLI::Vector< ValueType >::resize(), and GIMLI::x().

Referenced by createStartModel().

◆ fillStartVector()

void GIMLI::RegionManager::fillStartVector ( RVector vec)
inline

DEPRECATED use setStartModel

◆ interfaceConstraints()

const std::map< SIndex, double > GIMLI::RegionManager::interfaceConstraints ( ) const
inline

Return read only access to the interface constraint weights map.

◆ interRegionConstraints()

const std::map< std::pair< SIndex, SIndex >, double > GIMLI::RegionManager::interRegionConstraints ( ) const
inline

Retrun inter region constraint weights for all connecting regions.

◆ loadMap()

void GIMLI::RegionManager::loadMap ( const std::string &  fname)

load region parameters from region control file

References GIMLI::Region::boundaries(), GIMLI::lower(), region(), setInterfaceConstraint(), setInterRegionConstraint(), and GIMLI::x().

◆ parameterCount()

Index GIMLI::RegionManager::parameterCount ( ) const

Return global amount of parameter

References GIMLI::x().

Referenced by createModelControl(), createStartModel(), fillConstraints(), fillModelControl(), and fillStartModel().

◆ permuteParameterMarker()

void GIMLI::RegionManager::permuteParameterMarker ( const IVector p)

Permute all parameter marker after successful filled the Regionmanager.

References GIMLI::x().

◆ region()

Region * GIMLI::RegionManager::region ( SIndex  marker)

Returns a ptr to the region with the given marker. If no region exist an exception is thrown.

Referenced by addRegion(), createRegion_(), createSingleRegion_(), loadMap(), and setInterRegionConstraint().

◆ regionIdxs()

IVector GIMLI::RegionManager::regionIdxs ( ) const
inline

Return all region Indieces.

◆ saveMap()

void GIMLI::RegionManager::saveMap ( const std::string &  fname)

save region parameters to region control file

◆ setInterfaceConstraint()

void GIMLI::RegionManager::setInterfaceConstraint ( SIndex  marker,
double  weight 
)
inline

Set interface constraints weight for boundaries with a given marker.

Referenced by loadMap().

◆ setInterRegionConstraint()

void GIMLI::RegionManager::setInterRegionConstraint ( SIndex  a,
SIndex  b,
double  weight 
)

Set inter region constraint weights between region a and b.

References GIMLI::Region::isBackground(), and region().

Referenced by loadMap().

◆ setParameterCount()

void GIMLI::RegionManager::setParameterCount ( Index  count)
inline

Set the amount of parameter, will be override if regions are defined

Referenced by GIMLI::HarmonicModelling::HarmonicModelling().

◆ setZWeight()

void GIMLI::RegionManager::setZWeight ( double  z)

Syntactic sugar: set zweight/constraintType to all regions.

References GIMLI::x(), and GIMLI::z().