[MOAB-dev] commit/MOAB: danwu: Merged master into error_handling_enhancement
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Mar 6 09:28:32 CST 2014
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/75c833861b21/
Changeset: 75c833861b21
Branch: error_handling_enhancement
User: danwu
Date: 2014-03-06 16:28:25
Summary: Merged master into error_handling_enhancement
Affected #: 4 files
diff --git a/src/MBTagConventions.hpp b/src/MBTagConventions.hpp
index 61e5732..5cb518f 100644
--- a/src/MBTagConventions.hpp
+++ b/src/MBTagConventions.hpp
@@ -108,6 +108,18 @@
#define NAME_TAG_NAME "NAME"
#define NAME_TAG_SIZE 32
+/* BLOCK_HEADER: tag
+ * A fixex lenght tag containg block header data
+ * BlockColor, MaterialId and BlockDimension
+ */
+#define BLOCK_HEADER "BLOCK_HEADER"
+
+/* BLOCK_ATTRIBUTES: tag
+ * A varible lenght tag of doubles
+ * Tag contains attributes set to BlockSet in cubit file
+ */
+#define BLOCK_ATTRIBUTES "BLOCK_ATTRIBUTES"
+
#ifndef MB_PARALLEL_CONVENTIONS_H
#define MB_PARALLEL_CONVENTIONS_H
diff --git a/src/SpatialLocator.cpp b/src/SpatialLocator.cpp
index 694122c..f976ae7 100644
--- a/src/SpatialLocator.cpp
+++ b/src/SpatialLocator.cpp
@@ -263,7 +263,9 @@ namespace moab
iargs[1] = TLforward_o.vi_rd[3*i+2];
iargs[2] = locTable.get_n();
TLsearch_results_o.push_back(iargs, NULL, NULL, NULL);
- locTable.push_back(const_cast<int*>(&TLforward_o.vi_rd[3*i+1]), NULL, &ents[i], ¶ms[3*i]);
+ ulong ent_ulong=(ulong)ents[i];
+ sint forward= (sint)TLforward_o.vi_rd[3*i+1];
+ locTable.push_back(&forward, NULL, &ent_ulong, ¶ms[3*i]);
}
}
locTable.disableWriteAccess();
diff --git a/src/io/Tqdcfr.cpp b/src/io/Tqdcfr.cpp
index afc0493..701ff15 100644
--- a/src/io/Tqdcfr.cpp
+++ b/src/io/Tqdcfr.cpp
@@ -592,7 +592,6 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
if (MB_SUCCESS != result) return result;
}
// check for more data
- // <- likask
if (num_read < nodeseth->nsLength) {
FREADC(2); num_read += 2;
if (char_buf[0] == 'i' && char_buf[1] == 'd') {
@@ -608,7 +607,7 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
}
}
- if(debug) { // <-likask
+ if(debug) {
nodeseth->print();
if(!bc_data.empty()) {
std::cout << "bc_data = ";
@@ -623,7 +622,7 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
}
std::cout << std::endl;
}
- } // <-likask
+ }
// and put entities into this nodeset's set
ErrorCode result = put_into_set(nodeseth->setHandle, ns_entities, excl_entities);
@@ -632,7 +631,6 @@ ErrorCode Tqdcfr::read_nodeset(const unsigned int nsindex,
result = get_names(model->nodesetMD, nsindex, nodeseth->setHandle);
if (MB_SUCCESS != result) return result;
- // <-likask
const int def_bc_data_len = 0;
std::string tag_name = std::string(DIRICHLET_SET_TAG_NAME)+"__BC_DATA";
Tag nbc_data;
@@ -761,7 +759,7 @@ ErrorCode Tqdcfr::read_sideset(const unsigned int ssindex,
}
}
- if(debug) { // <-likask
+ if(debug) {
sideseth->print();
if(!bc_data.empty()) {
std::cout << "bc_data = ";
@@ -776,12 +774,11 @@ ErrorCode Tqdcfr::read_sideset(const unsigned int ssindex,
}
std::cout << std::endl;
}
- } // <-likask
+ }
result = get_names(model->sidesetMD, ssindex, sideseth->setHandle);
if (MB_SUCCESS != result) return result;
- // <-likask
const int def_bc_data_len = 0;
std::string tag_name = std::string(NEUMANN_SET_TAG_NAME)+"__BC_DATA";
Tag nbc_data;
@@ -920,6 +917,7 @@ ErrorCode Tqdcfr::read_block(const unsigned int blindex,
Tqdcfr::ModelEntry *model,
Tqdcfr::BlockHeader *blockh)
{
+
if (blockh->memCt == 0) return MB_SUCCESS;
// position file
@@ -949,24 +947,20 @@ ErrorCode Tqdcfr::read_block(const unsigned int blindex,
ErrorCode result = put_into_set(blockh->setHandle, block_entities, excl_entities);
if (MB_SUCCESS != result) return result;
- // read attribs if there are any
+ // read attribs if there are any
+ Tag block_attribs;
+ {
+ int def_block_attributes_length = 0;
+ result = mdbImpl->tag_get_handle(BLOCK_ATTRIBUTES,def_block_attributes_length,MB_TYPE_DOUBLE,
+ block_attribs,MB_TAG_CREAT|MB_TAG_SPARSE|MB_TAG_VARLEN,NULL);
+ if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
+ }
if (blockh->attribOrder > 0) {
- Tag block_attribs;
-
+
FREADD(blockh->attribOrder); num_read += sizeof(double);
- // now do something with them...
- // This code seems broken. It is apparently supposed to read
- // blockh->attribOrder values for each block and store them in
- // a tag. However, blockh->attribOrder is not a constant
- // so the same fixed-length tag cannot be used for all blocks.
- // For now, just store one value, as that was what the buggy code
- // previously did.
- result = mdbImpl->tag_get_handle("Block_Attributes", 1/*blockh->attribOrder*/,
- MB_TYPE_DOUBLE, block_attribs,
- MB_TAG_SPARSE|MB_TAG_CREAT);
- if (MB_SUCCESS != result && MB_ALREADY_ALLOCATED != result) return result;
- result = mdbImpl->tag_set_data(block_attribs, &(blockh->setHandle), 1,
- &(dbl_buf[0]));
+ void const* tag_data[] = { &dbl_buf[0] };
+ int tag_sizes[] = { blockh->attribOrder };
+ result = mdbImpl->tag_set_by_ptr(block_attribs,&(blockh->setHandle),1,tag_data,tag_sizes);
if (MB_SUCCESS != result) return result;
}
@@ -1932,6 +1926,19 @@ ErrorCode Tqdcfr::BlockHeader::read_info_header(const double data_version,
block_headers[i].blockLength = instance->uint_buf[10];
block_headers[i].blockDim = instance->uint_buf[11];
+ Tag bhTag_header;
+ {
+ std::vector<int> def_uint_zero(3,0);
+ result = instance->mdbImpl->tag_get_handle(BLOCK_HEADER,3*sizeof(unsigned int),MB_TYPE_INTEGER,
+ bhTag_header,MB_TAG_CREAT|MB_TAG_SPARSE|MB_TAG_BYTES,&def_uint_zero[0]);
+ if (MB_SUCCESS != result) return result;
+ int block_header_data[] = { block_headers[i].blockCol, block_headers[i].blockMat, block_headers[i].blockDim };
+ result = instance->mdbImpl->tag_set_data(bhTag_header,&(block_headers[i].setHandle), 1,
+ block_header_data);
+ }
+
+ if (MB_SUCCESS != result) return result;
+
// adjust element type for data version; older element types didn't include
// 4 new trishell element types
if (data_version <= 1.0 && block_headers[i].blockElemType >= 15)
diff --git a/tools/mbcslam/Makefile.am b/tools/mbcslam/Makefile.am
index 0697a15..f6a0292 100644
--- a/tools/mbcslam/Makefile.am
+++ b/tools/mbcslam/Makefile.am
@@ -18,7 +18,7 @@ AM_CPPFLAGS += -DIS_BUILDING_MB \
lib_LTLIBRARIES = libmbcslam.la
libmbcslam_la_LIBADD = $(top_builddir)/src/libMOAB.la $(top_builddir)/itaps/imesh/libiMesh.la
-LDADD = $(top_builddir)/src/libMOAB.la libmbcslam.la
+LDADD = libmbcslam.la $(top_builddir)/src/libMOAB.la
libmbcslam_la_SOURCES = \
Intx2Mesh.cpp Intx2Mesh.hpp Intx2MeshOnSphere.cpp Intx2MeshOnSphere.hpp \
@@ -50,8 +50,10 @@ intx_mpas_SOURCES = intx_mpas.cpp
cslam_par_test_SOURCES = cslam_par_test.cpp
proj1_SOURCES = proj1.cpp
intx_imesh_SOURCES = intx_imesh.cpp
+intx_imesh_LDADD = $(LDADD) $(top_builddir)/itaps/imesh/libiMesh.la
create_dp_SOURCES = create_dp.cpp
advection_SOURCES = advection.F90
+advection_LDADD = $(LDADD) $(top_builddir)/itaps/imesh/libiMesh.la
EXTRA_DIST = lagrangeHomme.vtk \
eulerHomme.vtk \
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