[MOAB-dev] r5025 - in MOAB/trunk/src: . moab
iulian at mcs.anl.gov
iulian at mcs.anl.gov
Tue Jun 21 00:18:46 CDT 2011
Author: iulian
Date: 2011-06-21 00:18:44 -0500 (Tue, 21 Jun 2011)
New Revision: 5025
Modified:
MOAB/trunk/src/FBEngine.cpp
MOAB/trunk/src/moab/FBEngine.hpp
Log:
set unique neumann tags for all faces, after volume creation
used mostly to extract faces with mbconvert later
Modified: MOAB/trunk/src/FBEngine.cpp
===================================================================
--- MOAB/trunk/src/FBEngine.cpp 2011-06-20 17:22:00 UTC (rev 5024)
+++ MOAB/trunk/src/FBEngine.cpp 2011-06-21 05:18:44 UTC (rev 5025)
@@ -2847,6 +2847,9 @@
MBERRORR(rval, "can't set lateral face sense to the volume");
}
+ rval = set_default_neumann_tags();
+ MBERRORR(rval, "can't set new neumann tags");
+
return MB_SUCCESS;
}
@@ -3133,6 +3136,34 @@
//
return MB_SUCCESS;
}
+// this will be used during creation of the volume, to set unique
+// tags on all surfaces
+// it is changing original tags, so do not use it if you want to preserve
+// initial neumann tags
+ErrorCode FBEngine::set_default_neumann_tags()
+{
+ // these are for debugging purposes only
+ // check the initial tag, then
+ Tag ntag;
+ ErrorCode rval = _mbImpl->tag_get_handle(NEUMANN_SET_TAG_NAME, 1, MB_TYPE_INTEGER, ntag);
+ MBERRORR(rval, "can't get tag handle");
+ // get all surfaces in the model now
+ Range sets[4];
+ rval = _my_geomTopoTool->find_geomsets(sets);
+ MBERRORR(rval, "can't get geo sets");
+ int nfaces = (int)sets[2].size();
+ int * vals = new int [nfaces];
+ for (int i=0; i<nfaces; i++)
+ {
+ vals[i] = i+1;
+ }
+ rval = _mbImpl->tag_set_data(ntag, sets[2], (void*)vals);
+ MBERRORR(rval, "can't set tag values for neumann sets");
+
+ delete [] vals;
+
+ return MB_SUCCESS;
+}
} // namespace moab
Modified: MOAB/trunk/src/moab/FBEngine.hpp
More information about the moab-dev
mailing list