Created
May 19, 2017 19:28
-
-
Save PetrKryslUCSD/292263d346a1c5653c07cf0dda70b7b2 to your computer and use it in GitHub Desktop.
FEMMBaseModule.jl
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
module Junk | |
using FEMMBaseModule | |
function run1() | |
fes = FESetT3() | |
femm = FEMMBase(fes) | |
J = ones(2, 2) | |
loc = zeros(1,3) | |
conn = reshape([1,2,3], 1, 3) | |
N = zeros(3,1) | |
@time for j = 1:10000000 | |
FEMMBaseModule.Jacobianvolume(femm, J, loc, conn, N) | |
end | |
@code_warntype FEMMBaseModule.Jacobianvolume(femm, J, loc, conn, N) | |
end | |
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
module FEMMBaseModule | |
typealias FInt Int | |
typealias FFlt Float64 | |
typealias FFltVec Vector{FFlt} | |
typealias FIntVec Vector{FInt} | |
typealias FFltMat Matrix{FFlt} | |
typealias FIntMat Matrix{FInt} | |
abstract FESet | |
abstract FESet2Manifold <: FESet | |
type FESetT3 <: FESet2Manifold | |
end | |
export FESetT3 | |
type FEMMBase{T<:FESet, F<:Function} | |
fes::T # finite element set object | |
otherdimension::F | |
end | |
export FEMMBase | |
function FEMMBase{T<:FESet}(fes::T) | |
return FEMMBase(fes, otherdimensionunity) | |
end | |
function otherdimensionunity(loc::FFltMat, conn::FIntMat, N::FFltMat)::FFlt | |
return 1.0 | |
end | |
function Jacobiansurface{T<:FESet2Manifold}(self::FEMMBase{T}, J::FFltMat, | |
loc::FFltMat, conn::FIntMat, N::FFltMat)::FFlt | |
return 1.0 | |
end | |
function Jacobianvolume{T<:FESet2Manifold}(self::FEMMBase{T}, J::FFltMat, | |
loc::FFltMat, conn::FIntMat, N::FFltMat)::FFlt | |
Jac = Jacobiansurface(self, J, loc, conn, N)::FFlt | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment