~ubuntu-branches/ubuntu/wily/rheolef/wily

« back to all changes in this revision

Viewing changes to nfem/pform_element/2D.h

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito, Pierre Saramito, Sylvestre Ledru
  • Date: 2013-04-30 11:29:51 UTC
  • mfrom: (1.2.1) (11.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130430112951-g69nuqin77t75dek
Tags: 6.4-1
[ Pierre Saramito ]
* New upstream release 6.4 (major changes):
  - new powerful c++ expressions for FEM specifications
  - configure script improved (portability increased)
  - minor bug fixes
* control:
  - all architectures are considered (armel & armhf are back)
  - no more circular-dependency librheolef-dev <--> rheolef
* rules: add security compiler flags (hardening and -W,-l,relro)
* watch: include an updated version, thanks to B. Martens <bartm@debian.org>
* copyright: various file format fixes

[ Sylvestre Ledru ]
*  Standards-Version updated to 3.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef _RHEO_TWO_D_H
2
 
#define _RHEO_TWO_D_H
3
 
///
4
 
/// This file is part of Rheolef.
5
 
///
6
 
/// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
7
 
///
8
 
/// Rheolef is free software; you can redistribute it and/or modify
9
 
/// it under the terms of the GNU General Public License as published by
10
 
/// the Free Software Foundation; either version 2 of the License, or
11
 
/// (at your option) any later version.
12
 
///
13
 
/// Rheolef is distributed in the hope that it will be useful,
14
 
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 
/// GNU General Public License for more details.
17
 
///
18
 
/// You should have received a copy of the GNU General Public License
19
 
/// along with Rheolef; if not, write to the Free Software
20
 
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21
 
/// 
22
 
/// =========================================================================
23
 
 
24
 
#include "rheolef/form_element.h"
25
 
namespace rheolef { 
26
 
 
27
 
/*Class:2D
28
 
NAME: @code{2D} -- rate of deformation tensor
29
 
@bfindex 2D
30
 
@cindex  rate of deformation tensor
31
 
@cindex  tensor
32
 
@clindex form
33
 
@clindex space
34
 
@apindex P0
35
 
@apindex P1
36
 
@apindex P2
37
 
@apindex P1d
38
 
SYNOPSIS:
39
 
  @example
40
 
        form (const space V, const space& T, "2D");
41
 
  @end example
42
 
DESCRIPTION:       
43
 
  @noindent
44
 
  Assembly the form associated to the rate of deformation
45
 
  tensor, i.e. the symmetric part of the gradient of a 
46
 
  vector field.
47
 
  These derivative are usefull in fluid mechanic and
48
 
  elasticity.
49
 
@iftex
50
 
@tex
51
 
  $$
52
 
      b({\bf u},\tau) = \int_\Omega 
53
 
         2D({\bf u}) : \, \tau \, dx,
54
 
    \forall u \in V \ {\rm and }\  q \in T.
55
 
  $$
56
 
  where
57
 
  $$
58
 
     2 D({\bf u}) = \nabla {\bf u} + \nabla {\bf u}^T
59
 
  $$
60
 
@end tex
61
 
@end iftex
62
 
@ifnottex
63
 
  @example
64
 
                 /
65
 
                 |
66
 
      b(u,tau) = | 2 D(u) : tau dx,
67
 
                 |
68
 
                 / Omega 
69
 
  @end example
70
 
  where
71
 
  @example
72
 
     2 D(u) = grad u + (grad u)^T
73
 
  @end example
74
 
@end ifnottex
75
 
 
76
 
  @noindent
77
 
  If the V space is a vector-valued @code{P1} (resp. @code{P2})
78
 
  finite element space, the T space may be
79
 
  a tensor-valued @code{P0} (resp. @code{P1d}) one.
80
 
 
81
 
EXAMPLE:
82
 
  @noindent
83
 
  The following piece of code build the Laplacian form
84
 
  associated to the P1 approximation:
85
 
  @example
86
 
        geo omega ("square");
87
 
        space V (omega, "P1", "vector");
88
 
        space T (omega, "P0", "tensor");
89
 
        form  b (V, T, "2D");
90
 
  @end example
91
 
AUTHOR: 
92
 
    LMC-IMAG, 38041 Grenoble cedex 9, France
93
 
    | Pierre.Saramito@imag.fr
94
 
SEE ALSO:
95
 
    "form"(3)
96
 
DATE:
97
 
    28 november 1997
98
 
End:
99
 
*/
100
 
template<class T, class M>
101
 
class _2D: public form_element_rep<T,M> {
102
 
public:
103
 
    typedef form_element_rep<T,M>       base;
104
 
    typedef typename base::size_type    size_type;
105
 
    typedef typename base::geo_type     geo_type;
106
 
    typedef typename base::space_type   space_type;
107
 
 
108
 
// allocator:
109
 
 
110
 
    _2D (const space_type& X, const space_type& Y, const geo_type& omega,
111
 
        const quadrature_option_type& qopt)
112
 
        : form_element_rep<T,M> (X,Y,omega,qopt) { base::initialize_all(); }
113
 
 
114
 
    void operator() (const geo_element& K, ublas::matrix<T>& m) const;
115
 
    void initialize () const;
116
 
    bool is_symmetric () const { return false; }
117
 
};
118
 
 
119
 
}// namespace rheolef
120
 
#endif // _RHEOLEF_TWO_D_H