Public Member Functions
ModelGenerator Class Reference

Brief description of class still missing. More...

#include <ModelGenerator.h>

Inheritance diagram for ModelGenerator:
DinverCore::AbstractForward

List of all members.

Public Member Functions

AbstractForwardclone () const
bool isFussyOk (const Parameter *from)
virtual double misfit (bool &ok)
 ModelGenerator ()
bool setParamSpace (ParamGroundModel *gm)
virtual void valueChanged (const Parameter *from=0)
 ~ModelGenerator ()

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

Description of constructor still missing

Referenced by clone().

{
  _vp=0;
  _vs=0;
  _rho=0;
  _poissonCondition=0;
}

Description of destructor still missing

{
  // Poisson's condition deleted by parameter space
  // Profiles deleted by ground model
}

Member Function Documentation

AbstractForward * ModelGenerator::clone ( ) const [virtual]

Implements DinverCore::AbstractForward.

References ModelGenerator(), setParamSpace(), and TRACE.

{
  TRACE;
  ModelGenerator * forward=new ModelGenerator;
  forward->setParamSpace(new ParamGroundModel(*_paramModel));
  return forward;
}
bool ModelGenerator::isFussyOk ( const Parameter from) [inline, virtual]

Reimplemented from DinverCore::AbstractForward.

References DinverDCCore::PoissonCondition::isOk().

{
  if(_poissonCondition)
    return _poissonCondition->isOk(static_cast<const GroundParameter *>(from));
  else
    return true;
}
double ModelGenerator::misfit ( bool &  ok) [virtual]

Provided for convenience, it calls misfit(double *, bool) to compute misfit from a vector of parameter values. Reimplement this function if you do not need values under this format (direct access to parameter space).

Reimplemented from DinverCore::AbstractForward.

References QGpCoreWave::Profile::depths(), QGpCoreTools::endl(), QGpCoreWave::Seismic1DModel::initCalculation(), DinverCore::AbstractForward::modelIndex(), DinverDCCore::ParamProfile::resampledProfile(), QGpCoreWave::Seismic1DModel::toStream(), QGpCoreWave::Seismic1DModel::toString(), QGpCoreTools::tr(), TRACE, and QGpCoreWave::Profile::values().

Referenced by main().

{
  TRACE;
  Seismic1DModel * surfModel =
    DCReportBlock::surfaceWaveModel(_vp->resampledProfile().depths(),
                                    _vp->resampledProfile().values(),
                                    _vs->resampledProfile().values(),
                                    _rho->resampledProfile().values());
  if( !surfModel->initCalculation()) {
    App::stream() << tr( " *** WARNING *** : bad physical model" ) << endl;
    App::stream() << surfModel->toString() << endl;
    ok=false;
  }
  QTextStream s(stdout);
  s << QString("# Model %1").arg(modelIndex()) << endl;
  surfModel->toStream(s);
  delete surfModel;
  return 0.0;
}

References DinverCore::RealSpace::addCondition(), DinverCore::RealSpace::clearParameters(), DinverDCCore::ParamGroundModel::find(), DinverCore::AbstractForward::parameterSpace(), DinverDCCore::ParamGroundModel::toParameters(), TRACE, and DinverDCCore::ParamProfile::type().

Referenced by clone(), and main().

{
  TRACE;

  _paramModel=gm;
  parameterSpace().clearParameters();
  if( !_paramModel->toParameters(parameterSpace()) ) return false;
  _vp=_paramModel->find( "Vp" );
  _vs=_paramModel->find( "Vs" );
  _rho=_paramModel->find( "Rho" );
  if(_vp && _vs) {
    ParamProfile * nu=_paramModel->find( "Nu" );
    ASSERT(nu && nu->type()==ParamProfile::Condition);
    _poissonCondition=new PoissonCondition(_vp, _vs, nu);
    parameterSpace().addCondition(_poissonCondition);
  }
  return true;
}
void ModelGenerator::valueChanged ( const Parameter from = 0) [inline, virtual]

Reimplemented from DinverCore::AbstractForward.

References DinverDCCore::ParamGroundModel::updateFinalProfiles().

{
  _paramModel->updateFinalProfiles(static_cast<const GroundParameter *>(from));
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines