Loading [MathJax]/extensions/tex2jax.js
Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ZoltanPartitioner.hpp File Reference
#include <cstdlib>
#include "moab/PartitionerBase.hpp"
#include "zoltan_cpp.h"
#include <ctime>
#include <vector>
+ Include dependency graph for ZoltanPartitioner.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ZoltanPartitioner
 

Namespaces

 moab
 Class representing axis-aligned bounding box.
 

Functions

int mbGetNumberOfAssignedObjects (void *userDefinedData, int *err)
 
void mbGetObjectList (void *userDefinedData, int numGlobalIds, int numLids, ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR lids, int wgt_dim, float *obj_wgts, int *err)
 
int mbGetObjectSize (void *userDefinedData, int *err)
 
void mbGetObject (void *userDefinedData, int numGlobalIds, int numLids, int numObjs, ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR lids, int numDim, double *pts, int *err)
 
void mbGetNumberOfEdges (void *userDefinedData, int numGlobalIds, int numLids, int numObjs, ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR lids, int *numEdges, int *err)
 
void mbGetEdgeList (void *userDefinedData, int numGlobalIds, int numLids, int numObjs, ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR lids, int *numEdges, ZOLTAN_ID_PTR nborGlobalIds, int *nborProcs, int wgt_dim, float *edge_wgts, int *err)
 
void mbGetPart (void *userDefinedData, int numGlobalIds, int numLids, int numObjs, ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR lids, int *part, int *err)
 
void mbShowError (int val, const char *s, int me)
 
void mbPrintGlobalResult (const char *s, int begin, int import, int exp, int change)
 

Function Documentation

◆ mbGetEdgeList()

void mbGetEdgeList ( void *  userDefinedData,
int  numGlobalIds,
int  numLids,
int  numObjs,
ZOLTAN_ID_PTR  gids,
ZOLTAN_ID_PTR  lids,
int *  numEdges,
ZOLTAN_ID_PTR  nborGlobalIds,
int *  nborProcs,
int  wgt_dim,
float *  edge_wgts,
int *  err 
)

Definition at line 1476 of file ZoltanPartitioner.cpp.

1488 { 1489  int i, id, idSum, j; 1490  int next = 0; 1491  1492  for( i = 0; i < numObjs; i++ ) 1493  { 1494  id = lids[i]; 1495  1496  if( ( id < 0 ) || ( id >= NumPoints ) ) 1497  { 1498  *err = 1; 1499  return; 1500  } 1501  1502  idSum = 0; 1503  1504  for( j = 0; j < id; j++ ) 1505  idSum += NumEdges[j]; 1506  1507  for( j = 0; j < NumEdges[id]; j++ ) 1508  { 1509  nborGlobalIds[next] = NborGlobalId[idSum]; 1510  nborProcs[next] = NborProcs[idSum]; 1511  if( wgt_dim > 0 ) edge_wgts[next] = EdgeWeights[idSum]; 1512  next++; 1513  idSum++; 1514  } 1515  } 1516 }

References EdgeWeights, NborGlobalId, NborProcs, NumEdges, and NumPoints.

Referenced by ZoltanPartitioner::balance_mesh(), ZoltanPartitioner::partition_mesh_and_geometry(), ZoltanPartitioner::partition_owned_cells(), ZoltanPartitioner::repartition(), and ZoltanPartitioner::repartition_to_procs().

◆ mbGetNumberOfAssignedObjects()

int mbGetNumberOfAssignedObjects ( void *  userDefinedData,
int *  err 
)

MOAB, a Mesh-Oriented datABase, is a software component for creating, storing and accessing finite element mesh data.

Copyright 2004 Sandia Corporation. Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain rights in this software.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. Zoltan: class to get a mesh from MOAB and write a Zoltan partition set for that mesh back into MOAB and to a file

Definition at line 1382 of file ZoltanPartitioner.cpp.

1383 { 1384  *err = 0; 1385  return NumPoints; 1386 }

References NumPoints.

Referenced by ZoltanPartitioner::balance_mesh(), ZoltanPartitioner::partition_mesh_and_geometry(), ZoltanPartitioner::partition_owned_cells(), ZoltanPartitioner::repartition(), and ZoltanPartitioner::repartition_to_procs().

◆ mbGetNumberOfEdges()

void mbGetNumberOfEdges ( void *  userDefinedData,
int  numGlobalIds,
int  numLids,
int  numObjs,
ZOLTAN_ID_PTR  gids,
ZOLTAN_ID_PTR  lids,
int *  numEdges,
int *  err 
)

Definition at line 1450 of file ZoltanPartitioner.cpp.

1458 { 1459  int i, id; 1460  int next = 0; 1461  1462  for( i = 0; i < numObjs; i++ ) 1463  { 1464  id = lids[i]; 1465  1466  if( ( id < 0 ) || ( id >= NumPoints ) ) 1467  { 1468  *err = 1; 1469  return; 1470  } 1471  1472  numEdges[next++] = NumEdges[id]; 1473  } 1474 }

References NumEdges, and NumPoints.

Referenced by ZoltanPartitioner::balance_mesh(), ZoltanPartitioner::partition_mesh_and_geometry(), ZoltanPartitioner::partition_owned_cells(), ZoltanPartitioner::repartition(), and ZoltanPartitioner::repartition_to_procs().

◆ mbGetObject()

void mbGetObject ( void *  userDefinedData,
int  numGlobalIds,
int  numLids,
int  numObjs,
ZOLTAN_ID_PTR  gids,
ZOLTAN_ID_PTR  lids,
int  numDim,
double *  pts,
int *  err 
)

Definition at line 1413 of file ZoltanPartitioner.cpp.

1422 { 1423  int i, id, id3; 1424  int next = 0; 1425  1426  if( numDim != 3 ) 1427  { 1428  *err = 1; 1429  return; 1430  } 1431  1432  for( i = 0; i < numObjs; i++ ) 1433  { 1434  id = lids[i]; 1435  1436  if( ( id < 0 ) || ( id >= NumPoints ) ) 1437  { 1438  *err = 1; 1439  return; 1440  } 1441  1442  id3 = lids[i] * 3; 1443  1444  pts[next++] = Points[id3]; 1445  pts[next++] = Points[id3 + 1]; 1446  pts[next++] = Points[id3 + 2]; 1447  } 1448 }

References NumPoints, and Points.

Referenced by ZoltanPartitioner::balance_mesh(), ZoltanPartitioner::partition_mesh_and_geometry(), ZoltanPartitioner::partition_owned_cells(), ZoltanPartitioner::repartition(), and ZoltanPartitioner::repartition_to_procs().

◆ mbGetObjectList()

void mbGetObjectList ( void *  userDefinedData,
int  numGlobalIds,
int  numLids,
ZOLTAN_ID_PTR  gids,
ZOLTAN_ID_PTR  lids,
int  wgt_dim,
float *  obj_wgts,
int *  err 
)

Definition at line 1388 of file ZoltanPartitioner.cpp.

1396 { 1397  for( int i = 0; i < NumPoints; i++ ) 1398  { 1399  gids[i] = GlobalIds[i]; 1400  lids[i] = i; 1401  if( wgt_dim > 0 ) obj_wgts[i] = ObjWeights[i]; 1402  } 1403  1404  *err = 0; 1405 }

References GlobalIds, NumPoints, and ObjWeights.

Referenced by ZoltanPartitioner::balance_mesh(), ZoltanPartitioner::partition_mesh_and_geometry(), ZoltanPartitioner::partition_owned_cells(), ZoltanPartitioner::repartition(), and ZoltanPartitioner::repartition_to_procs().

◆ mbGetObjectSize()

int mbGetObjectSize ( void *  userDefinedData,
int *  err 
)

◆ mbGetPart()

void mbGetPart ( void *  userDefinedData,
int  numGlobalIds,
int  numLids,
int  numObjs,
ZOLTAN_ID_PTR  gids,
ZOLTAN_ID_PTR  lids,
int *  part,
int *  err 
)

Definition at line 1518 of file ZoltanPartitioner.cpp.

1526 { 1527  int i, id; 1528  int next = 0; 1529  1530  for( i = 0; i < numObjs; i++ ) 1531  { 1532  id = lids[i]; 1533  1534  if( ( id < 0 ) || ( id >= NumPoints ) ) 1535  { 1536  *err = 1; 1537  return; 1538  } 1539  1540  part[next++] = Parts[id]; 1541  } 1542 }

References NumPoints, and Parts.

Referenced by ZoltanPartitioner::partition_mesh_and_geometry().

◆ mbPrintGlobalResult()

void mbPrintGlobalResult ( const char *  s,
int  begin,
int  import,
int  exp,
int  change 
)

◆ mbShowError()

void mbShowError ( int  val,
const char *  s,
int  me 
)