This file contains 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
(ns rt.core | |
(:refer-clojure :exclude [+ - * /]) | |
(:require [clojure.core.typed :as typed | |
:refer [ann ann-datatype ann-form ann-record check-ns]]) | |
(:require [clojure.algo.generic.arithmetic :as arith :refer [+ - * /]])) | |
(ann-record Vec3 [x :- Number y :- Number z :- Number]) | |
(defrecord Vec3 [x y z]) | |
(def a (Vec3. 1 2 3)) |
This file contains 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
// From ElementADPK2: | |
virtual void computeSecondPiolaKirchhoff(Vec3DiffMatrix3x3 &matS, const Vec3DiffMatrix3x3 &matF, const MaterialParams &matParams) const { | |
//*****************ASSIGNMENT 4 START HERE *********************** | |
//Compute Strain | |
// Vec3DiffMatrix3x3 matE = | |
//Compute Second Piola Kirchoff Stress (S) | |
// matS = | |
// matF is the deformation matrix |
This file contains 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
abstract class OpVar | |
case class RegVar(val varName:String) extends OpVar { | |
var _register = 0 | |
def register = { | |
"%r" + _register | |
} | |
def register_=(reg: Int) = { | |
_register = reg | |
} |
This file contains 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
// Need to compute: | |
//*************************ASSIGNMENT 4 START HERE******************* | |
matd = Vec3DiffMatrix3x3::createFromColumnVectors(xEl[1] - xEl[0], xEl[2] - xEl[0], xEl[3] - xEl[0]); | |
//Compute the deformation gradient F = d*D^{-1} | |
matF = matd * matDInv(); | |
//Get the second Piola Kirchoff stress from your element | |
//Place the value in matS |
This file contains 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
///@TODO draw scanline here | |
glColor3f(1.0f, 1.0f, 1.0f); | |
glBegin(GL_QUADS); | |
glVertex3f(imgNum, 0, 0.1); | |
glVertex3f(imgNum, resy, 0.1); | |
glVertex3f(imgNum+1, resy, 0.1); | |
glVertex3f(imgNum+1, 0, 0.1); | |
glEnd(); |
This file contains 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
///@TODO draw scanline here | |
glColor3f(1.0f, 1.0f, 1.0f); | |
glBegin(GL_QUADS); | |
glVertex3f(imgNum, 0, 0.1); | |
glVertex3f(imgNum, resy, 0.1); | |
glVertex3f(imgNum+1, resy, 0.1); | |
glVertex3f(imgNum+1, 0, 0.1); | |
glEnd(); |
This file contains 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
class ColorsController < UIViewController | |
def viewDidLoad | |
super | |
self.view.backgroundColor = UIColor.whiteColor | |
@label = UILabel.alloc.initWithFrame(CGRectZero) | |
@label.text = "Colors" | |
@label.sizeToFit | |
@label.center = [ |
This file contains 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
# I am currently using http://refit.sourceforge.net/ as my boot menu. | |
# Mac OS is installed on a tiny partition. | |
# I was able to create a USB stick with 12.10 using these instructions: | |
# https://help.ubuntu.com/community/How%20to%20install%20Ubuntu%20on%20MacBook%20using%20USB%20Stick | |
# By restarting and holding option, I was able to boot into the Ubuntu installer | |
# (no refit needed for this step). | |
# The installation process went hitch-free. | |
# But after installation, the graphics card (Intel HD4000) was not recognized. | |
# So I did the following: |
This file contains 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
;; Ethan Sherbondy | |
;; 6.946, Fall 2012 | |
;; Project Exercise 1.39 | |
;; The Double Pendulum | |
(define ((L-rect-pend m1 m2 g) local) | |
(let ((q (coordinate local)) | |
(v (velocity local))) | |
(let* ((v1 (ref v 0)) |
This file contains 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
(define ((parametric-path-action Lagrangian t0 q0 t1 q1) qs) | |
(let ((path (make-path t0 q0 t1 q1 qs))) | |
(Lagrangian-action Lagrangian path t0 t1))) | |
; canned multi-dimensional minimization | |
; used to find approximate solution path | |
(define (find-path Lagrangian t0 q0 t1 q1 n) | |
(let ((initial-qs (linear-interpolants q0 q1 n))) | |
(let ((minimizing-qs | |
(multidimensional-minimize |