29 "Different algorithms to make the sparse graph with weighted edges\n" 30 "from the multidimensional mesh. Main difference is dealing with \n" 31 "neighborings of elements of different dimension.")
33 .
add_value(
any_weight_lower_dim_cuts,
"any_wight_lower_dim_cuts",
"Same as before and assign higher weight to cuts of lower dimension in order to make them stick to one face.")
39 return IT::Selection(
"PartTool",
"Select the partitioning tool to use.")
40 .
add_value(
PETSc,
"PETSc",
"Use PETSc interface to various partitioning tools.")
46 static IT::Record input_type =
IT::Record(
"Partition",
"Setting for various types of mesh partitioning." )
114 if (e_idx != ele.index()) {
123 for (i_neigh = 0; i_neigh < ele->n_neighs_vb; i_neigh++) {
124 n_s = ele->neigh_vb[i_neigh]->edge()->n_sides;
125 for (i_s = 0; i_s < n_s; i_s++) {
155 if (mesh_size < num_of_procs) {
156 THROW( ExcDecomposeMesh() << EI_NElems( mesh_size ) << EI_NProcs( num_of_procs ) );
183 Distribution * &new_ds,
int * &id_4_loc,
int * &new_4_id) {
185 IS part, new_numbering;
186 unsigned int size = old_ds.
size();
187 int new_counts[old_ds.
np()];
193 ISCreateGeneral(PETSC_COMM_WORLD, old_ds.
lsize(), loc_part, PETSC_COPY_VALUES, &part);
194 ISPartitioningCount(part, old_ds.
np(), new_counts);
196 new_ds =
new Distribution((
unsigned int *) new_counts, PETSC_COMM_WORLD);
197 ISPartitioningToNumbering(part, &new_numbering);
199 old_4_new =
new int [size];
200 id_4_loc =
new int [ new_ds->lsize() ];
201 new_4_id =
new int [ n_ids + 1 ];
204 AOCreateBasicIS(new_numbering, PETSC_NULL, &new_old_ao);
205 for (
unsigned int i = 0; i < size; i++)
207 AOApplicationToPetsc(new_old_ao, size, old_4_new);
208 AODestroy(&(new_old_ao));
213 for (
unsigned int i_new = new_ds->begin(); i_new < new_ds->end(); i_new++) {
214 id_4_loc[i_loc++] = id_4_old[old_4_new[i_new]];
217 for (i_loc = 0; i_loc <= n_ids; i_loc++)
218 new_4_id[i_loc] = -1;
219 for (
unsigned int i_new = 0; i_new < size; i_new++)
220 new_4_id[id_4_old[old_4_new[i_new]]] = i_new;
237 seq_part_ = make_shared< vector<int> >(seq_size);
unsigned int size() const
get global size
Mesh * mesh_
The input mesh.
~Partitioning()
Destructor.
shared_ptr< vector< int > > subdomain_id_field_data()
void id_maps(int n_ids, int *id_4_old, Distribution *&new_ds, int *&id_4_loc, int *&new_4_id)
void make_element_connection_graph()
#define FOR_EDGE_SIDES(i, j)
#define FOR_ELEMENTS(_mesh_, __i)
static const Input::Type::Record & get_input_type()
Add edge for any pair of neighboring elements.
shared_ptr< vector< int > > seq_part_
Sequential partitioning for output.
#define ELEMENT_FULL_ITER(_mesh_, i)
#define MPI_Gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm)
#define FOR_ELEMENT_SIDES(i, j)
const unsigned int * get_lsizes_array()
get local sizes array
unsigned int n_elements() const
bool is_local(unsigned int idx) const
identify local index
Use PETSc interface to various partitioing tools.
static const Input::Type::Selection & get_tool_sel()
Input::Record in_
Input Record accessor.
const unsigned int * get_starts_array() const
get local starts array
MPI_Comm get_comm() const
void finalize()
Make sparse graph structures: rows, adj.
virtual void partition(int *loc_part)=0
Use direct interface to Metis.
unsigned int np() const
get num of processors
Distribution * init_el_ds_
Original distribution of elements. Depends on type of partitioner.
unsigned int myp() const
get my processor
Support classes for parallel programing.
ElementFullIter element() const
MPI_Comm get_comm() const
Returns communicator.
Same as before and assign higher weight to cuts of lower dimension in order to make them stick to one...
Distributed sparse graphs, partitioning.
const Distribution * get_init_distr() const
const int * get_loc_part() const
SparseGraph * graph_
Graph used to partitioning the mesh.
static const Input::Type::Selection & get_graph_type_sel()
Input specification objects.
Add edge for any pair of neighboring elements of same dimension (bad for matrix multiply) ...
Partitioning(Mesh *mesh, Input::Record in)
#define THROW(whole_exception_expr)
Wrapper for throw. Saves the throwing point.
SideIter side(const unsigned int i) const
void set_edge(const int a, const int b, int weight=1)
int * loc_part_
Partition numbers for local elements in original distribution of elements given be init_el_ds_...
ElementVector element
Vector of elements of the mesh.
unsigned int lsize(int proc) const
get local size