1
0
Fork 0
mirror of https://github.com/gwm17/catima.git synced 2024-11-23 02:38:51 -05:00
This commit is contained in:
hrocho 2018-07-30 19:57:51 +02:00
parent f01cb88ddd
commit 12676b53aa
3 changed files with 24 additions and 13 deletions

View File

@ -21,7 +21,7 @@ set(CMAKE_BUILD_TYPE Release)
######### compiler flags ########### ######### compiler flags ###########
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
@ -87,7 +87,7 @@ set_target_properties(catima_static
POSITION_INDEPENDENT_CODE ON POSITION_INDEPENDENT_CODE ON
ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib
) )
target_link_libraries(catima ${EXTRA_LIBS} ${GSL_LIBRARIES} nurex::nurex) target_link_libraries(catima ${EXTRA_LIBS} ${GSL_LIBRARIES})
target_link_libraries(catima_static ${EXTRA_LIBS} ${GSL_LIBRARIES}) target_link_libraries(catima_static ${EXTRA_LIBS} ${GSL_LIBRARIES})
target_include_directories(catima target_include_directories(catima

View File

@ -1,26 +1,38 @@
#include "catima/reactions.h" #include "catima/reactions.h"
#ifdef NUREX #ifdef NUREX
#include "nurex/Parametrization.h"
#include "catima/catima.h" #include "catima/catima.h"
#include "catima/abundance_database.h" #include "catima/abundance_database.h"
#include "catima/storage.h"
#include <cmath> #include <cmath>
#include <iostream> #include <iostream>
namespace catima{ namespace catima{
double reaction_rate1(Projectile &projectile, const Material &target, const Config &c){ double reaction_rate1(Projectile &projectile, const Material &target, const Config &c){
int num_elements = target.ncomponents();
int ap = lround(projectile.A); int ap = lround(projectile.A);
int zp = lround(projectile.Z); int zp = lround(projectile.Z);
nurex::Nucleus nurex_projectile = nurex::get_default_nucleus(ap,zp);
int zt = target.get_element(0).Z; int zt = target.get_element(0).Z;
int at = abundance::get_isotope_a(zt,0); int at = abundance::get_isotope_a(zt,0); // most abundand natural isotope mass
nurex::Nucleus nurex_target = nurex::get_default_nucleus(at,zt);
double eout = energy_out(projectile,projectile.T, target,c); auto data = _storage.Get(projectile,target,c);
std::cout<<eout<<"\n"; Interpolator range_spline(energy_table.values,data.range.data(),energy_table.num);
nurex::GlauberModelOLA_ZeroRange gm(nurex_projectile, nurex_target);
double cs = nurex::SigmaR(gm, projectile.T); auto sigma_r = [&](double th){
double stn_sum=0.0, sum=0.0;
double e = energy_out(projectile.T, th, range_spline);
for(unsigned int i = 0;i<target.ncomponents();i++){
stn_sum += target.molar_fraction(i);
sum += target.molar_fraction(i)*nurex::SigmaR_Kox(ap,zp,e,at,zt);
}
return sum/stn_sum;
};
//nurex::Nucleus nurex_projectile = nurex::get_default_nucleus(ap,zp);
//nurex::Nucleus nurex_target = nurex::get_default_nucleus(at,zt);
//nurex::GlauberModelOLA_ZeroRange gm(nurex_projectile, nurex_target);
//double cs = nurex::SigmaR_Kox(ap,zp,projectile.T,);
double cs = catima::integrator.integrate(sigma_r,0,target.thickness());
double rr = reaction_rate(cs,target.number_density_cm2(0)); double rr = reaction_rate(cs,target.number_density_cm2(0));
std::cout<<rr<<"\n"; std::cout<<rr<<"\n";

View File

@ -18,7 +18,6 @@
#define REACTIONS_H #define REACTIONS_H
#include "catima/build_config.h" #include "catima/build_config.h"
#ifdef NUREX #ifdef NUREX
#include "nurex/nurex.h"
#include "catima/structures.h" #include "catima/structures.h"
#include "catima/config.h" #include "catima/config.h"
#include "catima/integrator.h" #include "catima/integrator.h"