Hermes2D  3.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  {
32  template<typename Scalar>
33  class HERMES_API L2Space : public Space < Scalar >
34  {
35  public:
36  L2Space();
37  L2Space(MeshSharedPtr mesh, int p_init = 0,
38  Shapeset* shapeset = nullptr);
39 
40  virtual ~L2Space();
41 
42  virtual Scalar* get_bc_projection(SurfPos* surf_pos, int order, EssentialBoundaryCondition<Scalar> *bc);
43 
44  virtual void get_element_assembly_list(Element* e, AsmList<Scalar>* al) const;
45 
47  virtual void copy(SpaceSharedPtr<Scalar> space, MeshSharedPtr new_mesh);
48  protected:
49  virtual int get_edge_order(Element* e, int edge) const {
50  return H2D_MAKE_EDGE_ORDER(e->get_mode(), edge, this->edata[e->id].order);
51  }
52 
53  virtual void set_shapeset(Shapeset* shapeset, bool clone = false);
54 
55  virtual SpaceType get_type() const { return HERMES_L2_SPACE; }
56 
58  void init(Shapeset* shapeset, int p_init, bool assign_dofs_init = true);
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  template<typename T> friend class Space<T>::ReferenceSpaceCreator;
68  };
69 
72  template<typename Scalar>
73  class HERMES_API L2MarkerWiseConstSpace : public L2Space < Scalar >
74  {
75  public:
76  L2MarkerWiseConstSpace(MeshSharedPtr mesh);
77 
78  protected:
79  virtual SpaceType get_type() const { return HERMES_L2_MARKERWISE_CONST_SPACE; }
80  virtual void assign_bubble_dofs();
81  };
82  }
83 }
84 #endif
Definition: adapt.h:24
int id
element id number
Definition: element.h:112
Stores one element of a mesh.
Definition: element.h:107
virtual int get_edge_order(Element *e, int edge) const
Internal. Obtains the order of an edge, according to the minimum rule.
Definition: space_l2.h:49
virtual SpaceType get_type() const
Internal. Return type of this space. See enum SpaceType.
Definition: space_l2.h:79
Should be exactly the same as is the count of enum ShapesetType.
Definition: shapeset.h:95
virtual SpaceType get_type() const
Internal. Return type of this space. See enum SpaceType.
Definition: space_l2.h:55