62#pragma GCC diagnostic ignored "-Wold-style-cast"
90 ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID,
91 int wgt_dim,
float *obj_wgts,
int *ierr)
104 for (Foam::label i=0; i<
mesh.nCells(); i++)
114 ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID,
115 int *numEdges,
int *ierr)
119 if ((sizeGID != 1) || (sizeLID != 1) || (num_obj !=
mesh.nCells()))
121 *ierr = ZOLTAN_FATAL;
125 for (Foam::label i=0; i < num_obj ;i++)
127 Foam::label celli = localID[i];
132 if (
mesh.isInternalFace(cFaces[cFacei]))
144static void get_edge_list(
void *data,
int sizeGID,
int sizeLID,
145 int num_obj, ZOLTAN_ID_PTR globalID, ZOLTAN_ID_PTR localID,
147 ZOLTAN_ID_PTR nborGID,
int *nborProc,
148 int wgt_dim,
float *ewgts,
int *ierr)
156 || (num_obj !=
mesh.nCells())
160 *ierr = ZOLTAN_FATAL;
164 ZOLTAN_ID_TYPE* nextNbor = nborGID;
165 int* nextProc = nborProc;
166 float* nextWgt = ewgts;
168 for (Foam::label i=0; i < num_obj; i++)
170 Foam::label celli = localID[i];
177 Foam::label facei = cFaces[cFacei];
178 if (
mesh.isInternalFace(facei))
180 Foam::label nbr =
mesh.faceOwner()[facei];
183 nbr =
mesh.faceNeighbour()[facei];
193 if (
n != num_edges[i])
195 *ierr = ZOLTAN_FATAL;
208 return mesh.nSolutionD();
218 ZOLTAN_ID_PTR global_ids,
219 ZOLTAN_ID_PTR local_ids,
229 (num_gid_entries != 1)
230 || (num_lid_entries != 1)
231 || (num_obj !=
mesh.nCells())
232 || (num_dim !=
mesh.nSolutionD())
235 *ierr = ZOLTAN_FATAL;
239 double*
p = geom_vec;
246 for (Foam::label celli = 0; celli < num_obj; celli++)
267 coeffsDict_(
dict.optionalSubDict(typeName+
"Coeffs"))
280 args[0] =
"zoltanRenumber";
284 for (label i = 0; i < argc; i++)
286 argv[i] = strdup(
args[i].c_str());
290 int rc = Zoltan_Initialize(argc, argv, &ver);
300 struct Zoltan_Struct *zz = Zoltan_Create(MPI_COMM_WORLD);
305 for (
const entry& dEntry : coeffsDict_)
307 if (!dEntry.isDict())
309 const word& key = dEntry.keyword();
310 const word value(dEntry.get<
word>());
312 Info<< typeName <<
" : setting parameter " << key
313 <<
" to " << value <<
endl;
315 Zoltan_Set_Param(zz, key.c_str(), value.c_str());
340 wantedCells[i] = globalCells.
toGlobal(i);
345 int err = Zoltan_Order
354 if (err != ZOLTAN_OK)
361 for (label i = 0; i < argc; i++)
370 order[i] = oldToNew[i];
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
iterator begin() noexcept
Return an iterator to begin traversing the UList.
void size(const label n)
Older name for setAddressableSize.
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
label size() const noexcept
The number of arguments.
A cell is defined as a list of faces with extra functionality.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A keyword and a list of tokens is an 'entry'.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
label toGlobal(const label i) const
From local to global index.
label nTotalCells() const noexcept
Return total number of cells in decomposed mesh.
static constexpr direction nComponents
Number of components in bool is 1.
Mesh consisting of general polyhedral cells.
const globalMeshData & globalData() const
Return parallel info.
label nCells() const noexcept
Number of mesh cells.
Abstract base class for renumbering.
A class for handling words, derived from Foam::string.
virtual labelList renumber(const pointField &) const
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.
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)
static int get_number_of_vertices(void *data, int *ierr)
static int get_mesh_dim(void *data, int *ierr)
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)
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)
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)