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 #if defined(EpetraExt_SHOW_DEPRECATED_WARNINGS)
48 #ifdef __GNUC__
49 #warning "The EpetraExt package is deprecated"
50 #endif
51 #endif
52 
53 #include "Epetra_ConfigDefs.h"
56 #include "EpetraExt_BlockVector.h"
58 #ifdef HAVE_MPI
59 #include "EpetraExt_MultiMpiComm.h"
60 #else
62 #endif
63 
73 namespace EpetraExt {
75  : public ModelEvaluator
76  {
77  public:
78 
81 
84  Teuchos::RCP<EpetraExt::ModelEvaluator> underlyingME_,
85  const Teuchos::RCP<EpetraExt::MultiComm> &globalComm_,
86  const std::vector<Epetra_Vector*> initGuessVec,
87  Teuchos::RCP<std::vector< Teuchos::RCP<Epetra_Vector> > > qvec,
88  Teuchos::RCP<std::vector< Teuchos::RCP<Epetra_Vector> > > matching_vec = Teuchos::null
89  );
90 
92 
94 
95 
98 
100  Teuchos::RCP<const Epetra_Map> get_x_map() const;
102  Teuchos::RCP<const Epetra_Map> get_f_map() const;
104  Teuchos::RCP<const Epetra_Map> get_p_map(int l) const;
106  Teuchos::RCP<const Epetra_Map> get_g_map(int j) const;
108  Teuchos::RCP<const Epetra_Vector> get_x_init() const;
110  Teuchos::RCP<const Epetra_Vector> get_p_init(int l) const;
112  Teuchos::RCP<Epetra_Operator> create_W() const;
114  InArgs createInArgs() const;
116  OutArgs createOutArgs() const;
118  void evalModel( const InArgs& inArgs, const OutArgs& outArgs ) const;
119 
121 
122  private:
123 
124  Teuchos::RCP<EpetraExt::ModelEvaluator> underlyingME;
125 
127  Teuchos::RCP<EpetraExt::MultiComm> globalComm;
128 
130  Teuchos::RCP<std::vector< Teuchos::RCP<Epetra_Vector> > > q_vec;
131 
133  Teuchos::RCP<Epetra_RowMatrix> split_W;
134 
136  Teuchos::RCP<Epetra_Vector> split_x;
137 
139  Teuchos::RCP<Epetra_Vector> split_f;
140 
142  Teuchos::RCP<Epetra_Vector> split_g;
143 
145  Teuchos::RCP<Epetra_MultiVector> split_DfDp;
146 
148  Teuchos::RCP<Epetra_MultiVector> split_DgDx;
149  Teuchos::RCP<Epetra_MultiVector> split_DgDp;
150 
157 
159  Teuchos::RCP<EpetraExt::BlockCrsMatrix> block_W;
160 
162  EpetraExt::BlockVector* block_x;
163 
165  EpetraExt::BlockVector* block_f;
166 
168  EpetraExt::BlockMultiVector* block_DfDp;
169 
171  EpetraExt::BlockMultiVector* block_DgDx;
172 
174  Teuchos::RCP<EpetraExt::BlockVector> solution_init;
175 
177  int underlyingNg;
178 
180  int timeStepsOnTimeDomain;
181 
183  int numTimeDomains;
184 
186  int timeDomain;
187 
194 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
195  std::vector< std::vector<int> >* rowStencil_int;
196 #endif
197 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
198  std::vector< std::vector<long long> >* rowStencil_LL;
199 #endif
200 
202 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
203  std::vector<int>* rowIndex_int;
204 #endif
205 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
206  std::vector<long long>* rowIndex_LL;
207 #endif
208  bool longlong;
209 
211  EDerivativeMultiVectorOrientation orientation_DgDp;
212  int num_dg0dp0;
213  int num_g0;
214  int num_p0;
215 
217  Teuchos::RCP<std::vector< Teuchos::RCP<Epetra_Vector> > > matching_vec;
218  bool matchingProblem;
219 
220  };
221 }
222 #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