8 #define BOOST_TEST_DYN_LINK
9 #define BOOST_TEST_MODULE "Test module for cf3::math::LSS where testing on a distributed matrix."
15 #include <boost/test/unit_test.hpp>
16 #include <boost/lexical_cast.hpp>
37 m_argc = boost::unit_test::framework::master_test_suite().argc;
38 m_argv = boost::unit_test::framework::master_test_suite().argv;
61 CFinfo.setFilterRankZero(
false);
72 boost::shared_ptr<common::PE::CommPattern> cp_ptr = common::allocate_component<common::PE::CommPattern>(
"commpattern");
78 boost::shared_ptr<LSS::System> sys_ptr = common::allocate_component<LSS::System>(
"system");
97 for (
int i=0; i<(
const int)(m.
elem_nodes.size()/3); i++)
105 sys.print(
"sys_test_assembly_bc_" + boost::lexical_cast<std::string>(m.
irank) +
".plt");
112 if (cp.isUpdatable()[i])
113 for (
int j=0; j<(
const int)m.
nbeqs; j++)
115 for (
int l=0;
l<(
const int)m.
nbeqs;
l++)
119 for (
int j=0; j<(
const int)m.
nbeqs; j++)
120 sys.rhs()->set_value(i,j,*vals++);
123 for (
int j=0; j<(
const int)m.
nbeqs; j++)
124 sys.solution()->set_value(i,j,*vals++);
127 for (
int i=0; i<(
const int)m.
bc_node.size(); i++)
128 if (cp.isUpdatable()[m.
bc_node[i]])
162 sys.solution()->debug_data(v);
164 if (cp.isUpdatable()[i])
165 for (
int j=0; j<(
const int)m.
nbeqs; j++)
171 std::ofstream fres(std::string(
"coords_with_sol_" + boost::lexical_cast<std::string>(m.
irank) +
".plt").c_str());
172 fres <<
"VARIABLES=\"X\",\"Y\",\"V0\",\"V1\",\"V2\"\nZONE T=\"Solve results of utest-lss-distributed-matrix.\"" << std::flush;
174 sys.solution()->debug_data(v);
176 if (cp.isUpdatable()[i])
186 CFinfo.setFilterRankZero(
true);
193 BOOST_AUTO_TEST_SUITE_END()
std::vector< cf3::Uint > bc_node
local node index of boundaries (without extension by nbeqs sub-matrix)
#define CFinfo
these are always defined
void resize(Uint numnodes, Uint numeqs)
setting up sizes
Safe pointer to an object. This is the supported method for referring to components.
This header collects all the headers needed for the linear system solver, also including configure-ti...
std::vector< cf3::Real > bc_value
what value to fix
Holding all the data and the constructor sets everything up, everything is public.
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.
std::vector< cf3::Uint > rowstart_positions
connectivity structure, CSR-style (without extension by nbeqs sub-matrix)
std::vector< cf3::Uint > global_numbering
global numbering of the nodes (without extension by nbeqs sub-matrix)
void insert(const std::string &name, T *&data, const int size, const unsigned int stride=1, const bool needs_update=true)
Real e()
Definition of the Unit charge [C].
LSSDistributedMatrixFixture()
common setup for each test case
std::vector< Uint > indices
local numbering of the unknowns
virtual void change_value(const boost::any &value)
change the value of this option
std::vector< cf3::Uint > column_indices
connectivity structure, CSR-style (without extension by nbeqs sub-matrix)
std::vector< cf3::Real > mat_prebc
matrix before applying boundary conditions
BOOST_AUTO_TEST_CASE(init_parallel_environment)
void init(int argc=0, char **args=0)
Top-level namespace for coolfluid.
std::vector< cf3::Uint > irank_updatable
rank where the node is updatable (without extension by nbeqs sub-matrix)
std::vector< cf3::Real > sol_prebc
solution before applying boundary conditions
std::vector< cf3::Real > result
reference result after solving the system
void reset(Real reset_to=0.)
reset the values to the value of reset_to
std::vector< cf3::Real > rhs_prebc
right hand side before applying boundary conditions
cf3::Uint nbeqs
number of equations
std::vector< cf3::Uint > periodic_pairs
pairs of periodic local node indices (obviously, size of vector is twice of number of periodic pairs)...
~LSSDistributedMatrixFixture()
common tear-down for each test case
std::vector< cf3::Real > nodal_coordinates
node coordinates for visualization
std::vector< cf3::Uint > bc_eqn
which equation to apply the dirichlet bc to (within nbeqs)
cf3::Uint irank
rank of current process
std::vector< cf3::Uint > elem_nodes
node ids of the elements, for mimicing the assembly
static Comm & instance()
Return a reference to the current PE.
const Option & option(const std::string &pname) const
get a constant option from the list