ProblemInterpol.h 2.45 KB
Newer Older
1
2
3
4
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
5
// ==  http://www.amdis-fem.org                                              ==
6
7
// ==                                                                        ==
// ============================================================================
8
9
10
11
12
13
14
15
16
17
18
19
//
// 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.


20

21
/** \file ProblemInterpol.h */
22

23
24
#ifndef AMDIS_PROBLEM_INTERPOL_H
#define AMDIS_PROBLEM_INTERPOL_H
25

26
#include "ProblemStat.h"
27
28
29

namespace AMDiS {

30
31
  using namespace std;

Thomas Witkowski's avatar
Thomas Witkowski committed
32
  /// Interpolates a given function adaptive on spaceProblems mesh.
33
  class ProblemInterpol : public ProblemStatSeq
Thomas Witkowski's avatar
Thomas Witkowski committed
34
35
36
37
38
39
40
  {
  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.
     */
41
42
43
44
    ProblemInterpol(const char *name,
		    ProblemStatSeq *spaceProblem,
		    vector<AbstractFunction<double, WorldVector<double> >*> *fct,
		    vector<AbstractFunction<WorldVector<double>, WorldVector<double> >*> *grdFct);
Thomas Witkowski's avatar
Thomas Witkowski committed
45
46
47
48
49
50
51
52

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

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

    /// No system assemblage.
53
54
55
56
    virtual void buildAfterCoarsen(AdaptInfo *adaptInfo, Flag,
				   bool assembleMatrix = true,
				   bool assembleVector = true)
    {}
Thomas Witkowski's avatar
Thomas Witkowski committed
57
58

    /// No equation system ins solved. Instead fct is interpolated to uh.
59
60
61
    virtual void solve(AdaptInfo *adaptInfo,
		       bool createMatrixData = true,
		       bool storeMatrixData = false);
Thomas Witkowski's avatar
Thomas Witkowski committed
62
63

    /// True H1 or L2 error is calculated.
64
    virtual void estimate(AdaptInfo *adaptInfo);
Thomas Witkowski's avatar
Thomas Witkowski committed
65
66
67

  protected:
    /// Function to interpolate.
68
    vector<AbstractFunction<double, WorldVector<double> >*> *interpolFct;
Thomas Witkowski's avatar
Thomas Witkowski committed
69
70

    /// Gradient of \ref interpolFct_. Used for H1 error in estimate().
71
    vector<AbstractFunction<WorldVector<double>, WorldVector<double> >*> *grdInterpolFct;
Thomas Witkowski's avatar
Thomas Witkowski committed
72
  };
73
74
75
76

}

#endif