Flow123d
JS_before_hm-1728-g5d7ebd453
|
Go to the documentation of this file.
19 #ifndef DH_CELL_ACCESSOR_HH_
20 #define DH_CELL_ACCESSOR_HH_
92 unsigned int n_dofs()
const;
101 inline unsigned int dim()
const {
113 template<
unsigned int dim>
131 return (loc_ele_idx_ < dof_handler_->el_ds_->lsize());
137 .error(
"Incompatible DOF handlers!");
214 inline unsigned int dim()
const {
259 inline virtual void inc() {
422 switch (this->
dim()) {
424 return fe<1>()->n_dofs();
427 return fe<2>()->n_dofs();
430 return fe<3>()->n_dofs();
442 return fe<1>()->dof(idof);
445 return fe<2>()->dof(idof);
448 return fe<3>()->dof(idof);
452 ASSERT(0)(this->
dim()).error(
"Unsupported FE dimension.");
454 return fe<1>()->dof(idof);;
459 auto bgn_it = make_iter<DHCellSide>(
DHCellSide(*
this, 0) );
460 auto end_it = make_iter<DHCellSide>(
DHCellSide(*
this,
dim()+1) );
467 auto bgn_it = make_iter<DHNeighbSide, DHCellSide>(
DHNeighbSide(*
this, 0, upper_bound) );
468 auto end_it = make_iter<DHNeighbSide, DHCellSide>(
DHNeighbSide(*
this, upper_bound, upper_bound) );
unsigned int n_neighs_vb() const
Return number of neighbours.
arma::Col< IntIdx > LocDofVec
void inc()
Iterates to next neighbour side.
DHNeighbSide()
Default invalid accessor.
DHCellAccessor & cell()
Return DHCellAccessor appropriate to the side.
unsigned int edge_idx_
Global index of Edge.
bool is_valid() const
Check validity of accessor (see default constructor)
std::unordered_map< LongIdx, LongIdx > global_to_local_el_idx_
Maps global element index into local/ghost index (obsolete).
Side side() const
Return Side of given cell and side_idx.
const DOFHandlerMultiDim * dh() const
Return DOF handler.
void inc()
Iterates to next local element.
unsigned int lsize(int proc) const
get local size
bool is_valid() const
Check validity of accessor (see default constructor)
DHCellSide()
Default invalid accessor.
bool operator!=(const DHCellAccessor &other) const
Comparison of accessors.
virtual void inc()
Iterates to next local element.
RangeConvert< DHEdgeSide, DHCellSide > edge_sides() const
Returns range of all sides looped over common Edge.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
bool operator==(const DHNeighbSide &other)
Comparison of accessors.
DHEdgeSide(const DHCellSide &cell_side, unsigned int side_idx)
unsigned int n_sides() const
Returns number of sides aligned with the edge.
unsigned int get_dof_indices(std::vector< LongIdx > &indices) const
Fill vector of the global indices of dofs associated to the cell.
DHNeighbSide(const DHCellAccessor &dh_cell, unsigned int neighb_idx, unsigned int max_idx)
Valid accessor allows iterate over neighbor sides.
bool is_own() const
Return true if accessor represents own element (false for ghost element)
DHEdgeSide()
Default invalid accessor.
Class allows to iterate over sides of neighbour.
bool is_valid() const
Check validity of accessor (see default constructor of DHCellAccessor)
vector< LongIdx > ghost_4_loc
Indices of ghost cells (neighbouring with local elements).
double measure() const
Calculate metrics of the side.
unsigned int elem_idx() const
Returns index of element in Mesh::element_vec_.
friend class DHNeighbSide
unsigned int dim() const
Return dimension of element appropriate to cell.
Distribution * el_ds_
Distribution of elements.
unsigned int side_idx_
Index of side.
DHCellAccessor dh_cell_
Appropriate cell accessor.
Declaration of class which handles the ordering of degrees of freedom (dof) and mappings between loca...
unsigned int dim() const
Return dimension of element appropriate to the side.
LocDofVec get_loc_dof_indices(unsigned int loc_ele_idx) const override
Returns the indices of dofs associated to the cell on the local process.
arma::vec3 centre() const
Side centre.
void inc()
Iterates to next edge side.
virtual unsigned int n_elements() const
Returns count of boundary or bulk elements.
Side accessor allows to iterate over sides of DOF handler cell.
const DOFHandlerMultiDim * dof_handler_
Pointer to the DOF handler owning the element.
Range< DHCellSide > side_range() const
Returns range of cell sides.
DHCellAccessor cell_with_other_dh(const DOFHandlerMultiDim *dh) const
Create new accessor with same local idx and given DOF handler. Actual and given DOF handler must be c...
const DHCellAccessor & cell() const
Return DHCellAccessor appropriate to the side.
RangeConvert< DHNeighbSide, DHCellSide > neighb_sides() const
Returns range of neighbour cell of lower dimension corresponding to cell of higher dimension.
bool not_local_cell()
Check if cell side of neighbour is not local (allow skip invalid accessors).
bool operator==(const DHEdgeSide &other)
Comparison of accessors.
bool el_is_local(int index) const
SideIter side(const unsigned int i) const
Gets side iterator of the i -th side.
Provides the numbering of the finite element degrees of freedom on the computational mesh.
unsigned int local_idx() const
Return local index to element (index of DOF handler).
Mesh * mesh() const
Returns the mesh.
unsigned int max_idx_
Maximal index into neigh_vb array.
Abstract class for description of finite elements.
const ElementAccessor< 3 > elm() const
Return ElementAccessor to element of loc_ele_idx_.
ElementAccessor< 3 > element() const
Returns iterator to the element of the side.
DHCellSide(const DHCellAccessor &dh_cell_accessor, unsigned int side_idx)
bool operator!=(const DHCellSide &other) const
unsigned int n_dofs() const
Return number of dofs on given cell.
unsigned int elm_idx() const
Return serial idx to element of loc_ele_idx_.
arma::vec3 centre() const
Centre of side.
unsigned int side_idx() const
Returns local index of the side on the element.
ElementAccessor< 3 > element() const
unsigned int elem_idx() const
unsigned int edge_idx(unsigned int edg_idx) const
Return edge_idx of given index.
int LongIdx
Define type that represents indices of large arrays (elements, nodes, dofs etc.)
const DHCellAccessor cell_accessor_from_element(unsigned int elm_idx) const
Return DHCellAccessor appropriate to ElementAccessor of given idx.
FEPtr< dim > fe() const
Returns finite element object for given space dimension.
std::shared_ptr< DiscreteSpace > ds_
Pointer to the discrete space for which the handler distributes dofs.
DHCellAccessor()
Default invalid accessor.
Cell accessor allow iterate over DOF handler cells.
double diameter() const
Calculate the side diameter.
DHCellAccessor(const DOFHandlerMultiDim *dof_handler, unsigned int loc_idx)
unsigned int n_edge_sides() const
virtual bool is_valid() const
Check validity of accessor (see default constructor)
DHCellAccessor dh_cell_accessor_
Appropriate DHCellAccessor.
Class allows to iterate over sides of edge.
#define ASSERT_LT_DBG(a, b)
Definition of comparative assert macro (Less Than) only for debug mode.
LocDofVec get_loc_dof_indices() const
Returns the local indices of dofs associated to the cell on the local process.
unsigned int idx() const
Return local idx of element in boundary / bulk part of element vector.
std::shared_ptr< FiniteElement< dim > > FEPtr
bool operator==(const DHCellAccessor &other) const
Comparison of accessors.
bool operator==(const DHCellSide &other)
Comparison of accessors.
unsigned int side_idx_
Index of side owned by Edge.
const DOFHandlerMultiDim * dof_handler_
Pointer to the DOF handler owning the element.
unsigned int side_idx() const
unsigned int loc_ele_idx_
Index into DOFHandler::el_4_loc array.
virtual ElementAccessor< 3 > element_accessor(unsigned int idx) const
Create and return ElementAccessor to element of given idx.
const Dof & cell_dof(unsigned int idof) const
Return dof on a given cell.
virtual unsigned int n_nodes() const
unsigned int get_dof_indices(const DHCellAccessor &cell, std::vector< LongIdx > &indices) const override
Returns the global indices of dofs associated to the cell.
Edge edge(uint edge_idx) const
unsigned int neighb_idx_
Index into neigh_vb array.
LongIdx * get_el_4_loc() const