Skip to content

Commit

Permalink
missing import and formating
Browse files Browse the repository at this point in the history
  • Loading branch information
bam241 committed Dec 11, 2024
1 parent f126a40 commit 052e446
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
18 changes: 12 additions & 6 deletions src/dagmc/dagmcmetadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,10 @@ void dagmcMetaData::parse_material_data() {
// set the material value
volume_material_property_data_eh[eh] = grp_name;
logger.message("Group name -- " + grp_name);
bool is_graveyard = dagmc_util::to_lower(grp_name) == dagmc_util::to_lower(graveyard_mat_str());
bool is_vacuum = dagmc_util::to_lower(grp_name) == dagmc_util::to_lower(vacuum_mat_str());
bool is_graveyard = dagmc_util::to_lower(grp_name) ==
dagmc_util::to_lower(graveyard_mat_str());
bool is_vacuum = dagmc_util::to_lower(grp_name) ==
dagmc_util::to_lower(vacuum_mat_str());

// not graveyard or vacuum or implicit compliment
if (!is_graveyard && !is_vacuum && !DAG->is_implicit_complement(eh)) {
Expand Down Expand Up @@ -376,13 +378,17 @@ void dagmcMetaData::parse_boundary_data() {

std::string bc_string = dagmc_util::to_lower(boundary_assignment[0]);

if (bc_string.find(dagmc_util::to_lower(reflecting_str())) != std::string::npos)
if (bc_string.find(dagmc_util::to_lower(reflecting_str())) !=
std::string::npos)
surface_boundary_data_eh[eh] = reflecting_str();
if (bc_string.find(dagmc_util::to_lower(white_str())) != std::string::npos)
if (bc_string.find(dagmc_util::to_lower(white_str())) !=
std::string::npos)
surface_boundary_data_eh[eh] = white_str();
if (bc_string.find(dagmc_util::to_lower(periodic_str())) != std::string::npos)
if (bc_string.find(dagmc_util::to_lower(periodic_str())) !=
std::string::npos)
surface_boundary_data_eh[eh] = periodic_str();
if (bc_string.find(dagmc_util::to_lower(vacuum_str())) != std::string::npos)
if (bc_string.find(dagmc_util::to_lower(vacuum_str())) !=
std::string::npos)
surface_boundary_data_eh[eh] = vacuum_str();
}
}
Expand Down
13 changes: 9 additions & 4 deletions src/mcnp/mcnp_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

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

using moab::DagMC;

Expand Down Expand Up @@ -201,8 +202,10 @@ 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 (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 (!DMD->try_to_make_int(mat_num)) {
std::cerr << "Failed to cast material number to an integer"
<< std::endl;
Expand All @@ -225,8 +228,10 @@ 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 (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 (workflow_data->material_library.count(mat_name) == 0) {
std::cerr << "Material with name " << mat_name << " not found "
<< std::endl;
Expand Down

0 comments on commit 052e446

Please sign in to comment.