19 #ifndef DH_CELL_ACCESSOR_HH_ 20 #define DH_CELL_ACCESSOR_HH_ 85 unsigned int n_dofs()
const;
94 inline unsigned int dim()
const {
101 template<
unsigned int dim>
159 : dh_cell_accessor_(dh_cell_accessor), side_idx_(side_idx) {}
163 return dh_cell_accessor_.is_valid();
169 return new Side( const_cast<const Mesh*>(dh_cell_accessor_.dof_handler_->mesh()), dh_cell_accessor_.elm_idx(), side_idx_ );
180 inline unsigned int dim()
const {
188 inline virtual void inc() {
221 : cell_side_(cell_side), side_idx_(side_idx)
226 return cell_side_.is_valid();
244 inline unsigned int side_idx() {
return side_idx_; }
272 : dh_cell_(dh_cell), neighb_idx_(neighb_idx)
277 return dh_cell_.is_valid();
283 unsigned int side_idx = dh_cell_.elm()->neigh_vb[neighb_idx_]->side()->side_idx();
312 unsigned int ndofs = 0;
314 for (
unsigned int k=0; k<ndofs; k++)
323 unsigned int ndofs = 0;
325 for (
unsigned int k=0; k<ndofs; k++)
334 switch (this->
dim()) {
354 return fe<1>()->dof(idof);
357 return fe<2>()->dof(idof);
360 return fe<3>()->dof(idof);
367 auto bgn_it = make_iter<DHCellSide>(
DHCellSide(*
this, 0) );
368 auto end_it = make_iter<DHCellSide>(
DHCellSide(*
this,
dim()+1) );
374 auto bgn_it = make_iter<DHNeighbSide>(
DHNeighbSide(*
this, 0) );
375 auto end_it = make_iter<DHNeighbSide>(
DHNeighbSide(*
this, this->
elm()->n_neighs_vb()) );
381 unsigned int edge_idx = dh_cell_accessor_.elm()->edge_idx(side_idx_);
383 make_iter<DHEdgeSide>(
DHEdgeSide( *
this, dh_cell_accessor_.dof_handler_->mesh()->edges[edge_idx].n_sides) ));
virtual bool is_valid() const
Check validity of accessor (see default constructor)
const Dof & cell_dof(unsigned int idof) const
Return dof on a given cell.
Range< DHCellSide > side_range() const
Returns range of cell sides.
Declaration of class which handles the ordering of degrees of freedom (dof) and mappings between loca...
DHCellSide cell_side() const
Return DHCellSide according to this object.
unsigned int elm_idx() const
Return serial idx to element of loc_ele_idx_.
const DHCellAccessor cell_accessor_from_element(unsigned int elm_idx) const
Return DHCellAccessor appropriate to ElementAccessor of given idx.
Range< DHEdgeSide > edge_sides() const
Returns range of all sides looped over common Edge.
DHCellSide cell_side() const
Return DHCellSide according to this object.
void inc()
Iterates to next local element.
unsigned int dim() const
Return dimension of element appropriate to the side.
Range< DHNeighbSide > neighb_sides() const
Returns range of neighbour cells of higher dimension.
DHCellAccessor dh_cell_accessor_
Appropriate DHCellAccessor.
unsigned int get_loc_dof_indices(std::vector< LongIdx > &indices) const
Returns the indices of dofs associated to the cell on the local process.
Distribution * el_ds_
Distribution of elements.
unsigned int dim() const
Return dimension of element appropriate to cell.
unsigned int local_idx() const
Return local index to element (index of DOF handler).
FiniteElement< dim > * fe() const
Returns finite element object for given space dimension.
bool is_valid() const
Check validity of accessor (see default constructor)
const DOFHandlerMultiDim * dof_handler_
Pointer to the DOF handler owning the element.
unsigned int side_idx_
Index of side owned by Edge.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
bool is_valid() const
Check validity of accessor (see default constructor)
Mesh * mesh() const
Returns the mesh.
unsigned int n_dofs() const
Return number of dofs on given cell.
virtual ElementAccessor< 3 > element_accessor(unsigned int idx) const
Create and return ElementAccessor to element of given idx.
bool operator==(const DHCellSide &other)
Comparison of accessors.
DHCellSide cell_side_
Appropriate side accessor.
bool is_valid() const
Check validity of accessor (see default constructor)
std::vector< LongIdx > cell_starts
Starting indices for element dofs.
const ElementAccessor< 3 > elm() const
Return ElementAccessor to element of loc_ele_idx_.
unsigned int neighb_idx_
Index into neigh_vb array.
void inc()
Iterates to next edge side.
std::vector< LongIdx > dof_indices
Dof numbers on local and ghost elements.
Provides the numbering of the finite element degrees of freedom on the computational mesh...
DHCellAccessor(const DOFHandlerMultiDim *dof_handler, unsigned int loc_idx)
vector< LongIdx > ghost_4_loc
Indices of ghost cells (neighbouring with local elements).
unsigned int edge_idx_
Pointer to the DOF handler owning the element.
const DHCellAccessor cell() const
Return DHCellAccessor appropriate to the side.
void inc()
Iterates to next edge side.
bool operator==(const DHNeighbSide &other)
Comparison of accessors.
#define ASSERT_LT(a, b)
Definition of comparative assert macro (Less Than)
virtual void inc()
Iterates to next local element.
DHNeighbSide(const DHCellAccessor &dh_cell, unsigned int neighb_idx)
DHEdgeSide(const DHCellSide &cell_side, unsigned int side_idx)
DHCellAccessor dh_cell_
Appropriate cell accessor.
std::shared_ptr< DiscreteSpace > ds_
Pointer to the discrete space for which the handler distributes dofs.
unsigned int side_idx_
Index of side.
virtual const Side * side() const
Return Side of given cell and side_idx.
Abstract class for the description of a general finite element on a reference simplex in dim dimensio...
bool operator==(const DHEdgeSide &other)
Comparison of accessors.
bool operator==(const DHCellAccessor &other)
Comparison of accessors.
DHCellSide(const DHCellAccessor &dh_cell_accessor, unsigned int side_idx)
unsigned int get_dof_indices(std::vector< int > &indices) const
Fill vector of the global indices of dofs associated to the cell.
LongIdx * get_el_4_loc() const
unsigned int loc_ele_idx_
Index into DOFHandler::el_4_loc array.
#define ASSERT_LT_DBG(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
unsigned int lsize(int proc) const
get local size