Solving System of Linear equations
Hi!
I need to solve in OpenFOAM system of linear equation like A*b = c where A is tensor (rank 2) and c is vector. A and c are constants. How can I solve this equation? Thank you 
Thank you, Stanley!
Can you show how to use this function? What Hfile I should include solve function to work? 
//I've created tensor A:
tensor A(Axx, Axy, Axz, Ayx, Ayy, Ayz, Azx, Azy, Azz); //and vector c: vector c(cx, cy, cz); and now I want to get vector b: A*b=c 
Why use OpenFOAM instead of MATLAB / Octave for this?

Anton, because it is only one step of big programm.
First I solve MHD turbulent equations in crucible. Then I solve lagrangian equation for solid particle motion. I take into acount lift force to (proportional U x rot(U)). And to solve this aquation I need to solve system of linear algebraic equations. 
Hi Mihails,
I would also be able to solve a system of linear equations in OF as a part of a larger code. Did you ever find out if there is a possibility to solve a system of linear equations i OF? Thanks 
Why don't you use our GPUbaed code (speedit.vratis.com)? It can be easily plugged to OF. So far we support CG/BiCGSTAB for solving symmetric/unsymmetric matrices in single/double precision (soon also with complex values).

Year ago I decided that it is much easier for me to write my own code that solve systems of linear equation using Gauss method.

But happens if the matrix is huge and sparse. The memory requirements are quite high for Gauss method.

Of course you are right, Lukasz. I am solving my specific problem and I have no goal to write universal code for systems of linear equations.

Thanks both of you!
The simplest way for me is to go for Michails suggestion, which I've already implemented in Matlab. Now I will just need to rewrite it into OF which for me will be the tricky part. Regards 
Hi,
if you want to use Gaussalgorithm only, you don't have to hardcode it. There is already a class called simpleMatrix which can do this job. The source is located in src/OpenFOAM/matrices/simpleMatrix/ . I don't know if there is an example in any solver, but it is quite simple to use. Regards, Stefan 
Perfect!
It works as expected. Thanks /NW 
Hello ! can you tell me how you add simpleMatrix to your code ?
I am trying to do the same thing but i have a lot of problems ! 
All times are GMT 4. The time now is 05:57. 