# Syntaxproblem LU decomposition of a matrix

 Register Blogs Members List Search Today's Posts Mark Forums Read

 January 20, 2009, 06:40 Hello! I am having a proble #1 Senior Member   Kathrin Kissling Join Date: Mar 2009 Location: Besigheim, Germany Posts: 134 Rep Power: 8 Hello! I am having a problem with the the syntax used to decompose a matrix with LU decomposition. I found two makros: scalarMatrix::LUsolve declared as: template static void LUsolve (Matrix &matrix, Field &source) and simpleMatrix:LUsolve declared as: Foam::Field LUsolve ( ) const Here is the snippet from my code: volTensorField D = fvc::grad(U); volTensorField Wtr = 0.5 * (D.T() + D); volTensorField WtrLambda = Wtr - test * I; volVectorField solution = WtrLambda.LUsolve(); The compiler gives me the following error: error: 'struct Foam::volTensorField' has no member named LUsolve. I understand, that LUsolve is obviously not a member function of volTensorField. Can anybody tell me the correct syntax to use the LUsolve macro? What is the difference between the two macros? I searched the forum, but I couldn't find anything regarding this topic. Thank you a lot! Kathrin

 January 20, 2009, 12:57 Dear Kathrin, I am not exac #2 Senior Member   Henrik Rusche Join Date: Mar 2009 Location: Braunschweig, Niedersachsen, Germany Posts: 275 Rep Power: 9 Dear Kathrin, I am not exactly sure what exactly you are trying to do. There are many ways to assemble and solve a linear system in OF depending whether you seek a solution for a standalone linear system, a discretised PDE or a pointwise solution. simpleMatrix is a NxN matrix & solver. It doesn't know about geometric Fields. It is used, for example, in the ODE solvers - where you can also find examples how to use it. scalarMatrix is used to solve discretised PDEs, but you would normally go solve(ffm::div(s)) or similar. However, my feeling is that you a looking for a pointwise solution of a 3x3 matrix (or tensor). If this is the case, you want to check out Tensor::cofactors and Tensor::inv (see \$FOAM_SRC/src/OpenFOAM/lnInclude/TensorI.H). BTW, symm(D) is faster than 0.5 * (D.T() + D) and can also be found in \$FOAM_SRC/src/OpenFOAM/lnInclude/TensorI.H. Henrik

 January 20, 2009, 13:46 Dear Henrik, thank you a lo #3 Senior Member   Kathrin Kissling Join Date: Mar 2009 Location: Besigheim, Germany Posts: 134 Rep Power: 8 Dear Henrik, thank you a lot for your answer. That helps me a lot! Regards! Kathrin

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post marziolettich OpenFOAM Running, Solving & CFD 2 February 19, 2008 06:04 Marc FLUENT 2 July 5, 2007 14:54 William Blake CD-adapco 3 June 29, 2006 16:43 chakri Main CFD Forum 1 December 13, 2002 05:17 xueying Main CFD Forum 2 September 24, 2002 09:44

All times are GMT -4. The time now is 13:12.