[MOAB-dev] commit/MOAB: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Apr 18 16:25:25 CDT 2013
2 new commits in MOAB:
https://bitbucket.org/fathomteam/moab/commits/143d15e50b79/
Changeset: 143d15e50b79
Branch: None
User: iulian07
Date: 2013-04-18 23:09:43
Summary: typo in get adjacency for polygons
pointed out by Andrew Cunningham
it was not caught by any test;
method needs work anyway for the case "create_if_missing=true"
Affected #: 1 file
diff --git a/src/AEntityFactory.cpp b/src/AEntityFactory.cpp
index cbc56dd..3d04244 100644
--- a/src/AEntityFactory.cpp
+++ b/src/AEntityFactory.cpp
@@ -795,7 +795,7 @@ ErrorCode AEntityFactory::get_down_adjacency_elements_poly(EntityHandle source_e
EntityType source_type = TYPE_FROM_HANDLE(source_entity);
if (!(source_type == MBPOLYHEDRON && target_dimension > 0 && target_dimension < 3) &&
- (!source_type == MBPOLYGON && target_dimension == 1))
+ !(source_type == MBPOLYGON && target_dimension == 1))
return MB_TYPE_OUT_OF_RANGE;
// make this a fixed size to avoid cost of working with STL vectors
https://bitbucket.org/fathomteam/moab/commits/fd126f07f119/
Changeset: fd126f07f119
Branch: master
User: iulian07
Date: 2013-04-18 23:20:42
Summary: Merge branch 'master' of bitbucket.org:iulian07/moab
Affected #: 5 files
diff --git a/examples/StructuredMeshSimple.cpp b/examples/StructuredMeshSimple.cpp
new file mode 100644
index 0000000..25aa08f
--- /dev/null
+++ b/examples/StructuredMeshSimple.cpp
@@ -0,0 +1,110 @@
+/** @example StructuredMeshSimple.cpp
+ * \brief Show creation and query of structured mesh, serial or parallel, through MOAB's structured mesh interface.
+ * This is an example showing creation and query of a 3D structured mesh. In serial, a single N*N*N block of elements
+ * is created; in parallel, each proc gets an N*N*N block, with blocks arranged in a 1d column, sharing vertices
+ * and faces at their interfaces (proc 0 has no left neighbor and proc P-1 no right neighbor).
+ * Each square block of hex elements is then referenced by its ijk parameterization.
+ * 1D and 2D examples could be made simply by changing the dimension parameter passed into the MOAB functions. \n
+ *
+ * <b>This example </b>:
+ * -# Instantiate MOAB and get the structured mesh interface
+ * -# Decide what the local parameters of the mesh will be, based on parallel/serial and rank.
+ * -# Create a N^d structured mesh, which includes (N+1)^d vertices and N^d elements.
+ * -# Get the vertices and elements from moab and check their numbers against (N+1)^d and N^d, resp.
+ * -# Loop over elements in d nested loops over i, j, k; for each (i,j,k):
+ * -# Get the element corresponding to (i,j,k)
+ * -# Get the connectivity of the element
+ * -# Get the coordinates of the vertices comprising that element
+ * -# Release the structured mesh interface and destroy the MOAB instance
+ *
+ * <b> To run: </b> ./structuredmesh [d [N] ] \n
+ * (default values so can run w/ no user interaction)
+ */
+
+#include "moab/Core.hpp"
+#include "moab/ScdInterface.hpp"
+#include "moab/ProgOptions.hpp"
+#include "moab/CN.hpp"
+#include <iostream>
+#include <vector>
+
+using namespace moab;
+
+int main(int argc, char **argv)
+{
+ int N = 10, dim = 3;
+
+ ProgOptions opts;
+ opts.addOpt<int>(std::string("dim,d"), std::string("Dimension of mesh (default=3)"),
+ &dim);
+ opts.addOpt<int>(std::string(",n"), std::string("Number of elements on a side (default=10)"),
+ &N);
+ opts.parseCommandLine(argc, argv);
+
+ // 0. Instantiate MOAB and get the structured mesh interface
+ Interface *mb = new Core();
+ ScdInterface *scdiface;
+ ErrorCode rval = mb->query_interface(scdiface); // get a ScdInterface object through moab instance
+ if (MB_SUCCESS != rval) return rval;
+
+ // 1. Decide what the local parameters of the mesh will be, based on parallel/serial and rank.
+ int ilow = 0, ihigh = N;
+ int rank = 0, nprocs = 1;
+#ifdef USE_MPI
+ MPI_Comm_size(MPI_COMM_WORLD, &nprocs); MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+ ilow = rank*N; ihigh = ilow + N;
+#endif
+
+ // 2. Create a N^d structured mesh, which includes (N+1)^d vertices and N^d elements.
+ ScdBox *box;
+ rval = scdiface->construct_box(HomCoord(ilow, (dim>1?0:-1), (dim>2?0:-1)), // use in-line logical tests to handle dimensionality
+ HomCoord(ihigh, (dim>1?N:-1), (dim>2?N:-1)),
+ NULL, 0, // NULL coords vector and 0 coords (don't specify coords for now)
+ box); // box is the structured box object providing the parametric
+ // structured mesh interface for this rectangle of elements
+ if (MB_SUCCESS != rval) return rval;
+
+ // 3. Get the vertices and elements from moab and check their numbers against (N+1)^d and N^d, resp.
+ Range verts, elems;
+ rval = mb->get_entities_by_dimension(0, 0, verts); // first '0' specifies "root set", or entire MOAB instance, second the entity dimension being requested
+ if (MB_SUCCESS != rval) return rval;
+ rval = mb->get_entities_by_dimension(0, dim, elems);
+ if (MB_SUCCESS != rval) return rval;
+
+#define MYSTREAM(a) if (!rank) std::cout << a << std::endl
+
+ if (pow(N,dim) == (int) elems.size() && pow(N+1,dim) == (int) verts.size()) { // expected #e and #v are N^d and (N+1)^d, resp.
+#ifdef USE_MPI
+ MYSTREAM("Proc 0: ");
+#endif
+ MYSTREAM("Created " << elems.size() << " " << CN::EntityTypeName(mb->type_from_handle(*elems.begin()))
+ << " elements and " << verts.size() << " vertices." << std::endl);
+ }
+ else
+ std::cout << "Created the wrong number of vertices or hexes!" << std::endl;
+
+ // 4. Loop over elements in 3 nested loops over i, j, k; for each (i,j,k):
+ std::vector<double> coords(3*pow(N+1,dim));
+ std::vector<EntityHandle> connect;
+ for (int k = 0; k < (dim>2?N:1); k++) {
+ for (int j = 0; j < (dim>1?N:1); j++) {
+ for (int i = 0; i < N-1; i++) {
+ // 4a. Get the element corresponding to (i,j,k)
+ EntityHandle ehandle = box->get_element(i, j, k);
+ if (0 == ehandle) return MB_FAILURE;
+ // 4b. Get the connectivity of the element
+ rval = mb->get_connectivity(&ehandle, 1, connect); // get the connectivity, in canonical order
+ if (MB_SUCCESS != rval) return rval;
+ // 4c. Get the coordinates of the vertices comprising that element
+ rval = mb->get_coords(connect.data(), connect.size(), coords.data()); // get the coordinates of those vertices
+ if (MB_SUCCESS != rval) return rval;
+ }
+ }
+ }
+
+ // 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;
+
+ return 0;
+}
diff --git a/examples/makefile b/examples/makefile
index dcf7029..4ec6154 100644
--- a/examples/makefile
+++ b/examples/makefile
@@ -20,7 +20,7 @@ HelloMoabPar: HelloMoabPar.o
TestExodusII: TestExodusII.o
${MOAB_CXX} -o $@ $< ${MOAB_LIBS_LINK}
-
+
.cpp.o :
${MOAB_CXX} ${MOAB_CXXFLAGS} ${MOAB_INCLUDES} -DMESH_DIR=\"${MESH_DIR}\" -c $<
diff --git a/itaps/iBase.h b/itaps/iBase.h
index 5172bb8..933b9d6 100644
--- a/itaps/iBase.h
+++ b/itaps/iBase.h
@@ -261,7 +261,7 @@ enum iBase_TagValueType {
******************************************************************************/
/***************************************************************************//**
- * \mainpage The ITAPS Interfaces
+ * \page The ITAPS Interfaces
*
* \subpage ibase
*
@@ -281,6 +281,8 @@ enum iBase_TagValueType {
*
* \subpage numhops
*
+ * \subpage resilient
+ *
* \page error Error Handling
*
* With few exceptions, every iMesh function includes an output argument,
diff --git a/itaps/imesh/iMeshP.h b/itaps/imesh/iMeshP.h
index 958c827..28da490 100644
--- a/itaps/imesh/iMeshP.h
+++ b/itaps/imesh/iMeshP.h
@@ -33,7 +33,7 @@ enum iMeshP_EntStatus
#define iMeshP_ALL_PARTS -1
-/** \mainpage
+/** \page imeshp iMeshP: ITAPS Parallel Mesh Interface
iMeshP.h -- ITAPS Parallel Mesh Interface
Release 0.1; October 2008
@@ -45,7 +45,7 @@ Release 0.1; October 2008
subsets; like a "mesh," it does not imply a serial or parallel
implementation.
- An application may use one or more meshes.
-- Parititions can create subsets of entities from one or more meshes.
+- Partitions can create subsets of entities from one or more meshes.
- Meshes can be subdivided by one or more partitions.
- Partitions contain parts. Parts contain the subsets of entities in the
partition.
diff --git a/src/io/mhdf/include/mhdf.h b/src/io/mhdf/include/mhdf.h
index e8aaa90..9a7a478 100644
--- a/src/io/mhdf/include/mhdf.h
+++ b/src/io/mhdf/include/mhdf.h
@@ -22,7 +22,7 @@
extern "C" {
#endif
-/** \mainpage H5M File Format API
+/** \page h5mmain H5M File Format API
*
*\section Intro Introduction
*
@@ -60,7 +60,7 @@ extern "C" {
* hexahedral topology) and the number of nodes in the element.
*
*
- *\section Root The \c tstt Group
+ *\section Root The tstt Group
*
* All file data is stored in the \c tstt group in the HDF5 root group.
* The \c tstt group may have an optional scalar integer attribute
@@ -87,12 +87,12 @@ extern "C" {
* - \c Polyhedron
*
*
- *\section History The \c history DataSet
+ *\section History The history DataSet
*
* The \c history DataSet is a list of variable-length strings with
- * appliation-defined meaning.
+ * application-defined meaning.
*
- *\section Nodes The \c nodes Group
+ *\section Nodes The nodes Group
*
*
* The \c nodes group contains a single DataSet and an optional
@@ -111,7 +111,7 @@ extern "C" {
* \c coordinates table.
*
*
- *\section Elements The \c elements Group
+ *\section Elements The elements Group
*
* The \c elements group contains an application-defined number of
* subgroups. Each subgroup defines one or more mesh elements that
@@ -141,7 +141,7 @@ extern "C" {
* sequentially in the order that they are defined in the table.
*
*
- *\section Sets The \c sets Group
+ *\section Sets The sets Group
*
* The \c sets group contains the definitions of any entity sets stored
* in the file. It contains 1 to 4 DataSets and the optional \c tags
@@ -199,7 +199,7 @@ extern "C" {
* subgroup is described in the \ref Dense "section on dense tag storage".
*
*
- * \section Tags The \c tags Group
+ * \section Tags The tags Group
*
* The \c tags group contains a sub-group for each tag defined
* in the file. These sub-groups contain the definition of the
@@ -283,7 +283,7 @@ extern "C" {
* dataset.
*
*
- * \section Dense The \c tags Sub-Groups
+ * \section Dense The tags Sub-Groups
*
* Data for fixed-length tags may also be stored in the \c tags sub-group
* of the \c nodes, \c sets, and subgroups of the \c elements group.
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