Tpetra Matrix/Vector Services  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Tpetra_Experimental_BlockVector_decl.hpp
00001 // @HEADER
00002 // ***********************************************************************
00003 //
00004 //          Tpetra: Templated Linear Algebra Services Package
00005 //                 Copyright (2008) Sandia Corporation
00006 //
00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00008 // the U.S. Government retains certain rights in this software.
00009 //
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00038 //
00039 // ************************************************************************
00040 // @HEADER
00041 
00042 #ifndef TPETRA_EXPERIMENTAL_BLOCKVECTOR_DECL_HPP
00043 #define TPETRA_EXPERIMENTAL_BLOCKVECTOR_DECL_HPP
00044 
00045 #include <Tpetra_Experimental_BlockMultiVector.hpp>
00046 #include <Tpetra_Vector.hpp>
00047 
00048 namespace Tpetra {
00049 namespace Experimental {
00050 
00076 template<class Scalar = BlockMultiVector<>::scalar_type,
00077          class LO = typename BlockMultiVector<Scalar>::local_ordinal_type,
00078          class GO = typename BlockMultiVector<Scalar, LO>::global_ordinal_type,
00079          class Node = typename BlockMultiVector<Scalar, LO, GO>::node_type>
00080 class BlockVector : public BlockMultiVector<Scalar, LO, GO, Node> {
00081 private:
00082   typedef BlockMultiVector<Scalar, LO, GO, Node> base_type;
00083   typedef Teuchos::ScalarTraits<Scalar> STS;
00084 
00085 public:
00087 
00088 
00090   typedef Scalar scalar_type;
00092   typedef LO local_ordinal_type;
00094   typedef GO global_ordinal_type;
00096   typedef Node node_type;
00097 
00099   typedef Tpetra::Map<local_ordinal_type, global_ordinal_type,
00100                       node_type> map_type;
00102   typedef Tpetra::MultiVector<scalar_type, local_ordinal_type,
00103                               global_ordinal_type, node_type> mv_type;
00105   typedef Tpetra::Vector<scalar_type, local_ordinal_type,
00106                          global_ordinal_type, node_type> vec_type;
00107 
00122   typedef LittleVector<Scalar, LO> little_vec_type;
00123 
00128   typedef LittleVector<const Scalar, LO> const_little_vec_type;
00129 
00131 
00132 
00133 
00163   BlockVector (const map_type& meshMap, const LO blockSize);
00164 
00169   BlockVector (const map_type& meshMap,
00170                const map_type& pointMap,
00171                const LO blockSize);
00172 
00186   BlockVector (const mv_type& X_mv,
00187                const map_type& meshMap,
00188                const LO blockSize);
00189 
00194   BlockVector ();
00195 
00197 
00198 
00199 
00204   vec_type getVectorView ();
00205 
00207 
00208 
00209 
00225   bool replaceLocalValues (const LO localRowIndex, const Scalar vals[]) const;
00226 
00236   bool replaceGlobalValues (const GO globalRowIndex, const Scalar vals[]) const;
00237 
00247   bool sumIntoLocalValues (const LO localRowIndex, const Scalar vals[]) const;
00248 
00258   bool sumIntoGlobalValues (const GO globalRowIndex, const Scalar vals[]) const;
00259 
00270   bool getLocalRowView (const LO localRowIndex, Scalar*& vals) const;
00271 
00282   bool getGlobalRowView (const GO globalRowIndex, Scalar*& vals) const;
00283 
00296   little_vec_type getLocalBlock (const LO localRowIndex) const;
00298 };
00299 
00300 } // namespace Experimental
00301 } // namespace Tpetra
00302 
00303 #endif // TPETRA_EXPERIMENTAL_BLOCKMULTIVECTOR_DECL_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines