ParMooN
 All Classes Functions Variables Friends Pages
FEFunction2D.h
1 // =======================================================================
2 // @(#)FEFunction2D.h 1.3 04/13/00
3 //
4 // Class: TFEFunction2D
5 // Purpose: a function from a finite element space in 2D
6 //
7 // Author: Gunar Matthies (17.01.98)
8 //
9 // History: start of implementation 17.01.98 (Gunar Matthies)
10 //
11 // start of reimplementation 06.08.1998 (GM)
12 //
13 // =======================================================================
14 
15 #ifndef __FEFUNCTION2D__
16 #define __FEFUNCTION2D__
17 
18 #include <AllClasses.h>
19 #include <FESpace2D.h>
20 #include <AuxParam2D.h>
21 #include <Constants.h>
22 
25 {
26  protected:
28  char *Name;
29 
31  char *Description;
32 
35 
37  double *Values;
38 
40  int Length;
41 
42  public:
44  TFEFunction2D(TFESpace2D *fespace2D, char *name, char *description,
45  double *values, int length);
46 
49 
51  char *GetName()
52  { return Name; }
53 
56  { return Description; }
57 
60  { return FESpace2D; }
61 
63  int GetLength()
64  { return Length; }
65 
67  double *GetValues()
68  { return Values; }
69 
71  void GetErrors(DoubleFunct2D *Exact, int N_Derivatives,
72  MultiIndex2D *NeededDerivatives,
73  int N_Errors, ErrorMethod2D *ErrorMeth,
74  CoeffFct2D *Coeff, TAuxParam2D *Aux,
75  int n_fespaces, TFESpace2D **fespaces,
76  double *errors);
77 
81  DoubleFunct2D * const * const Exact,
82  ErrorMethod2D * const ErrorMeth,
83  double * const errors);
84 
85  void GetErrorsAdapt(DoubleFunct2D *Exact, int N_Derivatives,
86  MultiIndex2D *NeededDerivatives,
87  int N_Errors, ErrorMethod2D *ErrorMeth,
88  CoeffFct2D *Coeff, TAuxParam2D *Aux,
89  int n_fespaces, TFESpace2D **fespaces,
90  double *errors);
91 
92  void GetErrorsOPTPDE(DoubleFunct2D *Exact, int N_Derivatives,
93  MultiIndex2D *NeededDerivatives,
94  int N_Errors, ErrorMethod2D *ErrorMeth,
95  CoeffFct2D *Coeff, TAuxParam2D *Aux,
96  int n_fespaces, TFESpace2D **fespaces,
97  int& kink, double upper, double lower, double *errors);
98 
99  void GetErrorsAdaptOPTPDE(DoubleFunct2D *Exact, int N_Derivatives,
100  MultiIndex2D *NeededDerivatives,
101  int N_Errors, ErrorMethod2D *ErrorMeth,
102  CoeffFct2D *Coeff, TAuxParam2D *Aux,
103  int n_fespaces, TFESpace2D **fespaces,
104  double radius, double upper, double lower,double *errors);
105 
108  void FindGradient(double x, double y, double *values);
109 
112  void FindGradientLocal(TBaseCell *cell, int cell_no, double x, double y, double *values);
113 
116  void FindValueLocal(TBaseCell *cell, int cell_no, double x, double y, double *values);
117 
119  void Interpolate(DoubleFunct2D *Exact);
125  void Interpolate(TFEFunction2D *F);
126 
137  void project_into_L20(double a = 0.0);
138 
145  void compute_integral_and_measure(double& integral, double& measure) const;
146 
153  double compute_mean() const;
154 
156  void GetMeshCellParams(DoubleFunct2D *Exact, int N_Derivatives,
157  MultiIndex2D *NeededDerivatives,
158  int N_Errors, ErrorMethod2D *ErrorMeth,
159  CoeffFct2D *Coeff,
160  TAuxParam2D *Aux,
161  int n_fespaces, TFESpace2D **fespaces,
162  double *errors, double *parameters);
163 
165  void InterpolateSuper(DoubleFunct2D *Exact);
166 
168  void SetDirichletBC(BoundCondFunct2D *BoundaryCondition,
169  BoundValueFunct2D *BoundaryValue);
170 
172  void WriteSol();
173 
175  void ReadSol(char *BaseName);
176 
177 
179  void CorrectMass(double OldMass);
180 
182  void GetMassAndMean(double *OutVal);
183 
184 
187  TFEFunction2D& operator*=(double alpha);
188 
191  TFEFunction2D & operator+=(const TFEFunction2D & rhs);
192 
195  TFEFunction2D & operator=(const TFEFunction2D & rhs);
198  void MinMax(double & min, double & max);
199 
203  void PrintMinMax();
204 
205 };
206 #endif
double * GetValues()
Definition: FEFunction2D.h:67
void GetMassAndMean(double *OutVal)
Definition: FEFunction2D.C:2712
void FindGradientLocal(TBaseCell *cell, int cell_no, double x, double y, double *values)
Definition: FEFunction2D.C:1188
TFEFunction2D & operator+=(const TFEFunction2D &rhs)
Definition: FEFunction2D.C:2452
int GetLength()
Definition: FEFunction2D.h:63
void MinMax(double &min, double &max)
Definition: FEFunction2D.C:2515
void compute_integral_and_measure(double &integral, double &measure) const
find the integral of this function and the measure of its domain
Definition: FEFunction2D.C:2324
Definition: AuxParam2D.h:22
Definition: FESpace2D.h:28
void GetErrorsAdapt(DoubleFunct2D *Exact, int N_Derivatives, MultiIndex2D *NeededDerivatives, int N_Errors, ErrorMethod2D *ErrorMeth, CoeffFct2D *Coeff, TAuxParam2D *Aux, int n_fespaces, TFESpace2D **fespaces, double *errors)
Definition: FEFunction2D.C:383
void GetMeshCellParams(DoubleFunct2D *Exact, int N_Derivatives, MultiIndex2D *NeededDerivatives, int N_Errors, ErrorMethod2D *ErrorMeth, CoeffFct2D *Coeff, TAuxParam2D *Aux, int n_fespaces, TFESpace2D **fespaces, double *errors, double *parameters)
Definition: FEFunction2D.C:1579
void WriteSol()
Definition: FEFunction2D.C:2071
void project_into_L20(double a=0.0)
project this functions into the space L20 (having zero mean value)
Definition: FEFunction2D.C:2389
void InterpolateSuper(DoubleFunct2D *Exact)
Definition: FEFunction2D.C:1739
void Interpolate(DoubleFunct2D *Exact)
Definition: FEFunction2D.C:1410
~TFEFunction2D()
Definition: FEFunction2D.C:64
char * Description
Definition: FEFunction2D.h:31
double compute_mean() const
compute the mean value of this TFEFunction2D
Definition: FEFunction2D.C:2380
char * GetName()
Definition: FEFunction2D.h:51
void ReadSol(char *BaseName)
Definition: FEFunction2D.C:2120
void FindValueLocal(TBaseCell *cell, int cell_no, double x, double y, double *values)
Definition: FEFunction2D.C:1307
void GetErrors(DoubleFunct2D *Exact, int N_Derivatives, MultiIndex2D *NeededDerivatives, int N_Errors, ErrorMethod2D *ErrorMeth, CoeffFct2D *Coeff, TAuxParam2D *Aux, int n_fespaces, TFESpace2D **fespaces, double *errors)
Definition: FEFunction2D.C:73
TFESpace2D * GetFESpace2D()
Definition: FEFunction2D.h:59
void GetErrorsForVectorValuedFunction(DoubleFunct2D *const *const Exact, ErrorMethod2D *const ErrorMeth, double *const errors)
use this for vector valued basis functions (Raviart-Thomas (RT) or Brezzi-Douglas-Marini (BDM) elemen...
Definition: FEFunction2D.C:1919
void PrintMinMax()
Definition: FEFunction2D.C:2531
TFEFunction2D(TFESpace2D *fespace2D, char *name, char *description, double *values, int length)
Definition: FEFunction2D.C:48
void GetErrorsAdaptOPTPDE(DoubleFunct2D *Exact, int N_Derivatives, MultiIndex2D *NeededDerivatives, int N_Errors, ErrorMethod2D *ErrorMeth, CoeffFct2D *Coeff, TAuxParam2D *Aux, int n_fespaces, TFESpace2D **fespaces, double radius, double upper, double lower, double *errors)
Definition: FEFunction2D.C:813
void SetDirichletBC(BoundCondFunct2D *BoundaryCondition, BoundValueFunct2D *BoundaryValue)
Definition: FEFunction2D.C:2543
information for finite element data structure
Definition: BaseCell.h:25
TFEFunction2D & operator=(const TFEFunction2D &rhs)
Definition: FEFunction2D.C:2481
void CorrectMass(double OldMass)
Definition: FEFunction2D.C:2660
double * Values
Definition: FEFunction2D.h:37
TFESpace2D * FESpace2D
Definition: FEFunction2D.h:34
int Length
Definition: FEFunction2D.h:40
void GetErrorsOPTPDE(DoubleFunct2D *Exact, int N_Derivatives, MultiIndex2D *NeededDerivatives, int N_Errors, ErrorMethod2D *ErrorMeth, CoeffFct2D *Coeff, TAuxParam2D *Aux, int n_fespaces, TFESpace2D **fespaces, int &kink, double upper, double lower, double *errors)
Definition: FEFunction2D.C:628
char * Name
Definition: FEFunction2D.h:28
void FindGradient(double x, double y, double *values)
Definition: FEFunction2D.C:1078
char * GetDescription()
Definition: FEFunction2D.h:55
Definition: FEFunction2D.h:24
TFEFunction2D & operator*=(double alpha)
Definition: FEFunction2D.C:2442