# Solving simultaneous algebraic equations for complex coefficients

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

 May 9, 2012, 08:02 Solving simultaneous algebraic equations for complex coefficients #1 Senior Member     Hisham Elsafti Join Date: Apr 2011 Location: Braunschweig, Germany Posts: 257 Blog Entries: 10 Rep Power: 17 Dear Foamers, I need to solve a system of linear equations using OpenFOAM (needed at each time step). The system has complex coefficients. I think the simpleMatrix is used for the solution of simultaneous linear algebraic equations. Although the simpleMatrix::solve() returns a Field http://foam.sourceforge.net/docs/cpp...ce.html#l00074 Code: 00073 template 00074 Foam::Field Foam::simpleMatrix::solve() const 00075 { 00076 scalarSquareMatrix tmpMatrix = *this; 00077 Field sourceSol = source_; 00078 00079 Foam::solve(tmpMatrix, sourceSol); 00080 00081 return sourceSol; 00082 } It seems that it can solve only for real scalars. I need to solve for a complexField. Is it possible from within OF? It would be nice if someone points me to an example of the simpleMatrix use? Edit: As expected simpleMatrix works only for real scalars! Best regards, Hisham Last edited by Hisham; May 9, 2012 at 08:50.

 January 19, 2014, 02:57 Dear Hisham #2 Senior Member   Join Date: Jun 2011 Posts: 163 Rep Power: 15 Dear Hisham I have the same problem and I want to solve a system of linear equation with complex coefficients do you find how can it be solved ? Best Regards

 January 19, 2014, 05:01 #3 Senior Member     Hisham Elsafti Join Date: Apr 2011 Location: Braunschweig, Germany Posts: 257 Blog Entries: 10 Rep Power: 17 Hi mechy, The Armadillo project was my solution: http://arma.sourceforge.net/ Hope it helps you too! Best regards, Hisham

 January 19, 2014, 09:09 #4 Senior Member   Join Date: Jun 2011 Posts: 163 Rep Power: 15 Dear Hisham you have used it separately or used it in openfoam ? is it possible to use it in openfoam codes ? Best Regards

 January 19, 2014, 10:40 #6 Senior Member   Join Date: Jun 2011 Posts: 163 Rep Power: 15 thanks for useful comments Best Regards

 January 19, 2014, 12:42 #7 Senior Member   Join Date: Jun 2011 Posts: 163 Rep Power: 15 Dear Hisham is it possible to couple OpenFoam and Aarmadillo in other word, is it possible to transfer data between openfoam objects and Aarmadillo objects ? Best Regards

 March 1, 2014, 10:09 #8 Member   Avdeev Evgeniy Join Date: Jan 2011 Location: Togliatty, Russia Posts: 69 Blog Entries: 1 Rep Power: 21 Probably will useful. http://openfoamwiki.net/index.php/Ho...lo_in_OpenFOAM wyldckat and anothr_acc like this.

 Tags algebraic, complex, complexfield, equations, simultaneous