Hermes2D  2.0
space_hdiv.h
1 // This file is part of Hermes2D.
2 //
3 // Hermes2D is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 2 of the License, or
6 // (at your option) any later version.
7 //
8 // Hermes2D is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with Hermes2D. If not, see <http://www.gnu.org/licenses/>.
15 
16 #ifndef __H2D_SPACE_HDIV_H
17 #define __H2D_SPACE_HDIV_H
18 
19 #include "space.h"
20 
21 namespace Hermes
22 {
23  namespace Hermes2D
24  {
35  template<typename Scalar>
36  class HERMES_API HdivSpace : public Space<Scalar>
37  {
38  public:
39  HdivSpace();
40  HdivSpace(const Mesh* mesh, EssentialBCs<Scalar>* boundary_conditions, int p_init = 1,
41  Shapeset* shapeset = NULL);
42 
43  HdivSpace(const Mesh* mesh, int p_init = 1,
44  Shapeset* shapeset = NULL);
45 
46  virtual ~HdivSpace();
47 
48  virtual void set_shapeset(Shapeset* shapeset);
49 
50  virtual Scalar* get_bc_projection(SurfPos* surf_pos, int order, EssentialBoundaryCondition<Scalar> *bc);
51 
53  virtual void copy(const Space<Scalar>* space, Mesh* new_mesh);
54  protected:
56  void init(Shapeset* shapeset, int p_init);
57 
58  virtual SpaceType get_type() const { return HERMES_HDIV_SPACE; }
59 
60  virtual void assign_vertex_dofs() {}
61  virtual void assign_edge_dofs();
62  virtual void assign_bubble_dofs();
63 
64  virtual void get_vertex_assembly_list(Element* e, int iv, AsmList<Scalar>* al) const {}
65  virtual void get_boundary_assembly_list_internal(Element* e, int surf_num, AsmList<Scalar>* al) const;
66  virtual void get_bubble_assembly_list(Element* e, AsmList<Scalar>* al) const;
67 
68  struct EdgeInfo
69  {
70  Node* node;
71  int part;
72  int ori;
73  double lo, hi;
74  };
75 
76  void update_constrained_nodes(Element* e, EdgeInfo* ei0, EdgeInfo* ei1, EdgeInfo* ei2, EdgeInfo* ei3);
77  virtual void update_constraints();
78  friend class Space<Scalar>;
79  };
80  }
81 }
82 #endif