This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE FlexibleContexts #-} | |
| -- # LANGUAGE NamedFieldPuns #-} | |
| -- # LANGUAGE OverloadedRecordDot #-} | |
| -- import Reinsch | |
| import Control.Lens | |
| import Data.List | |
| import qualified Data.Vector.Storable as V | |
| import Linear | |
| import Waterfall |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :set -XArrows | |
| :set -i. | |
| :load Arr.hs | |
| :script bin/Tidal.ghci | |
| import Control.Arrow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # diagram or explanation at http://aavogt.github.io/pickup.html | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from matplotlib.widgets import Slider, CheckButtons | |
| import warnings | |
| warnings.filterwarnings('ignore') | |
| # Vehicle and fuel parameters | |
| truck_mass = 15000 # kg (loaded garbage truck) | |
| drag_coefficient = 0.8 # typical for box truck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import fullcontrol as fc | |
| import math | |
| import time | |
| import os | |
| # the main thing is to reduce the temperature | |
| # do I add retraction? Z or E? M207, G10 G11 | |
| # do I slow it down? | |
| # do I make them closer together? | |
| # do I add a horizontal line that gets cut off? This way I |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE BlockArguments #-} | |
| {-# LANGUAGE TupleSections #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
| {-# LANGUAGE TemplateHaskell #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE BlockArguments #-} | |
| {-# LANGUAGE DeriveAnyClass #-} | |
| {-# LANGUAGE DeriveGeneric #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| module Main where | |
| import Data.Binary | |
| import Data.Binary.Get | |
| import qualified Data.ByteString.Lazy as BL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE TemplateHaskell #-} | |
| module InlineOCCT where | |
| import Data.Acquire | |
| import qualified Data.Map as Map | |
| import Foreign hiding (with) | |
| import Language.C.Inline.Context | |
| import Language.C.Inline.Cpp | |
| import Language.C.Inline.HaskellIdentifier |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# HLINT ignore "Eta reduce" #-} | |
| {-# LANGUAGE BlockArguments #-} | |
| {-# LANGUAGE RecordWildCards #-} | |
| {-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} | |
| import Control.Lens | |
| import Linear | |
| import Waterfall | |
| import Waterfall.IO |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # install cfdof | |
| # make the geometry where the gases mix such that inlets with z>0 are Ar, z<0 are Air | |
| # adjust rx,ry,rz below | |
| # the normal speed-weighted average composition of a rectangle specified below is calculated | |
| # | |
| # TODO: | |
| # - [ ] diffusion: reconstructPar -latestTime, then use the output velocity field with another openfoam solver for the transport equation | |
| # - [ ] composition from boundary names, instead of the ad-hoc plane split based on the location of the farthest upstream point in the streamline | |
| # - [ ] surrogate model (tgp?) for geometry/flow/model parameter sweeps | |
| from typing import cast |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #' Get the name of a symbol or function call | |
| #' | |
| #' @param expr An expression to extract the name from. | |
| #' @return A character string representing the name of the symbol or function call, or NULL if unsupported. | |
| #' @examples | |
| #' get_pun_name(quote(x)) # returns "x" | |
| #' get_pun_name(quote(f(x))) # returns "f" | |
| get_pun_name <- function(expr) { | |
| if (is.symbol(expr)) { | |
| return(as.character(expr)) |
NewerOlder