19 #ifndef DOFHANDLER_HH_ 20 #define DOFHANDLER_HH_ 100 virtual std::size_t
hash()
const =0;
176 void distribute_dofs(std::shared_ptr<DiscreteSpace> ds,
177 bool sequential =
false);
202 inline int el_index(
int loc_el)
const {
return el_4_loc[loc_el]; }
228 inline unsigned int n_loc_edges()
const {
return edg_4_loc.size(); }
233 inline unsigned int n_loc_nb()
const {
return nb_4_loc.size(); }
239 bool el_is_local(
int index)
const;
246 template<
unsigned int dim>
255 unsigned int idof)
const;
260 std::size_t
hash()
const override;
273 void make_elem_partitioning();
278 void init_cell_starts();
302 void receive_ghost_dofs(
unsigned int proc,
309 void send_ghost_dofs(
unsigned int proc);
321 void update_local_dofs(
unsigned int proc,
331 void create_sequential();
337 static const int INVALID_NODE = 1;
338 static const int VALID_NODE = 2;
339 static const int ASSIGNED_NODE = 3;
340 static const int INVALID_DOF = -1;
344 std::shared_ptr<DiscreteSpace>
ds_;
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
virtual ~DOFHandlerBase()
Destructor.
LongIdx * el_4_loc
Local element index -> global element index.
const unsigned int lsize() const
Returns the number of dofs on the current process.
std::vector< LongIdx > cell_starts_seq
Starting indices for element dofs (sequential version).
Distribution * el_ds_
Distribution of elements.
unsigned int n_loc_nb() const
Returns number of local neighbours.
int el_index(int loc_el) const
Returns the global index of local element.
Mesh * mesh() const
Returns the mesh.
Distribution * dof_ds_
Distribution of dofs associated to local process.
unsigned int lsize_
Number of dofs associated to local process.
map< unsigned int, vector< LongIdx > > ghost_proc_el
Arrays of ghost cells for each neighbouring processor.
std::vector< LongIdx > dof_indices_seq
Dof numbers on mesh elements (sequential version).
virtual unsigned int get_dof_indices(const ElementAccessor< 3 > &cell, std::vector< LongIdx > &indices) const =0
Fill vector of the global indices of dofs associated to the cell.
std::vector< LongIdx > cell_starts
Starting indices for element dofs (parallel version).
const unsigned int loffset() const
Returns the offset of the local part of dofs.
const unsigned int max_elem_dofs() const
Returns max. number of dofs on one element.
Mesh * mesh_
Pointer to the mesh to which the dof handler is associated.
std::vector< LongIdx > dof_indices
Dof numbers on local and ghost elements (parallel version).
Provides the numbering of the finite element degrees of freedom on the computational mesh...
vector< LongIdx > nb_4_loc
Local neighbour index -> global neighbour index.
virtual unsigned int get_loc_dof_indices(const ElementAccessor< 3 > &cell, std::vector< LongIdx > &indices) const =0
Fill vector of the indices of dofs associated to the cell on the local process.
unsigned int max_elem_dofs_
Max. number of dofs per element.
vector< LongIdx > ghost_4_loc
Indices of ghost cells (neighbouring with local elements).
Declaration of class which provides the finite element for every mesh cell.
unsigned int n_loc_edges() const
Returns number of local edges.
virtual std::size_t hash() const =0
Compute hash value of DOF handler.
LongIdx edge_index(int loc_edg) const
Returns the global index of local edge.
vector< LongIdx > edg_4_loc
Local edge index -> global edge index.
unsigned int loffset_
Index of the first dof on the local process.
set< unsigned int > ghost_proc
Processors of ghost elements.
vector< LongIdx > node_4_loc
Indices of local nodes in mesh tree.
std::shared_ptr< DiscreteSpace > ds_
Pointer to the discrete space for which the handler distributes dofs.
unsigned int n_global_dofs_
Number of global dofs assigned by the handler.
Abstract class for the description of a general finite element on a reference simplex in dim dimensio...
Distribution * distr() const
FiniteElement< dim > * fe(const ElementAccessor< 3 > &cell) const
Returns finite element object for given space dimension.
DOFHandlerBase(Mesh &_mesh)
Constructor.
LongIdx * row_4_el
Global element index -> index according to partitioning.
LongIdx nb_index(int loc_nb) const
Returns the global index of local neighbour.
const unsigned int n_global_dofs() const
Getter for the number of all mesh dofs required by the given finite element.