Geophysical Inversion and Modelling Library v1.5.4
|
#include <modellingbase.h>
Inherited by GIMLI::DC1dModelling, GIMLI::DCMultiElectrodeModelling, GIMLI::FDEM1dModelling, GIMLI::GravimetryModelling, GIMLI::HarmonicModelling, GIMLI::LinearModelling, GIMLI::MRSModelling, GIMLI::MT1dModelling, GIMLI::PolynomialModelling, and GIMLI::TravelTimeDijkstraModelling.
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) |
DataContainer & | data () const |
virtual RVector | createDefaultStartModel () |
virtual RVector | startModel () |
virtual void | setStartModel (const RVector &startModel) |
void | setMesh (const Mesh &mesh, bool ignoreRegionManager=false) |
Mesh * | mesh () |
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 () |
MatrixBase * | jacobian () |
MatrixBase * | jacobian () const |
virtual RMatrix & | jacobianRef () const |
virtual RMatrix & | jacobianRef () |
virtual void | clearJacobian () |
virtual void | setConstraints (MatrixBase *C) |
virtual void | clearConstraints () |
virtual void | initConstraints () |
virtual void | createConstraints () |
virtual MatrixBase * | constraints () |
virtual MatrixBase * | constraints () const |
virtual RSparseMapMatrix & | constraintsRef () const |
virtual RSparseMapMatrix & | constraintsRef () |
const RMatrix & | solution () const |
void | mapModel (const RVector &model, double background=0) |
RVector | createMappedModel (const RVector &model, double background=-9e99) const |
void | setRegionManager (RegionManager *reg) |
const RegionManager & | regionManager () const |
RegionManager & | regionManager () |
RegionManager & | regionManagerRef () |
bool | verbose () |
Region * | region (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 | |
Mesh * | mesh_ |
DataContainer * | dataContainer_ |
MatrixBase * | jacobian_ |
bool | ownJacobian_ |
MatrixBase * | constraints_ |
bool | ownConstraints_ |
RMatrix | solutions_ |
RVector | startModel_ |
bool | verbose_ |
bool | regionManagerInUse_ |
bool | ownRegionManager_ |
Index | nThreads_ |
Index | nThreadsJacobian_ |
General modelling interface class.
|
inlinevirtual |
Clear Jacobian matrix.
|
inlinevirtual |
Interface to define custom start model generators.
Reimplemented in GIMLI::DC1dModelling, GIMLI::DC1dRhoModelling, GIMLI::DCMultiElectrodeModelling, GIMLI::GravimetryModelling, GIMLI::LinearModelling, GIMLI::TravelTimeDijkstraModelling, and GIMLI::TTModellingWithOffset.
Referenced by startModel().
|
virtual |
Create and fill the Jacobian matrix with a given model vector.
Reimplemented in GIMLI::DCMultiElectrodeModelling, GIMLI::GravimetryModelling, GIMLI::HarmonicModelling, GIMLI::LinearModelling, GIMLI::MRS1dBlockModelling, GIMLI::MRSModelling, GIMLI::TravelTimeDijkstraModelling, and GIMLI::TTModellingWithOffset.
References createJacobian(), createJacobian_mt(), initJacobian(), GIMLI::Matrix< ValueType >::resize(), response_mt(), and GIMLI::Matrix< ValueType >::rows().
Referenced by createJacobian(), createJacobian(), and GIMLI::MRS1dBlockModelling::createJacobian().
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 createJacobian(), GIMLI::Stopwatch::duration(), initJacobian(), GIMLI::Matrix< ValueType >::resize(), GIMLI::Matrix< ValueType >::rows(), and GIMLI::Matrix< ValueType >::setCol().
|
virtual |
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 createJacobian_mt(), GIMLI::Stopwatch::duration(), initJacobian(), GIMLI::Matrix< ValueType >::resize(), and GIMLI::Matrix< ValueType >::rows().
Referenced by createJacobian(), and createJacobian_mt().
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 createMappedModel(), and GIMLI::unique().
Referenced by createMappedModel(), GIMLI::DCMultiElectrodeModelling::mapERTModel(), and GIMLI::TravelTimeDijkstraModelling::response().
RVector GIMLI::ModellingBase::createStartVector | ( | ) |
DataContainer & GIMLI::ModellingBase::data | ( | ) | const |
Return the associated data container.
References data().
Referenced by data(), GIMLI::DC1dModelling::DC1dModelling(), and setData().
void GIMLI::ModellingBase::deleteMesh | ( | ) |
|
protectedvirtual |
Reimplemented in GIMLI::DC1dModelling.
|
virtual |
Here you should initialize your Jacobian matrix. Default is RMatrix()
Reimplemented in GIMLI::GravimetryModelling, GIMLI::TravelTimeDijkstraModelling, and GIMLI::TTModellingWithOffset.
References initJacobian().
Referenced by createJacobian(), createJacobian(), createJacobian_mt(), and initJacobian().
|
inline |
Return the pointer to the Jacobian matrix associated with this forward operator.
Referenced by GIMLI::HarmonicModelling::createJacobian(), GIMLI::MRSModelling::createJacobian(), and GIMLI::TTModellingWithOffset::createJacobian().
|
inline |
Return the pointer to the Jacobian matrix associated with this forward operator.
|
inlinevirtual |
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).
|
inline |
Return number of threads used for Jacobian generation.
Region * GIMLI::ModellingBase::region | ( | int | marker | ) |
Reimplemented in GIMLI::DC1dModelling, GIMLI::DC1dModellingC, GIMLI::DC1dRhoModelling, GIMLI::DCMultiElectrodeModelling, GIMLI::GravimetryModelling, GIMLI::HarmonicModelling, GIMLI::LinearModelling, GIMLI::MRS1dBlockModelling, GIMLI::MRSModelling, GIMLI::MT1dModelling, GIMLI::MT1dRhoModelling, GIMLI::TravelTimeDijkstraModelling, and GIMLI::TTModellingWithOffset.
|
inlinevirtual |
Read only response function for multi threading purposes. Index i is use thread counter.
Referenced by createJacobian().
|
virtual |
Set and get constraint matrix
Clear Constraints matrix
References setConstraints().
Referenced by setConstraints().
void GIMLI::ModellingBase::setData | ( | DataContainer & | data | ) |
Change the associated data container
References data(), and setData().
Referenced by GIMLI::DC1dModelling::DC1dModelling(), and setData().
|
virtual |
void GIMLI::ModellingBase::setMesh | ( | const Mesh & | mesh, |
bool | ignoreRegionManager = false ) |
Set new mesh to the forward operator, optionally hold region parameter for the new mesh (i.e. for roll a long)
References GIMLI::Stopwatch::duration(), and setMesh().
Referenced by GIMLI::DCSRMultiElectrodeModelling::checkPrimpotentials_(), GIMLI::DC1dModelling::DC1dModelling(), GIMLI::DC1dModelling::DC1dModelling(), GIMLI::DC1dModelling::DC1dModelling(), GIMLI::DC1dModellingC::DC1dModellingC(), GIMLI::DC1dModellingC::DC1dModellingC(), GIMLI::FDEM1dRhoModelling::FDEM1dRhoModelling(), GIMLI::MRS1dBlockModelling::MRS1dBlockModelling(), and setMesh().
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.
References setMultiThreadJacobian().
Referenced by setMultiThreadJacobian().
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 setThreadCount(), and GIMLI::setThreadCount().
Referenced by setThreadCount().
void GIMLI::ModellingBase::setVerbose | ( | bool | verbose | ) |
|
virtual |
Return the start model. If there is no model defined createDefaultStartModel is called which can be overloaded by child classes. !
Reimplemented in GIMLI::HarmonicModelling, and GIMLI::PolynomialModelling.
References createDefaultStartModel(), and startModel().
Referenced by startModel().
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::numberOfCPU(), threadCount(), and verbose().
Referenced by GIMLI::TravelTimeDijkstraModelling::response(), and threadCount().
|
inlineprotectedvirtual |
Reimplemented in GIMLI::TravelTimeDijkstraModelling.
|
inline |
Get verbose state.
Referenced by GIMLI::DC1dModelling::DC1dModelling(), GIMLI::DC1dModelling::DC1dModelling(), GIMLI::DC1dModelling::DC1dModelling(), GIMLI::DC1dModellingC::DC1dModellingC(), GIMLI::DC1dModellingC::DC1dModellingC(), GIMLI::FDEM1dModelling::FDEM1dModelling(), GIMLI::FDEM1dRhoModelling::FDEM1dRhoModelling(), GIMLI::HarmonicModelling::HarmonicModelling(), GIMLI::MRS1dBlockModelling::MRS1dBlockModelling(), GIMLI::MRS1dBlockModelling::MRS1dBlockModelling(), GIMLI::MRSModelling::MRSModelling(), GIMLI::MRSModelling::MRSModelling(), GIMLI::TravelTimeDijkstraModelling::response(), setVerbose(), threadCount(), and GIMLI::TTModellingWithOffset::TTModellingWithOffset().