Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_MultiVectorFileIOBase.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
4 //
5 // Copyright 2004 NTESS and the Thyra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef THYRA_MULTI_VECTOR_FILE_IO_BASE_HPP
11 #define THYRA_MULTI_VECTOR_FILE_IO_BASE_HPP
12 
13 #include "Thyra_OperatorVectorTypes.hpp"
14 #include "Teuchos_ParameterListAcceptor.hpp"
15 #include "Teuchos_VerboseObject.hpp"
16 
17 
18 namespace Thyra {
19 
20 
49 template<class Scalar>
51  : virtual public Teuchos::VerboseObject<MultiVectorFileIOBase<Scalar> >
52 {
53 public:
54 
57  virtual bool isCompatible( const MultiVectorBase<Scalar> &mv ) const = 0;
58 
75  virtual void readMultiVectorFromFile(
76  const std::string &fileNameBase,
78  ) const = 0;
79 
91  virtual void writeMultiVectorToFile(
93  const std::string &fileNameBase
94  ) const = 0;
95 
97 
98 };
99 
100 
106 template<class Scalar>
109  const MultiVectorFileIOBase<Scalar> &fileIO,
110  const std::string &fileNameBase,
111  const VectorSpaceBase<Scalar> &vecSpc
112  )
113 {
114  Teuchos::RCP<VectorBase<Scalar> > v = createMember(vecSpc);
115  fileIO.readMultiVectorFromFile(fileNameBase,&*v);
116  return v;
117 }
118 
119 
120 } // namespace Thyra
121 
122 
123 #endif // THYRA_MULTI_VECTOR_FILE_IO_BASE_HPP
virtual bool isCompatible(const MultiVectorBase< Scalar > &mv) const =0
Return if the given multi-vector is compatible with this implementation.
Abstract interface for objects that represent a space for vectors.
Interface for a collection of column vectors called a multi-vector.
virtual void writeMultiVectorToFile(const Thyra::MultiVectorBase< Scalar > &mv, const std::string &fileNameBase) const =0
Write a (multi)vector to a file given the file base name.
Abstract strategy interface for reading and writing (multi)vector objects to and from files...
virtual void readMultiVectorFromFile(const std::string &fileNameBase, Thyra::MultiVectorBase< Scalar > *mv) const =0
Read a (multi)vector from a file given the file base name.
Teuchos::RCP< VectorBase< Scalar > > readVectorFromFile(const MultiVectorFileIOBase< Scalar > &fileIO, const std::string &fileNameBase, const VectorSpaceBase< Scalar > &vecSpc)
Read a vector from file(s) given the file base name and a vector space.