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

« back to all changes in this revision

Viewing changes to nfem/plib/space_constant.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 _RHEOLEF_SPACE_CONSTANT_H
 
2
#define _RHEOLEF_SPACE_CONSTANT_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
// constants
 
24
 
 
25
#include "rheolef/distributed.h"
 
26
 
 
27
namespace rheolef { namespace space_constant {
 
28
 
 
29
typedef size_t size_type;
 
30
 
 
31
// -------------------------------------------------------------
 
32
// coordinate system helper
 
33
// -------------------------------------------------------------
 
34
 
 
35
typedef enum {
 
36
        cartesian       = 0,
 
37
        axisymmetric_rz = 1,
 
38
        axisymmetric_zr = 2,
 
39
        last_coord_sys  = 3
 
40
} coordinate_type;
 
41
 
 
42
coordinate_type coordinate_system      (std::string sys_coord);
 
43
std::string     coordinate_system_name (coordinate_type);
 
44
void check_coord_sys_and_dimension     (coordinate_type, size_type d);
 
45
 
 
46
// -------------------------------------------------------------
 
47
// multi-component field support
 
48
// -------------------------------------------------------------
 
49
typedef enum {
 
50
        scalar             = 0,
 
51
        vector             = 1,
 
52
        tensor             = 2, // symmetric, D_ij
 
53
        unsymmetric_tensor = 3,
 
54
        tensor4            = 4, // symmetric, A_ijkl
 
55
        mixed              = 5,
 
56
        last_valued        = 6
 
57
} valued_type;
 
58
 
 
59
const std::string& valued_name (valued_type tag);
 
60
valued_type valued_tag  (const std::string& name);
 
61
 
 
62
size_type n_component (
 
63
    valued_type        valued_tag,
 
64
    size_type          d,
 
65
    coordinate_type    sys_coord);
 
66
 
 
67
size_type n_component (
 
68
    const std::string& valued,
 
69
    size_type          d,
 
70
    coordinate_type    sys_coord);
 
71
 
 
72
// -------------------------------------------------------------
 
73
// 2-tensor support
 
74
// -------------------------------------------------------------
 
75
size_type tensor_index (
 
76
    valued_type       valued_tag,
 
77
    coordinate_type   sys_coord,
 
78
    size_type         i,
 
79
    size_type         j);
 
80
 
 
81
size_type tensor_index (
 
82
    std::string      valued,
 
83
    std::string      sys_coord, 
 
84
    size_type   i, 
 
85
    size_type   j);
 
86
 
 
87
std::pair<size_type,size_type>
 
88
tensor_subscript (
 
89
    valued_type       valued_tag,
 
90
    coordinate_type   sys_coord,
 
91
    size_type         i_comp);
 
92
 
 
93
std::string
 
94
tensor_subscript_name (
 
95
    valued_type       valued_tag,
 
96
    coordinate_type   sys_coord,
 
97
    size_type         i_comp);
 
98
 
 
99
std::pair<size_type,size_type>
 
100
tensor_subscript (
 
101
    std::string     valued,
 
102
    std::string     sys_coord,
 
103
    size_type       i_comp);
 
104
 
 
105
std::string
 
106
tensor_subscript_name (
 
107
    std::string     valued,
 
108
    std::string     sys_coord,
 
109
    size_type       i_comp);
 
110
 
 
111
}} // namespace rheolef::space_constant
 
112
#endif // _RHEOLEF_SPACE_CONSTITUTION_H