COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
utest-lss-solvelss.cpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2013 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 the SolveLSS action"
9 
10 #include <boost/assign/std/vector.hpp>
11 #include <boost/test/unit_test.hpp>
12 
13 #include "common/Core.hpp"
14 
17 
18 #include "math/MatrixTypes.hpp"
19 #include "math/LSS/SolveLSS.hpp"
20 #include "math/LSS/System.hpp"
21 
22 using namespace boost::assign;
23 
24 using namespace cf3;
25 using namespace cf3::common;
26 using namespace cf3::common::PE;
27 using namespace cf3::math;
28 
29 BOOST_AUTO_TEST_SUITE( SolveSystemSuite )
30 
31 
33 BOOST_AUTO_TEST_CASE( TestSolveSystem )
34 {
35  Comm::instance().init(boost::unit_test::framework::master_test_suite().argc, boost::unit_test::framework::master_test_suite().argv);
36 
37  Component& root = Core::instance().root();
38  LSS::SolveLSS& solve_action = *root.create_component<LSS::SolveLSS>("solve_action");
40  CommPattern& cp = *root.create_component<CommPattern>("commpattern");
41 
42  std::vector<Uint> gid, conn, startidx, rnk;
43  gid += 0,1,2,3,4,5,6,7,8,9;
44  rnk += 0,0,0,0,0,0,0,0,0,0;
45  conn += 0,2,1,2,2,7,3,8,4,5,5,2,6,0,7,1,8,7,9,8;
46  startidx += 0,2,4,6,8,10,12,14,16,18,20;
47  cp.insert("gid",gid,1,false);
48  cp.setup(cp.get_child("gid")->handle<common::PE::CommWrapper>(),rnk);
49 
50  lss->options().set("matrix_builder", std::string("cf3.math.LSS.EmptyLSSMatrix"));
51  lss->options().set("solution_strategy", std::string("cf3.math.LSS.EmptyStrategy"));
52  lss->create(cp, 4u, conn, startidx);
53 
54  solve_action.options().set("lss", lss);
55  solve_action.execute();
56 }
57 
59 
60 BOOST_AUTO_TEST_SUITE_END()
61 
62 
BOOST_AUTO_TEST_CASE(TestSolveSystem)
This header collects all the headers needed for the linear system solver, also including configure-ti...
Basic Classes for Mathematical applications used by COOLFluiD.
Parallel Communication Pattern. This class provides functionality to collect communication. For efficiency it works such a way that you submit your request via the constructor or the add/remove/move magic triangle and then call setup to modify the commpattern. The data needed to be kept synchronous can be registered via the insert function. The word node here means any kind of "point of storage", in this context it is not directly related with the computational mesh.
tuple root
Definition: coolfluid.py:24
void insert(const std::string &name, T *&data, const int size, const unsigned int stride=1, const bool needs_update=true)
Base wrapper class serving as interface.
Definition: CommWrapper.hpp:42
Top-level namespace for coolfluid.
Definition: Action.cpp:18
Classes offering a MPI interface for COOLFluiD.
Definition: all_gather.hpp:39
OptionList & options()
Definition: Component.cpp:856
Base class for defining CF components.
Definition: Component.hpp:82
void set(const std::string &pname, const boost::any &val)
Definition: OptionList.cpp:132
Handle< Component > create_component(const std::string &name, const std::string &builder)
Build a (sub)component of this component using the extended type_name of the component.
Definition: Component.cpp:568
Most basic kernel library.
Definition: Action.cpp:19
void execute()
Run the underlying linear system math.
Definition: SolveLSS.cpp:44
Send comments to:
COOLFluiD Web Admin