Flow123d  master-8277f61
Public Member Functions | Private Member Functions | Private Attributes | List of all members
SubDOFHandlerMultiDim Class Reference

#include <dofhandler.hh>

Inheritance diagram for SubDOFHandlerMultiDim:
Inheritance graph
[legend]
Collaboration diagram for SubDOFHandlerMultiDim:
Collaboration graph
[legend]

Public Member Functions

 SubDOFHandlerMultiDim (std::shared_ptr< DOFHandlerMultiDim > dh, unsigned int component_idx)
 Creates a new dof handler for a component of FESystem. More...
 
void update_subvector (const VectorMPI &vec, VectorMPI &subvec)
 Update values in subvector from parent vector. More...
 
void update_parent_vector (VectorMPI &vec, const VectorMPI &subvec)
 Update values in parent vector from values of subvector. More...
 
const std::vector< LongIdx > & parent_indices ()
 Local indices in the parent handler. More...
 
- Public Member Functions inherited from DOFHandlerMultiDim
 DOFHandlerMultiDim (MeshBase &_mesh, bool make_elem_part=true)
 Constructor. More...
 
void distribute_dofs (std::shared_ptr< DiscreteSpace > ds)
 Distributes degrees of freedom on the mesh needed for the given discrete space. More...
 
std::shared_ptr< DOFHandlerMultiDimsequential ()
 Returns sequential version of the current dof handler. More...
 
std::shared_ptr< VecScatter > sequential_scatter ()
 Returns scatter context from parallel to sequential vectors. More...
 
virtual VectorMPI create_vector ()
 Allocates PETSc vector according to the dof distribution. More...
 
LongIdx edge_index (int loc_edg) const
 Returns the global index of local edge. More...
 
LongIdx nb_index (int loc_nb) const
 Returns the global index of local neighbour. More...
 
unsigned int n_loc_edges () const
 Returns number of local edges. More...
 
unsigned int n_loc_nb () const
 Returns number of local neighbours. More...
 
void print () const
 Output structure of dof handler. More...
 
std::size_t hash () const override
 
Range< DHCellAccessorown_range () const
 Returns range of DOF handler cells (only range of own without ghost cells) More...
 
Range< DHCellAccessorlocal_range () const
 Returns range over own and ghost cells of DOF handler. More...
 
Range< DHCellAccessorghost_range () const
 Returns range over ghosts DOF handler cells. More...
 
unsigned int n_own_cells () const
 Return size of own range (number of own cells) More...
 
unsigned int n_local_cells () const
 Return size of local range (number of local cells) More...
 
unsigned int n_ghost_cells () const
 Return size of ghost range (number of ghost cells) More...
 
const DHCellAccessor cell_accessor_from_element (unsigned int elm_idx) const
 Return DHCellAccessor appropriate to ElementAccessor of given idx. More...
 
std::shared_ptr< DiscreteSpaceds () const
 Return pointer to discrete space for which the handler distributes dofs. More...
 
const std::vector< LongIdx > & get_local_to_global_map () const
 Get the map between local dof indices and the global ones. More...
 
 ~DOFHandlerMultiDim () override
 Destructor. More...
 
- Public Member Functions inherited from DOFHandlerBase
 DOFHandlerBase (MeshBase &_mesh)
 Constructor. More...
 
unsigned int n_global_dofs () const
 Getter for the number of all mesh dofs required by the given finite element. More...
 
unsigned int lsize () const
 Returns the number of dofs on the current process. More...
 
unsigned int max_elem_dofs () const
 Returns max. number of dofs on one element. More...
 
std::shared_ptr< Distributiondistr () const
 
MeshBasemesh () const
 Returns the mesh. More...
 
virtual ~DOFHandlerBase ()
 Destructor. More...
 

Private Member Functions

void receive_sub_ghost_dofs (unsigned int proc, vector< unsigned int > &ghost_dof_proc, map< LongIdx, LongIdx > &global_to_local_dof_idx)
 Get global dof indices of ghost dofs for sub-handler. More...
 
void send_sub_ghost_dofs (unsigned int proc, const map< LongIdx, LongIdx > &global_to_local_dof_idx)
 Send global indices of dofs that are ghost on other processors. More...
 

Private Attributes

std::shared_ptr< DOFHandlerMultiDimparent_
 Parent dof handler. More...
 
unsigned int fe_idx_
 Index of FE in parent FESystem. More...
 
std::vector< LongIdxparent_dof_idx_
 Local indices in the parent handler. More...
 

Additional Inherited Members

- Protected Member Functions inherited from DOFHandlerMultiDim
bool el_is_local (int index) const
 
void make_elem_partitioning ()
 Prepare parallel distribution of elements, edges and neighbours. More...
 
void init_cell_starts ()
 Initialize vector of starting indices for elements. More...
 
void init_dof_starts (std::vector< LongIdx > &node_dof_starts, std::vector< LongIdx > &edge_dof_starts)
 Initialize auxiliary vector of starting indices of nodal/edge dofs. More...
 
void init_status (std::vector< short int > &node_status, std::vector< short int > &edge_status)
 Initialize node_status and edge_status. More...
 
void receive_ghost_dofs (unsigned int proc, std::vector< LongIdx > &dofs)
 Obtain dof numbers on ghost elements from other processor. More...
 
void send_ghost_dofs (unsigned int proc)
 Send dof numbers to other processor. More...
 
void update_local_dofs (unsigned int proc, const std::vector< bool > &update_cells, const std::vector< LongIdx > &dofs, const std::vector< LongIdx > &node_dof_starts, std::vector< LongIdx > &node_dofs, const std::vector< LongIdx > &edge_dof_starts, std::vector< LongIdx > &edge_dofs)
 Update dofs on local elements from ghost element dofs. More...
 
void create_sequential ()
 Communicate local dof indices to all processors and create new sequential dof handler. More...
 
unsigned int get_dof_indices (const DHCellAccessor &cell, std::vector< LongIdx > &indices) const override
 Returns the global indices of dofs associated to the cell. More...
 
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. More...
 
- Protected Attributes inherited from DOFHandlerMultiDim
std::shared_ptr< DiscreteSpaceds_
 Pointer to the discrete space for which the handler distributes dofs. More...
 
bool is_parallel_
 Indicator for parallel/sequential dof handler. More...
 
std::shared_ptr< DOFHandlerMultiDimdh_seq_
 Sequential dof handler associated to the current (parallel) one. More...
 
std::shared_ptr< VecScatter > scatter_to_seq_
 Scatter context for parallel to sequential vectors. More...
 
std::vector< LongIdxcell_starts
 Starting indices for local (owned+ghost) element dofs. More...
 
std::vector< IntIdxdof_indices
 Dof numbers on local and ghost elements. More...
 
std::vector< LongIdxlocal_to_global_dof_idx_
 Maps local and ghost dof indices to global ones. More...
 
std::unordered_map< LongIdx, LongIdxglobal_to_local_el_idx_
 Maps global element index into local/ghost index (obsolete). More...
 
Distributionel_ds_
 Distribution of elements. More...
 
vector< LongIdxedg_4_loc
 Local edge index -> global edge index. More...
 
vector< LongIdxnb_4_loc
 Local neighbour index -> global neighbour index. More...
 
vector< LongIdxghost_4_loc
 Indices of ghost cells (neighbouring with local elements). More...
 
set< unsigned int > ghost_proc
 Processors of ghost elements. More...
 
map< unsigned int, vector< LongIdx > > ghost_proc_el
 Arrays of ghost cells for each neighbouring processor. More...
 
bool distribute_edge_dofs
 Temporary flag which prevents using dof handler on meshes where edges are not allocated (currently BCMesh). More...
 
- Protected Attributes inherited from DOFHandlerBase
unsigned int n_global_dofs_
 Number of global dofs assigned by the handler. More...
 
unsigned int lsize_
 Number of dofs associated to local process. More...
 
unsigned int loffset_
 Index of the first dof on the local process. More...
 
unsigned int max_elem_dofs_
 Max. number of dofs per element. More...
 
MeshBasemesh_
 Pointer to the mesh to which the dof handler is associated. More...
 
std::shared_ptr< Distributiondof_ds_
 Distribution of dofs associated to local process. More...
 
- Static Protected Attributes inherited from DOFHandlerMultiDim
static const int INVALID_NFACE = 1
 
static const int VALID_NFACE = 2
 
static const int ASSIGNED_NFACE = 3
 
static const int INVALID_DOF = -1
 

Detailed Description

Definition at line 471 of file dofhandler.hh.

Constructor & Destructor Documentation

◆ SubDOFHandlerMultiDim()

SubDOFHandlerMultiDim::SubDOFHandlerMultiDim ( std::shared_ptr< DOFHandlerMultiDim dh,
unsigned int  component_idx 
)

Creates a new dof handler for a component of FESystem.

The component_idx indicates the index of finite-element from dh for which the new sub- handler is made. The numbering of dofs in sub-handler is compatible with the original handler.

Definition at line 763 of file dofhandler.cc.

Member Function Documentation

◆ parent_indices()

const std::vector<LongIdx>& SubDOFHandlerMultiDim::parent_indices ( )
inline

Local indices in the parent handler.

Definition at line 499 of file dofhandler.hh.

◆ receive_sub_ghost_dofs()

void SubDOFHandlerMultiDim::receive_sub_ghost_dofs ( unsigned int  proc,
vector< unsigned int > &  ghost_dof_proc,
map< LongIdx, LongIdx > &  global_to_local_dof_idx 
)
private

Get global dof indices of ghost dofs for sub-handler.

Definition at line 880 of file dofhandler.cc.

Here is the caller graph for this function:

◆ send_sub_ghost_dofs()

void SubDOFHandlerMultiDim::send_sub_ghost_dofs ( unsigned int  proc,
const map< LongIdx, LongIdx > &  global_to_local_dof_idx 
)
private

Send global indices of dofs that are ghost on other processors.

Definition at line 910 of file dofhandler.cc.

Here is the caller graph for this function:

◆ update_parent_vector()

void SubDOFHandlerMultiDim::update_parent_vector ( VectorMPI vec,
const VectorMPI subvec 
)

Update values in parent vector from values of subvector.

vec Vector aligned with parent dof handler. subvec Vector aligned with the current sub-handler.

Definition at line 938 of file dofhandler.cc.

◆ update_subvector()

void SubDOFHandlerMultiDim::update_subvector ( const VectorMPI vec,
VectorMPI subvec 
)

Update values in subvector from parent vector.

vec Vector aligned with the parent dof handler. subvec Vctor aligned with the current sub-handler.

Definition at line 928 of file dofhandler.cc.

Member Data Documentation

◆ fe_idx_

unsigned int SubDOFHandlerMultiDim::fe_idx_
private

Index of FE in parent FESystem.

Definition at line 514 of file dofhandler.hh.

◆ parent_

std::shared_ptr<DOFHandlerMultiDim> SubDOFHandlerMultiDim::parent_
private

Parent dof handler.

Definition at line 511 of file dofhandler.hh.

◆ parent_dof_idx_

std::vector<LongIdx> SubDOFHandlerMultiDim::parent_dof_idx_
private

Local indices in the parent handler.

Definition at line 517 of file dofhandler.hh.


The documentation for this class was generated from the following files: