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 
49 #include "EpetraExt_BlockVector.h"
51 #ifdef HAVE_MPI
52 #include "EpetraExt_MultiMpiComm.h"
53 #else
55 #endif
56 
66 namespace EpetraExt {
68  : public ModelEvaluator
69  {
70  public:
71 
74 
77  Teuchos::RefCountPtr<EpetraExt::ModelEvaluator> underlyingME_,
78  const Teuchos::RefCountPtr<EpetraExt::MultiComm> &globalComm_,
79  const std::vector<Epetra_Vector*> initGuessVec,
80  Teuchos::RefCountPtr<std::vector< Teuchos::RefCountPtr<Epetra_Vector> > > qvec,
81  Teuchos::RefCountPtr<std::vector< Teuchos::RefCountPtr<Epetra_Vector> > > matching_vec = Teuchos::null
82  );
83 
85 
87 
88 
91 
93  Teuchos::RefCountPtr<const Epetra_Map> get_x_map() const;
95  Teuchos::RefCountPtr<const Epetra_Map> get_f_map() const;
97  Teuchos::RefCountPtr<const Epetra_Map> get_p_map(int l) const;
99  Teuchos::RefCountPtr<const Epetra_Map> get_g_map(int j) const;
101  Teuchos::RefCountPtr<const Epetra_Vector> get_x_init() const;
103  Teuchos::RefCountPtr<const Epetra_Vector> get_p_init(int l) const;
105  Teuchos::RefCountPtr<Epetra_Operator> create_W() const;
107  InArgs createInArgs() const;
109  OutArgs createOutArgs() const;
111  void evalModel( const InArgs& inArgs, const OutArgs& outArgs ) const;
112 
114 
115  private:
116 
117  Teuchos::RefCountPtr<EpetraExt::ModelEvaluator> underlyingME;
118 
120  Teuchos::RefCountPtr<EpetraExt::MultiComm> globalComm;
121 
123  Teuchos::RefCountPtr<std::vector< Teuchos::RefCountPtr<Epetra_Vector> > > q_vec;
124 
126  Teuchos::RefCountPtr<Epetra_RowMatrix> split_W;
127 
129  Teuchos::RefCountPtr<Epetra_Vector> split_x;
130 
132  Teuchos::RefCountPtr<Epetra_Vector> split_f;
133 
135  Teuchos::RefCountPtr<Epetra_Vector> split_g;
136 
138  Teuchos::RefCountPtr<Epetra_MultiVector> split_DfDp;
139 
141  Teuchos::RefCountPtr<Epetra_MultiVector> split_DgDx;
142  Teuchos::RefCountPtr<Epetra_MultiVector> split_DgDp;
143 
150 
152  Teuchos::RefCountPtr<EpetraExt::BlockCrsMatrix> block_W;
153 
155  EpetraExt::BlockVector* block_x;
156 
158  EpetraExt::BlockVector* block_f;
159 
161  EpetraExt::BlockMultiVector* block_DfDp;
162 
164  EpetraExt::BlockMultiVector* block_DgDx;
165 
167  Teuchos::RefCountPtr<EpetraExt::BlockVector> solution_init;
168 
170  int underlyingNg;
171 
173  int timeStepsOnTimeDomain;
174 
176  int numTimeDomains;
177 
179  int timeDomain;
180 
187  std::vector< std::vector<int> >* rowStencil;
188 
190  std::vector<int>* rowIndex;
191 
193  EDerivativeMultiVectorOrientation orientation_DgDp;
194  int num_dg0dp0;
195  int num_g0;
196  int num_p0;
197 
199  Teuchos::RefCountPtr<std::vector< Teuchos::RefCountPtr<Epetra_Vector> > > matching_vec;
200  bool matchingProblem;
201 
202  };
203 }
204 #endif
Teuchos::RefCountPtr< const Epetra_Map > get_x_map() const
Teuchos::RefCountPtr< const Epetra_Map > get_f_map() 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::RefCountPtr< Epetra_Operator > create_W() const
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
Teuchos::RefCountPtr< const Epetra_Map > get_g_map(int j) const
.
Teuchos::RefCountPtr< const Epetra_Vector > get_x_init() const
Teuchos::RefCountPtr< const Epetra_Map > get_p_map(int l) const
.
MultiPointModelEvaluator(Teuchos::RefCountPtr< EpetraExt::ModelEvaluator > underlyingME_, const Teuchos::RefCountPtr< EpetraExt::MultiComm > &globalComm_, const std::vector< Epetra_Vector * > initGuessVec, Teuchos::RefCountPtr< std::vector< Teuchos::RefCountPtr< Epetra_Vector > > > qvec, Teuchos::RefCountPtr< std::vector< Teuchos::RefCountPtr< Epetra_Vector > > > matching_vec=Teuchos::null)
Base interface for evaluating a stateless &quot;model&quot;.
Teuchos::RefCountPtr< const Epetra_Vector > get_p_init(int l) const