53 #include "az_aztec_defs.h"
55 using namespace Teuchos;
57 int main(
int argc,
char *argv[]) {
100 std::pair<std::string,int> xlate_err;
102 int * az_opt =
new int [AZ_FIRST_USER_OPTION];
103 memset(az_opt,0,
sizeof(
int)*(AZ_FIRST_USER_OPTION));
104 std::vector<double> Vaz_param;
105 Vaz_param.resize(AZ_FIRST_USER_PARAM,0.0);
107 Vaz_param[AZ_tol] = 1e-9;
123 az_opt[AZ_solver] = AZ_gmres;
124 az_opt[AZ_conv] = AZ_r0;
127 const double * az_par_val = (
const double * ) &(Vaz_param[0]);
128 xlate_err = Belos::translateFromAztecParams(tpl,az_opt,az_par_val);
130 if(xlate_err.second != Belos::TRANSLATE_FROM_AZTEC_OK || xlate_err.first.size()!=0 ) {
132 std::cout <<
" translateFromAztecParams:: failure, string is:"<<std::endl;
133 std::cout << xlate_err.first<<std::endl;
134 std::cout <<
" Error num "<< xlate_err.second<<std::endl;
135 std::cout <<
" enum Opt Param "<<std::endl;
136 for(
int i=0;i<AZ_FIRST_USER_OPTION;++i) {
137 std::cout << i<<
" "<<az_opt[i];
138 if(i<AZ_FIRST_USER_PARAM) std::cout <<
" "<<az_par_val[i];
139 std::cout<<std::endl;
146 std::cout<<
" Pass "<<std::endl;
149 az_opt[AZ_precond] = AZ_ls;
150 az_opt[AZ_conv] = AZ_rhs;
152 xlate_err = Belos::translateFromAztecParams(tpl,az_opt,az_par_val);
154 if(xlate_err.second != Belos::TRANSLATE_FROM_AZTEC_WARN) {
156 std::cout <<
" translateFromAztecParams:: failure, string is:"<<std::endl;
157 std::cout << xlate_err.first<<std::endl;
158 std::cout <<
" Error num "<< xlate_err.second<<std::endl;
164 std::cout<<
" Pass "<<std::endl;
166 az_opt[AZ_precond] = AZ_none;
167 az_opt[AZ_subdomain_solve] = AZ_icc;
168 az_opt[AZ_conv] = AZ_Anorm;
170 xlate_err = Belos::translateFromAztecParams(tpl,az_opt,az_par_val);
172 if(xlate_err.second != Belos::TRANSLATE_FROM_AZTEC_WARN) {
174 std::cout <<
" translateFromAztecParams:: failure, string is:"<<std::endl;
175 std::cout << xlate_err.first<<std::endl;
176 std::cout <<
" Error num "<< xlate_err.second<<std::endl;
182 std::cout<<
" Pass "<<std::endl;
185 az_opt[AZ_orthog]=AZ_double_classic;
186 az_opt[AZ_conv] = AZ_noscaled;
187 az_opt[AZ_subdomain_solve] = AZ_lu;
188 xlate_err = Belos::translateFromAztecParams(tpl,az_opt,az_par_val);
190 if(! (xlate_err.second | Belos::TRANSLATE_FROM_AZTEC_ERROR && xlate_err.second|Belos::TRANSLATE_FROM_AZTEC_WARN)) {
193 std::cout <<
" translateFromAztecParams:: failure, string is:"<<std::endl;
194 std::cout << xlate_err.first<<std::endl;
195 std::cout <<
" Error num "<< xlate_err.second<<std::endl;
201 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...