246 const unsigned int offset)
251 unsigned int next_free_dof =
offset;
254 unsigned int n_obj_dofs[4][4];
263 for (
unsigned int dm=0; dm <= 3; dm++)
264 for (
unsigned int dd=1; dd <= 3; dd++)
265 n_obj_dofs[dd][dm] = 0;
266 for (
unsigned int d=0; d<fe1d.
n_dofs(); d++)
267 n_obj_dofs[1][fe1d.
dof(d).
dim]++;
268 for (
unsigned int d=0; d<fe2d.
n_dofs(); d++)
269 n_obj_dofs[2][fe2d.
dof(d).
dim]++;
270 for (
unsigned int d=0; d<fe3d.
n_dofs(); d++)
271 n_obj_dofs[3][fe3d.
dof(d).
dim]++;
295 if (loc_part[cell.index()] != (int)proc)
continue;
297 unsigned int dim = cell->dim();
304 for (
unsigned int i=0; i<dim+1; i++)
306 object_dofs[cell.index()][dim] =
new int[n_obj_dofs[dim][dim]];
308 for (
unsigned int i=0; i<n_obj_dofs[dim][dim]; i++)
309 object_dofs[cell.index()][dim][i] = next_free_dof++;
327 unsigned int dim = cell->dim();
328 unsigned int n_objects_dofs;
343 ASSERT_LE(n_objects_dofs, indices.size()).error();
345 for (
unsigned int k = 0; k < n_objects_dofs; k++)
348 return n_objects_dofs;
357 unsigned int dim = cell->dim();
358 unsigned int n_objects_dofs;
373 ASSERT_LE(n_objects_dofs, indices.size()).error();
375 for (
unsigned int k = 0; k < n_objects_dofs; k++)
378 return n_objects_dofs;
401 VecGetValues(values, ndofs, (PetscInt *)indices[0], local_values);
409 for (
unsigned int j=0; j<=elem->dim(); j++)
428 for (
unsigned int iedg=0; iedg<
mesh_->
n_edges(); iedg++)
430 bool is_edge_local =
false;
432 for (
int sid=0; sid<edg->
n_sides; sid++)
435 is_edge_local =
true;
int IdxInt
Define integers that are indices into large arrays (elements, nodes, dofs etc.)
Declaration of class which handles the ordering of degrees of freedom (dof) and mappings between loca...
vector< IdxInt > nb_4_loc
Local neighbour index -> global neighbour index.
DOFHandlerMultiDim(Mesh &_mesh)
Constructor.
IdxInt *** object_dofs
Number of dofs associated to geometrical entities.
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.
IdxInt * get_el_4_loc() const
Distribution * el_ds_
Distribution of elements.
unsigned int dim
Association to n-face of given dimension (point, line, triangle, tetrahedron.
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.
vector< IdxInt > edg_4_loc
Local edge index -> global edge index.
#define ASSERT_LE(a, b)
Definition of comparative assert macro (Less or Equal)
Dof dof(unsigned int i) const
Returns i -th degree of freedom.
unsigned int global_dof_offset
Index of first global dof.
unsigned int get_dof_indices(const CellIterator &cell, std::vector< IdxInt > &indices) const override
Returns the global indices of dofs associated to the cell.
Partitioning * get_part()
unsigned int lsize_
Number of dofs associated to local process.
unsigned int n_vb_neighbours() const
unsigned int get_loc_dof_indices(const CellIterator &cell, std::vector< IdxInt > &indices) const override
Returns the indices of dofs associated to the cell on the 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
unsigned int max_elem_dofs_
Max. number of dofs per element.
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.
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.
ElementFullIter element() const
IdxInt * row_4_el
Global element index -> index according to partitioning.
~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
#define MPI_Bcast(buffer, count, datatype, root, comm)
const unsigned int n_dofs() const
Returns the number of degrees of freedom needed by the finite element.
const IdxInt * get_loc_part() const
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.
unsigned int n_edges() const
bool el_is_local(int index) const
FullIter end()
Returns FullFullIterer of the fictions past the end element.
IdxInt * el_4_loc
Local element index -> global element index.
SideIter side(const unsigned int i) const
IdxInt * get_row_4_el() const
std::size_t hash() const override
ElementVector element
Vector of elements of the mesh.