| 1 |
// @HEADER |
| 2 |
// ***************************************************************************** |
| 3 |
// Trilinos: An Object-Oriented Solver Framework |
| 4 |
// |
| 5 |
// Copyright 2001-2024 NTESS and the Trilinos contributors. |
| 6 |
// SPDX-License-Identifier: BSD-3-Clause |
| 7 |
// ***************************************************************************** |
| 8 |
// @HEADER |
| 9 |
|
| 10 |
/* ******************************************************************** */ |
| 11 |
/* See the file COPYRIGHT for a complete copyright notice, contact */ |
| 12 |
/* person and disclaimer. */ |
| 13 |
/* ******************************************************************** */ |
| 14 |
// ML-headers |
| 15 |
#include "ml_common.h" |
| 16 |
#include "TrilinosCouplings_config.h" |
| 17 |
|
| 18 |
#if defined(HAVE_ML_NOX) && defined(HAVE_ML_EPETRA) && defined(HAVE_ML_AZTECOO) && defined(HAVE_ML_TEUCHOS) && defined(HAVE_ML_IFPACK) && defined(HAVE_ML_AMESOS) && defined(HAVE_ML_EPETRAEXT) |
| 19 |
|
| 20 |
// ---------- Includes ---------- |
| 21 |
#include <ctime> |
| 22 |
#include <iostream> |
| 23 |
|
| 24 |
|
| 25 |
// ---------- User Defined Includes ---------- |
| 26 |
#include "ml_nox_ConstrainedMultiLevelOperator.H" |
| 27 |
|
| 28 |
/*----------------------------------------------------------------------* |
| 29 |
| ctor (public) m.gee 11/05| |
| 30 |
*----------------------------------------------------------------------*/ |
| 31 |
ML_NOX::ML_Nox_ConstrainedMultiLevelOperator::ML_Nox_ConstrainedMultiLevelOperator( |
| 32 |
ML_Epetra::MultiLevelOperator* ml_operator, |
| 33 |
ML_NOX::Nox_CoarseProblem_Interface& coarseinterface) : |
| 34 |
comm_(ml_operator->Comm()), |
| 35 |
coarseinterface_(coarseinterface), |
| 36 |
ml_operator_(ml_operator) |
| 37 |
{ |
| 38 |
label_ = "ML_Nox_ConstrainedMultiLevelOperator"; |
| 39 |
usetranspose_ = false; |
| 40 |
return; |
| 41 |
} |
| 42 |
|
| 43 |
/*----------------------------------------------------------------------* |
| 44 |
| dtor (public) m.gee 11/05| |
| 45 |
*----------------------------------------------------------------------*/ |
| 46 |
ML_NOX::ML_Nox_ConstrainedMultiLevelOperator::~ML_Nox_ConstrainedMultiLevelOperator() |
| 47 |
{ |
| 48 |
if (ml_operator_) delete ml_operator_; ml_operator_ = NULL; |
| 49 |
} |
| 50 |
|
| 51 |
/*----------------------------------------------------------------------* |
| 52 |
| apply multigrid linear preconditioner (public) m.gee 11/05| |
| 53 |
*----------------------------------------------------------------------*/ |
| 54 |
int ML_NOX::ML_Nox_ConstrainedMultiLevelOperator::ApplyInverse( |
| 55 |
const Epetra_MultiVector& X, Epetra_MultiVector& Y) const |
| 56 |
{ |
| 57 |
int err = ml_operator_->ApplyInverse(X,Y); |
| 58 |
#if 0 |
| 59 |
Epetra_Vector tmp(View,Y,0); |
| 60 |
coarseinterface_.ApplyAllConstraints(tmp); |
| 61 |
#endif |
| 62 |
return err; |
| 63 |
} |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
#endif // defined(HAVE_ML_NOX) && defined(HAVE_ML_EPETRA) |