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 LinAlg.norm | |
abstract AbstractVoigt{T} | |
immutable VoigtStress <: AbstractVoigt | |
xx::Float64 | |
yy::Float64 | |
zz::Float64 | |
yz::Float64 | |
xz::Float64 |
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
using PyCall | |
@pyimport vtk | |
function create_vtk_object(mesh::Mesh) | |
n_nodes = length(mesh.nodes) | |
# Add points to vtkPoints | |
points = pycall(vtk.vtkPoints, PyAny) | |
for node in mesh.nodes |
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
###########################FUNCTIONS################################## | |
##### exportVTK | |
function exportVTK(DataMat, NameMat ,filename, dh, Nxyz) | |
nx = dh[1]*(Nxyz[1]-1); | |
ny = dh[2]*(Nxyz[2]-1); | |
nz = dh[3]*(Nxyz[3]-1); | |
x, y, z = ndgrid(0:dh[1]:nx, 0:dh[2]:ny, 0:dh[3]:nz ); |
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
using FixedSizeArrays | |
# Point types | |
abstract AbstractPoint{L} <: FixedVector{Int, L} | |
immutable Point2<: AbstractPoint{2} | |
x::Float64 | |
y::Float64 | |
end |
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
# Hyper spheres are used to bound points in space. | |
# For a node all it's children are bounded by the | |
# node's hyper sphere. | |
immutable HyperSphere{T <: FloatingPoint} | |
center::Vector{T} | |
r::T | |
end | |
# Checks if two spheres overlap. | |
# They do if the distance between their centers |
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
# Defines data types representing a purely geometrical mesh. | |
########## | |
# Points # | |
########## | |
immutable Point2<: FixedVector{Float64, 2} | |
x::Float64 | |
y::Float64 | |
end | |
typealias Vector2 Point2 |
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
function isnothermitian(A::SparseMatrixCSC) | |
m, n = size(A) | |
if m != n; return false; end | |
CHECK_PERCENTAGE = 0.001 | |
colptr = A.colptr | |
rowval = A.rowval | |
nzval = A.nzval | |
nrnzval = length(nzval) |
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
function ishermitian_new(A::SparseMatrixCSC) | |
m, n = size(A) | |
if m != n; return false; end | |
colptr = A.colptr | |
rowval = A.rowval | |
nzval = A.nzval | |
start_indices = copy(A.colptr) | |
nrnzval = length(nzval) | |
@inbounds for col = 1 : A.n |
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
function isstructsym(A::SparseMatrixCSC) | |
m, n = size(A) | |
if m != n; return false; end | |
colptr = A.colptr | |
rowval = A.rowval | |
nzval = A.nzval | |
tracker = copy(A.colptr) | |
@inbounds for col = 1:A.n | |
for p = tracker[col]:colptr[col+1]-1 |
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
do ii=1,nslip | |
! | |
k_alpha(ii)=n_k_alpha(ii)-XX(ii) | |
phi(ii)=(sum( Mbar*s_x_m(1:9,ii) ) )-& | |
( -para(8)*k_alpha(ii)+kappa_nl(ii) )-para(11) | |
if ( phi(ii).gt.0.d0 ) then | |
mclaur=phi(ii) | |
else | |
mclaur=0.d0 | |
endif |
OlderNewer