Thyra::ParameterDrivenMultiVectorInput< Scalar > Class Template Reference
[Development of linear Abstract Numerical Algorithms (ANAs) (Client Support)]

Concrete utility class that an ANA can use for reading in a (multi)vector as directed by a parameter sublist. More...

#include <Thyra_ParameterDrivenMultiVectorInput.hpp>

Inheritance diagram for Thyra::ParameterDrivenMultiVectorInput< Scalar >:

Inheritance graph
[legend]
List of all members.

Constructors/Initializers

 ParameterDrivenMultiVectorInput ()
 
 STANDARD_CONST_COMPOSITION_MEMBERS (VectorSpaceBase< Scalar >, vecSpc)
 Set the vector space used to create the (multi)vectors that are read in.
 STANDARD_COMPOSITION_MEMBERS (MultiVectorFileIOBase< Scalar >, fileIO)
 Set the MultiVectorFileIOBase object that will be used to read the vector from file(s).

Overridden from ParameterListAcceptor

void setParameterList (Teuchos::RCP< Teuchos::ParameterList > const &paramList)
 
Teuchos::RCP< Teuchos::ParameterListgetNonconstParameterList ()
 
Teuchos::RCP< Teuchos::ParameterListunsetParameterList ()
 
Teuchos::RCP< const Teuchos::ParameterListgetParameterList () const
 
Teuchos::RCP< const Teuchos::ParameterListgetValidParameters () const
 

Informational

const std::string & readinFileNameBase () const
 Return the value of the parameter "File Name Base" that was read in from the setParameterList() function.
const Teuchos::Array< Scalar > & readinExplicitArray () const
 Return the value of the parameter "Explicit Array" that was read in from the setParameterList() function.
Scalar readinScaleBy () const
 Return the value of the parameter "Explicit Array" that was read in from the setParameterList() function.

(Multi)Vector Readers

bool readMultiVector (const std::string &mvName, Thyra::MultiVectorBase< Scalar > *mv) const
 Read a MultiVector that has already been allocated, as directed by the set parameter sublist.
bool readVector (const std::string &vName, Teuchos::RCP< Thyra::VectorBase< Scalar > > *v) const
 Read a Vector as directed by the set parameter sublist, allocating the Vector object if it has not already been allocated.
Teuchos::RCP< Thyra::VectorBase<
Scalar > > 
readVector (const std::string &vName) const
 Read a newly allocated Vector as directed by the set parameter sublist.

Related Functions

(Note that these are not member functions.)

RCP< const VectorBase< Scalar > > readVectorOverride (const ParameterDrivenMultiVectorInput< Scalar > &pdmvi, const std::string &vName, const RCP< const VectorBase< Scalar > > &defaultVector)
 Read a vector and override if one is read.

Detailed Description

template<class Scalar>
class Thyra::ParameterDrivenMultiVectorInput< Scalar >

Concrete utility class that an ANA can use for reading in a (multi)vector as directed by a parameter sublist.

This class is made one-hundred percent general for all ANAs by accepting an abstract MultiVectorFileIOBase object that actually reads the (multi)vectors from file(s) (or whatever implementation is used for the storage of the (multi)vectors).

This class can also read in small (multi)vectors directly from the parameter sublist (see getValidParameters()).

Note that in order to use objects of this type, the client must minimally set the vector space using set_vecSpc() before any vectors can be extracted and if file IO is performed, then a MultiVectorFileIOBase object must be set using set_fileIO(). Note that the parameter sublist can be set using setParameterList() without first setting any of these two objects. In other words, this object can accept a parameter list without knowing anything about the actually type of the (multi)vector that will be read using the readMultiVector() or readVector() functions called later.

This simple utility class is not meant to be too fancy so please just study the actual implementation to see what this class does.

ToDo: When needed, implement a function that can read a multi-vector of any number of columns based on the number of columns stored in the file.

ToDo: When needed, add the ability to read in a multi-vector with more than one column directly from the array parameter.

Definition at line 76 of file Thyra_ParameterDrivenMultiVectorInput.hpp.


Constructor & Destructor Documentation

template<class Scalar>
Thyra::ParameterDrivenMultiVectorInput< Scalar >::ParameterDrivenMultiVectorInput (  ) 

Definition at line 351 of file Thyra_ParameterDrivenMultiVectorInput.hpp.


Member Function Documentation

template<class Scalar>
Thyra::ParameterDrivenMultiVectorInput< Scalar >::STANDARD_CONST_COMPOSITION_MEMBERS ( VectorSpaceBase< Scalar >  ,
vecSpc   
)

Set the vector space used to create the (multi)vectors that are read in.

template<class Scalar>
Thyra::ParameterDrivenMultiVectorInput< Scalar >::STANDARD_COMPOSITION_MEMBERS ( MultiVectorFileIOBase< Scalar >  ,
fileIO   
)

Set the MultiVectorFileIOBase object that will be used to read the vector from file(s).

template<class Scalar>
void Thyra::ParameterDrivenMultiVectorInput< Scalar >::setParameterList ( Teuchos::RCP< Teuchos::ParameterList > const &  paramList  )  [virtual]

Implements Teuchos::ParameterListAcceptor.

Definition at line 360 of file Thyra_ParameterDrivenMultiVectorInput.hpp.

template<class Scalar>
Teuchos::RCP< Teuchos::ParameterList > Thyra::ParameterDrivenMultiVectorInput< Scalar >::getNonconstParameterList (  )  [virtual]

Implements Teuchos::ParameterListAcceptor.

Definition at line 383 of file Thyra_ParameterDrivenMultiVectorInput.hpp.

template<class Scalar>
Teuchos::RCP< Teuchos::ParameterList > Thyra::ParameterDrivenMultiVectorInput< Scalar >::unsetParameterList (  )  [virtual]

Implements Teuchos::ParameterListAcceptor.

Definition at line 390 of file Thyra_ParameterDrivenMultiVectorInput.hpp.

template<class Scalar>
Teuchos::RCP< const Teuchos::ParameterList > Thyra::ParameterDrivenMultiVectorInput< Scalar >::getParameterList (  )  const [virtual]

Reimplemented from Teuchos::ParameterListAcceptor.

Definition at line 400 of file Thyra_ParameterDrivenMultiVectorInput.hpp.

template<class Scalar>
Teuchos::RCP< const Teuchos::ParameterList > Thyra::ParameterDrivenMultiVectorInput< Scalar >::getValidParameters (  )  const [virtual]

Reimplemented from Teuchos::ParameterListAcceptor.

Definition at line 407 of file Thyra_ParameterDrivenMultiVectorInput.hpp.

template<class Scalar>
const std::string & Thyra::ParameterDrivenMultiVectorInput< Scalar >::readinFileNameBase (  )  const [inline]

Return the value of the parameter "File Name Base" that was read in from the setParameterList() function.

Definition at line 275 of file Thyra_ParameterDrivenMultiVectorInput.hpp.

template<class Scalar>
const Teuchos::Array< Scalar > & Thyra::ParameterDrivenMultiVectorInput< Scalar >::readinExplicitArray (  )  const [inline]

Return the value of the parameter "Explicit Array" that was read in from the setParameterList() function.

Definition at line 283 of file Thyra_ParameterDrivenMultiVectorInput.hpp.

template<class Scalar>
Scalar Thyra::ParameterDrivenMultiVectorInput< Scalar >::readinScaleBy (  )  const [inline]

Return the value of the parameter "Explicit Array" that was read in from the setParameterList() function.

Definition at line 291 of file Thyra_ParameterDrivenMultiVectorInput.hpp.

template<class Scalar>
bool Thyra::ParameterDrivenMultiVectorInput< Scalar >::readMultiVector ( const std::string &  mvName,
Thyra::MultiVectorBase< Scalar > *  mv 
) const

Read a MultiVector that has already been allocated, as directed by the set parameter sublist.

Parameters:
mvName [in] The name of the multi-vector being read. This string name is added to any exception messages that are thrown and is printed to getDefaultOStream() if verbosity is turned on.
mv [in/out] The multi-vector to be read.
Preconditions:

Returns:
true if a vector was read, false otherwise.

Definition at line 444 of file Thyra_ParameterDrivenMultiVectorInput.hpp.

template<class Scalar>
bool Thyra::ParameterDrivenMultiVectorInput< Scalar >::readVector ( const std::string &  vName,
Teuchos::RCP< Thyra::VectorBase< Scalar > > *  v 
) const

Read a Vector as directed by the set parameter sublist, allocating the Vector object if it has not already been allocated.

Parameters:
vName [in] The name of the vector being read. This string name is added to any exception messages that are thrown and is printed to getDefaultOStream() if verbosity is turned on.
v [in/out] RCP to the vector to be read. If v->get()==NULL before this function is called, then a new vector object will be allocated and set on return. On return *(*v) will contain the values read as specified by the parameter sublist.
Preconditions:

Postconditions:

Returns:
true if a vector was read, false otherwise.
This function helps to avoid reallocations on multiple reads so that the same memory can be used over and over again.

This function simply calls the above readMultiVector() function but it allocates a Vector object instead of a multi-vector object.

Definition at line 499 of file Thyra_ParameterDrivenMultiVectorInput.hpp.

template<class Scalar>
Teuchos::RCP< Thyra::VectorBase< Scalar > > Thyra::ParameterDrivenMultiVectorInput< Scalar >::readVector ( const std::string &  vName  )  const

Read a newly allocated Vector as directed by the set parameter sublist.

This function just calls the above readVector() function (see its preconditions).

Returns:
returnVal.get()!=NULL if a vector was read and returnVal.get()==NULL if no vector was read.

Definition at line 516 of file Thyra_ParameterDrivenMultiVectorInput.hpp.


Friends And Related Function Documentation

template<class Scalar>
RCP< const VectorBase< Scalar > > readVectorOverride ( const ParameterDrivenMultiVectorInput< Scalar > &  pdmvi,
const std::string &  vName,
const RCP< const VectorBase< Scalar > > &  defaultVector 
) [related]

Read a vector and override if one is read.

Definition at line 255 of file Thyra_ParameterDrivenMultiVectorInput.hpp.


The documentation for this class was generated from the following file:
Generated on Tue Jul 13 09:26:36 2010 for Thyra by  doxygen 1.4.7