48 const double& max_error,
49 const double& min_error,
146 for (
unsigned e = 0;
e <
nelem;
e++)
152 for (
unsigned j = 0;
j < ndof;
j++)
178 for (std::set<unsigned>::iterator
it1 =
elements.begin();
182 for (std::set<unsigned>::iterator
it2 =
elements.begin();
186 if ((*
it1) != (*it2))
206 for (
unsigned e = 0;
e <
nelem;
e++)
212 typedef std::set<unsigned>::iterator
IT;
234 <<
"CPU time for setup of METIS data structures [nelem="
235 <<
nelem <<
"]: " <<
cpu0 <<
" sec" << std::endl;
247 <<
"Note: All elements in the Problem's Mesh appear to be\n"
248 <<
"unconnected. This happens, e.g. if all elements only have\n"
249 <<
"internal Data. Bypassing metis and distributing elements\n"
250 <<
"in round-robin fashion amongst the " <<
n_proc <<
" processors."
252 for (
unsigned e = 0;
e <
nelem;
e++)
329 <<
"Biasing element distribution via spatial error estimate\n";
337 mmesh_pt->spatial_error_estimator_pt()->get_element_errors(
347 for (
unsigned e = 0;
e <
nelem;
e++)
387 <<
"Biasing element distribution via spatial error estimate\n";
404 mmesh_pt->spatial_error_estimator_pt()->get_element_errors(
416 for (
unsigned e = start;
e <
end;
e++)
431 for (
unsigned e = start;
e <
end;
e++)
482 for (
unsigned e = 0;
e <
nelem;
e++)
501 <<
"when trying to partition " <<
nelem <<
"elements over "
502 <<
nparts <<
" processors!\n";
519 <<
"CPU time for METIS mesh partitioning [nelem="
520 <<
nelem <<
"]: " <<
cpu1 <<
" sec" << std::endl;
569 unsigned n_proc = comm_pt->nproc();
570 unsigned my_rank = comm_pt->my_rank();
583 unsigned n = elemental_assembly_time.
size();
587 error_stream <<
"Number of elements doesn't match the \n"
588 <<
"number of elemental assembly times: " <<
n_elem <<
" "
597 if (elemental_assembly_time.
size() != 0)
607 std::map<unsigned, std::set<GeneralisedElement*>>
694 for (
unsigned i = 0;
i <
n_dof;
i++)
741 comm_pt->mpi_comm());
780 comm_pt->mpi_comm());
833 comm_pt->mpi_comm());
866 comm_pt->mpi_comm());
899 comm_pt->mpi_comm());
919 comm_pt->mpi_comm());
926 <<
"CPU time for global setup of METIS data structures [nroot_elem="
949 std::map<unsigned, std::set<unsigned>>
980 for (std::set<unsigned>::iterator
it =
999 if ((*
it1) != (*it2))
1012 oomph_info <<
"CPU time for setup of connected elements (load balance) "
1035 typedef std::set<unsigned>::iterator
IT;
1056 oomph_info <<
"CPU time for setup of METIS data structures (load "
1057 "balance) [nroot_elem="
1131 oomph_info <<
"Basing distribution on assembly times of elements\n";
1141 error_stream <<
"Minimum assemble time for element is zero!\n";
1171 oomph_info <<
"Basing distribution on number of elements\n";
1192 <<
"Bypassing METIS for validation purposes.\n"
1193 <<
"Appending input for metis in metis_input_for_validation.dat\n";
1195 outfile.open(
"metis_input_for_validation.dat", std::ios_base::app);
1203 for (
unsigned i = 0;
i <
n;
i++)
1277 oomph_info <<
"Total weight on proc " <<
j <<
" is "
1283 oomph_info <<
"CPU time for METIS mesh partitioning [nroot_elem="
1316 comm_pt->mpi_comm());
1372 oomph_info <<
"CPU time for communication of partition to all processors "
double size() const
Calculate the size of the element (length, area, volume,...) in Eulerian computational coordinates....
A Generalised Element class.
bool is_halo() const
Is this element a halo?
unsigned ndof() const
Return the number of equations/dofs in the element.
unsigned long eqn_number(const unsigned &ieqn_local) const
Return the global equation number corresponding to the ieqn_local-th local equation number.
GeneralisedElement *& element_pt(const unsigned long &e)
Return pointer to element e.
unsigned long nelement() const
Return number of elements in the mesh.
An oomph-lib wrapper to the MPI_Comm communicator object. Just contains an MPI_Comm object (which is ...
An OomphLibError object which should be thrown when an run-time error is encountered....
////////////////////////////////////////////////////////////////// //////////////////////////////////...
OomphCommunicator * communicator_pt()
access function to the oomph-lib communicator
Vector< double > elemental_assembly_time()
Return vector of most-recent elemental assembly times (used for load balancing). Zero sized if no Jac...
unsigned nsub_mesh() const
Return number of submeshes.
Mesh *& mesh_pt()
Return a pointer to the global mesh.
RefineableElements are FiniteElements that may be subdivided into children to provide a better local ...
Base class for refineable meshes. Provides standardised interfaces for the following standard mesh ad...
TAdvectionDiffusionReactionElement<NREAGENT,DIM,NNODE_1D> elements are isoparametric triangular DIM-d...
void uniform_partition_mesh(Problem *problem_pt, const unsigned &ndomain, Vector< unsigned > &element_domain)
Partition mesh uniformly by dividing elements equally over the partitions, in the order in which they...
void partition_distributed_mesh(Problem *problem_pt, const unsigned &objective, Vector< unsigned > &element_domain_on_this_proc, const bool &bypass_metis=false)
Use METIS to assign each element in an already-distributed mesh to a domain. On return,...
void partition_mesh(Problem *problem_pt, const unsigned &ndomain, const unsigned &objective, Vector< unsigned > &element_domain)
Use METIS to assign each element to a domain. On return, element_domain[ielem] contains the number of...
void(* ErrorToWeightFctPt)(const double &spatial_error, const double &max_error, const double &min_error, int &weight)
Typedef for function pointer to to function that translates spatial error into weight for METIS parti...
ErrorToWeightFctPt Error_to_weight_fct_pt
Function pointer to to function that translates spatial error into weight for METIS partitioning.
void default_error_to_weight_fct(const double &spatial_error, const double &max_error, const double &min_error, int &weight)
Default function that translates spatial error into weight for METIS partitioning (unit weight regard...
DRAIG: Change all instances of (SPATIAL_DIM) to (DIM-1).
OomphInfo oomph_info
Single (global) instantiation of the OomphInfo object – this is used throughout the library as a "rep...