~ubuntu-branches/ubuntu/raring/rheolef/raring-proposed

« back to all changes in this revision

Viewing changes to nfem/pbasis/bubble_symbolic.cc

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito, Pierre Saramito, Sylvestre Ledru
  • Date: 2012-05-14 14:02:09 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20120514140209-dzbdlidkotyflf9e
Tags: 6.1-1
[ Pierre Saramito ]
* New upstream release 6.1 (minor changes):
  - support arbitrarily polynomial order Pk
  - source code supports g++-4.7 (closes: #671996)

[ Sylvestre Ledru ]
* update of the watch file

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
///
 
2
/// This file is part of Rheolef.
 
3
///
 
4
/// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
 
5
///
 
6
/// Rheolef is free software; you can redistribute it and/or modify
 
7
/// it under the terms of the GNU General Public License as published by
 
8
/// the Free Software Foundation; either version 2 of the License, or
 
9
/// (at your option) any later version.
 
10
///
 
11
/// Rheolef 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 Rheolef; if not, write to the Free Software
 
18
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
///
 
20
/// =========================================================================
 
21
//
 
22
// bubble approximation
 
23
//
 
24
#include "basis_symbolic.h"
 
25
using namespace rheolef;
 
26
using namespace std;
 
27
using namespace GiNaC;
 
28
 
 
29
class bubble_symbolic : public basis_symbolic_nodal
 
30
{
 
31
public:
 
32
    bubble_symbolic ();
 
33
};
 
34
bubble_symbolic::bubble_symbolic ()
 
35
: basis_symbolic_nodal("bubble",4)
 
36
{
 
37
  on('p') << node(0) 
 
38
          << poly (1)
 
39
          << end;
 
40
  on('e') << node (0.5)
 
41
          << poly (4*x*(1-x))
 
42
          << end;
 
43
  on('t') << node (ex(1)/3, ex(1)/3)
 
44
          << poly (27*x*y*(1-x-y))
 
45
          << end;
 
46
  on('T') << node (1./4, 1./4, 1./4)
 
47
          << poly (256*x*y*z*(1-x-y-z))
 
48
          << end;
 
49
}
 
50
int main (int argc, char **argv) {
 
51
        bubble_symbolic bubble;
 
52
        bubble.put_cxx_main (argc,argv);
 
53
}