Putting this here so I dont mislay it.
Shows very simple, hard-coded plot of nodal variabls, to go into call back.
# | |
## Understanding DG nodal basis functions in CLIMA | |
## | |
# 1. plotting the nodal basis functions (Lagrange interpolation polynomials). | |
# | |
using ClimateMachine | |
using StaticArrays | |
using MPI | |
using ClimateMachine.Mesh.Topologies | |
using ClimateMachine.Mesh.Grids |
# | |
## Understanding DG nodal basis functions in CLIMA | |
## | |
# 1. plotting the nodal basis functions (Lagrange interpolation polynomials). | |
# | |
using ClimateMachine | |
using MPI | |
using ClimateMachine.Mesh.Topologies | |
using ClimateMachine.Mesh.Grids |
import numpy as np | |
import matplotlib.pyplot as plt | |
# | |
# Vertical grid | |
# | |
dr=np.array([5.48716549, 6.19462098, 6.99291201, 7.89353689, \ | |
8.90937723, 10.05483267, 11.34595414, 12.80056778, \ | |
14.43837763, 16.28102917, 18.35210877, 20.67704362, \ | |
23.28285446, 26.1976981 , 29.45012046, 33.06792588, \ |
np.count_nonzero( ( abs(df.Z-zloc[3])<1e-4 ) & ( abs(df.Y-yloc[3])<1e-4 ) ) | |
np.count_nonzero( ( abs(df.Z-zloc[3])<1e-4 ) ) | |
rslt_df = df[( abs(df.Z-zloc[-2])<1e-4 ) & ( abs(df.Y-yloc[-2])<1e-4 )] | |
plt.scatter(rslt_df.X,rslt_df.θ) |
# use against | |
# | |
# origin https://github.com/christophernhill/ClimateMachine.jl.git (fetch) | |
# origin https://github.com/christophernhill/ClimateMachine.jl.git (push) | |
# | |
# commit 6f0df023a8c7ff39628e85b0af2d1eb6ad4bf659 (HEAD -> cnh/impl_diff-jmc/split_explicit_draft, origin/cnh/impl_diff-jmc/split_explicit_draft) | |
# Author: christophernhill <cnh@mit.edu> | |
# Date: Tue Jul 7 10:04:04 2020 -0400 | |
# | |
# |
function CLIMA_slicer(solver_config) | |
## Slicing routine for structured CLIMA meshes | |
# Define number nodal points along each axis of an element and number of elements along each | |
# axis of topology | |
Np=[4,4,4] | |
Nn=[Np[1]+1,Np[2]+1,Np[3]+1] | |
Ne=[20,20,20] | |
# Get X, Y, Z coords and make sure they are in a CPU array to make life easier. | |
Gnd=reshape(solver_config.dg.grid.vgeo,(Nn[1],Nn[2],Nn[3],16,Ne[1],Ne[2],Ne[3])) |
using Statistics | |
npts1=[8000*125] | |
npts2=[4000*125,4000*125] | |
npts3=[2660*125,2680*125,2660*125] | |
npts4=[2000*125,2000*125,2000*125,2000*125] | |
v=rand(npts1[1]) | |
cs1=[0;cumsum(npts1)] | |
cs1lo=cs1[1:end-1] | |
cs1hi=cs1[2:end ] | |
cs2=[0;cumsum(npts2)] |
Putting this here so I dont mislay it.
Shows very simple, hard-coded plot of nodal variabls, to go into call back.
using Pkg | |
Pkg.activate("../climatemachine.jl") | |
Pkg.instantiate() | |
using ClimateMachine | |
ClimateMachine.init() | |
using ClimateMachine.GenericCallbacks | |
using ClimateMachine.ODESolvers | |
using ClimateMachine.Mesh.Filters | |
using ClimateMachine.VariableTemplates |
#!/bin/bash | |
# | |
# See if someone has a public key in github | |
# | |
# ./get_auth_key.sh USERNAME | |
uname=$1 | |
expr match ${uname} "[a-zA-Z0-9][a-zA-Z0-9_-]*$" > /dev/null 2>&1 | |
if [ x$? != x"0" ]; then |