63 #ifndef MPICH_SKIP_MPICXX 64 #define MPICH_SKIP_MPICXX 66 #ifndef OMPI_SKIP_MPICXX 67 #define OMPI_SKIP_MPICXX 70 #pragma GCC diagnostic ignored "-Wold-style-cast" 98 ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID,
99 int wgt_dim,
float *obj_wgts,
int *ierr)
112 for (Foam::label i=0; i<
mesh.nCells(); i++)
122 ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID,
123 int *numEdges,
int *ierr)
127 if ((sizeGID != 1) || (sizeLID != 1) || (num_obj !=
mesh.nCells()))
129 *ierr = ZOLTAN_FATAL;
133 for (Foam::label i=0; i < num_obj ;i++)
135 Foam::label celli = localID[i];
140 if (
mesh.isInternalFace(cFaces[cFacei]))
152 static void get_edge_list(
void *data,
int sizeGID,
int sizeLID,
153 int num_obj, ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID,
155 ZOLTAN_ID_PTR nborGID,
int *nborProc,
156 int wgt_dim,
float *ewgts,
int *ierr)
164 || (num_obj !=
mesh.nCells())
168 *ierr = ZOLTAN_FATAL;
172 ZOLTAN_ID_TYPE* nextNbor = nborGID;
173 int* nextProc = nborProc;
174 float* nextWgt = ewgts;
176 for (Foam::label i=0; i < num_obj; i++)
178 Foam::label celli = localID[i];
185 Foam::label facei = cFaces[cFacei];
186 if (
mesh.isInternalFace(facei))
188 Foam::label nbr =
mesh.faceOwner()[facei];
191 nbr =
mesh.faceNeighbour()[facei];
201 if (
n != num_edges[i])
203 *ierr = ZOLTAN_FATAL;
226 ZOLTAN_ID_PTR global_ids,
227 ZOLTAN_ID_PTR local_ids,
237 (num_gid_entries != 1)
238 || (num_lid_entries != 1)
239 || (num_obj !=
mesh.nCells())
240 || (num_dim !=
mesh.nSolutionD())
243 *ierr = ZOLTAN_FATAL;
247 double*
p = geom_vec;
254 for (Foam::label celli = 0; celli < num_obj; celli++)
275 coeffsDict_(
dict.optionalSubDict(typeName+
"Coeffs"))
288 args[0] =
"zoltanRenumber";
292 for (label i = 0; i < argc; i++)
294 argv[i] = strdup(
args[i].c_str());
298 int rc = Zoltan_Initialize(argc, argv, &ver);
308 struct Zoltan_Struct *zz = Zoltan_Create(MPI_COMM_WORLD);
313 for (
const entry& dEntry : coeffsDict_)
315 if (!dEntry.isDict())
317 const word&
key = dEntry.keyword();
318 const word value(dEntry.get<
word>());
320 Info<< typeName <<
" : setting parameter " <<
key 321 <<
" to " << value <<
endl;
323 Zoltan_Set_Param(zz,
key.c_str(), value.c_str());
348 wantedCells[i] = globalCells.toGlobal(i);
353 int err = Zoltan_Order
362 if (err != ZOLTAN_OK)
369 for (label i = 0; i < argc; i++)
378 order[i] = oldToNew[i];
static int get_mesh_dim(void *data, int *ierr)
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void get_geom_list(void *data, int num_gid_entries, int num_lid_entries, int num_obj, ZOLTAN_ID_PTR global_ids, ZOLTAN_ID_PTR local_ids, int num_dim, double *geom_vec, int *ierr)
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
virtual labelList renumber(const pointField &) const
Return the order in which cells need to be visited (ie. from ordered back to original cell label)...
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
Abstract base class for renumbering.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
static void get_edge_list(void *data, int sizeGID, int sizeLID, int num_obj, ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID, int *num_edges, ZOLTAN_ID_PTR nborGID, int *nborProc, int wgt_dim, float *ewgts, int *ierr)
A class for handling words, derived from Foam::string.
label size() const noexcept
The number of arguments.
const globalMeshData & globalData() const
Return parallel info (demand-driven)
Templated 3D Vector derived from VectorSpace adding construction from 3 components, element access using x(), y() and z() member functions and the inner-product (dot-product) and cross-product operators.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
defineTypeNameAndDebug(combustionModel, 0)
label nTotalCells() const noexcept
Return total number of cells in decomposed mesh.
static int get_number_of_vertices(void *data, int *ierr)
static void get_vertex_list(void *data, int sizeGID, int sizeLID, ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID, int wgt_dim, float *obj_wgts, int *ierr)
label nCells() const noexcept
Number of mesh cells.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
A cell is defined as a list of faces with extra functionality.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Mesh consisting of general polyhedral cells.
Foam::argList args(argc, argv)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
A keyword and a list of tokens is an 'entry'.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static void get_num_edges_list(void *data, int sizeGID, int sizeLID, int num_obj, ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID, int *numEdges, int *ierr)