Hermes2D  3.0
discrete_problem_selective_assembler.h
1 
16 #ifndef __H2D_DISCRETE_PROBLEM_SELECTIVE_ASSEMBLER_H
17 #define __H2D_DISCRETE_PROBLEM_SELECTIVE_ASSEMBLER_H
18 
19 #include "hermes_common.h"
20 #include "forms.h"
21 #include "weakform/weakform.h"
22 #include "mesh/traverse.h"
23 #include "space/space.h"
24 #include "mixins2d.h"
25 #include "discrete_problem_helpers.h"
26 
27 namespace Hermes
28 {
29  namespace Hermes2D
30  {
31  class PrecalcShapeset;
32  template<typename Scalar> class Solver;
37  template<typename Scalar>
39  public Hermes::Mixins::TimeMeasurable,
41  public Hermes::Mixins::Loggable,
44  {
45  public:
48 
57  bool prepare_sparse_structure(SparseMatrix<Scalar>* mat, Vector<Scalar>* rhs, std::vector<SpaceSharedPtr<Scalar> > spaces, Traverse::State**& states, unsigned int& num_states);
58 
60  void set_spaces(std::vector<SpaceSharedPtr<Scalar> > spaces);
61 
63  void set_weak_formulation(WeakFormSharedPtr<Scalar> wf);
64 
66  bool form_to_be_assembled(MatrixForm<Scalar>* form, Traverse::State* current_state);
68  bool form_to_be_assembled(MatrixFormVol<Scalar>* form, Traverse::State* current_state);
70  bool form_to_be_assembled(MatrixFormSurf<Scalar>* form, Traverse::State* current_state);
72  bool form_to_be_assembled(MatrixFormDG<Scalar>* form, Traverse::State* current_state);
73 
75  bool form_to_be_assembled(VectorForm<Scalar>* form, Traverse::State* current_state);
77  bool form_to_be_assembled(VectorFormVol<Scalar>* form, Traverse::State* current_state);
79  bool form_to_be_assembled(VectorFormSurf<Scalar>* form, Traverse::State* current_state);
81  bool form_to_be_assembled(VectorFormDG<Scalar>* form, Traverse::State* current_state);
82 
83  protected:
85  unsigned int spaces_size;
86 
88  int* sp_seq;
89 
93  SparseMatrix<Scalar>* previous_mat;
94  bool vector_structure_reusable;
95  Vector<Scalar>* previous_rhs;
96 
97  friend class DiscreteProblem < Scalar > ;
98  friend class DiscreteProblemIntegrationOrderCalculator < Scalar > ;
99  friend class Solver < Scalar > ;
100  };
101  }
102 }
103 #endif
Definition: adapt.h:24
Class utilizes parallel calculation.
Definition: mixins2d.h:37
Abstract, base class for vector form - i.e. a single integral in the linear form on the right hand si...
Definition: weakform.h:439
Provides capabilities to (re-)assemble a matrix / vector only where necessary. See also Solver::keep_...
Used to pass the instances of Space around.
Definition: space.h:34
Abstract, base class for vector Surface form - i.e. VectorForm, where the integration is with respect...
Definition: weakform.h:48
Abstract, base class for vector DG form - i.e. linear Form, where the integration is with respect to ...
Definition: weakform.h:50
Abstract, base class for matrix Surface form - i.e. MatrixForm, where the integration is with respect...
Definition: weakform.h:47
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
Abstract, base class for matrix Volumetric form - i.e. MatrixForm, where the integration is with resp...
Definition: weakform.h:45
Abstract, base class for matrix DG form - i.e. bilinear form, where the integration is with respect t...
Definition: weakform.h:49
Abstract, base class for vector Volumetric form - i.e. VectorForm, where the integration is with resp...
Definition: weakform.h:46