Hermes2D  3.0
space_h1.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_H1_H
17 #define __H2D_SPACE_H1_H
18 
19 #include "../shapeset/shapeset_h1_all.h"
20 #include "space.h"
21 
22 namespace Hermes
23 {
24  namespace Hermes2D
25  {
34  template<typename Scalar>
35  class HERMES_API H1Space : public Space < Scalar >
36  {
37  public:
38  H1Space();
39  H1Space(MeshSharedPtr mesh, EssentialBCs<Scalar>* boundary_conditions, int p_init = 1,
40  Shapeset* shapeset = nullptr);
41 
42  H1Space(MeshSharedPtr mesh, int p_init = 1,
43  Shapeset* shapeset = nullptr);
44 
45  virtual ~H1Space();
46 
47  virtual void set_shapeset(Shapeset* shapeset, bool clone = false);
48 
49  virtual Scalar* get_bc_projection(SurfPos* surf_pos, int order, EssentialBoundaryCondition<Scalar> *bc);
50 
52  virtual void copy(SpaceSharedPtr<Scalar> space, MeshSharedPtr new_mesh);
53 
54  protected:
55 
56  virtual SpaceType get_type() const { return HERMES_H1_SPACE; }
57 
59  void init(Shapeset* shapeset, int p_init, bool assign_dofs_init = true);
60 
61  virtual void assign_vertex_dofs();
62  virtual void assign_edge_dofs();
63  virtual void assign_bubble_dofs();
64 
65  virtual void get_vertex_assembly_list(Element* e, int iv, AsmList<Scalar>* al) const;
66  virtual void get_boundary_assembly_list_internal(Element* e, int ie, AsmList<Scalar>* al) const;
67 
68  inline void output_component(typename Space<Scalar>::BaseComponent*& current, typename Space<Scalar>::BaseComponent*& last, typename Space<Scalar>::BaseComponent* min,
69  Node*& edge, typename Space<Scalar>::BaseComponent*& edge_dofs);
70 
71  typename Space<Scalar>::BaseComponent* merge_baselists(typename Space<Scalar>::BaseComponent* l1, int n1, typename Space<Scalar>::BaseComponent* l2, int n2,
72  Node* edge, typename Space<Scalar>::BaseComponent*& edge_dofs, int& ncomponents);
73 
74  void update_constrained_nodes(Element* e, typename Space<Scalar>::EdgeInfo* ei0, typename Space<Scalar>::EdgeInfo* ei1, typename Space<Scalar>::EdgeInfo* ei2, typename Space<Scalar>::EdgeInfo* ei3);
75 
76  virtual void update_constraints();
77  };
78  }
79 }
80 #endif
Definition: adapt.h:24
Stores one element of a mesh.
Definition: element.h:107
Stores one node of a mesh.
Definition: element.h:45
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_h1.h:56