32 #include "antioch_config.h"
36 #ifdef ANTIOCH_HAVE_EIGEN
37 #include "Eigen/Dense"
40 #ifdef ANTIOCH_HAVE_METAPHYSICL
41 #include "metaphysicl/numberarray.h"
44 #ifdef ANTIOCH_HAVE_VEXCL
45 #include "vexcl/vexcl.hpp"
70 #ifdef ANTIOCH_HAVE_GRVY
73 GRVY::GRVY_Timer_Class gt;
80 template <
typename PairScalars>
81 int vectester(
const PairScalars& example,
const std::string& testname)
85 std::vector<std::string> species_str_list;
86 const unsigned int n_species = 2;
87 species_str_list.reserve(n_species);
88 species_str_list.push_back(
"N2" );
89 species_str_list.push_back(
"Air" );
94 MicroThermo thermo_stat( chem_mixture );
99 s_mu_mixture(tran_mixture);
102 b_mu_mixture(tran_mixture);
107 std::cout << s_mu_mixture << std::endl;
108 std::cout << b_mu_mixture << std::endl;
110 PairScalars T = example;
111 for (
unsigned int tuple=0; tuple != ANTIOCH_N_TUPLES; ++tuple)
113 T[2*tuple ] = 1500.1;
114 T[2*tuple+1] = 1600.1;
117 PairScalars mu = example;
119 std::cout <<
"Blottner:" << std::endl;
120 for(
unsigned int s = 0; s < n_species; s++ )
122 #ifdef ANTIOCH_HAVE_GRVY
123 const std::string testblottner = testname +
"-blottner";
124 gt.BeginTimer(testblottner);
127 mu = b_mu_mixture(s,T);
129 #ifdef ANTIOCH_HAVE_GRVY
130 gt.EndTimer(testblottner);
133 std::cout <<
"mu(" << species_str_list[s] <<
") = " << mu << std::endl;
136 std::cout <<
"Sutherland:" << std::endl;
137 for(
unsigned int s = 0; s < n_species; s++ )
139 #ifdef ANTIOCH_HAVE_GRVY
140 const std::string testsutherland = testname +
"-sutherland";
141 gt.BeginTimer(testsutherland);
144 mu = s_mu_mixture(s,T);
146 #ifdef ANTIOCH_HAVE_GRVY
147 gt.EndTimer(testsutherland);
150 std::cout <<
"mu(" << species_str_list[s] <<
") = " << mu << std::endl;
162 returnval = returnval ||
163 vectester (std::valarray<float>(2*ANTIOCH_N_TUPLES),
"valarray<float>");
164 returnval = returnval ||
165 vectester (std::valarray<double>(2*ANTIOCH_N_TUPLES),
"valarray<double>");
166 returnval = returnval ||
167 vectester (std::valarray<long double>(2*ANTIOCH_N_TUPLES),
"valarray<ld>");
168 #ifdef ANTIOCH_HAVE_EIGEN
169 returnval = returnval ||
170 vectester (Eigen::Array<float, 2*ANTIOCH_N_TUPLES, 1>(),
"Eigen::ArrayXf");
171 returnval = returnval ||
172 vectester (Eigen::Array<double, 2*ANTIOCH_N_TUPLES, 1>(),
"Eigen::ArrayXd");
173 returnval = returnval ||
174 vectester (Eigen::Array<long double, 2*ANTIOCH_N_TUPLES, 1>(),
"Eigen::ArrayXld");
176 #ifdef ANTIOCH_HAVE_METAPHYSICL
177 returnval = returnval ||
178 vectester (MetaPhysicL::NumberArray<2*ANTIOCH_N_TUPLES, float> (0),
"NumberArray<float>");
179 returnval = returnval ||
180 vectester (MetaPhysicL::NumberArray<2*ANTIOCH_N_TUPLES, double> (0),
"NumberArray<double>");
181 returnval = returnval ||
182 vectester (MetaPhysicL::NumberArray<2*ANTIOCH_N_TUPLES, long double> (0),
"NumberArray<ld>");
184 #ifdef ANTIOCH_HAVE_VEXCL
185 vex::Context ctx_f (vex::Filter::All);
187 returnval = returnval ||
188 vectester (vex::vector<float> (ctx_f, 2*ANTIOCH_N_TUPLES),
"vex::vector<float>");
190 vex::Context ctx_d (vex::Filter::DoublePrecision);
192 returnval = returnval ||
193 vectester (vex::vector<double> (ctx_d, 2*ANTIOCH_N_TUPLES),
"vex::vector<double>");
196 #ifdef ANTIOCH_HAVE_GRVY
int vectester(const PairScalars &example, const std::string &testname)
Container class for species viscosities.
Class storing chemical mixture properties.
static const std::string & sutherland_data()
static const std::string & blottner_data()
Class storing chemical mixture properties.