4
/// This file is part of Rheolef.
6
/// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
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.
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.
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
22
/// =========================================================================
24
//! Helps the management of the finite element method.
25
//! Helps the geometry coordinate system.
26
//! Helps fields that have tensor value :
27
//! doubles indices (i,j) are mapped to single index depending upon
28
//! the case : symmetric tensor, axisymmetric problems with extra
29
//! theta-theta tensor component or tridimensionnal case.
30
//! This class is used internally by field and space classes.
31
//! It contains no data, only typedefs and member functions.
33
#include "rheolef/compiler.h"
37
// -------------------------------------------------------------
38
// coordinate system helper
39
// -------------------------------------------------------------
41
// typedefs and static data:
43
typedef size_t size_type;
52
static const char* coord_sys_table [max_coord_sys];
56
static coordinate_type coordinate_system (std::string sys_coord);
57
static std::string coordinate_system_name (coordinate_type);
58
static void check_coord_sys_and_dimension (coordinate_type, size_type d);
60
// -------------------------------------------------------------
61
// valued field helper
62
// -------------------------------------------------------------
64
// typedefs and static data:
69
tensorial = 2, // symmetric, D_ij
70
unsymmetric_tensorial = 3,
71
tensorial_4 = 4, // symmetric, A_ijkl
76
// Note: 3 symmetries for 4-order tensors
77
// A_ijkl=A_ijlk, A_ijkl=A_jikl & A_ijkl=Aklij
78
// => 6 components in 2d, 21 in 3d and 10 in 2d-axisymmetric(rz)
80
struct pair_size_type {
84
struct double_pair_size_type {
86
pair_size_type second;
88
static pair_size_type make_pair_size(size_type a, size_type b);
89
static double_pair_size_type make_double_pair_size(
90
size_type a, size_type b, size_type c, size_type d);
92
static const char* valued_field_table [max_valued_field];
94
static size_type unsymmetric_tensor_index [3][3];
95
static pair_size_type unsymmetric_tensor_subscript [9];
96
static const char* unsymmetric_tensor_subscript_name [9];
98
static size_type symmetric_tensor_index [3][3];
99
static pair_size_type symmetric_tensor_subscript [6];
100
static const char* symmetric_tensor_subscript_name [6];
102
static size_type symmetric_tensor4_index [6][6];
103
static double_pair_size_type symmetric_tensor4_subscript [21];
104
static const char* symmetric_tensor4_subscript_name [21];
105
static double_pair_size_type symmetric_tensor4_subscript_rz [10];
106
static const char* symmetric_tensor4_subscript_rz_name [10];
110
static valued_field_type valued_field (std::string valued);
111
static std::string valued_field_name (valued_field_type);
113
static size_type tensor_index (std::string valued, std::string sys_coord, size_type i, size_type j);
114
static size_type tensor_index (valued_field_type, coordinate_type, size_type i, size_type j);
116
static pair_size_type tensor_subscript (valued_field_type, coordinate_type, size_type i_comp);
117
static std::string tensor_subscript_name (valued_field_type, coordinate_type, size_type i_comp);
118
static pair_size_type tensor_subscript (std::string valued, std::string sys_coord, size_type i_comp);
119
static std::string tensor_subscript_name (std::string valued, std::string sys_coord, size_type i_comp);
121
static size_type tensor4_index (std::string valued, std::string sys_coord,
122
size_type i, size_type j, size_type k, size_type l);
123
static size_type tensor4_index (valued_field_type, coordinate_type,
124
size_type i, size_type j, size_type k, size_type l);
126
static double_pair_size_type tensor4_subscript (valued_field_type, coordinate_type, size_type i_comp);
127
static std::string tensor4_subscript_name (valued_field_type, coordinate_type, size_type i_comp);
128
static double_pair_size_type tensor4_subscript (std::string valued, std::string sys_coord, size_type i_comp);
129
static std::string tensor4_subscript_name (std::string valued, std::string sys_coord, size_type i_comp);
131
// -------------------------------------------------------------
132
// approximation name -> basis and numbering names
133
// -------------------------------------------------------------
134
static std::string basis_name (std::string approx_name);
135
static std::string numbering_name (std::string approx_name);
137
#endif // _RHEO_FEM_H