EpetraExt Package Browser (Single Doxygen Collection) Development
Loading...
Searching...
No Matches
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"
52#ifdef HAVE_MPI
54#else
56#endif
57
67namespace 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
157
160
163
166
168 Teuchos::RCP<EpetraExt::BlockVector> solution_init;
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
203
209
211 Teuchos::RCP<std::vector< Teuchos::RCP<Epetra_Vector> > > matching_vec;
213
214 };
215}
216#endif
Simple aggregate class for a derivative object represented as a column-wise multi-vector or its trans...
Simple aggregate class that stores a derivative object as a general linear operator or as a multi-vec...
Base interface for evaluating a stateless "model".
EDerivativeMultiVectorOrientation orientation_DgDp
Some local data.
Teuchos::RCP< EpetraExt::MultiComm > globalComm
Pointer to the global (full XYZT) communicator.
std::vector< std::vector< long long > > * rowStencil_LL
Teuchos::RCP< const Epetra_Map > get_x_map() const
EpetraExt::BlockVector * block_x
Pointer to global multipoint solution vector – local storage.
Teuchos::RCP< std::vector< Teuchos::RCP< Epetra_Vector > > > q_vec
Array of parameter vectors that define the multi-point problem.
EpetraExt::ModelEvaluator::DerivativeMultiVector * derivMV_DfDp
Teuchos::RCP< Epetra_RowMatrix > split_W
Pointer to split (spatial) Jacobian matrix.
EpetraExt::ModelEvaluator::Derivative * deriv_DfDp
Teuchos::RCP< Epetra_Vector > split_f
Split (spatial) residual vector – local storage.
Teuchos::RCP< const Epetra_Map > get_f_map() const
std::vector< int > * rowIndex_int
Set of indices into global XYZT Jacobian matrix.
int timeDomain
Time domain on current processor.
Teuchos::RCP< EpetraExt::BlockVector > solution_init
Pointer to initial multipoint solution vector.
void evalModel(const InArgs &inArgs, const OutArgs &outArgs) const
Teuchos::RCP< Epetra_Vector > split_x
Split (spatial) input vector – local storage.
int timeStepsOnTimeDomain
Number of time steps computed on each time domain.
Teuchos::RCP< Epetra_MultiVector > split_DfDp
Split sensitivity vector – local storage.
EpetraExt::ModelEvaluator::Derivative * deriv_DgDp
Teuchos::RCP< const Epetra_Map > get_g_map(int j) const
\breif .
EpetraExt::BlockVector * block_f
Pointer to global multipoint residual vector – local storage.
Teuchos::RCP< std::vector< Teuchos::RCP< Epetra_Vector > > > matching_vec
Array of vectors that have data for g-matching optimization problem.
EpetraExt::BlockMultiVector * block_DgDx
Pointer to global multipoint DfDp multi vector – local storage.
Teuchos::RCP< EpetraExt::ModelEvaluator > underlyingME
EpetraExt::ModelEvaluator::DerivativeMultiVector * derivMV_DgDx
Teuchos::RCP< Epetra_MultiVector > split_DgDx
Split sensitivity vector – local storage.
Teuchos::RCP< const Epetra_Vector > get_x_init() const
EpetraExt::ModelEvaluator::DerivativeMultiVector * derivMV_DgDp
EpetraExt::ModelEvaluator::Derivative * deriv_DgDx
std::vector< std::vector< int > > * rowStencil_int
Stencil for each row of global XYZT Jacobian matrix.
Teuchos::RCP< Epetra_Operator > create_W() const
Teuchos::RCP< Epetra_Vector > split_g
Split vector of response functions – local storage.
int numTimeDomains
Total number of time step domains.
Teuchos::RCP< EpetraExt::BlockCrsMatrix > block_W
Pointer to global XYZT Jacobian matrix.
EpetraExt::BlockMultiVector * block_DfDp
Pointer to global multipoint DfDp multi vector – local storage.
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
\breif .
Teuchos::RCP< const Epetra_Vector > get_p_init(int l) const
EpetraExt::BlockCrsMatrix: A class for constructing a distributed block matrix.