Hermes2D  3.0
norm_form.h
Go to the documentation of this file.
1 // This file is part of Hermes2D
2 //
3 // Copyright (c) 2009 hp-FEM group at the University of Nevada, Reno (UNR).
4 // Email: hpfem-group@unr.edu, home page: http://www.hpfem.org/.
5 //
6 // Hermes2D is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published
8 // by the Free Software Foundation; either version 2 of the License,
9 // or (at your option) any later version.
10 //
11 // Hermes2D is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with Hermes2D; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef __H2D_NORM_FORM_H_
23 #define __H2D_NORM_FORM_H_
24 
25 #include "weakform/weakform.h"
26 
27 namespace Hermes
28 {
30  namespace Hermes2D
31  {
34  {
35  CoarseSolutions,
36  FineSolutions,
37  SolutionsDifference
38  };
39 
40  class HERMES_API NormForm
41  {
42  public:
43  NormForm(int i, int j, FunctionsEvaluatedType functionType = SolutionsDifference);
44 
47  void set_area(std::string area);
48  inline std::string get_area() const { return this->area; };
49 
51  int i, j;
52 
54  inline FunctionsEvaluatedType get_function_type() const { return this->functionType; };
55 
56  protected:
58  FunctionsEvaluatedType functionType;
59 
60  std::string area;
61  };
62 
63  template<typename Scalar>
64  class HERMES_API NormFormVol : public NormForm
65  {
66  public:
67  NormFormVol(int i, int j);
68 
69  virtual Scalar value(int n, double *wt, Func<Scalar> *u, Func<Scalar> *v, GeomVol<double> *e) const = 0;
70  };
71 
72  template<typename Scalar>
73  class HERMES_API NormFormSurf : public NormForm
74  {
75  public:
76  NormFormSurf(int i, int j);
77 
78  virtual Scalar value(int n, double *wt, Func<Scalar> *u, Func<Scalar> *v, GeomSurf<double> *e) const = 0;
79  };
80 
81  template<typename Scalar>
82  class HERMES_API NormFormDG : public NormForm
83  {
84  public:
85  NormFormDG(int i, int j);
86 
87  virtual Scalar value(int n, double *wt, DiscontinuousFunc<Scalar> *u, DiscontinuousFunc<Scalar> *v, GeomSurf<double> *e) const = 0;
88  };
89 
90  template <typename Scalar>
91  class HERMES_API DefaultNormFormVol : public NormFormVol < Scalar >
92  {
93  public:
94  DefaultNormFormVol(int i, int j, NormType normType);
95 
96  Scalar value(int n, double *wt, Func<Scalar> *u, Func<Scalar> *v, GeomVol<double> *e) const;
97 
98  protected:
99  NormType normType;
100  };
101 
102  template <typename Scalar>
103  class HERMES_API DefaultNormFormSurf : public NormFormSurf < Scalar >
104  {
105  public:
106  DefaultNormFormSurf(int i, int j, NormType normType);
107 
108  Scalar value(int n, double *wt, Func<Scalar> *u, Func<Scalar> *v, GeomSurf<double> *e) const;
109 
110  protected:
111  NormType normType;
112  };
113 
114  template<typename Scalar>
115  class HERMES_API MatrixDefaultNormFormVol : public MatrixFormVol < Scalar >
116  {
117  public:
118  MatrixDefaultNormFormVol(int i, int j, NormType normType);
119 
120  Scalar value(int n, double *wt, Func<Scalar> *u_ext[], Func<double> *u,
121  Func<double> *v, GeomVol<double> *e, Func<Scalar> **ext) const;
122 
123  Ord ord(int n, double *wt, Func<Ord> *u_ext[], Func<Ord> *u, Func<Ord> *v,
124  GeomVol<Ord> *e, Func<Ord> **ext) const;
125 
126  MatrixFormVol<Scalar>* clone() const;
127 
128  protected:
129  NormType normType;
130  };
131 
132  template<typename Scalar>
133  class HERMES_API VectorDefaultNormFormVol : public VectorFormVol < Scalar >
134  {
135  public:
136  VectorDefaultNormFormVol(int i, NormType normType);
137 
138  Scalar value(int n, double *wt, Func<Scalar> *u_ext[], Func<double> *v, GeomVol<double> *e, Func<Scalar> **ext) const;
139 
140  Ord ord(int n, double *wt, Func<Ord> *u_ext[], Func<Ord> *v, GeomVol<Ord> *e, Func<Ord> **ext) const;
141 
142  VectorFormVol<Scalar>* clone() const;
143 
144  protected:
145  NormType normType;
146  };
147  }
148 }
149 #endif
Definition: adapt.h:24
This class represents a function with jump discontinuity on an interface of two elements.
Definition: forms.h:335
FunctionsEvaluatedType
Enum passed to the class NormForm specifying the functions the form acts upon.
Definition: norm_form.h:33
Calculated function values (from the class Function) on an element for assembling.
Definition: forms.h:214
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.
FunctionsEvaluatedType get_function_type() const
Get the function type.
Definition: norm_form.h:54
Abstract, base class for matrix Volumetric form - i.e. MatrixForm, where the integration is with resp...
Definition: weakform.h:45
Abstract, base class for vector Volumetric form - i.e. VectorForm, where the integration is with resp...
Definition: weakform.h:46