54 #include "AbstractLinAlgPack_exampleNLPDiagSetup.hpp"
55 #include "AbstractLinAlgPack_VectorSpaceSerial.hpp"
56 #include "OptionsFromStreamPack_OptionsFromStream.hpp"
57 #include "Teuchos_CommandLineProcessor.hpp"
59 #ifdef USE_EPETRA_THYRA
61 #include "TSFCoreSerialVectorSpaceStd.hpp"
62 #include "AbstractLinAlgPack_VectorSpaceTSFCore.hpp"
63 #include "TSFCoreEpetraVectorSpace.hpp"
64 #include "Epetra_Map.h"
66 #include "Epetra_MpiComm.h"
68 #include "Epetra_SerialComm.h"
71 #endif // USE_EPETRA_THYRA
74 int AbstractLinAlgPack::exampleNLPDiagSetup(
75 int argc,
char* argv[], MPI_Comm comm
77 ,
int *n, value_type *xo,
bool *has_bounds,
bool *dep_bounded
83 namespace mmp = MemMngPack;
86 typedef AbstractLinAlgPack::value_type value_type;
95 int num_proc, proc_rank;
96 MPI_Comm_size( comm, &num_proc );
97 MPI_Comm_rank( comm, &proc_rank );
107 #ifdef USE_EPETRA_THYRA
109 bool in_parallel =
false;
111 bool use_tsf =
false;
112 #endif // USE_EPETRA_THYRA
114 CommandLineProcessor command_line_processor;
116 command_line_processor.setOption(
"n", n,
"Global number of dependent (and independent) variables" );
117 command_line_processor.setOption(
"xo", xo,
"Initial guess of the solution" );
118 command_line_processor.setOption(
119 "has-bounds",
"no-has-bounds", has_bounds
120 ,
"Determine if the NLP has bounds or not" );
121 command_line_processor.setOption(
122 "dep-bounded",
"indep-bounded", dep_bounded
123 ,
"Determine if the dependent or independent variables are bounded" );
124 #ifdef USE_EPETRA_THYRA
125 command_line_processor.setOption(
126 "in-parallel",
"in-serial", &in_parallel
127 ,
"Determine if computations are performed in parallel or not" );
128 command_line_processor.setOption(
129 "use-tsf",
"no-use-tsf", &use_tsf
130 ,
"Determine whether to use TSF vectors or not" );
131 #endif // USE_EPETRA_THYRA
133 CommandLineProcessor::EParseCommandLineReturn
134 parse_return = command_line_processor.parse(argc,argv,&std::cerr);
136 if( parse_return != CommandLineProcessor::PARSE_SUCCESSFUL )
141 #ifdef USE_EPETRA_THYRA
143 using AbstractLinAlgPack::VectorSpaceTSFCore;
156 Teuchos::set_extra_data(comm,
"comm", Teuchos::outArg(map));
171 #else // USE_EPETRA_THYRA
175 #endif // USE_EPETRA_THYRA
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)