Hermes2D  2.0
space_l2.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_L2
17 #define __H2D_SPACE_L2
18 
19 #include "space.h"
20 namespace Hermes
21 {
22  namespace Hermes2D
23  {
33  template<typename Scalar>
34  class HERMES_API L2Space : public Space<Scalar>
35  {
36  public:
37  L2Space();
38  L2Space(const Mesh* mesh, int p_init = 0,
39  Shapeset* shapeset = NULL);
40 
41  virtual ~L2Space();
42 
43  virtual Scalar* get_bc_projection(SurfPos* surf_pos, int order, EssentialBoundaryCondition<Scalar> *bc);
44 
45  virtual void get_element_assembly_list(Element* e, AsmList<Scalar>* al, unsigned int first_dof = 0) const;
46 
48  virtual void copy(const Space<Scalar>* space, Mesh* new_mesh);
49  protected:
50  virtual int get_edge_order(Element* e, int edge) const {
51  return H2D_MAKE_EDGE_ORDER(e->get_mode(), edge, this->edata[e->id].order);
52  }
53 
54  virtual void set_shapeset(Shapeset* shapeset);
55 
56  virtual SpaceType get_type() const { return HERMES_L2_SPACE; }
57 
59  void init(Shapeset* shapeset, int p_init);
60 
61  struct L2Data
62  {
63  int vdof[H2D_MAX_NUMBER_VERTICES];
64  int edof[H2D_MAX_NUMBER_EDGES];
65  };
66 
67  L2Data* ldata;
68  int lsize;
69 
70  virtual void resize_tables();
71 
72  virtual void assign_vertex_dofs() {}
73  virtual void assign_edge_dofs() {}
74  virtual void assign_bubble_dofs();
75 
76  virtual void get_vertex_assembly_list(Element* e, int iv, AsmList<Scalar>* al) const;
77  virtual void get_boundary_assembly_list_internal(Element* e, int surf_num, AsmList<Scalar>* al) const;
78  virtual void get_bubble_assembly_list(Element* e, AsmList<Scalar>* al) const;
79  template<typename T> friend class Space<T>::ReferenceSpaceCreator;
80  friend class Space<Scalar>;
81  };
82  }
83 }
84 #endif