Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Tobias WEBER
Takin MnSi module
Commits
1e11a441
Verified
Commit
1e11a441
authored
Jun 26, 2020
by
Tobias WEBER
Browse files
some cleanups
parent
0e2abf6e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
1e11a441
...
...
@@ -6,6 +6,8 @@
#
CXX
=
g++
STRIP
=
strip
#STRIP = echo -e "Not stripping"
STD
=
-std
=
c++17
OPT
=
-O2
-march
=
native
DEFS
=
-DDEF_SKX_ORDER
=
7
-DDEF_HELI_ORDER
=
7
\
...
...
@@ -24,8 +26,8 @@ LIBDEFS = -fPIC
all
:
prepare lib/skxmod.so lib/skxmod_grid.so
\
bin/genskx bin/merge bin/convert bin/dump
\
bin/
heliphase bin/skx_gs
\
bin/
drawskx bin/dyn bin/weight
#
bin/weight_sum
bin/
drawskx bin/dyn bin/weight
\
#
bin/
heliphase bin/skx_gs
bin/weight_sum
clean
:
find
.
-name
"*.o"
-exec
rm
-fv
{}
\;
...
...
@@ -45,12 +47,12 @@ lib/skxmod.so: src/core/skx.o src/core/fp.o src/core/heli.o src/core/magsys.o sr
ext/takin/tools/monteconvo/sqwbase.o ext/tlibs2/libs/log.o
@
echo
"Linking Takin module
$@
..."
$(CXX)
$(STD)
$(OPT)
$(DEFS)
$(LIBDIRS)
$(LIBDEFS)
-shared
-o
$@
$+
-llapacke
strip
$@
$(STRIP)
$@
lib/skxmod_grid.so
:
src/takin/takin_grid.o ext/takin/tools/monteconvo/sqwbase.o ext/tlibs2/libs/log.o
@
echo
"Linking Takin grid module
$@
..."
$(CXX)
$(STD)
$(OPT)
$(DEFS)
$(LIBDIRS)
$(LIBDEFS)
-shared
-o
$@
$+
-lboost_system
-lQt5Core
strip
$@
$(STRIP)
$@
# -----------------------------------------------------------------------------
...
...
@@ -59,35 +61,35 @@ lib/skxmod_grid.so: src/takin/takin_grid.o ext/takin/tools/monteconvo/sqwbase.o
# -----------------------------------------------------------------------------
bin/genskx
:
src/takin/genskx.o src/core/skx.o src/core/magsys.o ext/tlibs2/libs/log.o
$(CXX)
$(STD)
$(OPT)
$(DEFS)
$(LIBDIRS)
$(LIBDEFS)
-o
$@
$+
-lboost_filesystem
-llapacke
-lpthread
strip
$@
$(STRIP)
$@
bin/merge
:
src/takin/merge.o
$(CXX)
$(STD)
$(OPT)
$(DEFS)
$(LIBDIRS)
-o
$@
$+
-lboost_system
strip
$@
$(STRIP)
$@
bin/convert
:
src/takin/convert.o
$(CXX)
$(STD)
$(OPT)
$(DEFS)
$(LIBDIRS)
-o
$@
$+
strip
$@
$(STRIP)
$@
bin/dump
:
src/takin/dump.o
$(CXX)
$(STD)
$(OPT)
$(DEFS)
$(LIBDIRS)
-o
$@
$+
strip
$@
$(STRIP)
$@
bin/drawskx
:
src/calc/drawskx.o
$(CXX)
$(STD)
$(OPT)
$(DEFS)
$(LIBDIRS)
-o
$@
$+
strip
$@
$(STRIP)
$@
bin/dyn
:
src/calc/dyn.o src/core/skx.o src/core/fp.o src/core/heli.o src/core/magsys.o ext/tlibs2/libs/log.o
$(CXX)
$(STD)
$(OPT)
$(DEFS)
$(LIBDIRS)
$(LIBDEFS)
-o
$@
$+
-llapacke
-lpthread
strip
$@
$(STRIP)
$@
bin/weight
:
src/calc/weight.o src/core/skx.o src/core/fp.o src/core/heli.o src/core/magsys.o ext/tlibs2/libs/log.o
$(CXX)
$(STD)
$(OPT)
$(DEFS)
$(LIBDIRS)
$(LIBDEFS)
-o
$@
$+
-llapacke
-lpthread
strip
$@
$(STRIP)
$@
bin/weight_sum
:
src/calc/weight_sum.o src/core/skx.o src/core/fp.o src/core/heli.o src/core/magsys.o ext/tlibs2/libs/log.o
$(CXX)
$(STD)
$(OPT)
$(DEFS)
$(LIBDIRS)
$(LIBDEFS)
-o
$@
$+
-llapacke
-lpthread
strip
$@
$(STRIP)
$@
# -----------------------------------------------------------------------------
...
...
@@ -96,11 +98,11 @@ bin/weight_sum: src/calc/weight_sum.o src/core/skx.o src/core/fp.o src/core/heli
# -----------------------------------------------------------------------------
bin/heliphase
:
src/calc/heliphase.cpp src/core/heli.cpp src/core/magsys.cpp ext/tlibs2/libs/log.cpp
$(CXX)
$(STD)
$(OPT)
$(INCS)
-DDEF_HELI_ORDER
=
4
-DNO_REDEFINITIONS
-D__HACK_FULL_INST__
$(LIBDIRS)
-o
$@
$+
-lMinuit2
-llapacke
-lgomp
strip
$@
$(STRIP)
$@
bin/skx_gs
:
src/calc/skx_gs.cpp src/core/skx.cpp src/core/heli.cpp src/core/magsys.cpp ext/tlibs2/libs/log.cpp
$(CXX)
$(STD)
$(OPT)
$(INCS)
-DDEF_SKX_ORDER
=
7
-DDEF_HELI_ORDER
=
7
-DNO_REDEFINITIONS
-D__HACK_FULL_INST__
$(LIBDIRS)
-o
$@
$+
-lMinuit2
-llapacke
-lgomp
strip
$@
$(STRIP)
$@
# -----------------------------------------------------------------------------
...
...
src/calc/weight_sum.cpp
View file @
1e11a441
/**
* Calculates
the
integrated weights/energies
for the reseda experiment
* Calculates integrated weights/energies
* @author Tobias Weber <tweber@ill.fr>
* @date jun-20
* @license GPLv2 (see 'LICENSE' file)
...
...
@@ -43,7 +43,7 @@ void calc_disp(
skx
.
SetFourier
(
fourier_skx
);
skx
.
SetProjNeutron
(
iProj
!=
0
);
skx
.
SetT
(
-
1000.
);
skx
.
SetB
(
25.
);
// BC2 = 40.3425
skx
.
SetB
(
25.
);
skx
.
GenFullFourier
();
skx
.
SetFilterZeroWeight
(
1
);
skx
.
SetWeightEps
(
1e-6
);
...
...
@@ -52,8 +52,8 @@ void calc_disp(
skx
.
SetG
(
Gx
,
Gy
,
Gz
);
t_real
Erange
=
0.1
;
t_real
angle_begin
=
-
135
/
180.
*
tl2
::
pi
<
t_real
>
;
t_real
angle_end
=
135
/
180.
*
tl2
::
pi
<
t_real
>
;
t_real
angle_begin
=
(
-
135
+
90
)
/
180.
*
tl2
::
pi
<
t_real
>
;
t_real
angle_end
=
(
135
+
90
)
/
180.
*
tl2
::
pi
<
t_real
>
;
t_real
angle_delta
=
2
*
tl2
::
pi
<
t_real
>/
100.
;
auto
histWeights
=
hist
::
make_histogram
(
hist
::
axis
::
regular
<
t_real
>
(
E_BINS
,
-
Erange
,
Erange
,
"E"
));
...
...
@@ -77,7 +77,7 @@ void calc_disp(
for
(
const
auto
&
val
:
boost
::
histogram
::
indexed
(
histWeights
))
{
t_real
E
=
val
.
bin
().
lower
()
+
0.5
*
(
val
.
bin
().
upper
()
-
val
.
bin
().
lower
());
t_real
w
=
*
val
;
t_real
w
=
*
val
/
t_real
{
E_BINS
}
;
std
::
cout
<<
std
::
left
<<
std
::
setw
(
15
)
<<
E
<<
" "
<<
std
::
left
<<
std
::
setw
(
15
)
<<
w
<<
"
\n
"
;
}
...
...
@@ -88,14 +88,11 @@ int main()
{
std
::
cout
.
precision
(
5
);
// kh = 0.02829 rlu
t_real
Gx
=
1.
,
Gy
=
0.
,
Gz
=
0.
;
t_real
Gx
=
1.
,
Gy
=
1.
,
Gz
=
0.
;
t_real
Bx
=
0.
,
By
=
0.
,
Bz
=
1.
;
t_real
q
=
0.0123
;
int
proj
=
1
;
// setup used at reseda
calc_disp
(
Gx
,
Gy
,
Gz
,
Bx
,
By
,
Bz
,
1
,
0
,
0
,
q
,
proj
);
return
0
;
}
Write
Preview
Markdown
is supported
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