50 #ifdef HAVE_MOOCHO_MA28
55 namespace AbstractLinAlgPack {
58 :direct_linear_solver_type_(
59 #ifdef SPARSE_SOLVER_PACK_USE_MA48
62 # ifdef HAVE_MOOCHO_MA28
86 BasisSystemFactoryStd::obj_ptr_t
89 namespace mmp = MemMngPack;;
100 direct_sparse_solver = dss_dense;
104 #ifdef HAVE_MOOCHO_MA28
109 opt_setter(dss_ma28.
get());
112 direct_sparse_solver = dss_ma28;
115 true, std::logic_error
116 ,
"Error, HAVE_MOOCHO_MA28 is not defined and therefore MA28 is not supported!" );
122 true, std::logic_error
123 ,
"Error, MA48 is not supported yet!" );
127 #ifdef SPARSE_SOLVER_PACK_USE_SUPERLU
129 dss_slu =
Teuchos::rcp(
new DirectSparseSolverSuperLU());
131 direct_sparse_solver = dss_slu;
134 true, std::logic_error
135 ,
"Error, SPARSE_SOLVER_PACK_USE_SUPERLU is not defined and therefore SuperLU is not supported!" );
152 namespace ofsp = OptionsFromStreamPack;
153 using ofsp::OptionsFromStream;
154 typedef OptionsFromStream::options_group_t options_group_t;
155 using ofsp::StringToIntMap;
161 const std::string opt_grp_name =
"BasisSystemFactoryStd";
163 if( OptionsFromStream::options_group_exists( optgrp ) ) {
165 const int num_opts = 1;
166 enum EBasisSystemFactorStd {
169 const char* SBasisSystemFactorStd[num_opts] = {
170 "direct_linear_solver"
172 StringToIntMap map( opt_grp_name, num_opts, SBasisSystemFactorStd );
174 options_group_t::const_iterator itr = optgrp.begin();
175 for( ; itr != optgrp.end(); ++itr ) {
177 case DIRECT_LINEAR_SOLVER:
180 if( linear_solver ==
"DENSE" ) {
182 }
else if( linear_solver ==
"MA28" ) {
183 #ifdef HAVE_MOOCHO_MA28
187 true, std::logic_error
188 ,
"BasisSystemFactoryStd::read_options(...) : MA28 is not supported,"
189 " you must configure with --enable-moocho-ma28!" );
191 }
else if( linear_solver ==
"MA48" ) {
192 #ifdef SPARSE_SOLVER_PACK_USE_MA48
196 true, std::logic_error
197 ,
"BasisSystemFactoryStd::read_options(...) : MA48 is not supported,"
198 " must define SPARSE_SOLVER_PACK_USE_MA48!" );
200 }
else if( linear_solver ==
"SUPERLU" ) {
201 #ifdef SPARSE_SOLVER_PACK_USE_SUPERLU
205 true, std::logic_error
206 ,
"BasisSystemFactoryStd::read_options(...) : SUPERLU is not supported,"
207 " must define SPARSE_SOLVER_PACK_USE_SUPERLU!" );
211 true, std::invalid_argument
212 ,
"BasisSystemFactoryStd::read_options(...) : "
213 "Error, incorrect value for \"direct_linear_solver\" "
214 "Only the options \'DENSE\', \'MA28\' and \'SUPERLU\' are avalible." );
bool StringToBool(const char *opt_name, const char *str)
Convert a string "true" or "false" into bool #true# or #false#.
Concreate sparse solver subclass that uses MA28.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
const std::string & option_name(OptionsGroup::const_iterator &itr)
void set_options(const OptionsFromStream &options)
Overridden from SetOptionsFromStream and calls setOption(...).
void set_options(const options_ptr_t &options)
Concreate sparse solver subclass that uses the dense LAPACK routines.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
const options_ptr_t & get_options() const
EDirectLinearSolverType direct_linear_solver_type_
Permutatble basis system subclass that uses a direct sparse solver.
void read_options() const
options_group_t options_group(const std::string &options_group_name)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
Set options for DirectSparseSolverMA28 from OptionsFromStream object.
const std::string & option_value(OptionsGroup::const_iterator &itr)