|
EpetraExt Development
|
00001 #include "GLpApp_AdvDiffReactOptModelCreator.hpp" 00002 00003 namespace GLpApp { 00004 00005 AdvDiffReactOptModelCreator::AdvDiffReactOptModelCreator() 00006 :len_x_(1.0) 00007 ,len_y_(1.0) 00008 ,local_nx_(3) 00009 ,local_ny_(4) 00010 ,geomFileBase_("") 00011 ,np_(1) 00012 ,normalizeBasis_(false) 00013 ,beta_(0.0) 00014 ,reactionRate_(1.0) 00015 ,x0_(0.0) 00016 ,p0_(1.0) 00017 ,supportDerivatives_(true) 00018 {} 00019 00020 void AdvDiffReactOptModelCreator::setupCLP( 00021 Teuchos::CommandLineProcessor *clp 00022 ) 00023 { 00024 clp->setOption( "len-x", &len_x_, "Mesh dimension in the x direction (Overridden by --geom-file-base)." ); 00025 clp->setOption( "len-y", &len_y_, "Mesh dimension in the y direction (Overridden by --geom-file-base)." ); 00026 clp->setOption( "local-nx", &local_nx_, "Number of local discretization segments in the x direction (Overridden by --geom-file-base)." ); 00027 clp->setOption( "local-ny", &local_ny_, "Number of local discretization segments in the y direction (Overridden by --geom-file-base)." ); 00028 clp->setOption( "geom-file-base", &geomFileBase_, "Base name of geometry file to read the mesh from." ); 00029 clp->setOption( "np", &np_, "The number of optimization parameters p (If < 0 then all of boundary is used)" ); 00030 clp->setOption( "normalize-basis", "no-normalize-basis", &normalizeBasis_, "Normalize the basis for the parameters p or not." ); 00031 clp->setOption( "beta", &beta_, "Regularization." ); 00032 clp->setOption( "reaction-rate", &reactionRate_, "The rate of the reaction" ); 00033 clp->setOption( "x0", &x0_, "Initial guess for the state." ); 00034 clp->setOption( "p0", &p0_, "Initial guess or nonminal value for optimization parameters." ); 00035 clp->setOption( "support-derivatives","no-support-derivatives",&supportDerivatives_,"Support derivatives or not." ); 00036 } 00037 00038 Teuchos::RefCountPtr<AdvDiffReactOptModel> 00039 AdvDiffReactOptModelCreator::createModel( 00040 const Teuchos::RefCountPtr<const Epetra_Comm> &comm 00041 ,std::ostream *out 00042 ) const 00043 { 00044 return Teuchos::rcp( 00045 new GLpApp::AdvDiffReactOptModel( 00046 comm,beta_,len_x_,len_y_,local_nx_,local_ny_,geomFileBase_.c_str() 00047 ,np_,x0_,p0_,reactionRate_,normalizeBasis_,supportDerivatives_ 00048 ) 00049 ); 00050 } 00051 00052 } // namespace GLpApp
1.7.4