STEM/TEM/Coherent CBED image simulations
QSTEM is GPL software.
Homepage here: http://qstem.org
Build instructions here: http://qstem.org/?page_id=14
STEM/TEM/Coherent CBED image simulations
License: GNU General Public License v3.0
STEM/TEM/Coherent CBED image simulations
QSTEM is GPL software.
Homepage here: http://qstem.org
Build instructions here: http://qstem.org/?page_id=14
Could QSTEM somehow be integrated with ASE ( https://wiki.fysik.dtu.dk/ase/ ?). Which is basically a framework for interfacing with various atomic simulation packages.
I'm thinking this could be useful for relaxing some structure through DFT, then automatically running QSTEM with the output from the DFT calculations.
Hi,
I'd like to work with the c++_refactor branch but the latest version is not compiling. It seems to have something to do with the FFTWAllocator class missing some operator != definition.
Here is my build output: https://drive.google.com/file/d/0B4lamnoJuIMaU3hGLXhzcEMzZzQ/edit?usp=sharing
Thanks for any help on this!
These files are used in the code to calculate alternative structure factors but I can't find them in the code. Is there any chance you could upload them?
Thanks in advance!
This has been broken since OpenMP introduced in 2010.
Either Python somehow, or perhaps Boost's program options:
http://www.boost.org/doc/libs/1_53_0/doc/html/program_options.html
Stemlib.cpp :: make3Dslices() has some variable confusion
Function has (input) FILE fileName as an argument and then declares (output) FILE filename. Needless to say this causes confusion and at the bottom of the function the total projected potential is written to the (input) file, overwriting the original .cfg file used to run stem3.exe.
FIX: Rename variables to fileIn and fileOut respectively. Correct sprintf of projected potential at bottom of function.
Working code fragment:
sprintf(fileOut,"%s/%s%d.img",muls->folder,muls->fileBase,iz);
sprintf(fileOut,"%s\\%s%d.img",muls->folder,muls->fileBase,iz);
if (muls->printLevel >= 3)
printf( "Saving (complex) potential layer %d to file %s (r: %g..%g)\n", iz, fileOut, ddx, ddy );
imageIO->SetThickness(muls->sliceThickness);
sprintf(buf,"Projected Potential (slice %d)",iz);
imageIO->SetComment(buf);
imageIO->WriteComplexImage( (void **)muls->trans[iz], fileOut );
} // loop through all slices
} /* end of if savePotential ... */
if (muls->saveTotalPotential) {
if (tempPot == NULL) tempPot = float2D(muls->potNx,muls->potNy,"total projected potential");
for (ix=0;ix<muls->potNx;ix++) for (iy=0;iy<muls->potNy;iy++) {
tempPot[ix][iy] = 0;
for (iz=0;iz<nlayer;iz++) tempPot[ix][iy] += muls->trans[iz][ix][iy][0];
}
for (ddx=tempPot[0][0],ddy = potVal,ix=0;ix<muls->potNy*muls->potNx;potVal = tempPot[0][++ix]) {
if (ddy<potVal) ddy = potVal;
if (ddx>potVal) ddx = potVal;
}
sprintf(fileOut,"%s/%sProj.img",muls->folder,muls->fileBase);
// RAM DEBUG : this is overwriting the original config file, why? is filename something else?
// RAM RESOLVED: both fileName and filename were defined above...
sprintf( fileOut, "%s\\%sProj.img", muls->folder, muls->fileBase );
if (muls->printLevel >= 2)
printf( "Saving total projected potential to file %s (r: %g..%g)\n", fileOut, ddx, ddy );
imageIO->SetThickness(nlayer*muls->sliceThickness);
sprintf(buf,"Projected Potential (sum of %d slices)",muls->slices);
imageIO->SetComment(buf);
imageIO->WriteRealImage( (void **)tempPot, fileOut );
}
Using double precision by setting FLOATING_PRECISION to something other than 1 in libs/stemtypes_fftw3.h gives the following errors when compiling:
[ 31%] Building CXX object libs/CMakeFiles/qstem_libs.dir/data_containers.cpp.o
QSTEM/libs/data_containers.cpp: In constructor ‘WAVEFUNC::WAVEFUNC(int, int, float, float)’:
QSTEM/libs/data_containers.cpp:41: error: cannot convert ‘double**’ to ‘float**’ in assignment
QSTEM/libs/data_containers.cpp:42: error: cannot convert ‘double**’ to ‘float**’ in assignment
QSTEM/libs/data_containers.cpp:55: error: ‘fftMeasureFlag’ was not declared in this scope
QSTEM/libs/data_containers.cpp: In constructor ‘Detector::Detector(int, int, float, float)’:
QSTEM/libs/data_containers.cpp:124: error: cannot convert ‘double**’ to ‘float**’ in assignment
QSTEM/libs/data_containers.cpp:125: error: cannot convert ‘double**’ to ‘float**’ in assignment
model corrupted with save level = 3; showing mulswav and potential. Need to reproduce.
In line 55 of convert2cfg.m it is asumed that first 2 characters are alphabets of element symbol. VMD for some reason in its XYZ files leave first character as blank space ' '. Hence it breaks on XYZ files created from VMD, which quite popular open source alternative.
I made it work by simply checking for white spaces in beginning:
Currently:
for k1=1:natom
% data(k1,:)=fscanf(fid,'%2c %f32 %f32 %f32',1);
buf = fgets(fid);
type(k1,1:2) = buf(1:2);
coords(k1,1:3)=sscanf(buf(3:end),' %f %f %f');
end
modified to:
for k1=1:natom
% data(k1,:)=fscanf(fid,'%2c %f32 %f32 %f32',1);
buf = fgets(fid);
space_counter=1;
while buf(space_counter)==' '
space_counter=space_counter+1;
end
type(k1,1:2) = buf(space_counter:space_counter + 1);
coords(k1,1:3)=sscanf(buf(space_counter+2:end),' %f %f %f');
end
This way convert2cfg can handle arbitrary amount of white spaces before element symbol.
msarahan/QSTEM/C++ refactor:
Stem3.exe crashes on runtime with message, “Assertion failed: px != 0, file E:\lib\boost_1_55_0\boost/smart_ptr/shared_ptr.hpp, line 653”
Debugged finds const boost::shared_ptrQSTEM::IConfigReader * is the offender. CConfigReaderFactory constructor does not initialize a pointer. This may cause memory leak issues? Browsing the various classes that sub-type shared_ptr they do not seem to do pointer initialization. Unsure on how to proceed to fix.
HDF5, perhaps?
Purpose: not only store some few parameters, but also document all settings that went into a simulation. Allow transparent identification of parameters. Enable compression, and make file management simpler.
In VS2013 with msarahan/QSTEM/C++ refactor:
By default QSTEM is a dynamic library, but project expects a static one. In Config Props -> General -> Config Type change to static library (.lib).
Default build location for QSTEM is X:\GitHub\QSTEM\bin\Debug but projects expect it to be in X:\GitHub\QSTEM\libs\Debug. Change Config Props -> General -> Output Directory.
Many projects (STEM3, and test scripts) trying to link directly to hdf5.dll. In general linking to dll will not work. Change to library, in Config Props -> Linker -> Input -> Additional Deps -> Edit and change *\bin\hdf5.dll to *\lib\hdf5.lib
Hi all,
I'm trying to compile stem3 in Linux (manjaro). cmake
looks to run pretty well, but I have a error by running make
:
/home/USER/QSTEM-master/stem3/stem3.cpp:2762:34: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
2762 | while (readparam("sequence: ",buf,0)) {
| ^~~~~~~~~~~~
make[2]: *** [stem3/CMakeFiles/stem3.dir/build.make:90: stem3/CMakeFiles/stem3.dir/stem3.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:223: stem3/CMakeFiles/stem3.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
Any advice to solve it?
Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.