simnum-d1-python's Introduction
python can be python (python 2) or python3 Running: python main.py timeEnd default 1 from constants.py if not specified as program argument as following: python main.py --timeEnd=20 --------------------- Parameters in files: constants.py z0 zf nint timeEnd verbose = False | True problemType = 'soundwave' | 'riemann' schemeType = 'lf' | 'fg' #lax-friederich scheme or first generation scheme fcfl #this depends on the numeric scheme used : 0.97 for first generation and 0.99 for lax-fr gamma #this is everytime 5/3, but for complete riemann problem this changes to 1.4 in case of schemeType = fg we can specify the step in which to apply the boundary conditions :bcStep = "interm" | "final" SOUNDWAVE Problem sound_wave_params.py rho00 p00 init_functions_generation: specify the way to create the initial conditions for velocity, pressure and density perturbations at time t=0 (we cand specify a superposition of waves) We will only consider changing amplitude sign as it is equivalent to changing phase by adding +/- pi if csSign=+1 the wave will travel right (the velocity and pressure(denisty) perturbation at time t = 0 have same amplitude sign) , left if csSign = -1 (velocity and pressure(density) pert at time = 0 have different amplitude Sign) v00 A functiontype = 'sine' | 'defined' waves classes in sound_wave.py 'sine': this will use SoundWaveSine class with constructor arguments(wl, phi) from sound_wave_sine_params.py 'defined': this will use SoundWave class with constructor argument(periodicFunction) from sound_wave_defined_params.py periodicType = "repeat" | "refl" boundary conditions to apply : repeat or reflection plotPresCurve , plotRhoCurve, plotVelCurve = True if I want to plot the curves and mark the point, False otherwise plotPresAn, plotRhoAn, plotVelAn - if I want to plot analitical solutions markPoints plotVelFFT : set it to True if I want FFT of velocity sound_wave_defined_params.py sound_wave_sine_params.py notifier_params.py -- parameters used for plot/write_to_file backend notifierType = "visual" | "file" 'visual' : use class VisualPlot defined in visual_plot.py 'file' : use class SaveToFile defined in save_to_file.py nstepsPlot RIEMANN Problem rieman_params.py presLeft presRight rhoLeft rhoRight velLeft velRight zC timeAfterAnPoints #after this time will try to determine rwPointAn and shPointAn (if it's not complete problem) and check expressions Development issues: notifier can be any class implementing (see VisualPlot class in visual_plot.py and SaveToFile class in save_to_file.py) __init__ afterInit addGraph updateValues markPoint afterUpdateValues finish model a class subclassing ModelBase implementing def __init__(self): def updateValues(self, dt, time): #make sure you call self.notifier.afterUpdateValues(time) #at the end of the function def getInitialValues(self): def additionalInit(self): see model_soundwave.py and model_riemann.py (*) If I don't want to save images set saveImages = False in visual_plot.py From saved images we can create the movie with: ffmpeg -r 1 -pattern_type glob -i '*.png' -c:v libx264 -pix_fmt yuv420p out.mp4 #convert them before if made withh fullscreen for i in `ls *.png`; do convert $i -geometry 800x600 $i; done (*) If I want a break after each update uncomment in visual_plot.py in afterUpdateValues import time time.sleep(5) (*) The same for the inital break - this is in afterInit function in visual_plot.py
simnum-d1-python's People
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.