[MOAB-dev] commit/MOAB: danwu: Fixed compilation errors of structuredmesh and StructuredMeshSimple examples.
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Fri Feb 14 10:52:24 CST 2014
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/2dfe9f7c9b5f/
Changeset: 2dfe9f7c9b5f
Branch: master
User: danwu
Date: 2014-02-14 17:51:56
Summary: Fixed compilation errors of structuredmesh and StructuredMeshSimple examples.
Affected #: 3 files
diff --git a/examples/StructuredMeshSimple.cpp b/examples/StructuredMeshSimple.cpp
index 25aa08f..bd21dd1 100644
--- a/examples/StructuredMeshSimple.cpp
+++ b/examples/StructuredMeshSimple.cpp
@@ -25,6 +25,9 @@
#include "moab/ScdInterface.hpp"
#include "moab/ProgOptions.hpp"
#include "moab/CN.hpp"
+#ifdef USE_MPI
+#include "moab_mpi.h"
+#endif
#include <iostream>
#include <vector>
@@ -34,6 +37,10 @@ int main(int argc, char **argv)
{
int N = 10, dim = 3;
+#ifdef USE_MPI
+ MPI_Init(&argc, &argv);
+#endif
+
ProgOptions opts;
opts.addOpt<int>(std::string("dim,d"), std::string("Dimension of mesh (default=3)"),
&dim);
@@ -105,6 +112,10 @@ int main(int argc, char **argv)
// 5. Release the structured mesh interface and destroy the MOAB instance
mb->release_interface(scdiface); // tell MOAB we're done with the ScdInterface
delete mb;
-
+
+#ifdef USE_MPI
+ MPI_Finalize();
+#endif
+
return 0;
}
diff --git a/examples/makefile b/examples/makefile
index 6c1ed9a..5042726 100644
--- a/examples/makefile
+++ b/examples/makefile
@@ -7,7 +7,7 @@ include ${MOAB_DIR}/lib/iMesh-Defs.inc
# MESH_DIR is the directory containing mesh files that come with MOAB source
MESH_DIR="../MeshFiles/unittest"
-EXAMPLES = HelloMOAB GetEntities SetsNTags StructuredMeshSimple DirectAccessWithHoles DirectAccessNoHoles
+EXAMPLES = HelloMOAB GetEntities SetsNTags structuredmesh StructuredMeshSimple DirectAccessWithHoles DirectAccessNoHoles
PAREXAMPLES = HelloParMOAB ReduceExchangeTags LloydRelaxation
F90EXAMPLES = DirectAccessNoHolesF90 PushParMeshIntoMoabF90
EXOIIEXAMPLES = TestExodusII
@@ -26,6 +26,9 @@ SetsNTags: SetsNTags.o ${MOAB_LIBDIR}/libMOAB.la
LloydRelaxation: LloydRelaxation.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
+structuredmesh : structuredmesh.o ${MOAB_LIBDIR}/libMOAB.la
+ ${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
+
StructuredMeshSimple : StructuredMeshSimple.o ${MOAB_LIBDIR}/libMOAB.la
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
@@ -62,6 +65,6 @@ clean:
.cpp.o :
${MOAB_CXX} ${CXXFLAGS} ${MOAB_CXXFLAGS} ${MOAB_CPPFLAGS} ${MOAB_INCLUDES} -DMESH_DIR=\"${MESH_DIR}\" -c $<
- .F90.o :
+.F90.o :
${IMESH_FC} ${FCFLAGS} ${IMESH_FCFLAGS} ${MOAB_CPPFLAGS} ${IMESH_INCLUDES} ${IMESH_FCDEFS} -DMESH_DIR=\"${MESH_DIR}\" -c $<
diff --git a/examples/structuredmesh.cpp b/examples/structuredmesh.cpp
index 017937d..5ad42fb 100644
--- a/examples/structuredmesh.cpp
+++ b/examples/structuredmesh.cpp
@@ -26,9 +26,9 @@
using namespace moab;
-int main(int argv, char **argv)
+int main(int argc, char **argv)
{
- int N;
+ int I, J, K;
// progoptions?
std::cout << "Enter I, J, K... " << std::endl;
std::cin >> I >> J >> K;
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the moab-dev
mailing list