Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prog bars #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions export_dagmc_cmd/DAGMCExportCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ DAGMCExportCommand::DAGMCExportCommand() :
load_message <<"Loaded DAGMC export plugin." << std::endl;
CubitInterface::get_cubit_message_handler()->print_error(load_message.str().c_str());
}

progTool = new TtyProgressTool();
}

DAGMCExportCommand::~DAGMCExportCommand()
Expand Down Expand Up @@ -598,6 +600,9 @@ moab::ErrorCode DAGMCExportCommand::create_curve_facets(refentity_handle_map& cu

// Map iterator
refentity_handle_map_itor ci;

progTool->clear_all();
progTool->start(0,curve_map.size(),"FACETING CURVES");

// Create geometry for all curves
GMem data;
Expand Down Expand Up @@ -705,7 +710,10 @@ moab::ErrorCode DAGMCExportCommand::create_curve_facets(refentity_handle_map& cu
rval = mdbImpl->add_entities(ci->second, &edges[0], edges.size());
if (moab::MB_SUCCESS != rval)
return moab::MB_FAILURE;

progTool->step();
}
progTool->end();

if (!verbose_warnings && curve_warnings < 0) {
message << "Suppressed " << -curve_warnings
Expand All @@ -727,6 +735,9 @@ moab::ErrorCode DAGMCExportCommand::create_surface_facets(refentity_handle_map&

DLIList<TopologyEntity*> me_list;

progTool->clear_all();
progTool->start(0,surface_map.size(),"FACETING_SURFACES");

GMem data;
// Create geometry for all surfaces
for (ci = surface_map.begin(); ci != surface_map.end(); ++ci) {
Expand Down Expand Up @@ -836,8 +847,12 @@ moab::ErrorCode DAGMCExportCommand::create_surface_facets(refentity_handle_map&
rval = mdbImpl->add_entities(ci->second, facets);
if (moab::MB_SUCCESS != rval)
return moab::MB_FAILURE;

progTool->step();
}

progTool->end();

return moab::MB_SUCCESS;
}

Expand Down
2 changes: 2 additions & 0 deletions export_dagmc_cmd/DAGMCExportCommand.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "CubitCommandInterface.hpp"
#include "CubitMessageHandler.hpp"
#include "TtyProgressTool.hpp"

// CGM includes
#include "RefEntity.hpp"
Expand Down Expand Up @@ -30,6 +31,7 @@ class DAGMCExportCommand: public CubitCommand
bool execute(CubitCommandData &data);

protected:
TtyProgressTool* progTool;

moab::ErrorCode create_tags();
moab::ErrorCode parse_options(CubitCommandData &data, moab::EntityHandle* file_set = 0);
Expand Down