I don't know how J looks, but could it be that it is diagonal? If so, I have an idea for the reason for this. If you look here
https://github.com/JuliaLang/julia/blob/master/base/linalg/dense.jl#L412 you can see the \ checks if the matrix is diagonal. If it is, the solver uses the \(Diagonal, Matrix) method which avoid the LU factorization that \(Matrix, Matrix) uses. Do you think that is the reason? 2014-12-13 17:56 GMT-05:00 Petr Krysl <krysl.p...@gmail.com>: > > You're absolutely right, sorry! I got distracted and I forgot to post > instructions. I've also tried to simplify things, and I think I've gotten > it down to just a few lines of code. Unfortunately, the rest of the code > still needs to be there for declarations and such (https://github.com/ > PetrKryslUCSD/Test_jfineale). > > The rotation matrix gets used in one place only. Refer to lines 68ff in > conductivity() from FEMMHeatDiffusionModule.jl. > > # Here is that rotation matrix Rm > FEMMBaseModule.getRm!(self.femmbase,Rm,Ns[j]'*x,J,labels[i]); > # Material orientation matrix > # And here is the only place it gets used > gradN = gradNparams[j]/(Rm'*J); # gradient WRT material > coordinates > # > > conductivity() is the last thing called in the driver. Picking Rm on line > 41 of the driver (Poisson_FE_example.jl) leads to different computation > CPU times. > > Petr > > On Saturday, December 13, 2014 1:37:36 PM UTC-8, Steven G. Johnson wrote: >> >> Unfortunately, it's not really reasonable for people on a mailing list to >> dissect such a large body of code; you need to boil it down to a smaller >> example that illustrates the behavior you mentioned. >> >