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 __future__ import division | |
import numpy as np | |
from numpy import cos, sin, exp, zeros | |
from numpy.linalg import solve, norm | |
import matplotlib.pyplot as plt | |
from matplotlib import rcParams | |
rcParams['font.family'] = 'serif' | |
rcParams['font.size'] = 16 |
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 -*- | |
""" | |
Plot the convex hull around a set of points as a | |
shaded polygon. | |
@author: Nicolas Guarin Zapata | |
@date: October 15, 2014 | |
""" | |
import numpy as np | |
from scipy.spatial import ConvexHull |
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 -*- | |
""" | |
Eigenmodes of an Euler-Bernoulli beam with fixed ends [1]_. The stencil | |
used is a central finite difference of second order [2]_. | |
References | |
---------- | |
.. [1] Euler–Bernoulli beam theory. (2015, June 2). In Wikipedia, | |
The Free Encyclopedia. Retrieved 20:11, June 3, 2015, from |
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 numpy import array | |
from matplotlib import pyplot as plt | |
def plot_msh(pts, els, shw_pts=True, shw_els=True, | |
pts_text=False, els_text=False): | |
""" | |
Plot a mesh of 8 nodes (serendipity) elements. | |
Parameters | |
---------- |
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
def eval_fun(f, **args): | |
""" (str, dict) -> object | |
f: Function as string. | |
args: dictionary with arbitrary variables. | |
Use arbitrary args in **args to eval general functions. | |
Examples: | |
>> eval_fun('x**2',x=5) | |
25 | |
>> eval_fun('x*y', x=3, y=2) | |
6 |
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 projection to parallel in Paraview | |
In Paraview 4.3 the default is perspective projection. | |
""" | |
camera = GetActiveCamera () | |
camera. SetParallelProjection (True) |
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 -*- | |
""" | |
Calculate two-side Hausdorff distance between two sets using a brute | |
force approach. | |
References | |
[1] http://en.wikipedia.org/wiki/Hausdorff_distance | |
@author: Nicolas Guarin-Zapata | |
""" |
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
# -*- coding: utf-8 -*- | |
""" | |
Wave propagation in layered elastic media. | |
@author: Nicolas Guarin-Zapata | |
@email: [email protected] | |
""" | |
import matplotlib.pyplot as plt | |
from matplotlib import rcParams | |
from layered_elastic import * |
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
""" | |
Mohr circle in 2D. | |
@author: Nicolás Guarín-Zapata | |
@date: May 2020 | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib import rcParams | |
rcParams['font.family'] = 'serif' |