Skip to content
Snippets Groups Projects
Forked from iwr / amdis
1298 commits behind the upstream repository.
ProblemInterpol.h 2.31 KiB
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
// ==  http://www.amdis-fem.org                                              ==
// ==                                                                        ==
// ============================================================================
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology 
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.



/** \file ProblemInterpol.h */

#ifndef AMDIS_PROBLEM_INTERPOL_H
#define AMDIS_PROBLEM_INTERPOL_H

#include "ProblemStat.h"

namespace AMDiS {

  using namespace std;

  /// Interpolates a given function adaptive on spaceProblems mesh.
  class ProblemInterpol : public ProblemStatSeq
  {
  public:
    /** \brief
     * Constructor. fct will be interpolated on the mesh of spaceProblem.
     * grdFct is used, if H1 error should be used for estimation. It points
     * to the gradient of fct.
     */
    ProblemInterpol(const char *name,
		    ProblemStatSeq *spaceProblem,
		    vector<AbstractFunction<double, WorldVector<double> >*> *fct,
		    vector<AbstractFunction<WorldVector<double>, WorldVector<double> >*> *grdFct);

    /// No system assemblage.
    virtual void buildbeforeRefine(AdaptInfo *adaptInfo, Flag) {}

    /// No system assemblage.
    virtual void buildbeforeCoarsen(AdaptInfo *adaptInfo, Flag) {}

    /// No system assemblage.
    virtual void buildAfterCoarsen(AdaptInfo *adaptInfo, Flag) {}

    /// No equation system ins solved. Instead fct is interpolated to uh.
    virtual void solve(AdaptInfo *adaptInfo);

    /// True H1 or L2 error is calculated.
    virtual void estimate(AdaptInfo *adaptInfo, double);

  protected:
    /// Function to interpolate.
    vector<AbstractFunction<double, WorldVector<double> >*> *interpolFct;

    /// Gradient of \ref interpolFct_. Used for H1 error in estimate().
    vector<AbstractFunction<WorldVector<double>, WorldVector<double> >*> *grdInterpolFct;
  };

}
#endif