Commit dbce44c5 authored by Iulian Grindeanu's avatar Iulian Grindeanu Committed by vijaysm
Browse files

include a c driver

also, include a h5m test file, partitioned, and with some material
and neumann sets
it will be the guinea pig file for testing
parent f8fe4ab6
Steps to test driver.c interface:
1) compile imoab.o
cd ../src
make imoab.o
2) compile driver.o
cd ../test
make driver.o
make driver
// test driver with ./driver p8ex1.h5m
#include "mpi.h"
#include "../src/moab/imoab.h"
#include <string.h>
#define CHECKRC(rc, message) if (0!=rc) { printf ("%s", message); return 1;}
int main(int argc, char * argv[])
{
char * filen = "p8ex1.h5m";
if (argc>1)
filen = argv[1];
ErrCode rc = iMOABInitialize(argc, argv);
CHECKRC(rc, "failed to initialize MOAB");
int num_global_vertices=0, num_global_elements=0, num_dimension=0, num_parts=0;
rc = ReadHeaderInfo ( filen, &num_global_vertices, &num_global_elements, &num_dimension,
&num_parts, (int)strlen(filen) );
CHECKRC(rc, "failed to read header info");
printf("file %s has %d vertices, %d elements, %d parts in partition\n", filen,
num_global_vertices, num_global_elements, num_parts);
rc = iMOABFinalize();
CHECKRC(rc, "failed to finalize MOAB");
return 0;
}
# MOAB_DIR points to top-level install dir, below which MOAB's lib/ and include/ are located
MOAB_BUILD_DIR := /homes/iulian/source/MOAB14
MOAB_DIR := /homes/iulian/lib/moab14
ifneq ($(wildcard ${MOAB_DIR}/lib/moab.make),)
include ${MOAB_DIR}/lib/moab.make
include ${MOAB_DIR}/lib/iMesh-Defs.inc
else
include ${MOAB_BUILD_DIR}/moab.make
include ${MOAB_BUILD_DIR}/itaps/imesh/iMesh-Defs.inc
endif
.SUFFIXES: .o .cpp .F90
driver: driver.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ../src/imoab.o ${MOAB_LIBS_LINK}
clean:
rm -rf *.o *.mod *.h5m ${ALLEXAMPLES}
.cpp.o:
${MOAB_CXX} ${CXXFLAGS} ${MOAB_CXXFLAGS} ${MOAB_CPPFLAGS} ${MOAB_INCLUDES} -DMESH_DIR=\"${MESH_DIR}\" -c $<
.c.o:
${MOAB_CXX} ${CXXFLAGS} ${MOAB_CXXFLAGS} ${MOAB_CPPFLAGS} ${MOAB_INCLUDES} -DMESH_DIR=\"${MESH_DIR}\" -c $<
.F90.o:
${IMESH_FC} ${FCFLAGS} ${IMESH_FCFLAGS} ${MOAB_CPPFLAGS} ${IMESH_INCLUDES} ${IMESH_FCDEFS} -DMESH_DIR=\"${MESH_DIR}\" -c $<
File added
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment