259 const unsigned int offset)
264 unsigned int next_free_dof =
offset;
267 unsigned int n_obj_dofs[4][4];
275 for (
unsigned int dm=0; dm <= 1; dm++)
277 n_obj_dofs[1][dm] = 0;
281 for (
unsigned int dm=0; dm <= 2; dm++)
283 n_obj_dofs[2][dm] = 0;
287 for (
unsigned int dm=0; dm <= 3; dm++)
289 n_obj_dofs[3][dm] = 0;
316 if (loc_part[cell.index()] != (int)proc)
continue;
318 unsigned int dim = cell->dim();
325 for (
unsigned int i=0; i<dim+1; i++)
327 object_dofs[cell.index()][dim] =
new int[n_obj_dofs[dim][dim]];
329 for (
unsigned int i=0; i<n_obj_dofs[dim][dim]; i++)
330 object_dofs[cell.index()][dim][i] = next_free_dof++;
348 unsigned int dim = cell->dim();
383 unsigned int indices[ndofs];
386 VecGetValues(values, ndofs, (PetscInt *)indices, local_values);
394 for (
unsigned int j=0; j<elem->dim(); j++)
415 for (
unsigned int iedg=0; iedg<
mesh_->
edges.size(); iedg++)
417 bool is_edge_local =
false;
419 for (
int sid=0; sid<edg->
n_sides; sid++)
422 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.
void id_maps(int n_ids, int *id_4_old, Distribution *&new_ds, int *&id_4_loc, int *&new_4_id)
FiniteElement< 3, 3 > * fe3d_
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...
#define FOR_ELEMENTS(_mesh_, __i)
FiniteElement< 1, 3 > * fe1d_
Pointer to the finite element class for which the handler distributes dofs.
const unsigned int n_dofs() const
Returns the number of degrees of freedom needed by the finite element.
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.
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 np() const
get num of processors
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
FullIter end()
Returns FullFullIterer of the fictions past the end element.
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.
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.
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.
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.
unsigned int index(const T *pointer) const
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.