Skip to content

Commit

Permalink
back to origin
Browse files Browse the repository at this point in the history
  • Loading branch information
bam241 committed Dec 11, 2024
1 parent 92a7a39 commit 2b8ba5d
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions src/mcnp/mcnp_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

#include "DagMC.hpp"
#include "dagmcmetadata.hpp"
#include "util.hpp"

using moab::DagMC;

#include <assert.h>
Expand Down Expand Up @@ -202,10 +200,8 @@ void write_cell_cards(std::ostringstream& lcadfile,
// that material numbers are assigned
mat_num = DMD->volume_material_data_eh[entity];
// if we cant make an int from the mat_num
if (dagmc_util::to_lower(mat_num) !=
dagmc_util::to_lower(DMD->graveyard_mat_str()) &&
dagmc_util::to_lower(mat_num) !=
dagmc_util::to_lower(DMD->vacuum_mat_str())) {
if (mat_num.find(DMD->graveyard_str()) == std::string::npos &&
mat_num.find(DMD->vacuum_str()) == std::string::npos) {
if (!DMD->try_to_make_int(mat_num)) {
std::cerr << "Failed to cast material number to an integer"
<< std::endl;
Expand All @@ -228,10 +224,8 @@ void write_cell_cards(std::ostringstream& lcadfile,
} else {
std::string mat_name = DMD->volume_material_property_data_eh[entity];
// if we not vacuum or graveyard
if (dagmc_util::to_lower(mat_num) !=
dagmc_util::to_lower(DMD->graveyard_mat_str()) &&
dagmc_util::to_lower(mat_num) !=
dagmc_util::to_lower(DMD->vacuum_mat_str())) {
if (mat_name.find(DMD->vacuum_str()) == std::string::npos &&
mat_name.find(DMD->graveyard_str()) == std::string::npos) {
if (workflow_data->material_library.count(mat_name) == 0) {
std::cerr << "Material with name " << mat_name << " not found "
<< std::endl;
Expand Down Expand Up @@ -272,12 +266,10 @@ void write_cell_cards(std::ostringstream& lcadfile,
}
double imp = 1.0;
// if we find graveyard always have importance 0.0
if (dagmc_util::to_lower(mat_num) ==
dagmc_util::to_lower(DMD->graveyard_mat_str())) {
if (mat_name.find(DMD->graveyard_str()) != std::string::npos) {
imp = 0.0;
// no splitting can happenin vacuum set to 1
} else if (dagmc_util::to_lower(mat_num) ==
dagmc_util::to_lower(DMD->vacuum_mat_str())) {
} else if (mat_name.find(DMD->vacuum_str()) != std::string::npos) {
imp = 1.0;
// otherwise as the map says
} else {
Expand All @@ -287,15 +279,15 @@ void write_cell_cards(std::ostringstream& lcadfile,
}
// its possible no importances were assigned
if (set.size() == 0) {
if (dagmc_util::to_lower(mat_num) != dagmc_util::to_lower(DMD->graveyard_mat_str())) {
if (mat_name.find(DMD->graveyard_str()) == std::string::npos) {
importances = "imp:n=1";
} else {
importances = "imp:n=0";
}
}

// add descriptive comments for special volumes
if (dagmc_util::to_lower(mat_num) == dagmc_util::to_lower(DMD->graveyard_mat_str())) {
if (mat_name.find(DMD->graveyard_str()) != std::string::npos) {
importances += " $ graveyard";
} else if (DAG->is_implicit_complement(entity)) {
importances += " $ implicit complement";
Expand Down

0 comments on commit 2b8ba5d

Please sign in to comment.