Epetra Package Browser (Single Doxygen Collection) Development
Epetra_FEVector.h
Go to the documentation of this file.
00001 /*
00002 //@HEADER
00003 // ************************************************************************
00004 // 
00005 //               Epetra: Linear Algebra Services Package 
00006 //                 Copyright 2001 Sandia Corporation
00007 // 
00008 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00009 // the U.S. Government retains certain rights in this software.
00010 //
00011 // Redistribution and use in source and binary forms, with or without
00012 // modification, are permitted provided that the following conditions are
00013 // met:
00014 //
00015 // 1. Redistributions of source code must retain the above copyright
00016 // notice, this list of conditions and the following disclaimer.
00017 //
00018 // 2. Redistributions in binary form must reproduce the above copyright
00019 // notice, this list of conditions and the following disclaimer in the
00020 // documentation and/or other materials provided with the distribution.
00021 //
00022 // 3. Neither the name of the Corporation nor the names of the
00023 // contributors may be used to endorse or promote products derived from
00024 // this software without specific prior written permission.
00025 //
00026 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00027 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00029 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00030 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00031 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00032 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00033 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00034 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00035 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00036 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 //
00038 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00039 // 
00040 // ************************************************************************
00041 //@HEADER
00042 */
00043 
00044 #ifndef EPETRA_FEVECTOR_H
00045 #define EPETRA_FEVECTOR_H
00046 
00047 #include <Epetra_CombineMode.h>
00048 #include <Epetra_Map.h>
00049 #include <Epetra_MultiVector.h>
00050 class Epetra_IntSerialDenseVector;
00051 class Epetra_SerialDenseVector;
00052 
00068 class EPETRA_LIB_DLL_EXPORT Epetra_FEVector : public Epetra_MultiVector {
00069  public:
00085    Epetra_FEVector(const Epetra_BlockMap& Map,
00086                    int numVectors=1,
00087        bool ignoreNonLocalEntries=false);
00088 
00090   Epetra_FEVector(const Epetra_FEVector& source);
00091 
00093    virtual ~Epetra_FEVector();
00094 
00098    int SumIntoGlobalValues(int numIDs,
00099                            const int* GIDs, const double* values,
00100                            int vectorIndex=0);
00101 
00111    int SumIntoGlobalValues(const Epetra_IntSerialDenseVector& GIDs,
00112          const Epetra_SerialDenseVector& values,
00113                            int vectorIndex=0);
00114 
00118    int ReplaceGlobalValues(int numIDs, const int* GIDs, const double* values,
00119                            int vectorIndex=0);
00120 
00130    int ReplaceGlobalValues(const Epetra_IntSerialDenseVector& GIDs,
00131          const Epetra_SerialDenseVector& values,
00132                            int vectorIndex=0);
00133 
00134    int SumIntoGlobalValues(int numIDs,
00135                            const int* GIDs,
00136          const int* numValuesPerID,
00137          const double* values,
00138                            int vectorIndex=0);
00139 
00140    int ReplaceGlobalValues(int numIDs, const int* GIDs,
00141          const int* numValuesPerID,
00142          const double* values,
00143                            int vectorIndex=0);
00144 
00162    int GlobalAssemble(Epetra_CombineMode mode = Add,
00163                       bool reuse_map_and_exporter = false);
00164 
00167    void setIgnoreNonLocalEntries(bool flag) {
00168      ignoreNonLocalEntries_ = flag;
00169    }
00170 
00171    Epetra_FEVector& operator=(const Epetra_FEVector& source);
00172 
00173  private:
00174   int inputValues(int numIDs,
00175                   const int* GIDs, const double* values,
00176                   bool suminto,
00177                   int vectorIndex);
00178 
00179   int inputValues(int numIDs,
00180                   const int* GIDs, const int* numValuesPerID,
00181       const double* values,
00182                   bool suminto,
00183                   int vectorIndex);
00184 
00185   int inputNonlocalValue(int GID, double value, bool suminto,
00186                          int vectorIndex);
00187 
00188   int inputNonlocalValues(int GID, int numValues, const double* values,
00189         bool suminto, int vectorIndex);
00190 
00191   void createNonlocalMapAndExporter();
00192 
00193   void destroyNonlocalMapAndExporter();
00194 
00195   void zeroNonlocalData();
00196   void destroyNonlocalData();
00197 
00198   int myFirstID_;
00199   int myNumIDs_;
00200 
00201   int* nonlocalIDs_;
00202   int* nonlocalElementSize_;
00203   int numNonlocalIDs_;
00204   int numNonlocalIDsAlloc_;
00205   double** nonlocalCoefs_;
00206   int numNonlocalCoefs_;
00207   int numNonlocalCoefsAlloc_;
00208   Epetra_BlockMap* nonlocalMap_;
00209   Epetra_Export* exporter_;
00210   Epetra_MultiVector* nonlocalVector_;
00211 
00212   bool ignoreNonLocalEntries_;
00213 };
00214 
00215 #endif
00216 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines