Skip to content

Instantly share code, notes, and snippets.

View liangwang0734's full-sized avatar

Liang Wang liangwang0734

  • Princeton University
View GitHub Profile
@liangwang0734
liangwang0734 / test_FiveMomentSource.lua
Created October 4, 2018 19:53
gkyl test 5m source single point
-- Gkyl ------------------------------------------------------------------------
--
-- Test for five-moment source updater
-- _______ ___
-- + 6 @ |||| # P ||| +
--------------------------------------------------------------------------------
local ffi = require "ffi"
local Unit = require "Unit"
local Grid = require "Grid"
@liangwang0734
liangwang0734 / gem5m_gkeyll1.lua
Created October 3, 2018 14:36
gem 5m old gkeyll
-- GEM-challenge problem
Pi = Lucee.Pi
log = Lucee.logInfo
-- physical parameters
gasGamma = 5./3.
elcCharge = -1.0
ionCharge = 1.0
ionMass = 1.0
@liangwang0734
liangwang0734 / gem5m.lua
Created October 2, 2018 15:02
gkeyll v2 gem 5m
-- Gkyl ------------------------------------------------------------------------
local Moments = require("App.PlasmaOnCartGrid").Moments
local Euler = require "Eq.Euler"
-- physical parameters
gasGamma = 5./3.
elcCharge = -1.0
ionCharge = 1.0
ionMass = 1.0
elcMass = ionMass/25.0
@liangwang0734
liangwang0734 / gkylFile2.py
Last active October 2, 2018 03:07
gkyl moment maxwell file reader
__all__ = ["gkylFile", "gkylFile_Moment"]
import numpy as np
import adios
import numexpr as ne
import re
import random
import string
@liangwang0734
liangwang0734 / khi2d.lua
Last active June 1, 2018 20:01
2d khi cerri
-- XXX testing only; force to use 1st order Lax solver (positivity-conserving but diffusive)
alwaysUseLaxFlux = true
------------------------------------
-- 2D 10-MOMENT SIMULATION OF KHI --
------------------------------------
----------------------
-- HELPER FUNCTIONS --
----------------------
@liangwang0734
liangwang0734 / read_1d_profile.ipynb
Created January 15, 2018 03:52
read 1d profile from Chuanfei's water world simulation
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.