Hermes2D  3.0
discrete_problem_helpers.h
1 
16 #ifndef __H2D_DISCRETE_PROBLEM_HELPERS_H
17 #define __H2D_DISCRETE_PROBLEM_HELPERS_H
18 
19 #include "hermes_common.h"
20 #include "weakform/weakform.h"
21 
22 namespace Hermes
23 {
24  namespace Hermes2D
25  {
26  namespace Mixins
27  {
28  template<typename Scalar>
29  class HERMES_API DiscreteProblemRungeKutta
30  {
31  protected:
34 
36  virtual void set_RK(int original_spaces_count, bool force_diagonal_blocks = nullptr, Table* block_weights = nullptr);
37 
39  bool rungeKutta;
40 
43 
44  bool force_diagonal_blocks;
45 
46  Table* block_weights;
47 
48  // Return scaling coefficient.
49  double block_scaling_coeff(MatrixForm<Scalar>* form) const;
50  double block_scaling_coeff(MatrixFormDG<Scalar>* form) const;
51  };
52 
53  template<typename Scalar>
54  class HERMES_API DiscreteProblemWeakForm
55  {
56  public:
57  WeakFormSharedPtr<Scalar> get_weak_formulation() const;
58 
59  protected:
61 
62  virtual void set_weak_formulation(WeakFormSharedPtr<Scalar> wf);
63 
66  };
67 
68  template<typename Scalar>
69  class HERMES_API DiscreteProblemMatrixVector
70  {
71  protected:
73 
74  virtual bool set_matrix(SparseMatrix<Scalar>* mat);
75  virtual bool set_rhs(Vector<Scalar>* rhs);
76 
77  SparseMatrix<Scalar>* current_mat;
78  Vector<Scalar>* current_rhs;
79  };
80  }
81 
84  HERMES_API unsigned char init_geometry_points_allocated(RefMap** reference_mapping, unsigned short reference_mapping_count, int order, GeomVol<double>& geometry, double* jacobian_x_weights);
85  HERMES_API unsigned char init_geometry_points_allocated(RefMap* rep_reference_mapping, int order, GeomVol<double>& geometry, double* jacobian_x_weights);
86  HERMES_API unsigned char init_surface_geometry_points_allocated(RefMap** reference_mapping, unsigned short reference_mapping_count, int& order, unsigned char isurf, int marker, GeomSurf<double>& geometry, double* jacobian_x_weights);
87  HERMES_API unsigned char init_surface_geometry_points_allocated(RefMap* rep_reference_mapping, int& order, unsigned char isurf, int marker, GeomSurf<double>& geometry, double* jacobian_x_weights);
88  }
89 }
90 #endif
Definition: adapt.h:24
bool rungeKutta
Turn on Runge-Kutta specific handling of external functions.
WeakFormSharedPtr< Scalar > wf
Weak formulation.
Abstract, base class for matrix form - i.e. a single integral in the bilinear form on the left hand s...
Definition: weakform.h:357
Used to pass the instances of WeakForm around.
Definition: weakform.h:55
int RK_original_spaces_count
Number of spaces in the original problem in a Runge-Kutta method.
Represents the reference mapping.
Definition: refmap.h:40
Abstract, base class for matrix DG form - i.e. bilinear form, where the integration is with respect t...
Definition: weakform.h:49
HERMES_API unsigned char init_geometry_points_allocated(RefMap **reference_mapping, unsigned short reference_mapping_count, int order, GeomVol< double > &geometry, double *jacobian_x_weights)