FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fei_Vector_Local.hpp
Go to the documentation of this file.
1 /*--------------------------------------------------------------------*/
2 /* Copyright 2007 Sandia Corporation. */
3 /* Under the terms of Contract DE-AC04-94AL85000, there is a */
4 /* non-exclusive license for use of this work by or on behalf */
5 /* of the U.S. Government. Export of this program may require */
6 /* a license from the United States Government. */
7 /*--------------------------------------------------------------------*/
8 
9 #ifndef _fei_Vector_Local_hpp_
10 #define _fei_Vector_Local_hpp_
11 
12 #include <fei_iosfwd.hpp>
13 #include <fei_SharedPtr.hpp>
14 #include <fei_VectorSpace.hpp>
15 #include <fei_Vector.hpp>
16 
17 namespace fei {
18 
19 class Vector_Local : public fei::Vector {
20  public:
22 
23  virtual ~Vector_Local();
24 
25  const char* typeName() const { return("fei::Vector_Local"); }
26 
29  int update(double a,
30  const fei::Vector* x,
31  double b);
32 
39  int scatterToOverlap();
40 
41  void setCommSizes();
42 
46  int gatherFromOverlap(bool accumulate = true);
47 
49  int putScalar(double scalar);
50 
54  int sumIn(int numValues, const int* indices, const double* values,
55  int vectorIndex=0);
56 
60  int copyIn(int numValues, const int* indices, const double* values,
61  int vectorIndex=0);
62 
66 
70 
77  int sumInFieldData(int fieldID,
78  int idType,
79  int numIDs,
80  const int* IDs,
81  const double* data,
82  int vectorIndex=0);
83 
90  int copyInFieldData(int fieldID,
91  int idType,
92  int numIDs,
93  const int* IDs,
94  const double* data,
95  int vectorIndex=0);
96 
97  int copyInFieldDataLocalIDs(int fieldID,
98  int idType,
99  int numIDs,
100  const int* localIDs,
101  const double* data,
102  int vectorIndex=0);
103 
110  int copyOutFieldData(int fieldID,
111  int idType,
112  int numIDs,
113  const int* IDs,
114  double* data,
115  int vectorIndex=0);
116 
117  int copyOut(int numValues, const int* indices,
118  double* values, int vectorIndex=0) const;
119 
120  int writeToFile(const char* filename,
121  bool matrixMarketFormat=true);
122 
123  int writeToStream(FEI_OSTREAM& ostrm,
124  bool matrixMarketFormat=true);
125 
126  std::vector<double>& getCoefs();
127 
128  private:
129  int giveToVector(int numValues, const int* indices,
130  const double* values,
131  bool sumInto, int vectorIndex);
132 
133  int assembleFieldData(int fieldID,
134  int idType,
135  int numIDs,
136  const int* IDs,
137  const double* data,
138  bool sumInto,
139  int vectorIndex);
140 
141  int assembleFieldDataLocalIDs(int fieldID,
142  int idType,
143  int numIDs,
144  const int* localIDs,
145  const double* data,
146  bool sumInto,
147  int vectorIndex);
148 
150  std::vector<double> coefs_;
151  std::map<int,int> global_to_local_;
152  std::vector<int> work_indices_;
153 };//class Vector_Local
154 
155 }//namespace fei
156 
157 #endif
158 
int copyOutFieldData(int fieldID, int idType, int numIDs, const int *IDs, double *data, int vectorIndex=0)
int copyInFieldDataLocalIDs(int fieldID, int idType, int numIDs, const int *localIDs, const double *data, int vectorIndex=0)
void setVectorSpace(fei::SharedPtr< fei::VectorSpace > vecSpace)
const char * typeName() const
int assembleFieldDataLocalIDs(int fieldID, int idType, int numIDs, const int *localIDs, const double *data, bool sumInto, int vectorIndex)
int gatherFromOverlap(bool accumulate=true)
int giveToVector(int numValues, const int *indices, const double *values, bool sumInto, int vectorIndex)
fei::SharedPtr< fei::VectorSpace > vecSpace_
int copyIn(int numValues, const int *indices, const double *values, int vectorIndex=0)
int update(double a, const fei::Vector *x, double b)
int putScalar(double scalar)
int copyInFieldData(int fieldID, int idType, int numIDs, const int *IDs, const double *data, int vectorIndex=0)
int writeToStream(FEI_OSTREAM &ostrm, bool matrixMarketFormat=true)
std::map< int, int > global_to_local_
Vector_Local(fei::SharedPtr< fei::VectorSpace > vecSpace)
std::vector< double > coefs_
std::vector< double > & getCoefs()
#define FEI_OSTREAM
Definition: fei_iosfwd.hpp:24
int writeToFile(const char *filename, bool matrixMarketFormat=true)
int sumIn(int numValues, const int *indices, const double *values, int vectorIndex=0)
fei::SharedPtr< fei::VectorSpace > getVectorSpace() const
std::vector< int > work_indices_
int assembleFieldData(int fieldID, int idType, int numIDs, const int *IDs, const double *data, bool sumInto, int vectorIndex)
int copyOut(int numValues, const int *indices, double *values, int vectorIndex=0) const
int sumInFieldData(int fieldID, int idType, int numIDs, const int *IDs, const double *data, int vectorIndex=0)