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
#Prototype implementation of pattern-matching | |
class AutoVarInstance(object): | |
def __init__(self, parent, name): | |
self.parent = parent | |
self.name = name | |
class AutoVar(object): | |
'''Access any member variable to return an AutoVarInstance object that can be used | |
to bind it to a value later''' |
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
# Compute force on a particle with a pair potential | |
# Uses Lennard-Jones potential | |
import sympy | |
# Assigment looks like a relational operator, but probably shouldn't be | |
from sympy.core.relational import Assignment | |
import sympy.printing |
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
import constants | |
import cython | |
cimport numpy as np | |
class LJ_Pot(object): | |
def __init__(self): | |
self.sigma = 2.315 | |
self.epsilon = 0.167 | |
self.mass = 63.55 * constants.amuToInternalMass |
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
import constants | |
import numba | |
class LJ_Pot(object): | |
def __init__(self): | |
self.sigma = 2.315 | |
self.epsilon = 0.167 | |
self.mass = 63.55 * constants.amuToInternalMass | |
self.lat = 3.615 | |
self.lattice_type = 'FCC' |
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
include("constants.jl") | |
type LJ_Pot | |
sigma::Float | |
epsilon::Float | |
mass::Float | |
lat::Float | |
lattice_type::String | |
cutoff::Float | |
name::String |
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
include("initAtoms.jl") | |
include("simflat.jl") | |
include("ljforce.jl") | |
using ArgParse | |
# Translation of CoMD to Julia | |
function initValidate(sim) |
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
import pyximport; pyximport.install() | |
import simflat | |
import initatoms | |
import time | |
import constants | |
import argparse | |
# Translation of CoMD to Python |
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 __future__ import print_function, division | |
import numpy as np | |
import math | |
import numba | |
def initLinkCells(sim, box_size): | |
gridSize = np.array([int(b/sim.pot.cutoff) for b in box_size], dtype=np.int) | |
boxSize = box_size*1.0/gridSize |
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 __future__ import print_function, division | |
import simflat | |
import initatoms | |
import time | |
import constants | |
import argparse | |
import numba | |
# Translation of CoMD to Python |
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 __future__ import print_function, division | |
import simflat | |
import initatoms | |
import time | |
import constants | |
import argparse | |
from multiprocessing import Process, Queue | |
from Queue import Empty | |
import collections |
OlderNewer