Hermes2D  3.0
weakforms_elasticity.h
1 // This file is part of Hermes2D.
2 //
3 // Hermes2D is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 2 of the License, or
6 // (at your option) any later version.
7 //
8 // Hermes2D is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with Hermes2D. If not, see <http://www.gnu.org/licenses/>.
15 
16 #ifndef __H2D_ELASTICITY_WEAK_FORMS_H
17 #define __H2D_ELASTICITY_WEAK_FORMS_H
18 
19 #include "../weakform/weakform.h"
20 #include "../spline.h"
21 
22 /* Default weak form for linear elasticity (Lame equations)
23 with Dirichlet and/or zero Neumann BC
24 
25 Nonzero Neumann and Newton boundary conditions can be enabled
26 by creating a descendant and adding surface forms to it.
27 */
28 namespace Hermes
29 {
30  namespace Hermes2D
31  {
32  namespace WeakFormsElasticity {
33  /* Single-component version -- to be used for multimesh assembling */
34 
35  template<typename Scalar>
36  class HERMES_API DefaultJacobianElasticity_0_0 : public MatrixFormVol < Scalar >
37  {
38  public:
39  DefaultJacobianElasticity_0_0(unsigned int i, unsigned int j, double lambda, double mu);
40  DefaultJacobianElasticity_0_0(unsigned int i, unsigned int j, std::string area, double lambda, double mu);
41 
42  virtual Scalar value(int n, double *wt, Func<Scalar> *u_ext[], Func<double> *u,
43  Func<double> *v, GeomVol<double> *e, Func<Scalar> **ext) const;
44 
45  virtual Hermes::Ord ord(int n, double *wt, Func<Hermes::Ord> *u_ext[], Func<Hermes::Ord> *u, Func<Hermes::Ord> *v,
46  GeomVol<Hermes::Ord> *e, Func<Ord> **ext) const;
47 
48  virtual MatrixFormVol<Scalar>* clone() const;
49  private:
50  double lambda, mu;
51  };
52 
53  template<typename Scalar>
54  class HERMES_API DefaultJacobianElasticity_0_1 : public MatrixFormVol < Scalar >
55  {
56  public:
57  DefaultJacobianElasticity_0_1(unsigned int i, unsigned int j, double lambda, double mu);
58  DefaultJacobianElasticity_0_1(unsigned int i, unsigned int j, std::string area, double lambda, double mu);
59 
60  virtual Scalar value(int n, double *wt, Func<Scalar> *u_ext[], Func<double> *u,
61  Func<double> *v, GeomVol<double> *e, Func<Scalar> **ext) const;
62 
63  virtual Hermes::Ord ord(int n, double *wt, Func<Hermes::Ord> *u_ext[], Func<Hermes::Ord> *u,
65 
66  virtual MatrixFormVol<Scalar>* clone() const;
67  private:
68  double lambda, mu;
69  };
70 
71  template<typename Scalar>
72  class HERMES_API DefaultResidualElasticity_0_0 : public VectorFormVol < Scalar >
73  {
74  public:
75  DefaultResidualElasticity_0_0(unsigned int i, double lambda, double mu);
76  DefaultResidualElasticity_0_0(unsigned int i, std::string area, double lambda, double mu);
77 
78  virtual Scalar value(int n, double *wt, Func<Scalar> *u_ext[], Func<double> *v,
79  GeomVol<double> *e, Func<Scalar> **ext) const;
80 
81  virtual Hermes::Ord ord(int n, double *wt, Func<Hermes::Ord> *u_ext[], Func<Hermes::Ord> *v,
82  GeomVol<Hermes::Ord> *e, Func<Ord> **ext) const;
83 
84  virtual VectorFormVol<Scalar>* clone() const;
85  private:
86  double lambda, mu;
87  };
88 
89  template<typename Scalar>
90  class HERMES_API DefaultResidualElasticity_0_1 : public VectorFormVol < Scalar >
91  {
92  public:
93  DefaultResidualElasticity_0_1(unsigned int i, double lambda, double mu);
94  DefaultResidualElasticity_0_1(unsigned int i, std::string area, double lambda, double mu);
95 
96  virtual Scalar value(int n, double *wt, Func<Scalar> *u_ext[], Func<double> *v,
97  GeomVol<double> *e, Func<Scalar> **ext) const;
98 
99  virtual Hermes::Ord ord(int n, double *wt, Func<Hermes::Ord> *u_ext[], Func<Hermes::Ord> *v,
100  GeomVol<Hermes::Ord> *e, Func<Ord> **ext) const;
101 
102  virtual VectorFormVol<Scalar>* clone() const;
103  private:
104  double lambda, mu;
105  };
106 
107  template<typename Scalar>
108  class HERMES_API DefaultResidualElasticity_1_0 : public VectorFormVol < Scalar >
109  {
110  public:
111  DefaultResidualElasticity_1_0(unsigned int i, double lambda, double mu);
112  DefaultResidualElasticity_1_0(unsigned int i, std::string area, double lambda, double mu);
113 
114  virtual Scalar value(int n, double *wt, Func<Scalar> *u_ext[], Func<double> *v,
115  GeomVol<double> *e, Func<Scalar> **ext) const;
116 
117  virtual Hermes::Ord ord(int n, double *wt, Func<Hermes::Ord> *u_ext[], Func<Hermes::Ord> *v,
118  GeomVol<Hermes::Ord> *e, Func<Ord> **ext) const;
119 
120  virtual VectorFormVol<Scalar>* clone() const;
121  private:
122  double lambda, mu;
123  };
124 
125  template<typename Scalar>
126  class HERMES_API DefaultResidualElasticity_1_1 : public VectorFormVol < Scalar >
127  {
128  public:
129  DefaultResidualElasticity_1_1(unsigned int i, double lambda, double mu);
130  DefaultResidualElasticity_1_1(unsigned int i, std::string area, double lambda, double mu);
131 
132  virtual Scalar value(int n, double *wt, Func<Scalar> *u_ext[], Func<double> *v,
133  GeomVol<double> *e, Func<Scalar> **ext) const;
134 
135  virtual Hermes::Ord ord(int n, double *wt, Func<Hermes::Ord> *u_ext[], Func<Hermes::Ord> *v,
136  GeomVol<Hermes::Ord> *e, Func<Ord> **ext) const;
137 
138  virtual VectorFormVol<Scalar>* clone() const;
139  private:
140  double lambda, mu;
141  };
142 
143  template<typename Scalar>
144  class HERMES_API DefaultJacobianElasticity_1_1 : public MatrixFormVol < Scalar >
145  {
146  public:
147  DefaultJacobianElasticity_1_1(unsigned int i, unsigned int j, double lambda, double mu);
148  DefaultJacobianElasticity_1_1(unsigned int i, unsigned int j, std::string area, double lambda, double mu);
149 
150  virtual Scalar value(int n, double *wt, Func<Scalar> *u_ext[], Func<double> *u,
151  Func<double> *v, GeomVol<double> *e, Func<Scalar> **ext) const;
152 
153  virtual Hermes::Ord ord(int n, double *wt, Func<Hermes::Ord> *u_ext[], Func<Hermes::Ord> *u, Func<Hermes::Ord> *v,
154  GeomVol<Hermes::Ord> *e, Func<Ord> **ext) const;
155 
156  virtual MatrixFormVol<Scalar>* clone() const;
157  private:
158  double lambda, mu;
159  };
160  };
161  }
162 }
163 #endif
Geometry - volumetric - for order calculation.
Definition: forms.h:90
Definition: adapt.h:24
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.
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