~ubuntu-branches/ubuntu/saucy/rheolef/saucy

« back to all changes in this revision

Viewing changes to nfem/basis/P1d_numbering.cc

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Saramito
  • Date: 2011-03-23 11:14:26 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20110323111426-cjvhey7lxt6077ty
Tags: 5.93-1
* New upstream release (minor changes):
  - some extra warning message deleted in heap_allocator
  - graphic output with mayavi2 fixed
  - add doc refman in .info and .pdf format

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
///
20
20
/// =========================================================================
21
21
#include "P1d_numbering.h"
22
 
using namespace rheolef;
 
22
namespace rheolef {
23
23
using namespace std;
24
24
 
25
25
std::string
35
35
        size_type             i_dof_local) const
36
36
{
37
37
  /*
38
 
   * WARNING: "q", "P" and "H" are not supported yet.
39
 
   *           mixed mesh with t+q or T+P+H not supported too
 
38
   * WARNING:  mixed mesh with t+q or T+P+H not supported too
40
39
   *           or mixtures or e+t, e+t+T etc...
41
40
   *           This requires ordered K_idx : all "e" and then all "t",
42
41
   *           and then all "q" ... => geo format version 3 ?
43
42
   */
44
43
  switch (K.type()) {
 
44
    case reference_element::p: return   K.index() + i_dof_local;
45
45
    case reference_element::e: return 2*K.index() + i_dof_local;
46
46
    case reference_element::t: return 3*K.index() + i_dof_local;
 
47
    case reference_element::q: return 4*K.index() + i_dof_local;
47
48
    case reference_element::T: return 4*K.index() + i_dof_local;
 
49
    case reference_element::P: return 6*K.index() + i_dof_local;
 
50
    case reference_element::H: return 8*K.index() + i_dof_local;
48
51
    default : {
49
 
        error_macro ("unexpected elment type `" << K.type() << "'");
 
52
        error_macro ("unexpected element type `" << K.type() << "'");
50
53
        return 0;
51
54
    }
52
55
  }
69
72
        const size_type* mesh_n_element) const
70
73
{
71
74
    switch (mesh_map_dimension) {
 
75
      case 0: return   mesh_n_element[reference_element::p];
72
76
      case 1: return 2*mesh_n_element[reference_element::e];
73
 
      case 2: return 3*mesh_n_element[reference_element::t];
74
 
      case 3: return 4*mesh_n_element[reference_element::T];
 
77
      case 2: return 3*mesh_n_element[reference_element::t]
 
78
                   + 4*mesh_n_element[reference_element::q];
 
79
      case 3: return 4*mesh_n_element[reference_element::T]
 
80
                   + 6*mesh_n_element[reference_element::P]
 
81
                   + 8*mesh_n_element[reference_element::H];
75
82
      default : {
76
83
        error_macro ("unexpected dimension" << mesh_map_dimension);
77
84
        return 0;
78
85
      }
79
86
    }
80
87
}
 
88
bool
 
89
numbering_P1d::is_continuous () const
 
90
{
 
91
        return false;
 
92
}
 
93
 
 
94
} // namespace rheolef