HArD::Core2D
Hybrid Arbitrary Degree::Core 2D - Library to implement 2D schemes with edge and cell polynomials as unknowns
Loading...
Searching...
No Matches
global-dof-table.hpp
Go to the documentation of this file.
1#ifndef GLOBAL_DOF_TABLE_HPP
2#define GLOBAL_DOF_TABLE_HPP
3
4#include "local-dof-table.hpp"
5
6namespace HArDCore2D
7{
8
9 namespace DSL {
16
19 public:
22
23 //------------------------------------------------------------------------------
24 // Global offsets
25 //------------------------------------------------------------------------------
26
28 inline size_t globalOffset(const Vertex & V) const
29 {
30 return V.global_index() * m_n_local_vertex_dofs;
31
32 }
33
35 inline size_t globalOffset(const Edge & E) const
36 {
38 + E.global_index() * m_n_local_edge_dofs;
39 }
40
42 inline size_t globalOffset(const Cell & T) const
43 {
46 + T.global_index() * m_n_local_cell_dofs;
47 }
48
49 //------------------------------------------------------------------------------
50 // Restrictions
51 //------------------------------------------------------------------------------
52
54 Eigen::VectorXd restrictEdge(size_t iE, const Eigen::VectorXd & vh) const;
55
57 Eigen::VectorXd restrictCell(size_t iT, const Eigen::VectorXd & vh) const;
58
60 inline Eigen::VectorXd restrict(const Edge & E, const Eigen::VectorXd vh) const
61 {
62 return restrictEdge(E.global_index(), vh);
63 }
64
66 inline Eigen::VectorXd restrict(const Cell & T, const Eigen::VectorXd vh) const
67 {
68 return restrictCell(T.global_index(), vh);
69 }
70
71 //------------------------------------------------------------------------------
72 // Extensions
73 //------------------------------------------------------------------------------
74
76 Eigen::MatrixXd extendOperator(const Cell & T, const Edge & E, const Eigen::MatrixXd & opE) const;
77
78 //------------------------------------------------------------------------------
79 // Global DOF indices for an element T
80 //------------------------------------------------------------------------------
81
82 std::vector<size_t> globalDOFIndices(const Cell & T) const;
83
84 //------------------------------------------------------------------------------
85 // Functions to handle labels
86 //------------------------------------------------------------------------------
88 inline void setLabelDOF(const size_t i, const int label)
89 {
90 m_labelDOF[i] = label;
91 }
92
94 inline int getLabelDOF(const size_t i)
95 {
96 return m_labelDOF[i];
97 }
98
99 private:
100 std::vector<int> m_labelDOF;
101
102 };
103
104 } // namespace DSL
105
106} // namespace HArDCore2D
107
108#endif
Definition discrete-space-descriptor.hpp:43
Base class for global DOF spaces. Provides functions to manipulate global DOFs (the local version bei...
Definition global-dof-table.hpp:18
Definition local-dof-table.hpp:10
DiscreteSpaceDescriptor & descriptor()
Definition local-dof-table.hpp:19
size_t m_n_local_vertex_dofs
Definition local-dof-table.hpp:151
const Mesh & mesh() const
Definition local-dof-table.hpp:14
size_t m_n_local_edge_dofs
Definition local-dof-table.hpp:150
size_t m_n_local_cell_dofs
Definition local-dof-table.hpp:149
Compute max and min eigenvalues of all matrices for i
Definition compute_eigs.m:5
Eigen::VectorXd restrict(const Edge &E, const Eigen::VectorXd vh) const
Restrict to an edge.
Definition global-dof-table.hpp:60
size_t globalOffset(const Edge &E) const
Return the global offset for the unknowns on the edge E.
Definition global-dof-table.hpp:35
void setLabelDOF(const size_t i, const int label)
Set a label to the DOF number i (default label is -1)
Definition global-dof-table.hpp:88
Eigen::VectorXd restrict(const Cell &T, const Eigen::VectorXd vh) const
Restrict to a cell.
Definition global-dof-table.hpp:66
Eigen::VectorXd restrictEdge(size_t iE, const Eigen::VectorXd &vh) const
Restrict to the edge (including its vertices) of index iE.
Definition global-dof-table.cpp:24
size_t globalOffset(const Vertex &V) const
Return the global offset for the unknowns on the vertex V.
Definition global-dof-table.hpp:28
std::vector< size_t > globalDOFIndices(const Cell &T) const
Definition global-dof-table.cpp:97
int getLabelDOF(const size_t i)
Get label of DOF number i.
Definition global-dof-table.hpp:94
size_t globalOffset(const Cell &T) const
Return the global offset for the unknowns on the cell T.
Definition global-dof-table.hpp:42
Eigen::MatrixXd extendOperator(const Cell &T, const Edge &E, const Eigen::MatrixXd &opE) const
Extend an edge operator to a cell.
Definition global-dof-table.cpp:74
Eigen::VectorXd restrictCell(size_t iT, const Eigen::VectorXd &vh) const
Restrict to the cell (including vertices and edges) of index iT.
Definition global-dof-table.cpp:45
std::size_t n_vertices() const
number of vertices in the mesh.
Definition Mesh2D.hpp:60
std::size_t n_edges() const
number of edges in the mesh.
Definition Mesh2D.hpp:61
if(strcmp(field, 'real')) % real valued entries T
Definition mmread.m:93
Definition ddr-klplate.hpp:27