21 #include "az_aztec_defs.h"
23 using namespace Teuchos;
25 int main(
int argc,
char *argv[]) {
68 std::pair<std::string,int> xlate_err;
70 int * az_opt =
new int [AZ_FIRST_USER_OPTION];
71 memset(az_opt,0,
sizeof(
int)*(AZ_FIRST_USER_OPTION));
72 std::vector<double> Vaz_param;
73 Vaz_param.resize(AZ_FIRST_USER_PARAM,0.0);
75 Vaz_param[AZ_tol] = 1e-9;
91 az_opt[AZ_solver] = AZ_gmres;
92 az_opt[AZ_conv] = AZ_r0;
95 const double * az_par_val = (
const double * ) &(Vaz_param[0]);
96 xlate_err = Belos::translateFromAztecParams(tpl,az_opt,az_par_val);
98 if(xlate_err.second != Belos::TRANSLATE_FROM_AZTEC_OK || xlate_err.first.size()!=0 ) {
100 std::cout <<
" translateFromAztecParams:: failure, string is:"<<std::endl;
101 std::cout << xlate_err.first<<std::endl;
102 std::cout <<
" Error num "<< xlate_err.second<<std::endl;
103 std::cout <<
" enum Opt Param "<<std::endl;
104 for(
int i=0;i<AZ_FIRST_USER_OPTION;++i) {
105 std::cout << i<<
" "<<az_opt[i];
106 if(i<AZ_FIRST_USER_PARAM) std::cout <<
" "<<az_par_val[i];
107 std::cout<<std::endl;
114 std::cout<<
" Pass "<<std::endl;
117 az_opt[AZ_precond] = AZ_ls;
118 az_opt[AZ_conv] = AZ_rhs;
120 xlate_err = Belos::translateFromAztecParams(tpl,az_opt,az_par_val);
122 if(xlate_err.second != Belos::TRANSLATE_FROM_AZTEC_WARN) {
124 std::cout <<
" translateFromAztecParams:: failure, string is:"<<std::endl;
125 std::cout << xlate_err.first<<std::endl;
126 std::cout <<
" Error num "<< xlate_err.second<<std::endl;
132 std::cout<<
" Pass "<<std::endl;
134 az_opt[AZ_precond] = AZ_none;
135 az_opt[AZ_subdomain_solve] = AZ_icc;
136 az_opt[AZ_conv] = AZ_Anorm;
138 xlate_err = Belos::translateFromAztecParams(tpl,az_opt,az_par_val);
140 if(xlate_err.second != Belos::TRANSLATE_FROM_AZTEC_WARN) {
142 std::cout <<
" translateFromAztecParams:: failure, string is:"<<std::endl;
143 std::cout << xlate_err.first<<std::endl;
144 std::cout <<
" Error num "<< xlate_err.second<<std::endl;
150 std::cout<<
" Pass "<<std::endl;
153 az_opt[AZ_orthog]=AZ_double_classic;
154 az_opt[AZ_conv] = AZ_noscaled;
155 az_opt[AZ_subdomain_solve] = AZ_lu;
156 xlate_err = Belos::translateFromAztecParams(tpl,az_opt,az_par_val);
158 if(! (xlate_err.second | Belos::TRANSLATE_FROM_AZTEC_ERROR && xlate_err.second|Belos::TRANSLATE_FROM_AZTEC_WARN)) {
161 std::cout <<
" translateFromAztecParams:: failure, string is:"<<std::endl;
162 std::cout << xlate_err.first<<std::endl;
163 std::cout <<
" Error num "<< xlate_err.second<<std::endl;
169 std::cout<<
" Pass All"<<std::endl;
int main(int argc, char *argv[])
Belos header file which uses auto-configuration information to include necessary C++ headers...