tamaas/1c328ce7a31cci-fix-static-checks
ci-fix-static-checks vs master
Commit | Author | Details | Committed | ||||
---|---|---|---|---|---|---|---|
04c23013552d | Lucas Frérot | allow import of tamaas | Oct 26 2023 | ||||
cee303c36400 | Lucas Frérot | html as root of pages | Oct 26 2023 | ||||
903a42f41c46 | Lucas Frérot | within repository | Oct 26 2023 | ||||
41701c4b5e0e | Lucas Frérot | added public folder as artifact | Oct 26 2023 | ||||
ef17b380b1ce | Lucas Frérot | renamed build step | Oct 26 2023 | ||||
9c8231b4f143 | Lucas Frérot | renaming doc push job | Oct 26 2023 | ||||
4c74be160ed0 | Lucas Frérot | fixing pipeline | Oct 26 2023 | ||||
0f119a0aa07a | Lucas Frérot | pushing doc to gitlab pages | Oct 26 2023 | ||||
e16815234513 | Lucas Frérot | added build matrix | Oct 26 2023 | ||||
45fe7b6db00e | Lucas Frérot | added documentation ci build | Oct 26 2023 |
README
#+TITLE: Welcome to Tamaas, the Rough surface toolkit of LSMS
- Build
The build system uses SCons. In order to construct the library you should hit:
#+BEGIN_SRC scons #+END_SRC
And to speedup the process you can do:
#+BEGIN_SRC scons -j 6 #+END_SRC
In order to clean the build
#+BEGIN_SRC scons -c #+END_SRC
In order to compile in debug
#+BEGIN_SRC scons build_type=debug #+END_SRC
Indeed the default was
#+BEGIN_SRC scons build_type=release #+END_SRC
In order to make the compilation more verbose
#+BEGIN_SRC scons verbose=true #+END_SRC
You can customize a few compilation variables:
- =CXX= changes the compiler
- =CXXFLAGS= adds flags to the compilation process
For example:
- ~scons CXX=icpc~ compiles with the intel C++ compiler
- ~CXXFLAGS=-mavx2 scons~ adds the =-mavx2= flag (which enables some Intel instructions) to the compilation process
If the =CXX= variable is defined in your environment, =scons= will take it as a default compiler.
- Coding
- C++
All classes and functions in Tamaas live in the tamaas namespace. Here is an example main:
#+NAME: Example main #+BEGIN_SRC c++ using namespace tamaas; int main (int argc, char * argv[]) {
// Initializing tamaas initialize(); // Surface parameters const UInt grid_size = 1024; const UInt k0 = 4, k1 = 4, k2 = 32; const Real hurst = 0.8; const Real rms = 0.1; // Surface generator SurfaceGeneratorFilterFFT sg; sg.getGridSize() = grid_size; sg.getQ0() = k0; sg.getQ1() = k1; sg.getQ2() = k2; sg.getRMS() = rms; sg.getHurst() = hurst; sg.getRandomSeed() = 56; sg.Init(); Surface<Real> & surface = sg.buildSurface(); // BEM object BemPolonski bem(surface); bem.setEffectiveModulus(1.); // Solving equilibrium Real load = 0.01; bem.computeEquilibrium(1e-12, load); Surface<Real> & tractions = bem.getTractions(); Surface<Real> & displacements = bem.getDisplacements(); // Cleaning up tamaas finalize();
} #+END_SRC
- Python
Tamaas also has a python interface. Here is an example:
#+NAME: Python example #+BEGIN_SRC python import numpy as np import tamaas as tm
tm.initialize()
Surface generation
SG = tm.SurfaceGeneratorFilterFFT() SG.getGridSize().assign(512) SG.getHurst().assign(0.8) SG.getRMS().assign(1.); SG.getQ0().assign(4); SG.getQ1().assign(4); SG.getQ2().assign(32); SG.getRandomSeed().assign(156); SG.Init() surface = SG.buildSurface()
bem = tm.BemPolonski(surface) bem.setEffectiveModulus(1.)
load = 0.01 bem.computeEquilibrium(1e-12, load)
tractions = bem.getTractions() displacements = bem.getDisplacements()
tm.finalize() #+END_SRC
- Paralellism
Tamaas features shared-memory paralellism with OpenMP. The number of threads can be controlled via the =OMP_NUM_THREADS= environment variable or the =omp_set_num_thread()= function in the OpenMP API.