Skip to content

Commit

Permalink
Resolving merge conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
elliottbiondo committed May 12, 2014
2 parents 4665ee3 + a94f01e commit 035ff53
Show file tree
Hide file tree
Showing 219 changed files with 19,853 additions and 18,703 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ tests/test.file
tests/test.txt
tests/U235.txt
tests/Ni59.txt

docs/rxname_listing
.ipynb_checkpoints
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ message("-- PYTHON_EXECUTABLE: ${PYTHON_EXECUTABLE}")
# Check for MOAB library
find_package(MOAB)
message("-- MOAB Found: ${MOAB_FOUND}")
if(${MOAB_FOUND})
include_directories(${MOAB_INCLUDE_DIR})
endif(${MOAB_FOUND})

# Include the CMake script UseCython.cmake. This defines add_cython_module().
# Instruction for use can be found at the top of cmake/UseCython.cmake.
Expand Down Expand Up @@ -60,7 +63,8 @@ set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
if(APPLE)
# I think that this is the right thing to do for MacOSX 10.5+ --Anthony
set(CMAKE_INSTALL_RPATH "@rpath/lib")
set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_INSTALL_RPATH "@loader_path/lib")
elseif(WIN32)
if(MSVC)
# ??? Who knows what to do here?! --Anthony
Expand Down Expand Up @@ -97,7 +101,7 @@ add_subdirectory(pyne/xs)

# Print include dir
get_property(inc_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
message("-- C_INCLUDE_PATH for ${CMAKE_CURRENT_SOURCE_DIR}: ${inc_dirs}")
message("-- Include paths for ${CMAKE_CURRENT_SOURCE_DIR}: ${inc_dirs}")

message("-- Copying C/C++ header files.")
file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/cpp/" DESTINATION
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindPythonLibsNew.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ find_library(PYTHON_LIBRARY
"Python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}m"
"Python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}mu"
"Python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}dm"
PATHS ${_PYTHON_LIBS_SEARCH}
HINTS ${_PYTHON_LIBS_SEARCH}
NO_SYSTEM_ENVIRONMENT_PATH)
#endif()

Expand Down
3 changes: 1 addition & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def setup():
scripts = [s for s in scripts if (os.name == 'nt' and s.endswith('.bat')) or
(os.name != 'nt' and not s.endswith('.bat'))]
packages = ['pyne', 'pyne.lib', 'pyne.dbgen', 'pyne.apigen', 'pyne.xs',
'pyne.simplesim', 'pyne.transmute', 'pyne.gui', 'pyne.cli']
'pyne.transmute', 'pyne.gui', 'pyne.cli']
pack_dir = {
'pyne': 'pyne',
'pyne.xs': 'pyne/xs',
Expand All @@ -99,7 +99,6 @@ def setup():
'pyne.cli': 'pyne/cli',
'pyne.dbgen': 'pyne/dbgen',
'pyne.apigen': 'pyne/apigen',
'pyne.simplesim': 'pyne/simplesim',
'pyne.transmute': 'pyne/transmute',
}
extpttn = ['*.dll', '*.so', '*.dylib', '*.pyd', '*.pyo']
Expand Down
11 changes: 9 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ install_lib(pyne_rxname)
add_library(pyne_data data.cpp)
set_target_properties(pyne_data PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/pyne/lib")
target_link_libraries(pyne_data pyne_nucname pyne hdf5)
target_link_libraries(pyne_data pyne_nucname pyne_rxname pyne hdf5)
install_lib(pyne_data)

# pyne_material
Expand All @@ -44,9 +44,16 @@ set_target_properties(pyne_enrichment PROPERTIES
target_link_libraries(pyne_enrichment pyne_material)
install_lib(pyne_enrichment)

# pyne_tally
add_library(pyne_tally tally.cpp)
set_target_properties(pyne_tally PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/pyne/lib")
install_lib(pyne_tally)


# Print include dir
get_property(inc_dirs DIRECTORY PROPERTY INCLUDE_DIRECTORIES)
message("-- C_INCLUDE_PATH for ${CMAKE_CURRENT_SOURCE_DIR}: ${inc_dirs}")
message("-- Include paths for ${CMAKE_CURRENT_SOURCE_DIR}: ${inc_dirs}")

#file(COPY "${CMAKE_CURRENT_SOURCE_DIR}" DESTINATION
# "${CMAKE_BINARY_DIR}/pyne/includes/" FILES_MATCHING PATTERN "*.h")
54 changes: 27 additions & 27 deletions cpp/dagmc_bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ using moab::EntityHandle;

namespace pyne {

float dag_version(void){
float dag_version(void) {
return DagMC::version();
}

unsigned dag_rev_version(void){
unsigned dag_rev_version(void) {
return DagMC::interface_revision();
}

int dag_ent_handle_size(void){
int dag_ent_handle_size(void) {
return sizeof(EntityHandle);
}

static std::vector<int> surfList;
static std::vector<int> volList;

const int* geom_id_list(int dimension, int* number_of_items){
switch(dimension){
const int* geom_id_list(int dimension, int* number_of_items) {
switch(dimension) {
case 2:
*number_of_items = surfList.size();
return &(surfList.front());
Expand All @@ -47,11 +47,11 @@ const int* geom_id_list(int dimension, int* number_of_items){
}
}

EntityHandle handle_from_id(int dimension, int id){
EntityHandle handle_from_id(int dimension, int id) {
return DagMC::instance()->entity_by_id(dimension, id);
}

int id_from_handle(EntityHandle eh){
int id_from_handle(EntityHandle eh) {
return DagMC::instance()->get_entity_id(eh);
}

Expand Down Expand Up @@ -80,31 +80,31 @@ ErrorCode dag_load(const char* filename){

int num_surfs = dag->num_entities(2);
surfList.reserve(num_surfs);
for(int i = 1; i <= num_surfs; ++i){
for(int i = 1; i <= num_surfs; ++i) {
surfList.push_back(dag->id_by_index(2, i));
}

int num_vols = dag->num_entities(3);
volList.reserve(num_vols);
for(int i = 1; i <= num_vols; ++i){
for(int i = 1; i <= num_vols; ++i) {
volList.push_back(dag->id_by_index(3, i));
}

return err;
}


void* dag_alloc_ray_history(void){
void* dag_alloc_ray_history(void) {
return new DagMC::RayHistory();
}

void dag_dealloc_ray_history(void* r){
void dag_dealloc_ray_history(void* r) {
delete (static_cast<DagMC::RayHistory*>(r));
}

ErrorCode dag_ray_fire(EntityHandle vol, vec3 ray_start, vec3 ray_dir,
EntityHandle* next_surf_ent, double* next_surf_dist,
void* history, double distance_limit){
void* history, double distance_limit) {
ErrorCode err;

DagMC* dag = DagMC::instance();
Expand All @@ -116,7 +116,7 @@ ErrorCode dag_ray_fire(EntityHandle vol, vec3 ray_start, vec3 ray_dir,
return err;
}

class ray_buffers{
class ray_buffers {

public:
DagMC::RayHistory history;
Expand Down Expand Up @@ -144,12 +144,12 @@ ErrorCode dag_ray_follow(EntityHandle firstvol, vec3 ray_start, vec3 ray_dir,
CartVect uvw(ray_dir);

// iterate over the ray until no more intersections are available
while(vol){
while(vol) {
err = dag->ray_fire(vol, ray_point.array(), ray_dir,
next_surf, next_surf_dist, &(buf->history), dlimit);
CHECKERR(err);

if(next_surf){
if(next_surf) {
ray_point += uvw * next_surf_dist;
buf->surfs.push_back(next_surf);
buf->dists.push_back(next_surf_dist);
Expand All @@ -173,12 +173,12 @@ ErrorCode dag_ray_follow(EntityHandle firstvol, vec3 ray_start, vec3 ray_dir,
return err;
}

void dag_dealloc_ray_buffer(void* data_buffers){
void dag_dealloc_ray_buffer(void* data_buffers) {
ray_buffers* b = static_cast<ray_buffers*>(data_buffers);
delete b;
}

ErrorCode dag_pt_in_vol(EntityHandle vol, vec3 pt, int* result, vec3 dir, const void* history){
ErrorCode dag_pt_in_vol(EntityHandle vol, vec3 pt, int* result, vec3 dir, const void* history) {

ErrorCode err;

Expand All @@ -189,7 +189,7 @@ ErrorCode dag_pt_in_vol(EntityHandle vol, vec3 pt, int* result, vec3 dir, const
return err;
}

ErrorCode dag_next_vol(EntityHandle surface, EntityHandle volume, EntityHandle* next_vol){
ErrorCode dag_next_vol(EntityHandle surface, EntityHandle volume, EntityHandle* next_vol) {

ErrorCode err;
DagMC* dag = DagMC::instance();
Expand All @@ -199,7 +199,7 @@ ErrorCode dag_next_vol(EntityHandle surface, EntityHandle volume, EntityHandle*
return err;
}

int vol_is_graveyard(EntityHandle vol){
int vol_is_graveyard(EntityHandle vol) {
return DagMC::instance()->has_prop(vol, "graveyard");
}

Expand All @@ -210,7 +210,7 @@ int vol_is_implicit_complement(EntityHandle vol){
return DagMC::instance()->is_implicit_complement(vol);
}

ErrorCode get_volume_metadata(EntityHandle vol, int* material, double* density, double* importance){
ErrorCode get_volume_metadata(EntityHandle vol, int* material, double* density, double* importance) {
ErrorCode err;
DagMC* dag = DagMC::instance();

Expand All @@ -220,28 +220,28 @@ ErrorCode get_volume_metadata(EntityHandle vol, int* material, double* density,

std::string str;
err = dag->prop_value(vol, "mat", str);
if(err == moab::MB_SUCCESS){
if(err == moab::MB_SUCCESS) {
mat_id = strtol(str.c_str(), NULL, 10);
}
else if(err != moab::MB_TAG_NOT_FOUND){
else if(err != moab::MB_TAG_NOT_FOUND) {
// TAG_NOT_FOUND should not be returned as an error; it just means
// the default value of mat_id needs to be used.
CHECKERR(err);
}

err = dag->prop_value(vol, "rho", str);
if(err == moab::MB_SUCCESS){
if(err == moab::MB_SUCCESS) {
rho = strtod(str.c_str(), NULL);
}
else if(err != moab::MB_TAG_NOT_FOUND){
else if(err != moab::MB_TAG_NOT_FOUND) {
CHECKERR(err);
}

err = dag->prop_value(vol, "imp", str);
if(err == moab::MB_SUCCESS){
if(err == moab::MB_SUCCESS) {
imp = strtod(str.c_str(), NULL);
}
else if(err != moab::MB_TAG_NOT_FOUND){
else if(err != moab::MB_TAG_NOT_FOUND) {
CHECKERR(err);
}

Expand All @@ -252,7 +252,7 @@ ErrorCode get_volume_metadata(EntityHandle vol, int* material, double* density,
return moab::MB_SUCCESS;
}

ErrorCode get_volume_boundary(EntityHandle vol, vec3 minPt, vec3 maxPt){
ErrorCode get_volume_boundary(EntityHandle vol, vec3 minPt, vec3 maxPt) {
return DagMC::instance()->getobb(vol, minPt, maxPt);
}

Expand Down
Loading

0 comments on commit 035ff53

Please sign in to comment.