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 numpy as np | |
from sfepy.base.goptions import goptions | |
goptions['verbose'] = False | |
from sfepy.discrete.fem import Field | |
try: | |
from sfepy.discrete.fem import FEDomain as Domain | |
except ImportError: | |
from sfepy.discrete.fem import Domain | |
from sfepy.discrete import (FieldVariable, Material, Integral, Function, | |
Equation, Equations, Problem) |
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 numpy as np | |
from sfepy.base.goptions import goptions | |
goptions['verbose'] = True | |
from sfepy.discrete.fem import Field | |
try: | |
from sfepy.discrete.fem import FEDomain as Domain | |
except ImportError: | |
from sfepy.discrete.fem import Domain | |
from sfepy.discrete import (FieldVariable, Material, Integral, Function, | |
Equation, Equations, Problem) |
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 numpy as np | |
from pymks import MKSRegressionModel | |
from pymks.datasets import make_elastic_FE_strain_delta | |
from pymks import DiscreteIndicatorBasis | |
from pymks.datasets.elastic_FE_simulation import ElasticFESimulation | |
from pymks.tools import draw_strains_compare | |
import matplotlib.pyplot as plt | |
elastic_modulus = (80, 100) | |
poissons_ratio = (0.3, 0.3) |
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
from pymks.datasets import make_elastic_FE_strain_delta | |
X_delta, strains_delta = make_elastic_FE_strain_delta(elastic_modulus=(80, 120), | |
poissons_ratio=(0.3, 0.3), | |
size=(15, 15)) | |
from pymks import MKSRegressionModel | |
from pymks.bases import DiscreteIndicatorBasis | |
basis = DiscreteIndicatorBasis(n_states=2) |
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 fipy as fp | |
L = 12 | |
nx = 200. | |
ny = nx | |
dx = L/nx | |
dy = L/ny | |
mesh = fp.Grid2D(nx=nx, ny=ny, dx=dx, dy=dy) + [[-L/2]] | |
x, y = mesh.getCellCenters() |
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 fipy as fp | |
L = 12 | |
nx = 200. | |
ny = nx | |
dx = L/nx | |
dy = L/ny | |
mesh = fp.Grid2D(nx=nx, ny=ny, dx=dx, dy=dy) + [[-L/2]] | |
x, y = mesh.getCellCenters() |
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
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue Sep 23 07:33:14 2014 | |
@author: olive | |
""" | |
""" a model to calculate radial injeciton of heat and a non reactive tracer | |
in a 2 layer domain | |
data from hecht mendez""" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from fipy import CellVariable, Grid1D, TransientTerm | |
from fipy import MatplotlibViewer, VanLeerConvectionTerm | |
from fipy import FaceVariable, ImplicitSourceTerm | |
length = 1. | |
nx = 100 | |
dx = length/nx | |
mesh = Grid1D(dx=dx, nx=nx) | |
TG = CellVariable(mesh = mesh, hasOld = True, name = 'TG') |
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 fipy as fp | |
nx = ny = 20 | |
mesh = fp.Grid2D(nx=nx, ny=ny, dx=0.25, dy=0.25) | |
noise = fp.GaussianNoiseVariable(mesh=mesh, | |
mean=0.5, | |
variance=0.01).value |