[MOAB-dev] r4307 - in MOAB/trunk/tools: . dagmc

sjackson at cae.wisc.edu sjackson at cae.wisc.edu
Tue Nov 30 18:04:52 CST 2010


Author: sjackson
Date: 2010-11-30 18:04:52 -0600 (Tue, 30 Nov 2010)
New Revision: 4307

Added:
   MOAB/trunk/tools/dagmc/dagmc_preproc.cpp
   MOAB/trunk/tools/program_opt.cpp
   MOAB/trunk/tools/program_opt.hpp
Modified:
   MOAB/trunk/tools/dagmc/Makefile.am
Log:
Add dagmc_preproc tool within dagmc dir; add command line option parser util

* dagmc_preproc will replace cgm2moab.  All features have been ported.
* dagmc_preproc can also load "alternate" mesh files, swapping the surfaces of
  its primary input file for the facetings specified in alternate files.  This
  allows a user to, e.g., surface mesh one volume in Cubit, and swap in that mesh
  in place of the faceted mesh produced by loading the CAD file directly into
  MOAB.  This is a partial port of the features of the dagmc tool update_coords.
  More details and documentation on this feature will be forthcoming.
* In the tools/ directory, a new command line parser has been added:
  program_opts.[hc]pp.  I have tried to document this parser's interface to a point
  where others could use it.  The main() of dagmc_preproc is a useful real-world
  example of using this parser.  Other tool writers should feel free to make use
  of this parser / improve upon it.

Modified: MOAB/trunk/tools/dagmc/Makefile.am
===================================================================
--- MOAB/trunk/tools/dagmc/Makefile.am	2010-11-30 23:50:20 UTC (rev 4306)
+++ MOAB/trunk/tools/dagmc/Makefile.am	2010-12-01 00:04:52 UTC (rev 4307)
@@ -28,10 +28,10 @@
 cgm2moab_DEPENDENCIES = libdagmc.la $(top_builddir)/src/libMOAB.la
 
 bin_PROGRAMS = $(cgm2moabbin)
-noinst_PROGRAMS = quads_to_tris $(netcdf_progs)
+noinst_PROGRAMS = quads_to_tris $(netcdf_progs) dagmc_preproc 
 man1_MANS = $(cgm2moabman)
 EXTRA_DIST = cgm2moab.man
-                   
+
 CGM_CPPFLAGS = @CGM_CPPFLAGS@
 CGM_LDFLAGS = @CGM_LDFLAGS@
 CGM_LTFLAGS = @CGM_LTFLAGS@
@@ -52,3 +52,5 @@
 pt_vol_test_SOURCES = pt_vol_test.cc
 
 ray_fire_test_SOURCES = ray_fire_test.cc
+
+dagmc_preproc_SOURCES = dagmc_preproc.cpp ../program_opt.cpp

Added: MOAB/trunk/tools/dagmc/dagmc_preproc.cpp
===================================================================
--- MOAB/trunk/tools/dagmc/dagmc_preproc.cpp	                        (rev 0)
+++ MOAB/trunk/tools/dagmc/dagmc_preproc.cpp	2010-12-01 00:04:52 UTC (rev 4307)
@@ -0,0 +1,350 @@
+#include "../program_opt.hpp"
+
+#include "moab/Core.hpp"
+#include "moab/Interface.hpp"
+#include "moab/Range.hpp"
+#include "moab/CartVect.hpp"
+#include "MBTagConventions.hpp"
+
+#include <iostream>
+#include <sstream>
+#include <iomanip>
+#include <cstdlib>
+#include <algorithm>
+
+using namespace moab;
+
+static bool verbose = false;
+
+/**
+ * Estimate the volume of the surface (actually multiplied by a factor of six).
+ * See DagMC::measure_volume, from which this code is borrowed, for algorithmic details.
+ * For our purpose, all that matters is the signedness.


More information about the moab-dev mailing list