Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VR-demos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nomad-lab
VR-demos
Commits
ff82d8ec
Commit
ff82d8ec
authored
Nov 02, 2018
by
Ruben Jesus Garcia Hernandez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add platform check in atoms.cpp
Add archive-NomadVR link and readme in web backend.
parent
003a9fd9
Pipeline
#38782
failed with stages
in 48 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
120 additions
and
0 deletions
+120
-0
NOMADVRLib/atoms.cpp
NOMADVRLib/atoms.cpp
+4
-0
webserver/Readme.md
webserver/Readme.md
+38
-0
webserver/cgi-bin/NOMAD/materialAnalytics
webserver/cgi-bin/NOMAD/materialAnalytics
+78
-0
No files found.
NOMADVRLib/atoms.cpp
View file @
ff82d8ec
...
...
@@ -279,6 +279,7 @@ int readAtomsXYZ(const char *const file, int **numatoms, int *timesteps, float *
{
const
char
*
myfile
=
nullptr
;
const
char
*
webdownload
=
"material.xyz"
;
#if !defined(OCULUSMOBILE) && !defined(__ANDROID__)
//add http support
if
(
!
strncmp
(
file
,
"http:"
,
5
)
||
!
strncmp
(
file
,
"https:"
,
6
))
{
char
cmd
[
2048
];
...
...
@@ -294,6 +295,9 @@ int readAtomsXYZ(const char *const file, int **numatoms, int *timesteps, float *
}
else
{
myfile
=
file
;
}
#else
myfile
=
file
;
#endif
int
mynumatoms
;
std
::
vector
<
float
*>
mypos
;
std
::
vector
<
int
>
mynum
;
...
...
webserver/Readme.md
0 → 100644
View file @
ff82d8ec
This directory contains the support files for the CGI backend to obtain
NOMAD VR files from the Encyclopedia and Archive.
Directories:
htdocs: Example files related to NOMAD VR
cgi-bin: CGI-backend
Files:
Readme.md: This document
pass: Information on the NOMAD user under which the data is accessed.
cgi-bin/NOMAD/material:
Entry point for NOMAD Encyclopedia.
See also the VR tutorial at
https://www.nomad-coe.eu/the-project/graphics/vrtutorial6
In the Encyclopedia webpage for a given material:
https://encyclopedia.nomad-coe.eu/gui/#/material/
<mat
id
>
the link "Virtual Reality files" -> "Get VR file" points to
http://nomad.srv.lrz.de/cgi-bin/NOMAD/material?
<mat_id>
This entry point creates a zip file with a the crystal structure of mat_id.
cgi-bin/NOMAD/materialAnalytics:
Entry point for NOMAD Archive / Analytics.
See also the VR tutorial at
https://www.nomad-coe.eu/the-project/graphics/vrtutorial5
In the analytics toolkit tutorial webpage, the tutorial
"Querying and visualizing the content of the NOMAD Archive" at
https://analytics-toolkit.nomad-coe.eu/notebook-edit/data/shared/tutorialsNew/nomad-query/nomad-query.bkr
The results of the queries have the form:
nmd://
<string>
with the link "Virtual Reality" pointing to
http://nomad.srv.lrz.de/cgi-bin/NOMAD/materialAnalytics?
<string>
This entry point creates a zip file with the structure or molecular dynamics
for
<string>
.
\ No newline at end of file
webserver/cgi-bin/NOMAD/materialAnalytics
0 → 100644
View file @
ff82d8ec
#!/bin/bash
export DATASOURCE=https://analytics-toolkit.nomad-coe.eu/api/resolve
if [[ "$QUERY_STRING" = "" ]]
then
#echo Location: /NOMAD/
echo Location:https://www.nomad-coe.eu/the-project/graphics/VR-prototype
echo ''
else
#rgh: text/plain works in pc but android chrome saves it as .txt, removing the extension
# export TOKEN=`cat t.b64`
export RAND=$RANDOM
#rgh: before end of september 2017, use /var/tmp, after, use /tmp (apache update)
cd /tmp
/usr/bin/mkdir $RAND
cd $RAND
export MAT=`echo $QUERY_STRING|cut -f 2 -d/`
mkdir $MAT
cd $MAT
#Some systems have atomic positions in section_system:0
#Others don't; they start at section_system:1
#Better to download all and test this in NOMADVR.
# wget --no-check-certificate https://analytics-toolkit.nomad-coe.eu/api/resolve/$QUERY_STRING/section_run/0c/section_system/0c?format=recursiveJson -O material.json
if [[ $QUERY_STRING = *"section_run"* ]]
then
QS=$QUERY_STRING
else
QS=$QUERY_STRING/section_run/0c
fi
wget --no-check-certificate $DATASOURCE/$QS?format=recursiveJson -O \
materialtmp.json
if [[ $QUERY_STRING = *"section_run"* ]]
then
echo "{ "section_system" : [" >>material.json
cat materialtmp.json >> material.json
echo "] }" >> material.json
rm materialtmp.json
else
mv materialtmp.json material.json
fi
export FORMULA=`grep system_composition material.json|head -n 1 |cut -f 4 -d\"`
if [[ "$FORMULA" = "" ]]
then
echo "Content-type: text/html"
echo ''
echo "
<html><body>
"
echo "No system_composition found in json: no information to display in VR"
echo "
</body></html>
"
else
echo \# Material $QUERY_STRING >> $FORMULA.ncfg
echo background 0 0 0 >> $FORMULA.ncfg
echo atomscaling 0.5 >> $FORMULA.ncfg
echo analyticsjson material.json >> $FORMULA.ncfg
echo displaybonds >> $FORMULA.ncfg
echo displayunitcell >> $FORMULA.ncfg
echo showcontrollers >> $FORMULA.ncfg
cd ..
zip -r $MAT $MAT >/dev/null 2>
&
1
echo "Content-type: application/octet-stream"
echo "Content-disposition: attachment; filename=${QUERY_STRING}.zip"
echo ''
cat $MAT.zip
fi
cd ..
# \rm -r $RAND
fi
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