EpetraExt Package Browser (Single Doxygen Collection)  Development
GLpApp_AdvDiffReactOptModel.hpp
Go to the documentation of this file.
1 /*
2 //@HEADER
3 // ***********************************************************************
4 //
5 // EpetraExt: Epetra Extended - Linear Algebra Services Package
6 // Copyright (2011) Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
39 //
40 // ***********************************************************************
41 //@HEADER
42 */
43 
44 #ifndef GLP_APP_ADV_DIFF_REACT_OPT_MODEL_HPP
45 #define GLP_APP_ADV_DIFF_REACT_OPT_MODEL_HPP
46 
49 #include "Epetra_Map.h"
50 #include "Epetra_Vector.h"
51 #include "Epetra_Comm.h"
52 #include "Epetra_CrsGraph.h"
54 #include "Teuchos_Array.hpp"
55 
56 namespace GLpApp {
57 
164  , public Teuchos::VerboseObject<AdvDiffReactOptModel>
165 {
166 public:
167 
171  ,const double beta
172  ,const double len_x // Ignored if meshFile is *not* empty
173  ,const double len_y // Ignored if meshFile is *not* empty
174  ,const int local_nx // Ignored if meshFile is *not* empty
175  ,const int local_ny // Ignored if meshFile is *not* empty
176  ,const char meshFile[]
177  ,const int np
178  ,const double x0
179  ,const double p0
180  ,const double reactionRate
181  ,const bool normalizeBasis
182  ,const bool supportDerivatives
183  );
184 
186  void set_q( Teuchos::RCP<const Epetra_Vector> const& q );
187 
190 
193 
196 
222  InArgs createInArgs() const;
224  OutArgs createOutArgs() const;
226  void evalModel( const InArgs& inArgs, const OutArgs& outArgs ) const;
227 
229 
230 private:
231 
232  // /////////////////////////////////////
233  // Private types
234 
237 
238  // /////////////////////////////////////
239  // Private member data
240 
241  static const int Np_ = 2; // Number of axiliary parameters
242  static const int p_bndy_idx = 0; // index for boundary flux parameters
243  static const int p_rx_idx = 1; // index for reaction rate parameter
244 
246 
248 
250  int np_;
252 
255 
261 
270 
272 
273 };
274 
275 } // namespace GLpApp
276 
277 #endif // GLP_APP_ADV_DIFF_REACT_OPT_MODEL_HPP
EpetraExt::ModelEvaluator
Base interface for evaluating a stateless "model".
Definition: EpetraExt_ModelEvaluator.h:85
GLpApp
Definition: GLpApp_AdvDiffReactOptModel.cpp:93
GLpApp::AdvDiffReactOptModel::get_p_lower_bounds
Teuchos::RCP< const Epetra_Vector > get_p_lower_bounds(int l) const
Definition: GLpApp_AdvDiffReactOptModel.cpp:324
GLpApp::AdvDiffReactOptModel::x0_
Teuchos::RCP< Epetra_Vector > x0_
Definition: GLpApp_AdvDiffReactOptModel.hpp:262
GLpApp::AdvDiffReactOptModel::get_x_map
Teuchos::RCP< const Epetra_Map > get_x_map() const
Definition: GLpApp_AdvDiffReactOptModel.cpp:273
GLpApp::AdvDiffReactOptModel::createOutArgs
OutArgs createOutArgs() const
Definition: GLpApp_AdvDiffReactOptModel.cpp:362
GLpApp::AdvDiffReactOptModel::pU_
RCP_Eptra_Vector_Array_t pU_
Definition: GLpApp_AdvDiffReactOptModel.hpp:267
GLpApp::AdvDiffReactOptModel::set_q
void set_q(Teuchos::RCP< const Epetra_Vector > const &q)
Definition: GLpApp_AdvDiffReactOptModel.cpp:246
GLpApp::AdvDiffReactOptModel::RCP_Eptra_Map_Array_t
Teuchos::Array< Teuchos::RCP< const Epetra_Map > > RCP_Eptra_Map_Array_t
Definition: GLpApp_AdvDiffReactOptModel.hpp:235
GLpApp::AdvDiffReactOptModel::gL_
Teuchos::RCP< Epetra_Vector > gL_
Definition: GLpApp_AdvDiffReactOptModel.hpp:268
GLpApp::AdvDiffReactOptModel::RCP_Eptra_Vector_Array_t
Teuchos::Array< Teuchos::RCP< Epetra_Vector > > RCP_Eptra_Vector_Array_t
Definition: GLpApp_AdvDiffReactOptModel.hpp:236
GLpApp::AdvDiffReactOptModel::map_x_
Teuchos::RCP< const Epetra_Map > map_x_
Definition: GLpApp_AdvDiffReactOptModel.hpp:257
Epetra_Vector.h
GLpApp::AdvDiffReactOptModel::epetra_comm_
Teuchos::RCP< const Epetra_Comm > epetra_comm_
Definition: GLpApp_AdvDiffReactOptModel.hpp:256
Teuchos_Array.hpp
GLpApp::AdvDiffReactOptModel::p0_
RCP_Eptra_Vector_Array_t p0_
Definition: GLpApp_AdvDiffReactOptModel.hpp:265
GLpApp::AdvDiffReactOptModel::dat_
Teuchos::RCP< GLpApp::GLpYUEpetraDataPool > dat_
Definition: GLpApp_AdvDiffReactOptModel.hpp:249
GLpApp::AdvDiffReactOptModel::map_p_bar_
Teuchos::RCP< const Epetra_Map > map_p_bar_
Definition: GLpApp_AdvDiffReactOptModel.hpp:253
GLpApp::AdvDiffReactOptModel::gU_
Teuchos::RCP< Epetra_Vector > gU_
Definition: GLpApp_AdvDiffReactOptModel.hpp:269
Teuchos::RCP< const Epetra_Comm >
GLpApp::AdvDiffReactOptModel::AdvDiffReactOptModel
AdvDiffReactOptModel(const Teuchos::RCP< const Epetra_Comm > &comm, const double beta, const double len_x, const double len_y, const int local_nx, const int local_ny, const char meshFile[], const int np, const double x0, const double p0, const double reactionRate, const bool normalizeBasis, const bool supportDerivatives)
Constructor.
Definition: GLpApp_AdvDiffReactOptModel.cpp:95
Teuchos::Array
GLpApp::AdvDiffReactOptModel::supportDerivatives_
bool supportDerivatives_
Definition: GLpApp_AdvDiffReactOptModel.hpp:245
GLpApp::AdvDiffReactOptModel::p_bndy_idx
static const int p_bndy_idx
Definition: GLpApp_AdvDiffReactOptModel.hpp:242
GLpApp::AdvDiffReactOptModel::W_graph_
Teuchos::RCP< Epetra_CrsGraph > W_graph_
Definition: GLpApp_AdvDiffReactOptModel.hpp:271
EpetraExt_ModelEvaluator.h
GLpApp::AdvDiffReactOptModel::create_W
Teuchos::RCP< Epetra_Operator > create_W() const
Definition: GLpApp_AdvDiffReactOptModel.cpp:338
GLpApp::AdvDiffReactOptModel::getDataPool
Teuchos::RCP< GLpApp::GLpYUEpetraDataPool > getDataPool()
Definition: GLpApp_AdvDiffReactOptModel.cpp:259
GLpApp::AdvDiffReactOptModel::get_x_lower_bounds
Teuchos::RCP< const Epetra_Vector > get_x_lower_bounds() const
Definition: GLpApp_AdvDiffReactOptModel.cpp:312
Teuchos::VerboseObject
GLpApp::AdvDiffReactOptModel::evalModel
void evalModel(const InArgs &inArgs, const OutArgs &outArgs) const
Definition: GLpApp_AdvDiffReactOptModel.cpp:411
GLpApp::AdvDiffReactOptModel::Np_
static const int Np_
Definition: GLpApp_AdvDiffReactOptModel.hpp:241
GLpApp::AdvDiffReactOptModel::q_
Teuchos::RCP< const Epetra_Vector > q_
Definition: GLpApp_AdvDiffReactOptModel.hpp:251
GLpApp::AdvDiffReactOptModel::pL_
RCP_Eptra_Vector_Array_t pL_
Definition: GLpApp_AdvDiffReactOptModel.hpp:266
GLpApp::AdvDiffReactOptModel::create_DfDp_op
Teuchos::RCP< Epetra_Operator > create_DfDp_op(int l) const
Definition: GLpApp_AdvDiffReactOptModel.cpp:344
GLpApp::AdvDiffReactOptModel::get_x_init
Teuchos::RCP< const Epetra_Vector > get_x_init() const
Definition: GLpApp_AdvDiffReactOptModel.cpp:299
GLpApp::AdvDiffReactOptModel::get_p_init
Teuchos::RCP< const Epetra_Vector > get_p_init(int l) const
Definition: GLpApp_AdvDiffReactOptModel.cpp:305
GLpApp::AdvDiffReactOptModel::np_
int np_
Definition: GLpApp_AdvDiffReactOptModel.hpp:250
GLpApp::AdvDiffReactOptModel::map_p_
RCP_Eptra_Map_Array_t map_p_
Definition: GLpApp_AdvDiffReactOptModel.hpp:258
Epetra_Comm.h
GLpApp::AdvDiffReactOptModel::map_f_
Teuchos::RCP< const Epetra_Map > map_f_
Definition: GLpApp_AdvDiffReactOptModel.hpp:259
GLpApp::AdvDiffReactOptModel::get_x_upper_bounds
Teuchos::RCP< const Epetra_Vector > get_x_upper_bounds() const
Definition: GLpApp_AdvDiffReactOptModel.cpp:318
EpetraExt::ModelEvaluator::InArgs
Definition: EpetraExt_ModelEvaluator.h:135
GLpApp::AdvDiffReactOptModel::createInArgs
InArgs createInArgs() const
Definition: GLpApp_AdvDiffReactOptModel.cpp:352
EpetraExt::ModelEvaluator::OutArgs
Definition: EpetraExt_ModelEvaluator.h:760
GLpApp::AdvDiffReactOptModel::xU_
Teuchos::RCP< Epetra_Vector > xU_
Definition: GLpApp_AdvDiffReactOptModel.hpp:264
Epetra_CrsGraph.h
GLpApp::AdvDiffReactOptModel::p_rx_idx
static const int p_rx_idx
Definition: GLpApp_AdvDiffReactOptModel.hpp:243
GLpApp::AdvDiffReactOptModel::B_bar_
Teuchos::RCP< Epetra_MultiVector > B_bar_
Definition: GLpApp_AdvDiffReactOptModel.hpp:254
GLpApp::AdvDiffReactOptModel::get_g_map
Teuchos::RCP< const Epetra_Map > get_g_map(int j) const
\breif .
Definition: GLpApp_AdvDiffReactOptModel.cpp:292
GLpApp::AdvDiffReactOptModel::map_g_
Teuchos::RCP< const Epetra_Map > map_g_
Definition: GLpApp_AdvDiffReactOptModel.hpp:260
GLpApp::AdvDiffReactOptModel::get_f_map
Teuchos::RCP< const Epetra_Map > get_f_map() const
Definition: GLpApp_AdvDiffReactOptModel.cpp:279
GLpApp::AdvDiffReactOptModel::get_B_bar
Teuchos::RCP< const Epetra_MultiVector > get_B_bar() const
Definition: GLpApp_AdvDiffReactOptModel.cpp:265
GLpApp::AdvDiffReactOptModel::get_p_map
Teuchos::RCP< const Epetra_Map > get_p_map(int l) const
\breif .
Definition: GLpApp_AdvDiffReactOptModel.cpp:285
Epetra_Map.h
GLpApp::AdvDiffReactOptModel::xL_
Teuchos::RCP< Epetra_Vector > xL_
Definition: GLpApp_AdvDiffReactOptModel.hpp:263
GLpApp::AdvDiffReactOptModel::get_p_upper_bounds
Teuchos::RCP< const Epetra_Vector > get_p_upper_bounds(int l) const
Definition: GLpApp_AdvDiffReactOptModel.cpp:331
GLpApp::AdvDiffReactOptModel
PDE-constrained inverse problem based on a 2D discretization of a diffusion/reaction system.
Definition: GLpApp_AdvDiffReactOptModel.hpp:162
GLpApp::AdvDiffReactOptModel::isInitialized_
bool isInitialized_
Definition: GLpApp_AdvDiffReactOptModel.hpp:247
Teuchos_VerboseObject.hpp
GLpApp_GLpYUEpetraDataPool.hpp