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

« back to all changes in this revision

Viewing changes to nfem/pbasis/numbering_tst.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
#include "rheolef/numbering.h"
 
22
using namespace rheolef;
 
23
using namespace std;
 
24
 
 
25
int
 
26
main (int argc, char **argv)
 
27
{
 
28
  environment distributed (argc, argv);
 
29
  if (argc != 2) {
 
30
      cerr << "usage: " << argv[0] << " <base>" << endl;
 
31
      exit (1);
 
32
  }
 
33
  {
 
34
    numbering<Float> num(argv[1]);
 
35
    size_t  dim = 2;
 
36
    size_t  n = 10;
 
37
    size_t  size_by_dimension [4];
 
38
    size_t  size_by_variant [reference_element::max_variant];
 
39
    size_by_dimension [0] = (n+1)*(n+1);
 
40
    size_by_dimension [1] = 2*n*(n+1) + n*n;
 
41
    size_by_dimension [2] = 2*n*n;
 
42
    size_by_dimension [3] = 0;
 
43
    size_by_variant [reference_element::p] = size_by_dimension [0];
 
44
    size_by_variant [reference_element::e] = size_by_dimension [1];
 
45
    size_by_variant [reference_element::t] = size_by_dimension [2];
 
46
    size_by_variant [reference_element::q] = 0;
 
47
    size_by_variant [reference_element::T] = 0;
 
48
    size_by_variant [reference_element::P] = 0;
 
49
    size_by_variant [reference_element::H] = 0;
 
50
    geo_size gs;
 
51
    for (size_t dim = 0; dim < 4; dim++) {
 
52
      gs.ownership_by_dimension [dim] = distributor (distributor::decide, communicator(), size_by_dimension [dim]);
 
53
    }
 
54
    for (size_t variant = 0; variant < reference_element::max_variant; variant++) {
 
55
      gs.ownership_by_variant [variant] = distributor (distributor::decide, communicator(), size_by_variant [variant]);
 
56
    }
 
57
    size_t dis_ndof = num.dis_ndof (gs, dim);
 
58
 
 
59
    cout << "\tndof => " << dis_ndof << endl;
 
60
  }
 
61
  return 0;
 
62
}