FEI Package Browser (Single Doxygen Collection)
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
support-Trilinos
fei_LinProbMgr_EpetraBasic.hpp
Go to the documentation of this file.
1
/*
2
// @HEADER
3
// ************************************************************************
4
// FEI: Finite Element Interface to Linear Solvers
5
// Copyright (2005) Sandia Corporation.
6
//
7
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, the
8
// U.S. Government retains certain rights in this software.
9
//
10
// Redistribution and use in source and binary forms, with or without
11
// modification, are permitted provided that the following conditions are
12
// met:
13
//
14
// 1. Redistributions of source code must retain the above copyright
15
// notice, this list of conditions and the following disclaimer.
16
//
17
// 2. Redistributions in binary form must reproduce the above copyright
18
// notice, this list of conditions and the following disclaimer in the
19
// documentation and/or other materials provided with the distribution.
20
//
21
// 3. Neither the name of the Corporation nor the names of the
22
// contributors may be used to endorse or promote products derived from
23
// this software without specific prior written permission.
24
//
25
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28
// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36
//
37
// Questions? Contact Alan Williams (william@sandia.gov)
38
//
39
// ************************************************************************
40
// @HEADER
41
*/
42
43
44
#ifndef _fei_LinProbMgr_EpetraBasic_hpp_
45
#define _fei_LinProbMgr_EpetraBasic_hpp_
46
47
#include <
fei_LinearProblemManager.hpp
>
48
49
#include <
fei_Include_Trilinos.hpp
>
50
#include <
fei_SharedPtr.hpp
>
51
52
#include <vector>
53
54
class
LinProbMgr_EpetraBasic
:
public
fei::LinearProblemManager
{
55
public
:
56
LinProbMgr_EpetraBasic
(
MPI_Comm
comm);
57
virtual
~LinProbMgr_EpetraBasic
();
58
63
void
setRowDistribution
(
const
std::vector<int>& ownedGlobalRows);
64
68
void
setMatrixGraph
(
fei::SharedPtr<fei::SparseRowGraph>
matrixGraph);
69
72
void
setMatrixValues
(
double
scalar);
73
81
void
setVectorValues
(
double
scalar,
bool
soln_vector);
82
86
int
getLocalNumRows
();
87
91
int
getRowLength
(
int
row);
92
105
int
copyOutMatrixRow
(
int
row,
int
len,
106
double
* coefs,
int
* indices);
107
115
int
insertMatrixValues
(
int
numRows,
const
int
* rows,
116
int
numCols,
const
int
* cols,
117
const
double
*
const
* values,
118
bool
sum_into);
119
142
int
insertVectorValues
(
int
numValues,
143
const
int
* globalIndices,
144
const
double
* values,
145
bool
sum_into,
146
bool
soln_vector,
147
int
vectorIndex=0);
148
152
int
copyOutVectorValues
(
int
numValues,
153
const
int
* globalIndices,
154
double
* values,
155
bool
soln_vector,
156
int
vectorIndex=0);
157
163
double
*
getLocalVectorValuesPtr
(
bool
soln_vector,
164
int
vectorIndex=0);
165
171
int
globalAssemble
();
172
175
fei::SharedPtr<Epetra_CrsMatrix>
get_A_matrix
();
176
179
fei::SharedPtr<Epetra_MultiVector>
get_rhs_vector
();
180
183
fei::SharedPtr<Epetra_MultiVector>
get_solution_vector
();
184
185
private
:
186
MPI_Comm
comm_
;
187
std::vector<int>
ownedRows_
;
188
fei::SharedPtr<Epetra_Comm>
epetra_comm_
;
189
fei::SharedPtr<Epetra_Map>
epetra_rowmap_
;
190
fei::SharedPtr<fei::SparseRowGraph>
fei_srgraph_
;
191
fei::SharedPtr<Epetra_CrsGraph>
crsgraph_
;
192
fei::SharedPtr<Epetra_CrsMatrix>
A_
;
193
int
numVectors_
;
194
fei::SharedPtr<Epetra_MultiVector>
x_
;
195
fei::SharedPtr<Epetra_MultiVector>
b_
;
196
};
197
198
#endif
// _LinProbMgr_EpetraBasic_hpp_
199
LinProbMgr_EpetraBasic::copyOutVectorValues
int copyOutVectorValues(int numValues, const int *globalIndices, double *values, bool soln_vector, int vectorIndex=0)
LinProbMgr_EpetraBasic::get_solution_vector
fei::SharedPtr< Epetra_MultiVector > get_solution_vector()
LinProbMgr_EpetraBasic::setMatrixGraph
void setMatrixGraph(fei::SharedPtr< fei::SparseRowGraph > matrixGraph)
LinProbMgr_EpetraBasic::setRowDistribution
void setRowDistribution(const std::vector< int > &ownedGlobalRows)
LinProbMgr_EpetraBasic::getLocalNumRows
int getLocalNumRows()
LinProbMgr_EpetraBasic::crsgraph_
fei::SharedPtr< Epetra_CrsGraph > crsgraph_
Definition
fei_LinProbMgr_EpetraBasic.hpp:191
LinProbMgr_EpetraBasic::comm_
MPI_Comm comm_
Definition
fei_LinProbMgr_EpetraBasic.hpp:186
LinProbMgr_EpetraBasic::setVectorValues
void setVectorValues(double scalar, bool soln_vector)
LinProbMgr_EpetraBasic::insertMatrixValues
int insertMatrixValues(int numRows, const int *rows, int numCols, const int *cols, const double *const *values, bool sum_into)
LinProbMgr_EpetraBasic::x_
fei::SharedPtr< Epetra_MultiVector > x_
Definition
fei_LinProbMgr_EpetraBasic.hpp:194
LinProbMgr_EpetraBasic::fei_srgraph_
fei::SharedPtr< fei::SparseRowGraph > fei_srgraph_
Definition
fei_LinProbMgr_EpetraBasic.hpp:190
LinProbMgr_EpetraBasic::copyOutMatrixRow
int copyOutMatrixRow(int row, int len, double *coefs, int *indices)
LinProbMgr_EpetraBasic::getLocalVectorValuesPtr
double * getLocalVectorValuesPtr(bool soln_vector, int vectorIndex=0)
LinProbMgr_EpetraBasic::get_A_matrix
fei::SharedPtr< Epetra_CrsMatrix > get_A_matrix()
LinProbMgr_EpetraBasic::epetra_rowmap_
fei::SharedPtr< Epetra_Map > epetra_rowmap_
Definition
fei_LinProbMgr_EpetraBasic.hpp:189
LinProbMgr_EpetraBasic::~LinProbMgr_EpetraBasic
virtual ~LinProbMgr_EpetraBasic()
LinProbMgr_EpetraBasic::LinProbMgr_EpetraBasic
LinProbMgr_EpetraBasic(MPI_Comm comm)
LinProbMgr_EpetraBasic::epetra_comm_
fei::SharedPtr< Epetra_Comm > epetra_comm_
Definition
fei_LinProbMgr_EpetraBasic.hpp:188
LinProbMgr_EpetraBasic::insertVectorValues
int insertVectorValues(int numValues, const int *globalIndices, const double *values, bool sum_into, bool soln_vector, int vectorIndex=0)
LinProbMgr_EpetraBasic::globalAssemble
int globalAssemble()
LinProbMgr_EpetraBasic::A_
fei::SharedPtr< Epetra_CrsMatrix > A_
Definition
fei_LinProbMgr_EpetraBasic.hpp:192
LinProbMgr_EpetraBasic::b_
fei::SharedPtr< Epetra_MultiVector > b_
Definition
fei_LinProbMgr_EpetraBasic.hpp:195
LinProbMgr_EpetraBasic::numVectors_
int numVectors_
Definition
fei_LinProbMgr_EpetraBasic.hpp:193
LinProbMgr_EpetraBasic::getRowLength
int getRowLength(int row)
LinProbMgr_EpetraBasic::get_rhs_vector
fei::SharedPtr< Epetra_MultiVector > get_rhs_vector()
LinProbMgr_EpetraBasic::ownedRows_
std::vector< int > ownedRows_
Definition
fei_LinProbMgr_EpetraBasic.hpp:187
LinProbMgr_EpetraBasic::setMatrixValues
void setMatrixValues(double scalar)
fei::LinearProblemManager
Definition
fei_LinearProblemManager.hpp:24
fei::SharedPtr
Definition
fei_SharedPtr.hpp:65
fei_Include_Trilinos.hpp
fei_LinearProblemManager.hpp
fei_SharedPtr.hpp
MPI_Comm
#define MPI_Comm
Definition
fei_mpi.h:56
Generated by
1.17.0