Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LAMBERT Jean-charles
uns_projects
Commits
c8390324
Commit
c8390324
authored
Aug 09, 2018
by
LAMBERT Jean-charles
Browse files
update to compile with gcc 7 against falcON
parent
0becd514
Changes
36
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
c8390324
...
...
@@ -24,6 +24,16 @@ MESSAGE( STATUS "CMAKE_MODULE_PATH=" ${CMAKE_MODULE_PATH} )
# load setup flags
include
(
SetupFlags
)
# use ccache if any
find_program
(
CCACHE_FOUND ccache
)
if
(
CCACHE_FOUND
)
set_property
(
GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache
)
set_property
(
GLOBAL PROPERTY RULE_LAUNCH_LINK ccache
)
endif
(
CCACHE_FOUND
)
# Cpack Generator detection
include
(
DetectCpackGenerator
)
# contains the full path to the top level directory of your build tree
MESSAGE
(
STATUS
"PROJECT_BINARY_DIR: "
${
PROJECT_BINARY_DIR
}
)
...
...
@@ -113,7 +123,7 @@ include_directories (${EXTRA_INCLUDES})
if
(
FALCON_INSTALLED
)
include_directories
(
${
DEHNEN
}
/falcON/utils/inc
${
DEHNEN
}
/falcON/inc
)
endif
()
include_directories
(
${
UNSIOPATH
}
/lib
${
UNSIOPATH
}
/include
${
UNSIOPATH
}
/include/uns $ENV{NEMO}/inc
)
include_directories
(
${
UNSIOPATH
}
/lib
${
UNSIOPATH
}
/include
${
UNSIOPATH
}
/include/uns $ENV{NEMO}/inc
$ENV{NEMO}/lib
)
include_directories
(
/usr/include/malloc
)
# Make sure the linker can find the Hello library once it is built.
...
...
@@ -125,6 +135,11 @@ link_directories ( ${UNSIOPATH}/lib64 ${DEHNEN}/falcON/lib ${DEHNEN}/utils/lib $
mark_as_advanced
(
CMAKE_INSTALL_PREFIX
)
if
(
CMAKE_INSTALL_PREFIX STREQUAL $ENV{NEMO}
)
SET
(
PREFIX_LIB lib
)
else
()
SET
(
PREFIX_LIB
${
LIB_SUFFIX
}
)
endif
()
if
(
NOT CMAKE_INSTALL_PREFIX
)
set
(
CMAKE_INSTALL_PREFIX
${
UNSIOPATH
}
)
endif
()
...
...
@@ -140,16 +155,16 @@ SET(CMAKE_SKIP_BUILD_RPATH FALSE)
# (but later on when installing)
SET
(
CMAKE_BUILD_WITH_INSTALL_RPATH FALSE
)
SET
(
CMAKE_INSTALL_RPATH
"
${
CMAKE_INSTALL_PREFIX
}
/
lib
"
)
SET
(
CMAKE_INSTALL_RPATH
"
${
CMAKE_INSTALL_PREFIX
}
/
${
PREFIX_LIB
}
"
)
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
SET
(
CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE
)
# the RPATH to be used when installing, but only if it's not a system directory
LIST
(
FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
"
${
CMAKE_INSTALL_PREFIX
}
/
lib
"
isSystemDir
)
LIST
(
FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
"
${
CMAKE_INSTALL_PREFIX
}
/
${
PREFIX_LIB
}
"
isSystemDir
)
IF
(
"
${
isSystemDir
}
"
STREQUAL
"-1"
)
SET
(
CMAKE_INSTALL_RPATH
"
${
CMAKE_INSTALL_PREFIX
}
/
lib
"
)
SET
(
CMAKE_INSTALL_RPATH
"
${
CMAKE_INSTALL_PREFIX
}
/
${
PREFIX_LIB
}
"
)
ENDIF
(
"
${
isSystemDir
}
"
STREQUAL
"-1"
)
# ----------------------------------------------------------
...
...
@@ -172,9 +187,9 @@ FOREACH(exe_cpp ${execpp_sources})
#
if
(
NEMO_INSTALLED
)
target_link_libraries
(
${
exe
}
JCLutils
JCLprojects cpgplot pgplot.a
${
FC_GFORT_LIB
}
${
FC_G77_LIB
}
CCfits cfitsio X11 nemo unsio WDutils falcON gomp
${
LIBBOOST
}
pthread dl
)
target_link_libraries
(
${
exe
}
JCLprojects
JCLutils
cpgplot pgplot.a
${
FC_GFORT_LIB
}
${
FC_G77_LIB
}
CCfits cfitsio X11 nemo unsio WDutils falcON gomp
${
LIBBOOST
}
pthread dl
)
else
()
target_link_libraries
(
${
exe
}
JCLutils
JCLprojects
${
FC_GFORT_LIB
}
${
FC_G77_LIB
}
CCfits cfitsio nemo unsio gomp
${
LIBBOOST
}
dl
)
target_link_libraries
(
${
exe
}
JCLprojects
JCLutils
${
FC_GFORT_LIB
}
${
FC_G77_LIB
}
CCfits cfitsio nemo unsio gomp
${
LIBBOOST
}
dl
)
endif
()
INSTALL
(
TARGETS
${
exe
}
RUNTIME DESTINATION bin
)
...
...
@@ -197,8 +212,9 @@ FOREACH(exe_cpp ${execpp_sources})
get_filename_component
(
exe
${
exe_cpp
}
NAME_WE
)
#INSTALL(PROGRAMS ${PROJECT_BINARY_DIR}/bin/${exe} DESTINATION bin)
ENDFOREACH
(
exe_cpp
${
execpp_sources
}
)
INSTALL
(
FILES
${
PROJECT_BINARY_DIR
}
/lib/libJCLutils.
${
SOEXT
}
DESTINATION lib64
)
INSTALL
(
FILES
${
PROJECT_BINARY_DIR
}
/lib/libJCLprojects.
${
SOEXT
}
DESTINATION lib64
)
INSTALL
(
FILES
${
PROJECT_BINARY_DIR
}
/lib/libJCLutils.
${
SOEXT
}
DESTINATION
${
PREFIX_LIB
}
)
INSTALL
(
FILES
${
PROJECT_BINARY_DIR
}
/lib/libJCLprojects.
${
SOEXT
}
DESTINATION
${
PREFIX_LIB
}
)
INSTALL
(
FILES
${
PROJECT_SOURCE_DIR
}
/man/uns_2dplot.1 DESTINATION man/man1
)
INSTALL
(
FILES
${
PROJECT_SOURCE_DIR
}
/man/uns_stack.1 DESTINATION man/man1
)
INSTALL
(
FILES
${
PROJECT_SOURCE_DIR
}
/man/uns2uns.1 DESTINATION man/man1
)
...
...
cmake/DetectCpackGenerator.cmake
0 → 100644
View file @
c8390324
# -*-cmake-*-
# ============================================================================
# Copyright Jean-Charles LAMBERT - 2008-2014
# e-mail: Jean-Charles.Lambert@lam.fr
# address: Dynamique des galaxies
# Centre de donneeS Astrophysique de Marseille (CeSAM)
# Laboratoire d'Astrophysique de Marseille
# Pole de l'Etoile, site de Chateau-Gombert
# 38, rue Frederic Joliot-Curie
# 13388 Marseille cedex 13 France
# CNRS U.M.R 7326
# ============================================================================
# Detect OS and architecture to select right CPACK Generator
# ============================================================================
#
# Inspired from :
# http://www.cmake.org/pipermail/cmake/2010-July/038268.html
# http://www.cmake.org/pipermail/cmake/attachments/20100722/04976a73/attachment-0001.obj
#
# define a set of string with may-be useful readable name
# this file is meant to be included in a CMakeLists.txt
# not as a standalone CMake script
set
(
SPECIFIC_COMPILER_NAME
""
)
set
(
SPECIFIC_SYSTEM_VERSION_NAME
""
)
set
(
SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR
""
)
set
(
LINUX_NAME
""
)
set
(
MY_OS
""
)
if
(
OSX
)
set
(
LIB_SUFFIX
"lib"
)
endif
(
OSX
)
if
(
UNIX
)
if
(
CMAKE_SYSTEM_NAME MATCHES
"Linux"
)
set
(
SPECIFIC_SYSTEM_VERSION_NAME
"
${
CMAKE_SYSTEM_NAME
}
"
)
set
(
SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR
"TGZ"
)
set
(
LINUX_NAME
""
)
set
(
LINUX_ISSUE
""
)
set
(
LIB_SUFFIX
"lib64"
)
if
(
EXISTS
"/etc/system-release"
)
file
(
READ
"/etc/system-release"
LINUX_ISSUE
)
elseif
(
EXISTS
"/etc/issue"
)
file
(
READ
"/etc/issue"
LINUX_ISSUE
)
elseif
(
EXISTS
"/etc/redhat-release"
)
file
(
READ
"/etc/redhat-release"
LINUX_ISSUE
)
endif
(
EXISTS
"/etc/system-release"
)
# Mageia case
if
(
LINUX_ISSUE MATCHES
"Mageia"
)
set
(
MY_OS
"Mageia"
)
string
(
REGEX MATCH
"release ([0-9]+)"
MAGEIA
"
${
LINUX_ISSUE
}
"
)
set
(
LINUX_NAME
"mga
${
CMAKE_MATCH_1
}
"
)
set
(
SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR
"RPM"
)
MESSAGE
(
STATUS
"Mageia :"
${
LINUX_NAME
}
)
endif
(
LINUX_ISSUE MATCHES
"Mageia"
)
# Arch Linux
if
(
LINUX_ISSUE MATCHES
"Arch"
)
set
(
MY_OS
"Arch"
)
set
(
LINUX_NAME
"arch"
)
#set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "RPM")
MESSAGE
(
STATUS
"Arch Linux :"
${
LINUX_NAME
}
)
endif
(
LINUX_ISSUE MATCHES
"Arch"
)
# Fedora case
if
(
LINUX_ISSUE MATCHES
"Fedora"
)
set
(
MY_OS
"Fedora"
)
string
(
REGEX MATCH
"release ([0-9]+)"
FEDORA
"
${
LINUX_ISSUE
}
"
)
set
(
LINUX_NAME
"fc
${
CMAKE_MATCH_1
}
"
)
set
(
SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR
"RPM"
)
endif
(
LINUX_ISSUE MATCHES
"Fedora"
)
# Scientific case
if
(
LINUX_ISSUE MATCHES
"Scientific"
)
set
(
MY_OS
"Scientific"
)
string
(
REGEX MATCH
"release ([0-9]+)"
SCIENTIFIC
"
${
LINUX_ISSUE
}
"
)
set
(
LINUX_NAME
"el
${
CMAKE_MATCH_1
}
"
)
set
(
SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR
"RPM"
)
endif
(
LINUX_ISSUE MATCHES
"Scientific"
)
if
(
LINUX_ISSUE MATCHES
"CentOS"
)
set
(
MY_OS
"CentOS"
)
string
(
REGEX MATCH
"release ([0-9]+)"
CENTOS
"
${
LINUX_ISSUE
}
"
)
set
(
LINUX_NAME
"el
${
CMAKE_MATCH_1
}
"
)
set
(
SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR
"RPM"
)
endif
(
LINUX_ISSUE MATCHES
"CentOS"
)
# Ubuntu case
if
(
LINUX_ISSUE MATCHES
"Ubuntu"
)
set
(
CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON
)
set
(
MY_OS
"Ubuntu"
)
string
(
REGEX MATCH
"buntu ([0-9]+
\\
.[0-9]+)"
UBUNTU
"
${
LINUX_ISSUE
}
"
)
set
(
LINUX_NAME
"ubuntu
${
CMAKE_MATCH_1
}
"
)
set
(
SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR
"DEB"
)
set
(
LIB_SUFFIX
"lib/x86_64-linux-gnu"
)
endif
(
LINUX_ISSUE MATCHES
"Ubuntu"
)
# Mint case
if
(
LINUX_ISSUE MATCHES
"Mint"
)
set
(
CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON
)
set
(
MY_OS
"Mint"
)
string
(
REGEX MATCH
"Mint ([0-9]+
\\
.[0-9]+)"
MINT
"
${
LINUX_ISSUE
}
"
)
set
(
LINUX_NAME
"mint
${
CMAKE_MATCH_1
}
"
)
set
(
SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR
"DEB"
)
set
(
LIB_SUFFIX
"lib/x86_64-linux-gnu"
)
endif
(
LINUX_ISSUE MATCHES
"Mint"
)
# Debian case
if
(
LINUX_ISSUE MATCHES
"Debian"
)
set
(
CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON
)
string
(
REGEX MATCH
"Debian .*ux ([a-zA-Z]*/?[a-zA-Z]*) .*"
DEBIAN
"
${
LINUX_ISSUE
}
"
)
set
(
LINUX_NAME
"debian-
${
CMAKE_MATCH_1
}
"
)
string
(
REPLACE
"/"
"_"
LINUX_NAME
${
LINUX_NAME
}
)
set
(
SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR
"DEB"
)
set
(
LIB_SUFFIX
"lib/x86_64-linux-gnu"
)
endif
(
LINUX_ISSUE MATCHES
"Debian"
)
# Open SuSE case
if
(
LINUX_ISSUE MATCHES
"SUSE"
)
set
(
MY_OS
"Suse"
)
string
(
REGEX MATCH
"SUSE ([a-zA-Z]*/?[a-zA-Z]*) ([0-9]+
\\
.[0-9]+)"
SUSE
"
${
LINUX_ISSUE
}
"
)
if
(
NOT
${
CMAKE_MATCH_2
}
STREQUAL
""
)
set
(
LINUX_NAME
"opensuse
${
CMAKE_MATCH_2
}
"
)
else
()
set
(
LINUX_NAME
"opensuse
${
CMAKE_MATCH_1
}
"
)
endif
()
string
(
REPLACE
"/"
"_"
LINUX_NAME
${
LINUX_NAME
}
)
set
(
SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR
"RPM"
)
endif
(
LINUX_ISSUE MATCHES
"SUSE"
)
# Mandriva case
# TODO
if
(
LINUX_NAME
)
set
(
SPECIFIC_SYSTEM_VERSION_NAME
"
${
CMAKE_SYSTEM_NAME
}
-
${
LINUX_NAME
}
"
)
endif
(
LINUX_NAME
)
endif
(
CMAKE_SYSTEM_NAME MATCHES
"Linux"
)
set
(
SPECIFIC_SYSTEM_VERSION_NAME
"
${
SPECIFIC_SYSTEM_VERSION_NAME
}
-
${
CMAKE_SYSTEM_PROCESSOR
}
"
)
set
(
SPECIFIC_COMPILER_NAME
""
)
endif
(
UNIX
)
if
(
NOT SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR STREQUAL
""
)
set
(
CPACK_GENERATOR
${
SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR
}
)
endif
(
NOT SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR STREQUAL
""
)
if
(
NOT MY_OS STREQUAL
""
)
message
(
STATUS
"---- Detect CPACK ----"
)
message
(
STATUS
"Linux distribution :"
${
MY_OS
}
)
message
(
STATUS
"OS version :"
${
LINUX_NAME
}
)
message
(
STATUS
"Generator :"
${
CPACK_GENERATOR
}
)
endif
(
NOT MY_OS STREQUAL
""
)
cmake/SetupFlags.cmake
View file @
c8390324
...
...
@@ -26,11 +26,16 @@ if ( NOT CMAKE_BUILD_TYPE ) # Debug default
# typed_cache_set ( STRING "Build type: Release or Debug" CMAKE_BUILD_TYPE Release )
endif
()
if
(
CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0 OR
CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 7.0
)
set
(
API_GCC
"-std=c++03 -Wall -Wextra -Winit-self -Wno-shadow -Wno-format-security -Wno-misleading-indentation"
)
endif
()
# set optimizer flag
if
(
${
CMAKE_BUILD_TYPE
}
STREQUAL
"Debug"
)
typed_cache_set
(
STRING
"Optimizer"
OPT
"-g -ggdb"
)
typed_cache_set
(
STRING
"Optimizer"
OPT
"-g -ggdb
${
API_GCC
}
"
)
else
()
typed_cache_set
(
STRING
"Optimizer"
OPT
"-O3"
)
typed_cache_set
(
STRING
"Optimizer"
OPT
"-O3
${
API_GCC
}
"
)
endif
()
#typed_cache_set (STRING "compilation warnings" WARNCPP "-Waddress -Warray-bounds -Wc++0x-compat -Wchar-subscripts -Wenum-compare -Wcomment -Wformat -Wmain -Wmissing-braces -Wparentheses -Wreorder -Wreturn-type -Wsequence-point -Wsign-compare -Wstrict-aliasing -Wstrict-overflow=1 -Wswitch -Wtrigraphs -Wuninitialized -Wunknown-pragmas -Wunused-function -Wunused-label -Wunused-value -Wunused-variable -Wvolatile-register-var")
...
...
lib/projects/nemodep/cbar.cc
View file @
c8390324
...
...
@@ -8,18 +8,23 @@
// 13388 Marseille cedex 13 France
// CNRS U.M.R 6110
// ============================================================================
#include
"csnaptools.h"
#include
<iostream>
#include
<cmath>
#include
<sstream>
#include
"cbar.h"
#include
"uns.h"
#include
"csnaptools.h"
using
namespace
uns_proj
;
using
namespace
jclut
;
using
namespace
std
;
#define PI 3.141592653589793238462643
// ----------------------------------------------------------------------------
// contructor
CBar
::
CBar
()
{
}
CBar
::
CBar
(
const
int
_nbody
,
float
*
_pos
,
float
*
_vel
,
float
*
_mass
,
float
*
_rho
,
float
*
_hsml
,
int
*
_id
)
{
// link arguments
...
...
@@ -50,7 +55,7 @@ float CBar::computeAngle(const float dmin, const float dmax, const bool mvcod)
double
cod
[
6
]
=
{
0.
,
0.
,
0.
,
0.
,
0.
,
0.
};
if
(
mvcod
)
CSnaptools
::
moveToCod
<
float
>
(
nbody
,
&
pos
[
0
],
&
vel
[
0
],
&
mass
[
0
],
rho
,
cod
,
false
);
float
alpha
=
0.0
;
float
beta
=
0.0
;
float
minrho
=
log
(
rho
[
vec_rho
.
at
(
0
).
index
]);
...
...
@@ -160,11 +165,12 @@ void CBar::rotate(const float theta)
// ----------------------------------------------------------------------------
// save
void
CBar
::
save
(
std
::
string
out
,
const
float
timu
,
const
bool
mvcod
)
{
{
// shift to COD
double
cod
[
6
]
=
{
0.
,
0.
,
0.
,
0.
,
0.
,
0.
};
if
(
mvcod
)
CSnaptools
::
moveToCod
<
float
>
(
nbody
,
&
pos
[
0
],
&
vel
[
0
],
&
mass
[
0
],
rho
,
cod
,
true
);
// save data
uns
::
CunsOut
*
unsout
=
new
uns
::
CunsOut
(
out
,
"nemo"
,
false
);
unsout
->
snapshot
->
setData
(
"time"
,
timu
);
...
...
lib/projects/nemodep/cbar.h
View file @
c8390324
...
...
@@ -12,12 +12,15 @@
/*
@author Jean-Charles Lambert <Jean-Charles.Lambert@oamp.fr>
*/
#include
"cfalcon.h"
#include
<vector>
#ifndef CBAR_H
#define CBAR_H
using
namespace
jclut
;
#include
<string>
#include
"cfalcon.h"
#include
<cassert>
#include
<vector>
#include
"csnaptools.h"
namespace
uns_proj
{
class
CBar
;
//------------------------------------------------------------------------------
...
...
@@ -37,6 +40,7 @@ namespace uns_proj {
class
CBar
{
public:
CBar
();
CBar
(
const
int
_nbody
,
float
*
_pos
,
float
*
_vel
,
float
*
mass
,
float
*
_rho
,
float
*
_hsml
,
int
*
_id
);
~
CBar
();
...
...
@@ -51,7 +55,7 @@ namespace uns_proj {
int
nbody
;
float
*
pos
,
*
vel
,
*
mass
,
*
rho
,
*
hsml
;
int
*
id
;
CDensity
*
density
;
jclut
::
CDensity
*
density
;
int
data_histo
[
100
];
// store #particles per percentage
std
::
vector
<
CVecRho
>
vec_rho
;
...
...
lib/projects/nemodep/crectify.cc
View file @
c8390324
...
...
@@ -316,7 +316,8 @@ bool CRectify::snapTransform(const int nbody,const float time,
std
::
cerr
<<
"
\n
Requested rect file["
<<
rect_file
<<
"] does not exist, abort
\n\n
"
;
std
::
exit
(
1
);
}
if
(
status
)
{;}
// remove compiler warning
float
data
[
15
];
ok
=
CSnaptools
::
getTimeDataFile
<
float
>
(
rect_file
,
time
,
15
,
data
);
...
...
lib/projects/nemodep/crectify.h
View file @
c8390324
...
...
@@ -94,6 +94,7 @@ public:
std
::
string
_cod_file
=
""
,
const
float
_radius
=
50.0
,
const
float
_dmin
=
0.0
,
const
float
_dmax
=
100.0
)
{
if
(
n2
&&
n3
&&
n4
)
{;}
// remove compiler warning
assert
(
n5
==
16
);
only_eigen_values
=
true
;
// !!!
...
...
lib/utils/csnaptools.cc
View file @
c8390324
...
...
@@ -52,7 +52,7 @@ template <class T> bool CSnaptools::getTimeDataFile(std::string input_file,cons
{
bool
ok
=
false
;
std
::
ifstream
fd
;
// file descriptor
if
(
verbose
)
{;}
fd
.
open
(
input_file
.
c_str
(),
std
::
ios
::
in
);
// open file
if
(
fd
.
is_open
())
{
...
...
@@ -91,7 +91,7 @@ std::string CSnaptools::fixFortran(const char * _ff, const bool lower)
{
static
char
buff
[
200
],
*
p
;
memset
(
buff
,
'\0'
,
200
);
if
(
lower
)
{;}
//std::cerr << "Fortran string ["<<_ff<<"]\n";
p
=
(
char
*
)
strchr
(
_ff
,
'\\'
);
...
...
@@ -127,7 +127,7 @@ std::string CSnaptools::fixFortran(const char * _ff, const int len, const bool l
buff
[
len
]
=
'\0'
;
std
::
string
str
=
buff
;
delete
[]
buff
;
if
(
lower
)
{;}
std
::
cerr
<<
"fix_fortran =["
<<
str
<<
"]
\n
"
;
size_t
found
;
...
...
@@ -459,6 +459,7 @@ extern "C" {
std
::
string
filename
=
jclut
::
CSnaptools
::
fixFortran
(
codfile
,
lenstring
);
double
cod
[
6
];
bool
is_codfile
=
false
;
if
(
mass
)
{;}
jclut
::
CSnaptools
::
isFileExist
(
filename
,
true
);
is_codfile
=
jclut
::
CSnaptools
::
getTimeDataFile
<
double
>
(
filename
,(
double
)(
*
time
),
6
,
cod
,
0.001
);
if
(
!
is_codfile
)
{
...
...
lib/utils/initcond_parms.cc
View file @
c8390324
...
...
@@ -78,7 +78,8 @@ bool get_initcond_potex_(const char * filename, const char * tag,
{
bool
status
;
float
dataf
;
char
datas
[
200
];
//
char
datas
[
200
];
//
if
(
l3
||
l4
)
{;}
status
=
get_initcond_param_
(
filename
,
tag
,
&
dataf
,
datas
,
l1
,
l2
,
200
);
if
(
status
)
{
// tag is valid
std
::
string
data
(
datas
);
...
...
src/fits2uns.cc
View file @
c8390324
...
...
@@ -40,7 +40,7 @@ const char * defv[] = { // use `::'string because of 'using namespace std'
"zmin=
\n
#z plane min"
,
"zmax=
\n
#z plane max"
,
"verbose=f
\n
verbose mode"
,
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
NULL
};
const
char
*
usage
=
"Simple converter fits to uns compatible output format"
;
...
...
src/glindex2nemo.cc
View file @
c8390324
...
...
@@ -34,7 +34,7 @@ const char * defv[] = { // use `::'string because of 'using namespace std'
"index=???
\n
glnemo2 indexes input file "
,
"select=???
\n
component selected (disk,stars,halo,gas,range)"
,
"time=all
\n
selected time"
,
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
NULL
};
const
char
*
usage
=
"Save in NEMO format a glnemo indexes list input file"
;
...
...
@@ -137,6 +137,7 @@ void nemoOut(char * select,uns::CunsIn * uns, int nbody,std::string outnemo,floa
CTimer
timing
,
ttot
;
// clear vectors
selvec
.
clear
();
if
(
select
)
{;}
pvec
.
clear
();
// read data
uns
->
snapshot
->
getData
(
"time"
,
&
timex
);
...
...
src/nemodep/uns_2dplot.cc
View file @
c8390324
...
...
@@ -58,7 +58,7 @@ const char * defv[] = {
"gp=5.
\n
gaussian parameter"
,
"threads=1
\n
#threads used"
,
"verbose=f
\n
verbose on/off"
,
"VERSION=2.O
\n
compiled on <"
__DATE__
"> JCL "
,
"VERSION=2.O
\n
compiled on <"
__DATE__
"> JCL "
,
NULL
,
};
const
char
*
usage
=
"2D Plot of a UNS file, y=f(x) and/or z=f(x) and/or y=f(z)"
;
...
...
@@ -90,6 +90,7 @@ int main(int argc, char ** argv )
std
::
string
sitf
[]
=
{
"linear"
,
"log"
,
"square"
};
bool
first
=
true
;
float
range
[
3
][
2
];
if
(
argc
)
{;}
// start NEMO
initparam
(
const_cast
<
char
**>
(
argv
),
const_cast
<
char
**>
(
defv
));
...
...
src/nemodep/uns_addgravity.cc
View file @
c8390324
...
...
@@ -41,7 +41,7 @@ const char * defv[] = { // use `::'string because of 'using namespace std'
"first=f
\n
add a trailing numbering to the first output file"
,
"offset=0.01
\n
+/- time offset"
,
"verbose=f
\n
verbose mode "
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
NULL
};
const
char
*
usage
=
"Add gravity to an UNS file, the output will be in NEMO format"
;
...
...
src/nemodep/uns_addgravity2.cc
View file @
c8390324
...
...
@@ -41,7 +41,7 @@ const char * defv[] = { // use `::'string because of 'using namespace std'
"first=f
\n
add a trailing numbering to the first output file"
,
"offset=0.01
\n
+/- time offset"
,
"verbose=f
\n
verbose mode "
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
NULL
};
const
char
*
usage
=
"Add gravity to an UNS file, the output will be in NEMO format"
;
...
...
src/nemodep/uns_barangle.cc
View file @
c8390324
...
...
@@ -17,13 +17,14 @@
#include
<cstdio>
#include
<iomanip>
#include
<vector>
#include
<nemo.h>
#include
"uns.h"
#include
<nemo.h>
#include
"csnaptools.h"
//
#include
"cfalcon.h"
//
#include "csnaptools.h"
#include
"cbar.h"
using
namespace
std
;
// prevent writing statment like 'std::cerr'
using
namespace
jclut
;
using
namespace
uns_proj
;
////
using namespace jclut;
//
using namespace uns_proj;
// NEMO parameters
const
char
*
defv
[]
=
{
// use `::'string because of 'using namespace std'
...
...
@@ -39,7 +40,7 @@ const char * defv[] = { // use `::'string because of 'using namespace std'
"mvcod=t
\n
move to COD
\n
"
,
"outnemo=
\n
nemo output file "
,
"verbose=f
\n
verbose mode "
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
NULL
};
const
char
*
usage
=
"Detect galaxy rotation angle"
;
...
...
@@ -136,15 +137,15 @@ int main(int argc, char ** argv )
ok
=
uns
->
snapshot
->
getData
(
select_c
,
"hsml"
,
&
nb
,
&
hsml
);
ok
=
uns
->
snapshot
->
getData
(
select_c
,
"id"
,
&
nb
,
&
id
);
CBar
*
bar
=
new
CBar
(
nbody
,
pos
,
vel
,
mass
,
rho
,
hsml
,
id
);
uns_proj
::
CBar
*
bar
=
new
uns_proj
::
CBar
(
nbody
,
pos
,
vel
,
mass
,
rho
,
hsml
,
id
);
#if 1
float
phi
;
if
(
dmin
<
0
||
dmax
<
0
)
phi
=
bar
->
computeAngle
(
mvcod
);
else
phi
=
bar
->
computeAngle
(
dmin
/
100.
,
dmax
/
100.
,
mvcod
);
//bar->saveAllRho(outname);
std
::
cerr
<<
"range ["
<<
dmin
<<
":"
<<
dmax
<<
"] Phi="
<<
phi
<<
" radian, "
<<
phi
*
180
/
acos
(
-
1.
)
<<
" degree
\n
"
;
...
...
@@ -189,7 +190,6 @@ int main(int argc, char ** argv )
#endif
// garbage collecting
delete
bar
;
}
}
anglefile
.
close
();
...
...
src/nemodep/uns_barangle2.cc
View file @
c8390324
...
...
@@ -32,7 +32,7 @@ const char * defv[] = { // use `::'string because of 'using namespace std'
"select=???
\n
component selected (disk,stars,halo,gas,range,all)"
,
"times=all
\n
selected time "
,
"verbose=f
\n
verbose mode "
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
NULL
};
const
char
*
usage
=
"Detect galaxy rotation angle"
;
...
...
src/nemodep/uns_density.cc
View file @
c8390324
...
...
@@ -37,7 +37,7 @@ const char * defv[] = { // use `::'string because of 'using namespace std'
"first=f
\n
add a trailing numbering to the first output file "
,
"offset=0.01
\n
+/- time offset "
,
"verbose=f
\n
verbose mode "
,
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
NULL
};
const
char
*
usage
=
"estimate mass density based on distance to Kth neighbour, add distance to the kth neighbours"
;
...
...
src/nemodep/uns_ellipse.cc
View file @
c8390324
...
...
@@ -36,7 +36,7 @@ const char * defv[] = { // use `::'string because of 'using namespace std'
"out=
\n
output file "
,
"times=all
\n
selected time "
,
"verbose=f
\n
verbose mode "
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
NULL
};
const
char
*
usage
=
"Fit ellipse on simulation data"
;
...
...
src/nemodep/uns_rectff.cc
View file @
c8390324
...
...
@@ -36,7 +36,7 @@ const char * defv[] = {
"times=all
\n
selected time"
,
"first=f
\n
add a trailing numbering to the first output file"
,
"verbose=f
\n
verbose on/off"
,
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
NULL
,
};
const
char
*
usage
=
"Rectify an UNS snapshot from a rectify file"
;
...
...
src/nemodep/uns_rectify.cc
View file @
c8390324
...
...
@@ -23,7 +23,7 @@
// Include file
#include
"uns.h"
#include
"crectify.h"
#include
"csnaptools.h"
//
#include "csnaptools.h"
using
namespace
jclut
;
// ------------------------------------------------------------
...
...
@@ -41,12 +41,12 @@ const char * defv[] = {
"times=all
\n
selected time"
,
"first=f
\n
add a trailing numbering to the first output file"
,
"verbose=f
\n
verbose on/off"
,
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
"VERSION=1.0
\n
compiled on <"
__DATE__
"> JCL "
,
NULL
,
};
const
char
*
usage
=
"Rectify an UNS snapshot"
;
using
namespace
uns_proj
;
//
using namespace uns_proj;
using
namespace
std
;
//------------------------------------------------------------------------------
// M A I N
...
...
@@ -86,7 +86,7 @@ int main(int argc, char ** argv )
bool
first_out
=
true
;
// Rectify object
CRectify
*
crectify
=
new
CRectify
();
uns_proj
::
CRectify
*
crectify
=
new
uns_proj
::
CRectify
();
// -----------------------------------------------
// instantiate a new UNS input object (for reading)
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment