HermesCommon  2.0
tables.h
Go to the documentation of this file.
1 // This file is part of HermesCommon
2 //
3 // Copyright (c) 2009 hp-FEM group at the University of Nevada, Reno (UNR).
4 // Email: hpfem-group@unr.edu, home page: http://hpfem.org/.
5 //
6 // Hermes2D is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published
8 // by the Free Software Foundation; either version 2 of the License,
9 // or (at your option) any later version.
10 //
11 // Hermes2D 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 Hermes2D; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #ifndef __HERMES_COMMON_TABLES_H_
23 #define __HERMES_COMMON_TABLES_H_
24 
25 #include "compat.h"
26 
27 namespace Hermes
28 {
33  {
34  /* EXPLICIT METHODS */
35 
40 
41  /* IMPLICIT METHODS */
42 
56 
57  /* EMBEDDED EXPLICIT METHODS */
58 
64 
65  /* EMBEDDED IMPLICIT METHODS */
66 
68 
70 
72 
74 
76 
78 
80 
81 
82 
83  };
84 
86  class HERMES_API Table
87  {
88  public:
89  Table();
90  Table(unsigned int size);
91  virtual void alloc(unsigned int size);
92  unsigned int get_size();
93  double get_A(unsigned int i, unsigned int j);
94  void set_A(unsigned int i, unsigned int j, double val);
95 
96  protected:
97  unsigned int size;
98  double** A;
99  };
100 
102  class HERMES_API ButcherTable: public Table
103  {
104  public:
105  ButcherTable();
106  ButcherTable(unsigned int size);
107  ButcherTable(ButcherTableType butcher_table);
108  virtual void alloc(unsigned int size);
109  double get_B(unsigned int i);
110  double get_B2(unsigned int i);
111  double get_C(unsigned int i);
112  void set_B(unsigned int i, double val);
113  void set_B2(unsigned int i, double val);
114  void set_C(unsigned int i, double val);
115  bool is_explicit();
116  bool is_diagonally_implicit();
117  bool is_fully_implicit();
118  bool is_embedded();
119  void switch_B_rows();
120 
121 
122  protected:
123  double* B;
124  double* B2;
125 
126  double* C;
127  };
128 }
129 #endif