Tpetra parallel linear algebra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Tpetra_FEMultiVector_decl.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Tpetra: Templated Linear Algebra Services Package
5 // Copyright (2008) Sandia Corporation
6 //
7 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8 // the 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 Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ************************************************************************
40 // @HEADER
41 
42 #ifndef TPETRA_FEMULTIVECTOR_DECL_HPP
43 #define TPETRA_FEMULTIVECTOR_DECL_HPP
44 
53 
56 
57 namespace Tpetra {
58 
59  template <class Scalar,
60  class LocalOrdinal,
61  class GlobalOrdinal,
62  class Node>
63  class FEMultiVector :
64  public MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>
65  {
66  private:
68  friend base_type;
69 
70  public:
72 
73 
75  using scalar_type = Scalar;
77  using local_ordinal_type = LocalOrdinal;
79  using global_ordinal_type = GlobalOrdinal;
80 
82  using device_type = typename base_type::device_type;
83 
85  using execution_space = typename base_type::execution_space;
86 
88  using node_type = Node;
89 
91  using dual_view_type = typename base_type::dual_view_type;
92 
94  using map_type = typename base_type::map_type;
95 
97  using impl_scalar_type = typename base_type::impl_scalar_type;
98 
100  using dot_type = typename base_type::dot_type;
101 
103  using mag_type = typename base_type::mag_type;
104 
106 
108 
110  FEMultiVector () = delete;
111 
134  FEMultiVector (const Teuchos::RCP<const map_type>& map,
135  const Teuchos::RCP<const Import<local_ordinal_type, global_ordinal_type, node_type>>& importer,
136  const size_t numVecs,
137  const bool zeroOut = true);
138 
140  FEMultiVector (const FEMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>&) = delete;
141 
143  FEMultiVector (FEMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>&&) = delete;
144 
146  FEMultiVector&
147  operator= (const FEMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>&) = delete;
148 
150  FEMultiVector&
151  operator= (FEMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>&&) = delete;
152 
162  virtual ~FEMultiVector () = default;
163 
165 
167 
169  void beginFill ();
170 
172  void endFill ();
173 
176  void globalAssemble ();
177 
183  void doOwnedPlusSharedToOwned(const CombineMode CM=Tpetra::ADD);
184 
189  void doOwnedToOwnedPlusShared(const CombineMode CM=Tpetra::ADD);
190 
192  void switchActiveMultiVector();
193 
194  protected:
199  void replaceMap (const Teuchos::RCP<const map_type>& map);
200 
202  enum FEWhichActive
203  {
204  FE_ACTIVE_OWNED_PLUS_SHARED,
205  FE_ACTIVE_OWNED
206  };
207 
209  Teuchos::RCP<base_type> inactiveMultiVector_;
210 
216  Teuchos::RCP<FEWhichActive> activeMultiVector_;
217 
219  Teuchos::RCP<const Import<local_ordinal_type, global_ordinal_type, node_type>> importer_;
220  };
221 
222 } // namespace Tpetra
223 
224 #endif // TPETRA_FEMULTIVECTOR_DECL_HPP
typename device_type::execution_space execution_space
Type of the (new) Kokkos execution space.
Kokkos::DualView< impl_scalar_type **, Kokkos::LayoutLeft, execution_space > dual_view_type
Kokkos::DualView specialization used by this class.
void replaceMap(const Teuchos::RCP< const map_type > &map)
Replace the underlying Map in place.
One or more distributed dense vectors.
int local_ordinal_type
Default value of Scalar template parameter.
Declaration of the Tpetra::MultiVector class.
typename Kokkos::Details::InnerProductSpaceTraits< impl_scalar_type >::dot_type dot_type
Type of an inner (&quot;dot&quot;) product result.
CombineMode
Rule for combining data in an Import or Export.
Sum new values into existing values.
typename Kokkos::ArithTraits< impl_scalar_type >::mag_type mag_type
Type of a norm result.
::Kokkos::Compat::KokkosDeviceWrapperNode< execution_space > node_type
Default value of Node template parameter.
Forward declaration of Tpetra::FEMultiVector.
typename map_type::device_type device_type
This class&#39; preferred Kokkos device type.
typename Kokkos::Details::ArithTraits< Scalar >::val_type impl_scalar_type
The type used internally in place of Scalar.
Map< LocalOrdinal, GlobalOrdinal, Node > map_type
The type of the Map specialization used by this class.