Hermes2D  2.0
space_hcurl.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_HCURL_H
17 #define __H2D_SPACE_HCURL_H
18 
19 #include "space.h"
20 namespace Hermes
21 {
22  namespace Hermes2D
23  {
34  template<typename Scalar>
35  class HERMES_API HcurlSpace : public Space<Scalar>
36  {
37  public:
38  HcurlSpace();
39  HcurlSpace(const Mesh* mesh, EssentialBCs<Scalar>* boundary_conditions, int p_init = 1,
40  Shapeset* shapeset = NULL);
41 
42  HcurlSpace(const Mesh* mesh, int p_init = 1,
43  Shapeset* shapeset = NULL);
44 
45  virtual ~HcurlSpace();
46 
47  virtual void set_shapeset(Shapeset* shapeset);
48 
49  virtual Scalar* get_bc_projection(SurfPos* surf_pos, int order, EssentialBoundaryCondition<Scalar> *bc);
50 
52  virtual void copy(const Space<Scalar>* space, Mesh* new_mesh);
53  protected:
54 
55  virtual SpaceType get_type() const { return HERMES_HCURL_SPACE; }
56 
58  void init(Shapeset* shapeset, int p_init);
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 
67  struct EdgeInfo
68  {
69  Node* node;
70  int part;
71  int ori;
72  double lo, hi;
73  };
74 
75  void update_constrained_nodes(Element* e, EdgeInfo* ei0, EdgeInfo* ei1, EdgeInfo* ei2, EdgeInfo* ei3);
76  virtual void update_constraints();
77  friend class Space<Scalar>;
78  };
79  }
80 }
81 #endif