From 501bd21c632ae1640497f809e338feaca0c2cd56 Mon Sep 17 00:00:00 2001 From: hrosiak Date: Mon, 30 Apr 2018 00:16:45 +0200 Subject: [PATCH] reaction --- CMakeLists.txt | 7 +++++++ build_config.in | 1 + reactions.cpp | 25 +++++++++++++++++++++++++ reactions.h | 32 ++++++++++++++++++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 reactions.cpp create mode 100644 reactions.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b20e0c..8897d27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,13 @@ if(PYTHONINTERP_FOUND) message("-- Python found: ${PYTHON_EXECUTABLE}") endif() +find_package(nurex QUIET) +if(nurex_FOUND) +message(STATUS "nurex library found") +set(NUREX ON) +endif(nurex_FOUND) + + configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/build_config.in" "${CMAKE_CURRENT_BINARY_DIR}/include/catima/build_config.h" diff --git a/build_config.in b/build_config.in index 87d7280..2f2a6d0 100644 --- a/build_config.in +++ b/build_config.in @@ -5,5 +5,6 @@ #cmakedefine GSL_INTEGRATION #cmakedefine GLOBAL +#cmakedefine NUREX #endif diff --git a/reactions.cpp b/reactions.cpp new file mode 100644 index 0000000..4618067 --- /dev/null +++ b/reactions.cpp @@ -0,0 +1,25 @@ +#include "catima/reactions.h" +#ifdef NUREX +#include +namespace catima{ + +double reaction_rate(Projectile &projectile, const Material &target, const Config &c){ + int num_elements = target.ncomponents(); + int ap = lround(projectile.A); + int zp = lround(projectile.Z); + nurex::Nucleus nurex_projectile = get_default_nucleus(ap,zp); + + int zt = lround(target.get_element(0).Z; + int at = abundance::get_isotope_a(zt,0); + nurex::Nucleus nurex_target = get_default_nucleus(at,zt); + + nurex::GlauberModelOLA_ZeroRange gm(nurex_projectile, nurex_target); + double cs = nurex::SigmaR(gm, projectile.T); + + + return 1.0; + } + +} + +#endif diff --git a/reactions.h b/reactions.h new file mode 100644 index 0000000..b856539 --- /dev/null +++ b/reactions.h @@ -0,0 +1,32 @@ +/* + * Author: Andrej Prochazka + * Copyright(C) 2017 + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#ifndef REACTIONS_H +#define REACTIONS_H + +#ifdef NUREX + +#include "nurex/nurex.h" +#include "catima/structures.h" + +namespace catima{ + + double reaction_rate(Projectile &projectile, const Material &target, const Config &c=default_config); + +} + +#endif //NUREX +#endif