247 const unsigned int offset)
252 unsigned int next_free_dof =
offset;
255 unsigned int n_obj_dofs[4][4];
263 for (
unsigned int dm=0; dm <= 1; dm++)
265 n_obj_dofs[1][dm] = 0;
269 for (
unsigned int dm=0; dm <= 2; dm++)
271 n_obj_dofs[2][dm] = 0;
275 for (
unsigned int dm=0; dm <= 3; dm++)
277 n_obj_dofs[3][dm] = 0;
304 if (loc_part[cell.index()] != (int)proc)
continue;
306 unsigned int dim = cell->dim();
313 for (
unsigned int i=0; i<dim+1; i++)
315 object_dofs[cell.index()][dim] =
new int[n_obj_dofs[dim][dim]];
317 for (
unsigned int i=0; i<n_obj_dofs[dim][dim]; i++)
318 object_dofs[cell.index()][dim][i] = next_free_dof++;
336 unsigned int dim = cell->dim();
337 unsigned int n_objects_dofs;
352 for (
unsigned int k = 0; k < n_objects_dofs; k++)
358 unsigned int dim = cell->dim();
359 unsigned int n_objects_dofs;
374 for (
unsigned int k = 0; k < n_objects_dofs; k++)
395 unsigned int indices[ndofs];
398 VecGetValues(values, ndofs, (PetscInt *)indices, local_values);
406 for (
unsigned int j=0; j<elem->dim(); j++)
425 for (
unsigned int iedg=0; iedg<
mesh_->
edges.size(); iedg++)
427 bool is_edge_local =
false;
429 for (
int sid=0; sid<edg->
n_sides; sid++)
432 is_edge_local =
true;
Declaration of class which handles the ordering of degrees of freedom (dof) and mappings between loca...
vector< int > edg_4_loc
Local edge index -> global edge index.
DOFHandlerMultiDim(Mesh &_mesh)
Constructor.
FiniteElement< 3, 3 > * fe3d_
#define FOR_ELEMENTS(_mesh_, __i)
FiniteElement< 1, 3 > * fe1d_
Pointer to the finite element class for which the handler distributes dofs.
Distribution * el_ds_
Distribution of elements.
void distribute_dofs(FiniteElement< 1, 3 > &fe1d, FiniteElement< 2, 3 > &fe2d, FiniteElement< 3, 3 > &fe3d, const unsigned int offset=0)
Distributes degrees of freedom on the mesh needed for the given finite elements.
int * get_el_4_loc() const
unsigned int global_dof_offset
Index of first global dof.
Partitioning * get_part()
const std::vector< DofMultiplicity > dof_multiplicities
unsigned int lsize_
Number of dofs associated to local process.
unsigned int n_elements() const
const unsigned int offset() const
Returns the number of the first global dof handled by this DOFHandler.
bool is_local(unsigned int idx) const
identify local index
Mesh * mesh_
Pointer to the mesh to which the dof handler is associated.
unsigned int index(const T *pointer) const
void get_loc_dof_indices(const CellIterator &cell, unsigned int indices[]) const override
Returns the indices of dofs associated to the cell on the local process.
unsigned int np() const
get num of processors
Distribution * get_el_ds() const
void make_elem_partitioning()
Prepare parallel distribution of elements, edges and neighbours.
Distribution * ds_
Distribution of dofs associated to local process.
int *** object_dofs
Number of dofs associated to geometrical entities.
unsigned int myp() const
get my processor
Support classes for parallel programing.
FiniteElement< 2, 3 > * fe2d_
vector< Neighbour > vb_neighbours_
unsigned int loffset_
Index of the first dof on the local process.
const unsigned int n_object_dofs(unsigned int object_dim, DofMultiplicity multiplicity)
Returns the number of single dofs/dof pairs/triples/sextuples that lie on a single geometric entity o...
void get_dof_indices(const CellIterator &cell, unsigned int indices[]) const override
Returns the global indices of dofs associated to the cell.
ElementFullIter element() const
~DOFHandlerMultiDim() override
Destructor.
int * get_row_4_el() const
MPI_Comm get_comm() const
Returns communicator.
std::vector< Edge > edges
Vector of MH edges, this should not be part of the geometrical mesh.
unsigned int n_dofs
Number of global dofs assigned by the handler.
const Distribution * get_init_distr() const
const int * get_loc_part() const
#define MPI_Bcast(buffer, count, datatype, root, comm)
int * row_4_el
Global element index -> index according to partitioning.
const unsigned int n_dofs() const
Returns the number of degrees of freedom needed by the finite element.
Abstract class for description of finite elements.
void get_dof_values(const CellIterator &cell, const Vec &values, double local_values[]) const override
Returns the dof values associated to the cell.
bool el_is_local(int index) const
vector< int > nb_4_loc
Local neighbour index -> global neighbour index.
FullIter end()
Returns FullFullIterer of the fictions past the end element.
int * el_4_loc
Local element index -> global element index.
SideIter side(const unsigned int i) const
ElementVector element
Vector of elements of the mesh.