~ubuntu-branches/ubuntu/trusty/rheolef/trusty

« back to all changes in this revision

Viewing changes to nfem/plib/basis_rep.h

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito
  • Date: 2012-04-06 09:12:21 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20120406091221-m58me99p1nxqui49
Tags: 6.0-1
* New upstream release 6.0 (major changes):
  - massively distributed and parallel support
  - full FEM characteristic method (Lagrange-Gakerkin method) support
  - enhanced users documentation 
  - source code supports g++-4.7 (closes: #667356)
* debian/control: dependencies for MPI distributed solvers added
* debian/rules: build commands simplified
* debian/librheolef-dev.install: man1/* to man9/* added
* debian/changelog: package description rewritted (closes: #661689)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _RHEO_BASIS_REP_H
 
2
#define _RHEO_BASIS_REP_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/reference_element.h"
 
25
#include "rheolef/point.h"
 
26
#include "rheolef/tensor.h"
 
27
#include "rheolef/element_constant.h"
 
28
namespace rheolef { 
 
29
class basis_rep {
 
30
public:
 
31
    typedef element_constant::dof_family_type dof_family_type;
 
32
    typedef size_t size_type;
 
33
    basis_rep(std::string name, dof_family_type family) : _name(name), _family(family) {};
 
34
    virtual ~basis_rep() { }
 
35
    std::string name() const;
 
36
    dof_family_type family() const;
 
37
    virtual dof_family_type dof_family(
 
38
        reference_element hat_K,
 
39
        size_type         i_dof_local) const = 0;
 
40
    virtual size_type degree () const = 0;
 
41
    virtual size_type size (
 
42
        reference_element hat_K, dof_family_type family) const = 0;
 
43
    virtual Float eval(
 
44
        reference_element hat_K,
 
45
        size_type         i_dof_local,
 
46
        const point&      hat_x) const = 0;
 
47
    virtual point grad_eval(
 
48
        reference_element hat_K,
 
49
        size_type         i_dof_local,
 
50
        const point&      hat_x) const = 0;
 
51
    virtual tensor hessian_eval(
 
52
        reference_element hat_K,
 
53
        size_type         i_dof_local,
 
54
        const point &     hat_x) const = 0;
 
55
    virtual void eval(
 
56
        reference_element    hat_K,
 
57
        const point&         hat_x,
 
58
        std::vector<Float>&  values) const = 0;
 
59
    virtual void grad_eval(
 
60
        reference_element    hat_K,
 
61
        const point&         hat_x,
 
62
        std::vector<point>&  values) const = 0;
 
63
    virtual void hessian_eval(
 
64
        reference_element    hat_K,
 
65
        const point&         hat_x,
 
66
        std::vector<tensor>& values) const = 0;
 
67
    virtual void hat_node(
 
68
        reference_element    hat_K,
 
69
        std::vector<point>&  hat_node) const = 0;
 
70
    static basis_rep* make_ptr (std::string name);
 
71
protected:
 
72
    std::string _name;
 
73
    dof_family_type _family;
 
74
};
 
75
inline
 
76
std::string
 
77
basis_rep::name() const
 
78
{
 
79
  return _name;
 
80
}
 
81
inline
 
82
basis_rep::dof_family_type
 
83
basis_rep::family() const
 
84
{
 
85
  return _family;
 
86
}
 
87
}// namespace rheolef
 
88
#endif // _RHEO_BASIS_REP_H