Difference between revisions of "How to use Armadillo in OpenFOAM"
From OpenFOAMWiki
(Created page with "= Introduction = This page is dedicated to explaining how to use [http://arma.sourceforge.net/ Armadillo] in OpenFOAM.") |
|||
Line 1: | Line 1: | ||
= Introduction = | = Introduction = | ||
This page is dedicated to explaining how to use [http://arma.sourceforge.net/ Armadillo] in OpenFOAM. | This page is dedicated to explaining how to use [http://arma.sourceforge.net/ Armadillo] in OpenFOAM. | ||
+ | |||
+ | When Armadillo installed you have to make following modifications. | ||
+ | |||
+ | File Make/options | ||
+ | <bash>EXE_INC = \ | ||
+ | -I$(LIB_SRC)/finiteVolume/lnInclude | ||
+ | |||
+ | EXE_LIBS = \ | ||
+ | -lfiniteVolume \ | ||
+ | -llapack \ | ||
+ | -lblas \ | ||
+ | -larmadillo | ||
+ | </bash> | ||
+ | |||
+ | Add inclusion of Armadillo to solver's main C++ file | ||
+ | |||
+ | <bash>#include "fvCFD.H" | ||
+ | #include "OFstream.H" | ||
+ | |||
+ | #include <armadillo> | ||
+ | #include "complex.H" | ||
+ | |||
+ | #include <math.h> | ||
+ | </bash> | ||
+ | |||
+ | Armadillo function could be called for example like this | ||
+ | |||
+ | <bash> | ||
+ | arma::mat Ar = arma::zeros<arma::mat>(p.size(),p.size()); | ||
+ | scalar x = arma::det(Ar); | ||
+ | </bash> | ||
+ | |||
+ | Then compile your solver ($ wmake). That's it. |
Revision as of 13:08, 1 March 2014
Introduction
This page is dedicated to explaining how to use Armadillo in OpenFOAM.
When Armadillo installed you have to make following modifications.
File Make/options
EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ -lfiniteVolume \ -llapack \ -lblas \ -larmadillo
Add inclusion of Armadillo to solver's main C++ file
#include "fvCFD.H" #include "OFstream.H" #include <armadillo> #include "complex.H" #include <math.h>
Armadillo function could be called for example like this
arma::mat Ar = arma::zeros<arma::mat>(p.size(),p.size()); scalar x = arma::det(Ar);
Then compile your solver ($ wmake). That's it.