FEI Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
fei_VectorReducer.hpp
Go to the documentation of this file.
1 /*--------------------------------------------------------------------*/
2 /* Copyright 2005 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_VectorReducer_hpp_
10 #define _fei_VectorReducer_hpp_
11 
12 #include <fei_iosfwd.hpp>
13 #include <fei_VectorSpace.hpp>
14 #include <fei_Reducer.hpp>
15 #include <fei_Vector.hpp>
16 
17 #undef fei_file
18 #define fei_file "fei_VectorReducer.hpp"
19 
20 #include <fei_ErrMacros.hpp>
21 
22 namespace fei {
23 
24  class VectorReducer : public fei::Vector {
25  public:
26 
30  bool isSolutionVector=false);
31 
33  virtual ~VectorReducer();
34 
37  { return(target_); }
38 
42  const char* typeName() const { return(target_->typeName()); }
43 
46  int update(double a,
47  const fei::Vector* x,
48  double b);
49 
56  int scatterToOverlap();
57 
59 
63  int gatherFromOverlap(bool accumulate = true);
64 
66  int putScalar(double scalar);
67 
71  int sumIn(int numValues, const int* indices, const double* values,
72  int vectorIndex=0);
73 
77  int copyIn(int numValues, const int* indices, const double* values,
78  int vectorIndex=0);
79 
83  { return(target_->getVectorSpace()); }
84 
88  { target_->setVectorSpace( vecSpace ); }
89 
96  int sumInFieldData(int fieldID,
97  int idType,
98  int numIDs,
99  const int* IDs,
100  const double* data,
101  int vectorIndex=0);
102 
109  int copyInFieldData(int fieldID,
110  int idType,
111  int numIDs,
112  const int* IDs,
113  const double* data,
114  int vectorIndex=0);
115 
116  int copyInFieldDataLocalIDs(int fieldID,
117  int idType,
118  int numIDs,
119  const int* localIDs,
120  const double* data,
121  int vectorIndex=0);
122 
129  int copyOutFieldData(int fieldID,
130  int idType,
131  int numIDs,
132  const int* IDs,
133  double* data,
134  int vectorIndex=0);
135 
136  int writeToFile(const char* filename,
137  bool matrixMarketFormat=true);
138 
139  int writeToStream(FEI_OSTREAM& ostrm,
140  bool matrixMarketFormat=true);
141 
142  int copyOut(int numValues,
143  const int* indices,
144  double* values,
145  int vectorIndex=0) const;
146 
147  private:
150  int copyOut_FE(int nodeNumber, int dofOffset, double& value);
151 
152  int giveToUnderlyingVector(int numValues,
153  const int* indices,
154  const double* values,
155  bool sumInto=true,
156  int vectorIndex=0);
157 
158  int sumIntoFEVector(int blockID,
159  int connOffset,
160  int numNodes,
161  const int* nodeNumbers,
162  const int* numIndicesPerNode,
163  const double* values);
164 
168 
171  };//class VectorReducer
172 
173 } //namespace fei
174 
175 #endif // _fei_VectorReducer_hpp_
176 
int copyOut(int numValues, const int *indices, double *values, int vectorIndex=0) const
virtual fei::SharedPtr< fei::VectorSpace > getVectorSpace() const =0
int copyInFieldData(int fieldID, int idType, int numIDs, const int *IDs, const double *data, int vectorIndex=0)
int update(double a, const fei::Vector *x, double b)
fei::SharedPtr< fei::Reducer > reducer_
int copyOutFieldData(int fieldID, int idType, int numIDs, const int *IDs, double *data, int vectorIndex=0)
VectorReducer(fei::SharedPtr< fei::Reducer > reducer, fei::SharedPtr< fei::Vector > target, bool isSolutionVector=false)
int sumIn(int numValues, const int *indices, const double *values, int vectorIndex=0)
virtual void setVectorSpace(fei::SharedPtr< fei::VectorSpace > vecSpace)=0
int writeToFile(const char *filename, bool matrixMarketFormat=true)
const char * typeName() const
int putScalar(double scalar)
fei::SharedPtr< fei::Vector > getTargetVector()
#define FEI_OSTREAM
Definition: fei_iosfwd.hpp:24
void setVectorSpace(fei::SharedPtr< fei::VectorSpace > vecSpace)
fei::SharedPtr< fei::Vector > target_
int copyInFieldDataLocalIDs(int fieldID, int idType, int numIDs, const int *localIDs, const double *data, int vectorIndex=0)
virtual const char * typeName() const =0
int gatherFromOverlap(bool accumulate=true)
int writeToStream(FEI_OSTREAM &ostrm, bool matrixMarketFormat=true)
fei::SharedPtr< fei::VectorSpace > getVectorSpace() const
int copyIn(int numValues, const int *indices, const double *values, int vectorIndex=0)
int giveToUnderlyingVector(int numValues, const int *indices, const double *values, bool sumInto=true, int vectorIndex=0)
virtual void setCommSizes()=0
int sumIntoFEVector(int blockID, int connOffset, int numNodes, const int *nodeNumbers, const int *numIndicesPerNode, const double *values)
int sumInFieldData(int fieldID, int idType, int numIDs, const int *IDs, const double *data, int vectorIndex=0)
int copyOut_FE(int nodeNumber, int dofOffset, double &value)