Skip to content
Snippets Groups Projects
ConditionalEstimator.h 3.18 KiB
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  crystal growth group                                                  ==
// ==                                                                        ==
// ==  Stiftung caesar                                                       ==
// ==  Ludwig-Erhard-Allee 2                                                 ==
// ==  53175 Bonn                                                            ==
// ==  germany                                                               ==
// ==                                                                        ==
// ============================================================================
// ==                                                                        ==
// ==  http://www.caesar.de/cg/AMDiS                                         ==
// ==                                                                        ==
// ============================================================================

/** \file ConditionalEstimator.h */

/** \defgroup Estimator Estimator module
 * @{ <img src="estimator.png"> @}
 */

#ifndef AMDIS_CONDITIONALESTIMATOR_H
#define AMDIS_CONDITIONALESTIMATOR_H

#include "Estimator.h"

namespace AMDiS {

  // ============================================================================
  // ===== class ConditionalEstimator ==============================================
  // ============================================================================

  /**
   * \ingroup Estimator
   * 
   * \brief
   * Estimator for scalar problems.
   */
  class ConditionalEstimator : public Estimator
  {
  public:
    MEMORY_MANAGED(ConditionalEstimator);

    ConditionalEstimator(Estimator *decorated) 
      : decoratedEstimator_(decorated),
	elementCount_(0), 
	row_(decorated ? decorated->getRow() : 0)
    {};

    double estimate(double timestep);

    inline int getElementCount() {
      return elementCount_;
    };

    //   inline double getErrorSum() const { 
    //     return decoratedEstimator_->getErrorSum(); 
    //   };

    //   inline void setErrorSum(double sum) {
    //     decoratedEstimator_->setErrorSum(sum); 
    //   };

    //   inline double getErrorMax() const {
    //     return decoratedEstimator_->getErrorMax(); 
    //   };

    //   inline double getTimeEst() const {
    //     return decoratedEstimator_->getTimeEst(); 
    //   };

    //   inline void setErrorMax(double m) {
    //     decoratedEstimator_->setErrorMax(m); 
    //   };

    //   inline Norm getErrorNorm() {
    //     return decoratedEstimator_->getErrorNorm(); 
    //   };

    inline Estimator *getDecoratedEstimator() { return decoratedEstimator_; };

  protected:
    Estimator *decoratedEstimator_;

    int elementCount_;

    int row_;
  };

}

#endif // AMDIS_ESTIMATOR_H