1 #ifndef DOFSPACE_HPP_INCLUDED
2 #define DOFSPACE_HPP_INCLUDED
18 template<
size_t dimension>
25 : _mesh(mesh), _nb_local_dofs(nb_local_dof) {;}
33 size_t i_cell )
const;
37 size_t i_cell )
const;
43 size_t i_cell )
const;
46 size_t i_cell )
const;
52 const Eigen::VectorXd & vh )
const;
59 const Eigen::MatrixXd & op )
const;
63 std::array<size_t,dimension+1> _nb_local_dofs;
70 template<
size_t dimension>
73 size_t rv = _mesh->n_cells(0)*_nb_local_dofs[0];
74 for (
size_t i = 1; i <= dimension; ++i) {
75 rv += _mesh->n_cells(i)*_nb_local_dofs[i];
80 template<
size_t dimension>
83 size_t rv = _nb_local_dofs[d];
84 for (
size_t i = 0; i < d; ++i) {
85 rv += _mesh->get_boundary(i,d,i_cell).size()*_nb_local_dofs[i];
90 template<
size_t dimension>
94 for (
size_t i = 0; i < d; ++i) {
95 rv += _mesh->get_boundary(i,d,i_cell).size()*_nb_local_dofs[i];
100 template<
size_t dimension>
103 assert(d_boundary < d || i_bd_rel == 0);
104 size_t rv = i_bd_rel*_nb_local_dofs[d_boundary];
105 for (
size_t i = 0; i < d_boundary; ++i) {
106 rv += _mesh->get_boundary(i,d,i_cell).size()*_nb_local_dofs[i];
111 template<
size_t dimension>
114 size_t rv = i_cell*_nb_local_dofs[d];
115 for (
size_t i = 0; i < d; ++i) {
116 rv += _mesh->n_cells(i)*_nb_local_dofs[i];
Convert between local and global data.
Definition: dofspace.hpp:19
size_t globalOffset(size_t d, size_t i_cell) const
Return the global offset of the unknown attached the i-th cell of dimension d.
Definition: dofspace.hpp:112
size_t numLocalDofs(size_t d) const
Return the number of Degree Of Freedoms on a d-cell.
Definition: dofspace.hpp:28
Eigen::VectorXd restrict(size_t d, size_t i_cell, const Eigen::VectorXd &vh) const
Restrict the vector vh to the i-th cell of dimension d (including its boundary).
Definition: dofspace.cpp:23
size_t localOffset(size_t d, size_t i_cell) const
Return the local offset of the unknown attached the i-th cell of dimension d.
Definition: dofspace.hpp:91
Eigen::MatrixXd extendOperator(size_t d_boundary, size_t d, size_t i_bd_global, size_t i_cell, const Eigen::MatrixXd &op) const
Extend operator op from a cell on the boundary to the i_cell-th cell.
Definition: dofspace.cpp:44
DOFSpace()
Empty space.
Definition: dofspace.hpp:22
size_t dimensionMesh() const
Return the total number of Degree Of Freedoms.
Definition: dofspace.hpp:71
DOFSpace(Mesh< dimension > const *mesh, std::array< size_t, dimension+1 > nb_local_dof)
Definition: dofspace.hpp:24
size_t dimensionCell(size_t d, size_t i_cell) const
Return the number of Degree Of Freedoms of the unknown attached the i-th cell of dimension d (includi...
Definition: dofspace.hpp:81
Main data structure for the mesh.
Definition: mesh.hpp:54
Compute and store the topological and geometrical data of the mesh.
Definition: maxwell.hpp:21