/usr/include/trilinos/LOCA_Epetra_xyztPrec.H is in libtrilinos-nox-dev 12.4.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | //@HEADER
// ************************************************************************
//
// LOCA: Library of Continuation Algorithms Package
// Copyright (2005) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use of this work by or on behalf of the U.S. Government.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Questions? Contact Roger Pawlowski (rppawlo@sandia.gov) or
// Eric Phipps (etphipp@sandia.gov), Sandia National Laboratories.
// ************************************************************************
// CVS Information
// $Source$
// $Author$
// $Date$
// $Revision$
// ************************************************************************
//@HEADER
#ifndef LOCA_EPETRA_XYZTPREC_H
#define LOCA_EPETRA_XYZTPREC_H
#include "NOX_Common.H"
#include "Teuchos_ParameterList.hpp"
#include "NOX_Epetra_Interface_Required.H"
#include "NOX_Epetra_Interface_Jacobian.H"
#include "NOX_Epetra_Interface_Preconditioner.H"
#include "NOX_Epetra_Vector.H"
#ifdef HAVE_MPI
#include "EpetraExt_MultiMpiComm.h"
#else
#include "EpetraExt_MultiSerialComm.h"
#endif
#include "EpetraExt_BlockVector.h"
#include "EpetraExt_BlockCrsMatrix.h"
#include "Epetra_Operator.h"
#include "Epetra_Import.h"
#include "NOX_Epetra_LinearSystem_AztecOO.H"
namespace LOCA {
namespace Epetra {
/*!
\brief Preconditioner operator class for solving space-time (XYZT) systems.
Implements right preconditioning operators for use in global
XYZT Jacobian matrix solves.
<ul>
<li> \em Global - applies a right preconditioner to the global
XYZT Jacobian matrix
<li> \em Sequential - applies single block right
preconditioning sequentially in time. This
preconditioner is intended as an efficient competitor to
the \em Global preconditioner by preconditioning using
only the nonzero blocks.
<li> \em Parallel - simultaneously applies sequential right
preconditioning across the decoupled time domains. This
means there is no communication of solutions between
time doamins.
<li> \em BlockDiagonal - similar to the \em Parallel
preconditioner, simultaneously applies sequential right
preconditioning across the decoupled time domains, but
only using the diagonal blocks of the Jacobian
matrix. Note that the BlockDiagonal and Parallel
preconditioners are equivalent when each time domain
contains only one time step.
<li> \em Parareal - two pass right preconditioning applying
\em Sequential preconditioner over a coarse time grid
(first time steps of each time domain) and then \em
Parallel preconditioning across the decoupled time
domains. This can be thought of as a linearized \em
parareal strategy for acheiving parallelism in time. The
benefit over \em Parallel preconditioning alone is that
an estimate of the solution from the time step on the
previous domain is computed to help accelerate
convergence.
<li> \em BDSDT (block diagonal in space, diagonal in time)
</ul>
*/
class xyztPrec : public Epetra_Operator,
public NOX::Epetra::Interface::Required,
public NOX::Epetra::Interface::Jacobian,
public NOX::Epetra::Interface::Preconditioner
{
public:
/*!
\brief Constructor
Builds a preconditioner operator for a full XYZT Jacobian
matrix \em jacobian. Right preconditioner applies are
controlled using the parameters in \em precLSParams.
*/
xyztPrec(EpetraExt::BlockCrsMatrix& jacobian,
Epetra_CrsMatrix &splitJac,
EpetraExt::BlockVector& solution,
EpetraExt::BlockVector& solutionOverlap,
Epetra_Import &overlapImporter,
Teuchos::ParameterList& precPrintParams,
Teuchos::ParameterList& precLSParams,
const Teuchos::RCP<EpetraExt::MultiComm> globalComm_);
//! Destructor
virtual ~xyztPrec();
//! Set transpose.
virtual int SetUseTranspose(bool UseTranspose);
//! Apply XYZT preconditioner operator
virtual int Apply(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
//! Apply XYZT preconditioner operator inverse
virtual int ApplyInverse(const Epetra_MultiVector& X, Epetra_MultiVector& Y) const;
//! Computing infinity norm
virtual double NormInf() const;
//! Label
virtual const char* Label() const;
//! Transpose
virtual bool UseTranspose() const;
//! Have norm-inf
virtual bool HasNormInf() const;
/*!
* \brief Returns a pointer to the Epetra_Comm communicator associated
* with this operator.
*/
virtual const Epetra_Comm& Comm() const;
/*!
* \brief Returns the Epetra_Map object associated with the domain of
* this operator.
*/
virtual const Epetra_Map& OperatorDomainMap() const;
/*!
* \brief Returns the Epetra_Map object associated with the range of
* this operator.
*/
virtual const Epetra_Map& OperatorRangeMap() const;
//! Compute residual \f$F\f$.
virtual bool computeF(const Epetra_Vector&,
Epetra_Vector&,
const NOX::Epetra::Interface::Required::FillType);
//! Compute Jacobian \f$J\f$.
virtual bool computeJacobian(const Epetra_Vector&, Epetra_Operator&);
//! Compute preconditioner \f$M\f$.
virtual bool computePreconditioner(const Epetra_Vector& x,
Epetra_Operator& Prec,
Teuchos::ParameterList* p = 0);
//! Exception handler for the XYZT preconditioner class.
virtual void throwError(const std::string& functionName,
const std::string& errorMsg) const;
private:
//! Reference to global XYZT Jacobian matrix.
EpetraExt::BlockCrsMatrix& jacobian;
//! Reference to split (spatial) Jacobian matrix.
Epetra_CrsMatrix &splitJac;
//! Reference to global XYZT solution.
EpetraExt::BlockVector& solution;
//! Reference to global XYZT solution overlap stored on other processors.
EpetraExt::BlockVector& solutionOverlap;
//! Reference to Epetra importer for overlapping XYZT solution imports.
Epetra_Import& overlapImporter;
//! Reference to parameter list for controlling output of solve.
Teuchos::ParameterList& printParams;
//! Reference to parameter list for controlling linear system solve.
Teuchos::ParameterList& lsParams;
//! Reference to global communicator for global XYZT operator.
const Teuchos::RCP<EpetraExt::MultiComm> globalComm;
//! Pointer to global XYZT linear system to be solved.
std::vector<NOX::Epetra::LinearSystemAztecOO *> linSys;
//! Pointer to jacobian blocks of global XYZT system.
std::vector<Teuchos::RCP<Epetra_CrsMatrix> > jacobianBlock;
//! Pointer to mass matrix blocks of global XYZT system.
std::vector<Teuchos::RCP<Epetra_CrsMatrix> > massBlock;
//! Pointer to subdiagonal blocks used in the BDSDT perconditioner.
std::vector<Teuchos::RCP<Epetra_Vector> > diagBlockSubdiag;
//! Pointer to global XYZT residual vector.
Teuchos::RCP<EpetraExt::BlockVector> residual;
//! Pointer to split (spatial) input vector of current iteration.
Teuchos::RCP<Epetra_Vector> splitVec;
//! Pointer to split (spatial) residual vector of current iteration.
Teuchos::RCP<Epetra_Vector> splitRes;
//! Pointer to split (spatial) input vector from previous iteration.
Teuchos::RCP<Epetra_Vector> splitVecOld;
//! View of split residual vector.
Teuchos::RCP<NOX::Epetra::Vector> splitRes_NEV;
//! View of split input vector.
Teuchos::RCP<NOX::Epetra::Vector> splitVec_NEV;
//! Flag indicating whether XYZT system is periodic.
bool isPeriodic;
//! Label for this operator.
std::string label;
};
} // namespace Epetra
} // namespace LOCA
#endif // LOCA_EPETRA_XYZTPREC_H
|