EpetraExt  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EpetraExt_MultiPointModelEvaluator.h
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 EPETRAEXT_MULTIPOINTMODELEVALUATOR_H
45 #define EPETRAEXT_MULTIPOINTMODELEVALUATOR_H
46 
47 #include "Epetra_ConfigDefs.h"
50 #include "EpetraExt_BlockVector.h"
52 #ifdef HAVE_MPI
53 #include "EpetraExt_MultiMpiComm.h"
54 #else
56 #endif
57 
67 namespace EpetraExt {
69  : public ModelEvaluator
70  {
71  public:
72 
75 
78  Teuchos::RCP<EpetraExt::ModelEvaluator> underlyingME_,
79  const Teuchos::RCP<EpetraExt::MultiComm> &globalComm_,
80  const std::vector<Epetra_Vector*> initGuessVec,
81  Teuchos::RCP<std::vector< Teuchos::RCP<Epetra_Vector> > > qvec,
82  Teuchos::RCP<std::vector< Teuchos::RCP<Epetra_Vector> > > matching_vec = Teuchos::null
83  );
84 
86 
88 
89 
92 
94  Teuchos::RCP<const Epetra_Map> get_x_map() const;
96  Teuchos::RCP<const Epetra_Map> get_f_map() const;
98  Teuchos::RCP<const Epetra_Map> get_p_map(int l) const;
100  Teuchos::RCP<const Epetra_Map> get_g_map(int j) const;
102  Teuchos::RCP<const Epetra_Vector> get_x_init() const;
104  Teuchos::RCP<const Epetra_Vector> get_p_init(int l) const;
106  Teuchos::RCP<Epetra_Operator> create_W() const;
108  InArgs createInArgs() const;
110  OutArgs createOutArgs() const;
112  void evalModel( const InArgs& inArgs, const OutArgs& outArgs ) const;
113 
115 
116  private:
117 
118  Teuchos::RCP<EpetraExt::ModelEvaluator> underlyingME;
119 
121  Teuchos::RCP<EpetraExt::MultiComm> globalComm;
122 
124  Teuchos::RCP<std::vector< Teuchos::RCP<Epetra_Vector> > > q_vec;
125 
127  Teuchos::RCP<Epetra_RowMatrix> split_W;
128 
130  Teuchos::RCP<Epetra_Vector> split_x;
131 
133  Teuchos::RCP<Epetra_Vector> split_f;
134 
136  Teuchos::RCP<Epetra_Vector> split_g;
137 
139  Teuchos::RCP<Epetra_MultiVector> split_DfDp;
140 
142  Teuchos::RCP<Epetra_MultiVector> split_DgDx;
143  Teuchos::RCP<Epetra_MultiVector> split_DgDp;
144 
151 
153  Teuchos::RCP<EpetraExt::BlockCrsMatrix> block_W;
154 
156  EpetraExt::BlockVector* block_x;
157 
159  EpetraExt::BlockVector* block_f;
160 
162  EpetraExt::BlockMultiVector* block_DfDp;
163 
165  EpetraExt::BlockMultiVector* block_DgDx;
166 
168  Teuchos::RCP<EpetraExt::BlockVector> solution_init;
169 
171  int underlyingNg;
172 
174  int timeStepsOnTimeDomain;
175 
177  int numTimeDomains;
178 
180  int timeDomain;
181 
188 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
189  std::vector< std::vector<int> >* rowStencil_int;
190 #endif
191 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
192  std::vector< std::vector<long long> >* rowStencil_LL;
193 #endif
194 
196 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
197  std::vector<int>* rowIndex_int;
198 #endif
199 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
200  std::vector<long long>* rowIndex_LL;
201 #endif
202  bool longlong;
203 
205  EDerivativeMultiVectorOrientation orientation_DgDp;
206  int num_dg0dp0;
207  int num_g0;
208  int num_p0;
209 
211  Teuchos::RCP<std::vector< Teuchos::RCP<Epetra_Vector> > > matching_vec;
212  bool matchingProblem;
213 
214  };
215 }
216 #endif
Teuchos::RCP< const Epetra_Vector > get_x_init() const
Teuchos::RCP< Epetra_Operator > create_W() const
Teuchos::RCP< const Epetra_Vector > get_p_init(int l) const
void evalModel(const InArgs &inArgs, const OutArgs &outArgs) const
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
Teuchos::RCP< const Epetra_Map > get_p_map(int l) const
.
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
MultiPointModelEvaluator(Teuchos::RCP< EpetraExt::ModelEvaluator > underlyingME_, const Teuchos::RCP< EpetraExt::MultiComm > &globalComm_, const std::vector< Epetra_Vector * > initGuessVec, Teuchos::RCP< std::vector< Teuchos::RCP< Epetra_Vector > > > qvec, Teuchos::RCP< std::vector< Teuchos::RCP< Epetra_Vector > > > matching_vec=Teuchos::null)
Teuchos::RCP< const Epetra_Map > get_g_map(int j) const
.
Base interface for evaluating a stateless &quot;model&quot;.
Teuchos::RCP< const Epetra_Map > get_f_map() const
Teuchos::RCP< const Epetra_Map > get_x_map() const