|
[Sponsors] |
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: 17 |
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<class> static void LUsolve (Matrix<scalar> &matrix, Field<t> &source) and simpleMatrix:LUsolve declared as: Foam::Field<t> 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: Wernigerode, Sachsen-Anhalt, Germany
Posts: 281
Rep Power: 18 |
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: 17 |
Dear Henrik,
thank you a lot for your answer. That helps me a lot! Regards! Kathrin |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Addressing matrix element and reuse of system matrix | marziolettich | OpenFOAM Running, Solving & CFD | 2 | February 19, 2008 06:04 |
Skewness & Decomposition | Marc | FLUENT | 2 | July 5, 2007 15:54 |
CCM+ and manual decomposition | William Blake | Siemens | 3 | June 29, 2006 17:43 |
Helium-Decomposition | chakri | Main CFD Forum | 1 | December 13, 2002 05:17 |
Elemtary matrix to CSR global matrix | xueying | Main CFD Forum | 2 | September 24, 2002 10:44 |