1#ifndef VARIABLEDOFSPACE_HPP
2#define VARIABLEDOFSPACE_HPP
22 const Eigen::VectorXd n_local_vertex_dofs,
23 const Eigen::VectorXd n_local_edge_dofs,
24 const Eigen::VectorXd n_local_cell_dofs
30 size_t n_local_vertex_dofs,
31 const Eigen::VectorXd n_local_edge_dofs,
32 const Eigen::VectorXd n_local_cell_dofs
38 size_t n_local_vertex_dofs,
39 size_t n_local_edge_dofs,
40 const Eigen::VectorXd n_local_cell_dofs
47 size_t n_local_vertex_dofs,
48 size_t n_local_edge_dofs,
49 size_t n_local_cell_dofs
67 return m_n_local_vertex_dofs[iV];
80 return m_n_local_edge_dofs[iE];
94 return m_n_local_cell_dofs[iT];
112 return m_n_local_vertex_dofs.sum();
118 return m_n_local_edge_dofs.sum();
125 return m_n_local_cell_dofs.sum();
138 return m_n_local_vertex_dofs[V.global_index()];
152 return m_n_local_vertex_dofs[E.vertex(0)->global_index()] + m_n_local_vertex_dofs[E.vertex(1)->global_index()]
153 + m_n_local_edge_dofs[E.global_index()];
168 for (Vertex * V :
T.get_vertices()){
169 nb_dofs += m_n_local_vertex_dofs[V->global_index()];
171 for (Edge * E :
T.get_edges()){
172 nb_dofs += m_n_local_edge_dofs[E->global_index()];
174 return nb_dofs + m_n_local_cell_dofs[
T.global_index()];
191 for (
int iV=0; iV<E.index_vertex(&V); iV++){
192 nb_dofs += m_n_local_vertex_dofs[E.vertex(iV)->global_index()];
200 return m_n_local_vertex_dofs[E.vertex(0)->global_index()] + m_n_local_vertex_dofs[E.vertex(1)->global_index()];
209 for (
int iV=0; iV<
T.index_vertex(&V); iV++){
210 nb_dofs += m_n_local_vertex_dofs[
T.vertex(iV)->global_index()];
219 for (
size_t iV=0; iV<
T.n_vertices(); iV++){
220 nb_dofs += m_n_local_vertex_dofs[
T.vertex(iV)->global_index()];
222 for (
int iE=0; iE<
T.index_edge(&E); iE++){
223 nb_dofs += m_n_local_edge_dofs[
T.edge(iE)->global_index()];
232 for (
size_t iV=0; iV<
T.n_vertices(); iV++){
233 nb_dofs += m_n_local_vertex_dofs[
T.vertex(iV)->global_index()];
235 for (
size_t iE=0; iE<
T.n_edges(); iE++){
236 nb_dofs += m_n_local_edge_dofs[
T.edge(iE)->global_index()];
248 return ( m_n_local_vertex_dofs.head(V.global_index()) ).sum();
254 return m_n_local_vertex_dofs.sum()
255 + ( m_n_local_edge_dofs.head(E.global_index()) ).sum();
262 return m_n_local_vertex_dofs.sum()
263 + m_n_local_edge_dofs.sum()
264 + ( m_n_local_cell_dofs.head(
T.global_index()) ).sum();
272 Eigen::VectorXd
restrictEdge(
size_t iE,
const Eigen::VectorXd & vh)
const;
276 Eigen::VectorXd
restrictCell(
size_t iT,
const Eigen::VectorXd & vh)
const;
279 inline Eigen::VectorXd
restrict(
const Edge & E,
const Eigen::VectorXd vh)
const
286 inline Eigen::VectorXd
restrict(
const Cell &
T,
const Eigen::VectorXd vh)
const
297 Eigen::MatrixXd
extendOperator(
const Cell &
T,
const Edge & E,
const Eigen::MatrixXd & opE)
const;
311 Eigen::VectorXd m_n_local_vertex_dofs;
312 Eigen::VectorXd m_n_local_edge_dofs;
313 Eigen::VectorXd m_n_local_cell_dofs;
Base class for global DOF spaces.
Definition variabledofspace.hpp:17
size_t localOffset(const Cell &T, const Edge &E) const
Returns the local offset of the edge E with respect to the cell T.
Definition variabledofspace.hpp:216
size_t dimensionEdge(const Edge &E) const
Returns the dimension of the local space on the edge E (including vertices)
Definition variabledofspace.hpp:150
size_t nDOFs_edges() const
Total number of edges DOFs.
Definition variabledofspace.hpp:116
Eigen::VectorXd restrict(const Edge &E, const Eigen::VectorXd vh) const
Restrict to an edge.
Definition variabledofspace.hpp:279
size_t localOffset(const Cell &T, const Vertex &V) const
Returns the local offset of the vertex V with respect to the cell T.
Definition variabledofspace.hpp:206
const Mesh & mesh() const
Returns the mesh.
Definition variabledofspace.hpp:58
size_t globalOffset(const Edge &E) const
Return the global offset for the unknowns on the edge E.
Definition variabledofspace.hpp:252
size_t dimensionVertex(const Vertex &V) const
Returns the dimension of the local space on the vertex V.
Definition variabledofspace.hpp:136
size_t numLocalDofsVertex(const Vertex &V) const
Returns the number of local DOFs on vertex V.
Definition variabledofspace.hpp:71
size_t dimension() const
Returns the dimension of the global space (all DOFs for all geometric entities)
Definition variabledofspace.hpp:129
size_t globalOffset(const Cell &T) const
Return the global offset for the unknowns on the cell T.
Definition variabledofspace.hpp:260
size_t numLocalDofsEdge(const size_t iE) const
Returns the number of local DOFs on edge of index iE.
Definition variabledofspace.hpp:77
size_t nDOFs_cells() const
Total number of cells DOFs.
Definition variabledofspace.hpp:123
size_t numLocalDofsEdge(const Edge &E) const
Returns the number of local DOFs on edge E.
Definition variabledofspace.hpp:84
size_t dimensionVertex(size_t iV) const
Returns the dimension of the local space on the vertex of index iV.
Definition variabledofspace.hpp:142
std::vector< size_t > globalDOFIndices(const Cell &T) const
Returns a vector listing the global DOFs attached to the element T: vertex DOFs, edge DOFs,...
Definition variabledofspace.cpp:149
size_t dimensionCell(size_t iT) const
Returns the dimension of the local space on the cell of index iT (including faces,...
Definition variabledofspace.hpp:178
size_t numLocalDofsCell(const Cell &T) const
Returns the number of local DOFs on cell T.
Definition variabledofspace.hpp:98
size_t localOffset(const Edge &E) const
Returns the local offset of the unknowns attached to the edge E.
Definition variabledofspace.hpp:198
Eigen::MatrixXd extendOperator(const Cell &T, const Edge &E, const Eigen::MatrixXd &opE) const
Extend an edge operator to a cell.
Definition variabledofspace.cpp:126
Eigen::VectorXd restrictEdge(size_t iE, const Eigen::VectorXd &vh) const
Restrict to the edge (including its vertices) of index iE.
Definition variabledofspace.cpp:73
size_t dimensionCell(const Cell &T) const
Returns the dimension of the local space on the cell T (including faces, edges and vertices)
Definition variabledofspace.hpp:165
size_t numLocalDofsVertex(const size_t iV) const
Returns the number of local DOFs on vertex of index iV.
Definition variabledofspace.hpp:64
size_t nDOFs_vertices() const
Total number of vertices DOFs.
Definition variabledofspace.hpp:110
size_t globalOffset(const Vertex &V) const
Return the global offset for the unknowns on the vertex V.
Definition variabledofspace.hpp:246
size_t localOffset(const Edge &E, const Vertex &V) const
Returns the local offset of the vertex V with respect to the edge E.
Definition variabledofspace.hpp:188
Eigen::VectorXd restrictCell(size_t iT, const Eigen::VectorXd &vh) const
Restrict to the cell (including vertices, edges and faces) of index iT.
Definition variabledofspace.cpp:95
size_t numLocalDofsCell(const size_t iT) const
Returns the number of local DOFs on cell of index iT.
Definition variabledofspace.hpp:91
size_t dimensionEdge(size_t iE) const
Returns the dimension of the local space on the edge of index iE (including vertices)
Definition variabledofspace.hpp:157
size_t localOffset(const Cell &T) const
Returns the local offset of the unknowns attached to the element T.
Definition variabledofspace.hpp:229
Eigen::VectorXd restrict(const Cell &T, const Eigen::VectorXd vh) const
Restrict to a cell.
Definition variabledofspace.hpp:286
std::size_t n_vertices() const
number of vertices in the mesh.
Definition Mesh2D.hpp:60
Cell * cell(std::size_t index) const
get a constant pointer to a cell using its global index
Definition Mesh2D.hpp:178
Edge * edge(std::size_t index) const
get a constant pointer to a edge using its global index
Definition Mesh2D.hpp:168
std::size_t n_cells() const
number of cells in the mesh.
Definition Mesh2D.hpp:63
Vertex * vertex(std::size_t index) const
get a constant pointer to a vertex using its global index
Definition Mesh2D.hpp:163
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