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
Scientific Software
Takin
mag-core
Commits
ce1a9b3b
Verified
Commit
ce1a9b3b
authored
Oct 22, 2020
by
Tobias WEBER
Browse files
continued with magnetic space group browser
parent
38976be3
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
ce1a9b3b
...
...
@@ -28,13 +28,10 @@
# External libraries
ext/**
plugins/**
!ext/.dir
!plugins/.dir
!plugins/qtas.py
data/**
# Temporary files
tmp/**
!tmp/.dir
build/**
tools/structfact/build/**
tools/cif2xml/build/**
...
...
CMakeLists.txt
View file @
ce1a9b3b
...
...
@@ -28,12 +28,9 @@ add_subdirectory(tools/scanbrowser)
if
(
NOT ONLY_BUILD_FINISHED
)
# tools in development
# setup tools
add_subdirectory
(
tools/setup
)
# magnetic structure factor browser
add_subdirectory
(
tools/magsgbrowser
)
endif
()
LICENSES
0 → 100644
View file @
ce1a9b3b
This diff is collapsed.
Click to expand it.
setup/setup_externals.sh
View file @
ce1a9b3b
#!/bin/bash
#
# downloads external libraries
for in20tools
# downloads external libraries
# @author Tobias Weber <tweber@ill.fr>
# @date 6-apr-18
# @license GPLv3, see 'LICENSE' file
...
...
@@ -19,11 +19,13 @@ UZIP=unzip
TLIBS
=
https://forge.frm2.tum.de/cgit/cgit.cgi/frm2/mira/tlibs.git/snapshot/tlibs-master.tar.bz2
QCP
=
https://www.qcustomplot.com/release/2.0.1/QCustomPlot-source.tar.gz
GEMMI
=
https://github.com/project-gemmi/gemmi/archive/master.zip
MAGDATA
=
https://stokes.byu.edu/iso/magnetic_data.txt
# local file names
TLIBS_LOCAL
=
${
TLIBS
##*[/\\]
}
QCP_LOCAL
=
${
QCP
##*[/\\]
}
GEMMI_LOCAL
=
${
GEMMI
##*[/\\]
}
MAGDATA_LOCAL
=
${
MAGDATA
##*[/\\]
}
# -----------------------------------------------------------------------------
...
...
@@ -80,10 +82,23 @@ function dl_gemmi()
mv
gemmi-master gemmi
}
function
dl_magdata
()
{
if
!
${
WGET
}
${
MAGDATA
}
then
echo
-e
"Error downloading magnetic space group data."
;
exit
-1
;
fi
mv
${
MAGDATA_LOCAL
}
magsg.dat
}
# -----------------------------------------------------------------------------
mkdir
-p
ext
mkdir
-pv
data
mkdir
-pv
ext
cd
ext
echo
-e
"
\n
--------------------------------------------------------------------------------"
...
...
@@ -102,6 +117,11 @@ echo -e "Installing external Gemmi library...\n"
dl_gemmi
echo
-e
"--------------------------------------------------------------------------------
\n
"
echo
-e
"
\n
--------------------------------------------------------------------------------"
echo
-e
"Downloading magnetic space group data...
\n
"
dl_magdata
echo
-e
"--------------------------------------------------------------------------------
\n
"
echo
-e
"
\n
--------------------------------------------------------------------------------"
echo
-e
"Removing temporary files...
\n
"
clean_files
...
...
tools/magsgbrowser/browser.cpp
View file @
ce1a9b3b
...
...
@@ -80,7 +80,7 @@ SgBrowserDlg::SgBrowserDlg(QWidget* pParent, QSettings *pSett)
void
SgBrowserDlg
::
SetupMagSpaceGroups
()
{
std
::
cerr
<<
"Loading magnetic space groups ... "
;
m_magsgs
.
Load
(
"magsg.info"
);
m_magsgs
.
Load
(
"
data/
magsg.info"
);
std
::
cerr
<<
"Done."
<<
std
::
endl
;
const
auto
*
pSgs
=
m_magsgs
.
GetSpacegroups
();
...
...
tools/setup/CMakeLists.txt
View file @
ce1a9b3b
...
...
@@ -12,11 +12,17 @@ add_definitions(-std=c++20)
include_directories
(
"
${
PROJECT_SOURCE_DIR
}
"
"../.."
)
message
(
"PROJECT_SOURCE_DIR:
${
PROJECT_SOURCE_DIR
}
."
)
message
(
"CMAKE_SOURCE_DIR:
${
CMAKE_SOURCE_DIR
}
."
)
message
(
"CMAKE_BINARY_DIR:
${
CMAKE_BINARY_DIR
}
."
)
# -----------------------------------------------------------------------------
# setup tool
add_executable
(
convmag
convmag.cpp
)
add_executable
(
setup
convmag
.cpp
)
target_link_libraries
(
setup
)
target_link_libraries
(
convmag
)
add_custom_command
(
TARGET setup POST_BUILD
COMMAND cd
${
CMAKE_SOURCE_DIR
}
&&
${
CMAKE_BINARY_DIR
}
/tools/setup/setup
MAIN_DEPENDENCY setup
)
# -----------------------------------------------------------------------------
tools/setup/convmag.cpp
View file @
ce1a9b3b
...
...
@@ -438,12 +438,10 @@ void convert_table(const char* pcInFile, const char* pcOutFile)
int
main
(
int
argc
,
char
**
argv
)
{
if
(
argc
<
3
)
{
std
::
cerr
<<
"Usage: "
<<
argv
[
0
]
<<
" <in.dat> <out.info>"
<<
std
::
endl
;
return
-
1
;
}
if
(
argc
>=
3
)
convert_table
(
argv
[
1
],
argv
[
2
]);
else
convert_table
(
"ext/magsg.dat"
,
"data/magsg.info"
);
convert_table
(
argv
[
1
],
argv
[
2
]);
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