Mesh Oriented datABase  (version 5.5.0)
An array-based unstructured mesh library
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 2206 of file ZoltanPartitioner.cpp.

2218 {
2219  int i, id, idSum, j;
2220  int next = 0;
2221 
2222  for( i = 0; i < numObjs; i++ )
2223  {
2224  id = lids[i];
2225 
2226  if( ( id < 0 ) || ( id >= NumPoints ) )
2227  {
2228  *err = 1;
2229  return;
2230  }
2231 
2232  idSum = 0;
2233 
2234  for( j = 0; j < id; j++ )
2235  idSum += NumEdges[j];
2236 
2237  for( j = 0; j < NumEdges[id]; j++ )
2238  {
2239  nborGlobalIds[next] = NborGlobalId[idSum];
2240  nborProcs[next] = NborProcs[idSum];
2241  if( wgt_dim > 0 ) edge_wgts[next] = EdgeWeights[idSum];
2242  next++;
2243  idSum++;
2244  }
2245  }
2246 }

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

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

◆ 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 2112 of file ZoltanPartitioner.cpp.

2113 {
2114  *err = 0;
2115  return NumPoints;
2116 }

References NumPoints.

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

◆ 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 2180 of file ZoltanPartitioner.cpp.

2188 {
2189  int i, id;
2190  int next = 0;
2191 
2192  for( i = 0; i < numObjs; i++ )
2193  {
2194  id = lids[i];
2195 
2196  if( ( id < 0 ) || ( id >= NumPoints ) )
2197  {
2198  *err = 1;
2199  return;
2200  }
2201 
2202  numEdges[next++] = NumEdges[id];
2203  }
2204 }

References NumEdges, and NumPoints.

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

◆ 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 2143 of file ZoltanPartitioner.cpp.

2152 {
2153  int i, id, id3;
2154  int next = 0;
2155 
2156  if( numDim != 3 )
2157  {
2158  *err = 1;
2159  return;
2160  }
2161 
2162  for( i = 0; i < numObjs; i++ )
2163  {
2164  id = lids[i];
2165 
2166  if( ( id < 0 ) || ( id >= NumPoints ) )
2167  {
2168  *err = 1;
2169  return;
2170  }
2171 
2172  id3 = lids[i] * 3;
2173 
2174  pts[next++] = Points[id3];
2175  pts[next++] = Points[id3 + 1];
2176  pts[next++] = Points[id3 + 2];
2177  }
2178 }

References NumPoints, and Points.

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

◆ 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 2118 of file ZoltanPartitioner.cpp.

2126 {
2127  for( int i = 0; i < NumPoints; i++ )
2128  {
2129  gids[i] = GlobalIds[i];
2130  lids[i] = i;
2131  if( wgt_dim > 0 ) obj_wgts[i] = ObjWeights[i];
2132  }
2133 
2134  *err = 0;
2135 }

References GlobalIds, NumPoints, and ObjWeights.

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

◆ 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 2248 of file ZoltanPartitioner.cpp.

2256 {
2257  int i, id;
2258  int next = 0;
2259 
2260  for( i = 0; i < numObjs; i++ )
2261  {
2262  id = lids[i];
2263 
2264  if( ( id < 0 ) || ( id >= NumPoints ) )
2265  {
2266  *err = 1;
2267  return;
2268  }
2269 
2270  part[next++] = Parts[id];
2271  }
2272 }

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 
)