From 20157dc1cb780ab5aa8f01d35a3313846b994042 Mon Sep 17 00:00:00 2001 From: Jukka Aho Date: Tue, 22 Sep 2015 20:05:40 +0300 Subject: [PATCH] fixed a bug with jacobian --- src/equations.jl | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/equations.jl b/src/equations.jl index 307dbd4..0ab54db 100644 --- a/src/equations.jl +++ b/src/equations.jl @@ -42,22 +42,12 @@ function get_detJ(eq::Equation, ip::IntegrationPoint) get_detJ(el, ip) end function get_detJ(el::Element, ip::IntegrationPoint) - J = get_Jacobian(el, ip.xi) - ls = length(size(J)) - if ls == 1 # for manifolds - return norm(J) - else - return det(J) - end + J = get_detJ(el, ip.xi) end function get_detJ(el::Element, xi::Vector) J = get_Jacobian(el, xi) - ls = length(size(J)) - if ls == 1 # for manifolds - return norm(J) - else - return det(J) - end + s = size(J) + return s[1] == s[2] ? det(J) : norm(J) end """