moab
MBZoltan.cpp File Reference
#include <iostream>
#include <assert.h>
#include <sstream>
#include <algorithm>
#include "MBZoltan.hpp"
#include "moab/Interface.hpp"
#include "Internals.hpp"
#include "moab/ParallelComm.hpp"
#include "moab/Range.hpp"
#include "moab/WriteUtilIface.hpp"
#include "moab/MeshTopoUtil.hpp"
#include "MBTagConventions.hpp"
#include "moab/CN.hpp"

Go to the source code of this file.

Defines

#define RR   if (MB_SUCCESS != result) return result

Functions

int mbGetNumberOfAssignedObjects (void *, int *err)
void mbGetObjectList (void *, int, int, ZOLTAN_ID_PTR gids, ZOLTAN_ID_PTR lids, int wgt_dim, float *obj_wgts, int *err)
int mbGetObjectSize (void *, int *err)
void mbGetObject (void *, int, int, int numObjs, ZOLTAN_ID_PTR, ZOLTAN_ID_PTR lids, int numDim, double *pts, int *err)
void mbGetNumberOfEdges (void *, int, int, int numObjs, ZOLTAN_ID_PTR, ZOLTAN_ID_PTR lids, int *numEdges, int *err)
void mbGetEdgeList (void *, int, int, int numObjs, ZOLTAN_ID_PTR, ZOLTAN_ID_PTR lids, int *, ZOLTAN_ID_PTR nborGlobalIds, int *nborProcs, int wgt_dim, float *edge_wgts, int *err)
void mbGetPart (void *, int, int, int numObjs, ZOLTAN_ID_PTR, ZOLTAN_ID_PTR lids, int *part, int *err)

Variables

static double * Points = NULL
static int * GlobalIds = NULL
static int NumPoints = 0
static int * NumEdges = NULL
static int * NborGlobalId = NULL
static int * NborProcs = NULL
static double * ObjWeights = NULL
static double * EdgeWeights = NULL
static int * Parts = NULL
const bool debug = false

Define Documentation

#define RR   if (MB_SUCCESS != result) return result

Definition at line 55 of file MBZoltan.cpp.


Function Documentation

void mbGetEdgeList ( void *  ,
int  ,
int  ,
int  numObjs,
ZOLTAN_ID_PTR  ,
ZOLTAN_ID_PTR  lids,
int *  ,
ZOLTAN_ID_PTR  nborGlobalIds,
int *  nborProcs,
int  wgt_dim,
float *  edge_wgts,
int *  err 
)

Definition at line 1951 of file MBZoltan.cpp.

{
  int i, id, idSum, j;
  int next = 0;

  for (i = 0; i < numObjs; i++) {
    id = lids[i];

    if ((id < 0) || (id >= NumPoints)) {
        *err = 1;
      return;
      }

    idSum = 0;

    for (j = 0; j < id; j++)
      idSum += NumEdges[j];

    for (j = 0; j < NumEdges[id]; j++) {
      nborGlobalIds[next] = NborGlobalId[idSum];
      nborProcs[next] = NborProcs[idSum];
      if (wgt_dim > 0) edge_wgts[next] = EdgeWeights[idSum];
        next++;
        idSum++;
    }
  }
}
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 Coroporation, 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 1878 of file MBZoltan.cpp.

{
  *err = 0;
  return NumPoints;
}
void mbGetNumberOfEdges ( void *  ,
int  ,
int  ,
int  numObjs,
ZOLTAN_ID_PTR  ,
ZOLTAN_ID_PTR  lids,
int *  numEdges,
int *  err 
)

Definition at line 1931 of file MBZoltan.cpp.

{
  int i, id;
  int next = 0;

  for (i = 0; i < numObjs; i++) {
    id = lids[i];

    if ((id < 0) || (id >= NumPoints)) {
      *err = 1;
      return;
    }

    numEdges[next++] = NumEdges[id];
  }
}
void mbGetObject ( void *  ,
int  ,
int  ,
int  numObjs,
ZOLTAN_ID_PTR  ,
ZOLTAN_ID_PTR  lids,
int  numDim,
double *  pts,
int *  err 
)

Definition at line 1904 of file MBZoltan.cpp.

{ 
  int i, id, id3;
  int next = 0;

  if (numDim != 3) {
    *err = 1;         
    return;
  }

  for (i = 0; i < numObjs; i++) {
    id = lids[i];

    if ((id < 0) || (id >= NumPoints)) {
      *err = 1;
      return;
    }

    id3 = lids[i] * 3;

    pts[next++] = Points[id3];
    pts[next++] = Points[id3 + 1];
    pts[next++] = Points[id3 + 2];
  }
} 
void mbGetObjectList ( void *  ,
int  ,
int  ,
ZOLTAN_ID_PTR  gids,
ZOLTAN_ID_PTR  lids,
int  wgt_dim,
float *  obj_wgts,
int *  err 
)

Definition at line 1884 of file MBZoltan.cpp.

{
  for (int i = 0; i < NumPoints; i++) {
    gids[i] = GlobalIds[i];
    lids[i] = i;
    if (wgt_dim > 0)
      obj_wgts[i] = ObjWeights[i];
  }

  *err = 0;
}
int mbGetObjectSize ( void *  ,
int *  err 
)

Definition at line 1898 of file MBZoltan.cpp.

{
  *err = 0; 
  return 3;
}
void mbGetPart ( void *  ,
int  ,
int  ,
int  numObjs,
ZOLTAN_ID_PTR  ,
ZOLTAN_ID_PTR  lids,
int *  part,
int *  err 
)

Definition at line 1983 of file MBZoltan.cpp.

{
  int i, id;
  int next = 0;

  for (i = 0; i < numObjs; i++) {
    id = lids[i];

    if ((id < 0) || (id >= NumPoints)) {
      *err = 1;
      return;
    }

    part[next++] = Parts[id];
  }
}

Variable Documentation

const bool debug = false

Definition at line 67 of file MBZoltan.cpp.

double* EdgeWeights = NULL [static]

Definition at line 64 of file MBZoltan.cpp.

int* GlobalIds = NULL [static]

Definition at line 58 of file MBZoltan.cpp.

int* NborGlobalId = NULL [static]

Definition at line 61 of file MBZoltan.cpp.

int* NborProcs = NULL [static]

Definition at line 62 of file MBZoltan.cpp.

int* NumEdges = NULL [static]

Definition at line 60 of file MBZoltan.cpp.

int NumPoints = 0 [static]

Definition at line 59 of file MBZoltan.cpp.

double* ObjWeights = NULL [static]

Definition at line 63 of file MBZoltan.cpp.

int* Parts = NULL [static]

Definition at line 65 of file MBZoltan.cpp.

double* Points = NULL [static]

Definition at line 57 of file MBZoltan.cpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines