COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
utest-advectiondiffusion.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2011 von Karman Institute for Fluid Dynamics, Belgium
2 //
3 // This software is distributed under the terms of the
4 // GNU Lesser General Public License version 3 (LGPLv3).
5 // See doc/lgpl.txt and doc/gpl.txt for the license text.
6 
7 #define BOOST_TEST_DYN_LINK
8 #define BOOST_TEST_MODULE "Test module for cf3::AdvectionDiffusion"
9 
10 #include <boost/test/unit_test.hpp>
11 
12 
13 #include "cf3/common/Log.hpp"
14 
15 #include "AdvectionDiffusion/Physics.hpp"
16 #include "AdvectionDiffusion/State1D.hpp"
17 
18 using namespace cf3;
19 using namespace cf3::AdvectionDiffusion;
20 
22 
23 BOOST_AUTO_TEST_SUITE( AdvectionDiffusion_Suite )
24 
25 
28 {
29  AdvectionDiffusion::State1D ad_state;
30  boost::shared_ptr<solver::Physics> p_ptr = ad_state.create_physics();
31  solver::Physics& p = *p_ptr;
32  RealVector state(1); state << 5. ;
33 
34  ad_state.set_state(state,p);
35 
36  RealVector normal(1); normal << 1.;
37  RealVector flux(1);
38  RealMatrix rv(1,1);
39  RealMatrix lv(1,1);
40  RealVector ev(1);
41 
42  ad_state.compute_flux(p,normal,flux);
43  ad_state.compute_fluxjacobian_eigenvalues(p,normal,ev);
44  ad_state.compute_fluxjacobian_right_eigenvectors(p,normal,rv);
45  ad_state.compute_fluxjacobian_left_eigenvectors(p,normal,lv);
46 
47  BOOST_CHECK_EQUAL(flux[0], 5.);
48  BOOST_CHECK_EQUAL(ev[0], 1.);
49  BOOST_CHECK_EQUAL(rv(0,0), 1.);
50  BOOST_CHECK_EQUAL(lv(0,0), 1.);
51 
52 }
53 
55 
56 BOOST_AUTO_TEST_SUITE_END()
57 
58 
boost::proto::terminal< SFOp< NormalOp > >::type const normal
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > RealMatrix
Dynamic sized matrix of Real scalars.
Definition: MatrixTypes.hpp:22
BOOST_AUTO_TEST_CASE(advdiff1d)
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealVector
Dynamic sized column vector.
Definition: MatrixTypes.hpp:25
Top-level namespace for coolfluid.
Definition: Action.cpp:18
Send comments to:
COOLFluiD Web Admin