Giter Site home page Giter Site logo

Comments (1)

MousasGen avatar MousasGen commented on July 28, 2024

Installation steps:

My OS is Ubuntu 20.04 mounted on a virtual box for Windows 8.
For the lua fronted one,
1)
git clone https://github.com/victorliu/S4.git
2)
sudo apt-get install lua5.2
3)
sudo apt-get install liblua5.2-dev
4)
sudo apt-get install libfftw3-dev
5)
sudo apt-get install libsuitesparse-dev
6)
git clone https://github.com/xianyi/OpenBLAS.git
7)
cd OpenBLAS
8)
make
9)
cd ../S4
10)
make
Notes:

  • Either in step no. 8) or 10), you may get an error such
    /bin/sh: 1: gfortran: not found
    Sol.:
    sudo apt-get install gfortran
    For any similar error, just download the required package with “sudo apt-get install” or search with encountered error, so after installation of the required package return to the step you encountered the error at either 8) or 10
  • After finishing the 10 steps, make sure there are not any kind of error
    Hint: read carefully the outputs of each command

Tutorial steps:

Make sure your current directory is S4/
Check by “pwd” command, if not just “cd S4/”

cd build

./S4
Hint: make sure this message shows up 'No input file given, running in interactive mode', if so you installed the package correctly, if not please return to the past 10 steps and check again for any error (mostly missing package -> go, download and install)

S = S4.NewSimulation()

S:SetLattice({1,0}, {0,1})

S:SetNumG(100)

S:AddMaterial('Vacuum', {1,0})

S:AddMaterial('Silicon', {12, 0.01})

S:AddLayer('top', 0, 'Vacuum')

S:AddLayer('slab', 0.5, 'Silicon')

S:AddLayerCopy('bottom', 0, 'top')

S:SetLayerPatternCircle('slab', 'Vacuum', {0,0}, 0.2)

S:SetExcitationPlanewave( {0, 0}, {1, 0}, {0, 0})

for freq = 0.25, 0.6, 0.001 do S:SetFrequency(freq) forward, backward = S:GetPoyntingFlux(‘top’, 0) forward = S:GetPoyntingFlux(‘bottom’, 0) print(freq, forward, backward) end

Now you should see it running and printing outputs in 3 columns (freq, trans, ref)
You can copy the 3 columns and paste them at libreOffice-calc “excel in Ubuntu :D”

Make sure after writting each command of these, there is no output except for step no. 14) at which you will see the 3 columns, otherwise it is an error, go and search with the error you see and you will probably find a sol.

from s4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.