-----------------------------------------------------------------------------
| 17 | |
| 18 | //----------------------------------------------------------------------------- |
| 19 | ElementDofLayout::ElementDofLayout( |
| 20 | int block_size, |
| 21 | const std::vector<std::vector<std::vector<int>>>& entity_dofs, |
| 22 | const std::vector<std::vector<std::vector<int>>>& entity_closure_dofs, |
| 23 | const std::vector<int>& parent_map, |
| 24 | const std::vector<ElementDofLayout>& sub_layouts) |
| 25 | : _block_size(block_size), _parent_map(parent_map), _num_dofs(0), |
| 26 | _entity_dofs(entity_dofs), _entity_closure_dofs(entity_closure_dofs), |
| 27 | _sub_dofmaps(sub_layouts) |
| 28 | { |
| 29 | // TODO: Handle global support dofs |
| 30 | |
| 31 | assert(entity_dofs.size() == _entity_closure_dofs.size()); |
| 32 | for (std::size_t dim = 0; dim < entity_dofs.size(); ++dim) |
| 33 | { |
| 34 | assert(!entity_dofs[dim].empty()); |
| 35 | assert(!_entity_closure_dofs[dim].empty()); |
| 36 | _num_dofs = std::accumulate(entity_dofs[dim].begin(), |
| 37 | entity_dofs[dim].end(), _num_dofs, |
| 38 | [](auto a, auto& b) { return a + b.size(); }); |
| 39 | } |
| 40 | } |
| 41 | //----------------------------------------------------------------------------- |
| 42 | ElementDofLayout ElementDofLayout::copy() const |
| 43 | { |