Hermes2D  2.0
mixins2d.h
1 #ifndef __H2D_MIXINS_H
2 #define __H2D_MIXINS_H
3 #include "global.h"
4 namespace Hermes
5 {
6  namespace Hermes2D
7  {
8  template<typename Scalar> class Space;
9 
17 
18 
19 
20 
21  namespace Mixins
22  {
25  template<typename Scalar>
26  class HERMES_API SettableSpaces
27  {
28  public:
30  virtual void set_spaces(Hermes::vector<const Space<Scalar>*> spaces) = 0;
31  virtual void set_space(const Space<Scalar>* space) = 0;
33  virtual Hermes::vector<const Space<Scalar>*> get_spaces() const = 0;
34  virtual const Space<Scalar>* get_space(int n) const;
35  };
36 
37 
40  class HERMES_API StateQueryable
41  {
42  public:
44  virtual bool isOkay() const = 0;
45 
47  virtual std::string getClassName() const = 0;
48 
50  void check() const;
51  };
52 
57  class HERMES_API XMLParsing
58  {
59  public:
61  XMLParsing();
62 
64  void set_validation(bool to_set);
65 
66  protected:
68  bool validate;
69  };
70 
73  template<typename Scalar>
74  class HERMES_API MatrixRhsOutput
75  {
76  public:
82  void output_matrix(int firstIterations = -1);
84  void set_print_zero_matrix_entries(bool to_set);
88  void set_matrix_filename(std::string name);
91  void set_matrix_varname(std::string name);
94  void set_matrix_E_matrix_dump_format(EMatrixDumpFormat format);
97  void set_matrix_number_format(char* number_format);
98 
101  void output_rhs(int firstIterations = -1);
105  void set_rhs_filename(std::string name);
108  void set_rhs_varname(std::string name);
111  void set_rhs_E_matrix_dump_format(EMatrixDumpFormat format);
114  void set_rhs_number_format(char* number_format);
115 
116  protected:
117  bool print_matrix_zero_values;
118  bool output_matrixOn;
119  int output_matrixIterations;
120  std::string matrixFilename;
121  std::string matrixVarname;
122  EMatrixDumpFormat matrixFormat;
123  char* matrix_number_format;
124 
125  bool output_rhsOn;
126  int output_rhsIterations;
127  std::string RhsFilename;
128  std::string RhsVarname;
129  EMatrixDumpFormat RhsFormat;
130  char* rhs_number_format;
131  };
132  }
133  }
134 }
135 #endif