EpetraExt Package Browser (Single Doxygen Collection)  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 
79  const Teuchos::RCP<EpetraExt::MultiComm> &globalComm_,
80  const std::vector<Epetra_Vector*> initGuessVec,
81  Teuchos::RCP<std::vector< Teuchos::RCP<Epetra_Vector> > > qvec,
83  );
84 
86 
88 
89 
92 
108  InArgs createInArgs() const;
110  OutArgs createOutArgs() const;
112  void evalModel( const InArgs& inArgs, const OutArgs& outArgs ) const;
113 
115 
116  private:
117 
119 
122 
125 
128 
131 
134 
137 
140 
144 
151 
154 
157 
160 
163 
166 
169 
172 
175 
178 
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 
207  int num_g0;
208  int num_p0;
209 
213 
214  };
215 }
216 #endif
Teuchos::RCP< const Epetra_Vector > get_x_init() const
Teuchos::RCP< Epetra_MultiVector > split_DgDx
Split sensitivity vector – local storage.
EpetraExt::ModelEvaluator::DerivativeMultiVector * derivMV_DgDp
Teuchos::RCP< Epetra_Operator > create_W() const
Teuchos::RCP< const Epetra_Vector > get_p_init(int l) const
std::vector< std::vector< long long > > * rowStencil_LL
std::vector< int > * rowIndex_int
Set of indices into global XYZT Jacobian matrix.
EpetraExt::BlockVector * block_x
Pointer to global multipoint solution vector – local storage.
void evalModel(const InArgs &inArgs, const OutArgs &outArgs) const
Teuchos::RCP< Epetra_Vector > split_g
Split vector of response functions – local storage.
int numTimeDomains
Total number of time step domains.
Teuchos::RCP< Epetra_Vector > split_f
Split (spatial) residual vector – local storage.
Teuchos::RCP< std::vector< Teuchos::RCP< Epetra_Vector > > > q_vec
Array of parameter vectors that define the multi-point problem.
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
Teuchos::RCP< EpetraExt::BlockCrsMatrix > block_W
Pointer to global XYZT Jacobian matrix.
int underlyingNg
Number of g vectors supported by underlyingME, often used as a bool.
Teuchos::RCP< const Epetra_Map > get_p_map(int l) const
.
EpetraExt::ModelEvaluator::Derivative * deriv_DgDp
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
int timeStepsOnTimeDomain
Number of time steps computed on each time domain.
EpetraExt::ModelEvaluator::Derivative * deriv_DfDp
Teuchos::RCP< Epetra_RowMatrix > split_W
Pointer to split (spatial) Jacobian matrix.
Teuchos::RCP< Epetra_Vector > split_x
Split (spatial) input vector – local storage.
EpetraExt::ModelEvaluator::DerivativeMultiVector * derivMV_DgDx
Teuchos::RCP< Epetra_MultiVector > split_DfDp
Split sensitivity vector – local storage.
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< EpetraExt::MultiComm > globalComm
Pointer to the global (full XYZT) communicator.
Teuchos::RCP< std::vector< Teuchos::RCP< Epetra_Vector > > > matching_vec
Array of vectors that have data for g-matching optimization problem.
Teuchos::RCP< const Epetra_Map > get_g_map(int j) const
.
EpetraExt::BlockVector * block_f
Pointer to global multipoint residual vector – local storage.
EpetraExt::BlockMultiVector * block_DfDp
Pointer to global multipoint DfDp multi vector – local storage.
EpetraExt::ModelEvaluator::DerivativeMultiVector * derivMV_DfDp
Teuchos::RCP< EpetraExt::ModelEvaluator > underlyingME
std::vector< std::vector< int > > * rowStencil_int
Stencil for each row of global XYZT Jacobian matrix.
int timeDomain
Time domain on current processor.
EpetraExt::BlockMultiVector * block_DgDx
Pointer to global multipoint DfDp multi vector – local storage.
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
Teuchos::RCP< EpetraExt::BlockVector > solution_init
Pointer to initial multipoint solution vector.
EpetraExt::ModelEvaluator::Derivative * deriv_DgDx
EDerivativeMultiVectorOrientation orientation_DgDp
Some local data.