All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions | Protected Member Functions
QGpCoreWave::DispersionFactory Class Reference

Brief description of class still missing. More...

#include <DispersionFactory.h>

Inheritance diagram for QGpCoreWave::DispersionFactory:
QGpCoreWave::ModalFactory

List of all members.

Public Member Functions

bool calculate (const Seismic1DModel *model, EllipticityFactory *ellFactory)
 DispersionFactory ()
DispersiongroupLove () const
DispersiongroupRayleigh () const
virtual const RealValuemode (const Mode &m) const
DispersionphaseLove () const
DispersionphaseRayleigh () const
virtual void setMode (const Mode &m)
virtual ModalStoragestorage (int storageIndex) const
virtual int storageCount () const
void validate (EllipticityFactory *ellFactory, AutocorrFactory *autocorr)
 ~DispersionFactory ()

Protected Member Functions

virtual ModalStoragenewStorage (int nModes)

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

References TRACE.

{
  TRACE;
  _phaseRayleigh=0;
  _phaseLove=0;
  _groupRayleigh=0;
  _groupLove=0;
}

References TRACE.

{
  TRACE;
  delete _phaseRayleigh;
  delete _phaseLove;
  delete _groupRayleigh;
  delete _groupLove;
}

Member Function Documentation

Calculate theoretical curves

References QGpCoreWave::ModalStorage::abs(), QGpCoreWave::Dispersion::calculate(), QGpCoreWave::Dispersion::setGroupSlowness(), TRACE, and QGpCoreWave::EllipticityFactory::values().

Referenced by SpacReader::parse(), and DinverDCCore::TargetList::surfaceMisfit().

{
  TRACE;
  if(_phaseRayleigh) {
    Rayleigh rayleigh(m);
    Ellipticity * ell;
    if(ellFactory) {
      ell=ellFactory->values();
    } else {
      ell=0;
    }
    if(!_phaseRayleigh->calculate(&rayleigh, ell)) {
      return false;
    }
    if(ell) { // Since 2011-01-07, signed ellipticity is computed
      ell->abs();
    }
    if(_groupRayleigh) {
      *_groupRayleigh=*_phaseRayleigh;
      _groupRayleigh->setGroupSlowness();
    }
  }
  if(_phaseLove) {
    Love love(m);
    if(!_phaseLove->calculate(&love)) {
      return false;
    }
    if(_groupLove) {
      *_groupLove=*_phaseLove;
      _groupLove->setGroupSlowness();
    }
  }
  return true;
}
{return _groupLove;}

Referenced by DinverDCCore::TargetList::dispersionSampleCount().

{return _groupRayleigh;}
const RealValue * QGpCoreWave::DispersionFactory::mode ( const Mode m) const [virtual]

Implements QGpCoreWave::ModalFactory.

References QGpCoreWave::Mode::Group, QGpCoreWave::Mode::index(), QGpCoreWave::Mode::Love, QGpCoreWave::ModalStorage::mode(), QGpCoreWave::Mode::Phase, QGpCoreWave::Mode::polarisation(), QGpCoreWave::Mode::Radial, QGpCoreWave::Mode::Rayleigh, QGpCoreWave::Mode::slowness(), QGpCoreWave::Mode::Transverse, and QGpCoreWave::Mode::Vertical.

{
  switch (m.slowness()) {
  case Mode::Phase:
    switch (m.polarisation()) {
    case Mode::Vertical:
    case Mode::Radial:
    case Mode::Rayleigh:
      return _phaseRayleigh ? _phaseRayleigh->mode(m.index()) : 0;
    case Mode::Love:
    case Mode::Transverse:
      return _phaseLove ? _phaseLove->mode(m.index()) : 0;
    }
    break;
  case Mode::Group:
    switch (m.polarisation()) {
    case Mode::Vertical:
    case Mode::Radial:
    case Mode::Rayleigh:
      return _groupRayleigh ? _groupRayleigh->mode(m.index()) : 0;
    case Mode::Love:
    case Mode::Transverse:
      return _groupLove ? _groupLove->mode(m.index()) : 0;
    }
    break;
  }
  return 0; // just to avoid warning
}
virtual ModalStorage* QGpCoreWave::DispersionFactory::newStorage ( int  nModes) [inline, protected, virtual]

Implements QGpCoreWave::ModalFactory.

{return new Dispersion(nModes, x());}
void QGpCoreWave::DispersionFactory::setMode ( const Mode m) [virtual]

Implements QGpCoreWave::ModalFactory.

References QGpCoreWave::Mode::Group, QGpCoreWave::Mode::index(), QGpCoreWave::Mode::Love, QGpCoreWave::Mode::Phase, QGpCoreWave::Mode::polarisation(), QGpCoreWave::Mode::Radial, QGpCoreWave::Mode::Rayleigh, QGpCoreWave::Mode::slowness(), TRACE, QGpCoreWave::Mode::Transverse, and QGpCoreWave::Mode::Vertical.

{
  TRACE;
  switch (m.slowness()) {
  case Mode::Phase:
    switch (m.polarisation()) {
    case Mode::Vertical:
    case Mode::Radial:
    case Mode::Rayleigh:
      upgrade<Dispersion>(_phaseRayleigh, m.index()); break;
    case Mode::Love:
    case Mode::Transverse:
      upgrade<Dispersion>(_phaseLove, m.index()); break;
    }
    break;
  case Mode::Group:
    switch (m.polarisation()) {
    case Mode::Vertical:
    case Mode::Radial:
    case Mode::Rayleigh:
      upgrade<Dispersion>(_groupRayleigh, m.index()); break;
    case Mode::Love:
    case Mode::Transverse:
      upgrade<Dispersion>(_groupLove, m.index()); break;
    default:
      ASSERT(false); break;
    }
    break;
  }
}
ModalStorage * QGpCoreWave::DispersionFactory::storage ( int  storageIndex) const [inline, virtual]

Implements QGpCoreWave::ModalFactory.

References TRACE.

{
  TRACE;
  switch (storageIndex) {
  case 1:
    return _groupRayleigh;
  case 2:
    return _phaseLove;
  case 3:
    return _groupLove;
  default:
    return _phaseRayleigh;
  }
}
virtual int QGpCoreWave::DispersionFactory::storageCount ( ) const [inline, virtual]

Implements QGpCoreWave::ModalFactory.

{return 4;}

Validate modes, make sure that the number of modes for group slowness is greater than for phase slowness.

References QGpCoreWave::AutocorrFactory::horizontalModeCount(), QGpCoreWave::ModalStorage::modeCount(), TRACE, QGpCoreWave::EllipticityFactory::values(), and QGpCoreWave::AutocorrFactory::verticalModeCount().

Referenced by Spac3CForward::setCurves(), SpacReader::setOptions(), and DinverDCCore::TargetList::validateTargets().

{
  TRACE;
  if(ell && ell->values()) {
    upgrade<Dispersion>(_phaseRayleigh, ell->values()->modeCount()-1);
  }
  if(autocorr) {
    if(autocorr->verticalModeCount()>0) {
      upgrade<Dispersion>(_phaseRayleigh, autocorr->verticalModeCount()-1);
    }
    if(autocorr->horizontalModeCount()>0) {
      upgrade<Dispersion>(_phaseRayleigh, autocorr->horizontalModeCount()-1);
      upgrade<Dispersion>(_phaseLove, autocorr->horizontalModeCount()-1);
    }
  }
  if(_groupRayleigh) {
    upgrade<Dispersion>(_phaseRayleigh, _groupRayleigh->modeCount()-1);
  }
  if(_groupLove) {
    upgrade<Dispersion>(_phaseLove, _groupLove->modeCount()-1);
  }
}

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