Geophysical Inversion and Modelling Library  jenkins-pyGIMLi_release-295-SUCCESS-1-geb9a2204
GIMLI::ModellingBase Class Reference

Inherited by GIMLI::DC1dModelling, GIMLI::DCMultiElectrodeModelling, GIMLI::FDEM1dModelling, GIMLI::GravimetryModelling, GIMLI::HarmonicModelling, GIMLI::LinearModelling, GIMLI::MRSModelling, GIMLI::MT1dModelling, GIMLI::PolynomialModelling, and GIMLI::TravelTimeDijkstraModelling.

+ Collaboration diagram for GIMLI::ModellingBase:

Public Member Functions

 ModellingBase (bool verbose=false)
 ModellingBase (DataContainer &dataContainer, bool verbose=false)
 ModellingBase (const Mesh &mesh, bool verbose=false)
 ModellingBase (const Mesh &mesh, DataContainer &dataContainer, bool verbose=false)
void setVerbose (bool verbose)
bool verbose () const
virtual RVector response (const RVector &model)
virtual RVector response_mt (const RVector &model, Index i=0) const
RVector operator() (const RVector &model)
void setData (DataContainer &data)
DataContainerdata () const
virtual RVector createDefaultStartModel ()
virtual RVector startModel ()
virtual void setStartModel (const RVector &startModel)
void setMesh (const Mesh &mesh, bool ignoreRegionManager=false)
Meshmesh ()
void createRefinedForwardMesh (bool refine=true, bool pRefine=false)
void deleteMesh ()
virtual void setJacobian (MatrixBase *J)
virtual void createJacobian (const RVector &model)
virtual void createJacobian (const RVector &model, const RVector &resp)
virtual void createJacobian_mt (const RVector &model, const RVector &resp)
virtual void initJacobian ()
MatrixBasejacobian ()
MatrixBasejacobian () const
virtual RMatrixjacobianRef () const
virtual RMatrixjacobianRef ()
virtual void clearJacobian ()
virtual void setConstraints (MatrixBase *C)
virtual void clearConstraints ()
virtual void initConstraints ()
virtual void createConstraints ()
virtual MatrixBaseconstraints ()
virtual MatrixBaseconstraints () const
virtual RSparseMapMatrixconstraintsRef () const
virtual RSparseMapMatrixconstraintsRef ()
const RMatrixsolution () const
void mapModel (const RVector &model, double background=0)
RVector createMappedModel (const RVector &model, double background=-9e99) const
void setRegionManager (RegionManager *reg)
const RegionManagerregionManager () const
RegionManagerregionManager ()
RegionManagerregionManagerRef ()
bool verbose ()
Regionregion (int marker)
RVector createStartModel ()
RVector createStartVector ()
void initRegionManager ()
void setThreadCount (Index nThreads)
Index threadCount ()
void setMultiThreadJacobian (Index nThreads)
Index multiThreadJacobian () const

Protected Member Functions

virtual void init_ ()
virtual void deleteMeshDependency_ ()
virtual void updateMeshDependency_ ()
virtual void updateDataDependency_ ()
void setMesh_ (const Mesh &mesh, bool update=true)

Protected Attributes

bool ownJacobian_
bool ownConstraints_
RMatrix solutions_
RVector startModel_
bool verbose_
bool regionManagerInUse_
bool ownRegionManager_
Index nThreads_
Index nThreadsJacobian_

Detailed Description

General modelling interface class.

Member Function Documentation

◆ clearJacobian()

virtual void GIMLI::ModellingBase::clearJacobian ( )

Clear Jacobian matrix.

References GIMLI::setThreadCount().

◆ createDefaultStartModel()

virtual RVector GIMLI::ModellingBase::createDefaultStartModel ( )

◆ createJacobian() [1/2]

◆ createJacobian() [2/2]

void GIMLI::ModellingBase::createJacobian ( const RVector model,
const RVector resp 

Create and fill the Jacobian matrix with a given model vector and a prior calculated response for this model. The Jacobian matrix need to by initialized and resized. If unsure take createJacobian(const RVector & model).

References GIMLI::Stopwatch::duration(), initJacobian(), GIMLI::Matrix< ValueType >::resize(), GIMLI::Matrix< ValueType >::rows(), and GIMLI::Matrix< ValueType >::setCol().

◆ createJacobian_mt()

void GIMLI::ModellingBase::createJacobian_mt ( const RVector model,
const RVector resp 

Create and fill the Jacobian matrix with a given model vector. Multi-threaded version. Will be called if setMultiThreadJacobian has been set > 1. For thread safe reasons response_mt, a read only variant of the response method need to be implemented.

References GIMLI::Stopwatch::duration(), initJacobian(), GIMLI::Matrix< ValueType >::resize(), and GIMLI::Matrix< ValueType >::rows().

Referenced by createJacobian().

◆ createMappedModel()

RVector GIMLI::ModellingBase::createMappedModel ( const RVector model,
double  background = -9e99 
) const

Read only extrapolation of model values given per cell marker to values given per cell. Exterior values will be set to background or prolongated for background != -9e99.

References GIMLI::unique().

Referenced by GIMLI::DCMultiElectrodeModelling::mapERTModel().

◆ createStartVector()

RVector GIMLI::ModellingBase::createStartVector ( )

DEPRECATED use createStartModel

References GIMLI::MatrixBase::cols(), setJacobian(), and verbose().

◆ data()

DataContainer & GIMLI::ModellingBase::data ( ) const

◆ deleteMesh()

void GIMLI::ModellingBase::deleteMesh ( )

Delete the actual mesh.

◆ initJacobian()

void GIMLI::ModellingBase::initJacobian ( )

Here you should initialize your Jacobian matrix. Default is RMatrix()

Reimplemented in GIMLI::TTModellingWithOffset, GIMLI::TravelTimeDijkstraModelling, and GIMLI::GravimetryModelling.

Referenced by createJacobian(), and createJacobian_mt().

◆ jacobian() [1/2]

MatrixBase* GIMLI::ModellingBase::jacobian ( )

◆ jacobian() [2/2]

MatrixBase* GIMLI::ModellingBase::jacobian ( ) const

Return the pointer to the Jacobian matrix associated with this forward operator.

◆ jacobianRef()

virtual RMatrix& GIMLI::ModellingBase::jacobianRef ( ) const

Return the Jacobian Matrix (read only) associated with this forward operator. Throws an exception if the jacobian is not initialized. Cannot yet be overloaded by pyplusplus (return virtual reference)(Warning 1049).

◆ multiThreadJacobian()

Index GIMLI::ModellingBase::multiThreadJacobian ( ) const

Return number of threads used for Jacobian generation.

◆ region()

Region * GIMLI::ModellingBase::region ( int  marker)

Syntactic sugar for this->regionManager().region(marker).

◆ response_mt()

virtual RVector GIMLI::ModellingBase::response_mt ( const RVector model,
Index  i = 0 
) const

Read only response function for multi threading purposes. Index i is use thread counter.

Referenced by createJacobian().

◆ setConstraints()

void GIMLI::ModellingBase::setConstraints ( MatrixBase C)

Set and get constraint matrix

Clear Constraints matrix

References GIMLI::MatrixBase::clear().

◆ setData()

void GIMLI::ModellingBase::setData ( DataContainer data)

Change the associated data container

References data().

Referenced by GIMLI::DC1dModelling::DC1dModelling().

◆ setJacobian()

void GIMLI::ModellingBase::setJacobian ( MatrixBase J)

Set external Jacobian matrix

Referenced by createStartVector().

◆ setMesh()

void GIMLI::ModellingBase::setMesh ( const Mesh mesh,
bool  ignoreRegionManager = false 

◆ setMultiThreadJacobian()

void GIMLI::ModellingBase::setMultiThreadJacobian ( Index  nThreads)

Set number of threads used for brute force Jacobian generation. 1 is default. If nThreads is greater than 1 you need to implement response_mt with a read only response function. Maybe its worth set the single setThreadCount to 1 than, that you don't find yourself in a threading overkill.

◆ setThreadCount()

void GIMLI::ModellingBase::setThreadCount ( Index  nThreads)

Set the maximum number of allowed threads for MT calculation. Have to be greater than 0. Will also set ENV(OPENBLAS_NUM_THREADS) .. if used.

References GIMLI::setThreadCount().

Referenced by GIMLI::dcfemDomainAssembleStiffnessMatrix().

◆ setVerbose()

void GIMLI::ModellingBase::setVerbose ( bool  verbose)

Set verbose state.

References verbose().

◆ startModel()

RVector GIMLI::ModellingBase::startModel ( )

Return the start model. If there is no model defined createDefaultStartModel is called which can be overloaded by child classes. !

Reimplemented in GIMLI::PolynomialModelling, and GIMLI::HarmonicModelling.

References createDefaultStartModel(), GIMLI::Mesh::createH2(), GIMLI::Mesh::createP2(), GIMLI::RegionManager::createStartModel(), and GIMLI::RegionManager::setParameterCount().

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

◆ threadCount()

Index GIMLI::ModellingBase::threadCount ( )

Return the maximum number of allowed threads for MT calculation based on local setting. GIMLI_NUM_THREADS will be used first. Give some verbose output.

References GIMLI::getEnvironment(), GIMLI::numberOfCPU(), and verbose().

◆ verbose()

bool GIMLI::ModellingBase::verbose ( ) const