Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "TSFSerialVectorSpace.hpp"
00028 #include "TSFSerialVector.hpp"
00029 #include "Teuchos_Utils.hpp"
00030
00031 #include "Teuchos_DefaultSerialComm.hpp"
00032 #include "Thyra_DefaultSpmdVectorSpaceFactory.hpp"
00033 #include "Thyra_DefaultSpmdVectorSpace_decl.hpp"
00034 #include "Thyra_DefaultColumnwiseMultiVector.hpp"
00035 #include "SundanceOut.hpp"
00036 #include "Epetra_SerialComm.h"
00037 #include "Epetra_Comm.h"
00038 #ifdef HAVE_MPI
00039 #include "Epetra_MpiComm.h"
00040 #include "Teuchos_DefaultMpiComm.hpp"
00041 #endif
00042
00043
00044 #ifndef HAVE_TEUCHOS_EXPLICIT_INSTANTIATION
00045 #include "TSFVectorSpaceImpl.hpp"
00046 #endif
00047
00048
00049
00050 using namespace TSFExtended;
00051 using namespace Thyra;
00052
00053 using Teuchos::RCP;
00054
00055 SerialVectorSpace::SerialVectorSpace(int dim)
00056 : DefaultSpmdVectorSpace<double>(dim),
00057 smallVecSpcFactory_(rcp(new DefaultSpmdVectorSpaceFactory<double>()))
00058 {
00059 }
00060
00061
00062 RCP<const VectorSpaceFactoryBase<double> >
00063 SerialVectorSpace::smallVecSpcFcty() const
00064 {
00065 return smallVecSpcFactory_;
00066 }
00067
00068 bool SerialVectorSpace::isCompatible(const VectorSpaceBase<double>& other) const
00069 {
00070 const SerialVectorSpace* rvs
00071 = dynamic_cast<const SerialVectorSpace*>(&other);
00072 if (rvs != 0)
00073 {
00074 return this->dim() == rvs->dim();
00075 }
00076 return false;
00077 }
00078
00079
00080
00081
00082 Teuchos::RCP<VectorBase<double> >
00083 SerialVectorSpace::createMember() const
00084 {
00085 return rcp(new SerialVector(rcp(this, false)));
00086 }
00087
00088
00089
00090 Teuchos::RCP<MultiVectorBase<double> >
00091 SerialVectorSpace::createMembers(int n) const
00092 {
00093 RCP<const VectorSpaceBase<double> > self = rcp(this, false);
00094 RCP<const VectorSpaceBase<double> > small
00095 = rcp(new SerialVectorSpace(n));
00096 Array<RCP<VectorBase<double> > > vecs(n);
00097 for (int i=0; i<vecs.size(); i++)
00098 {
00099 vecs[i] = createMember();
00100 }
00101 return rcp(
00102 new Thyra::DefaultColumnwiseMultiVector<double>(
00103 self, small,
00104 vecs
00105 )
00106 );
00107 }
00108
00109
00110
00111 Teuchos::RCP< const VectorSpaceBase<double> >
00112 SerialVectorSpace::clone() const
00113 {
00114 return Teuchos::rcp(new SerialVectorSpace(this->dim()));
00115 }
00116
00117
00118
00119 string SerialVectorSpace::description() const
00120 {
00121 std::string rtn = "SerialVS[d=" + Teuchos::toString(this->dim()) + "]";
00122 return rtn;
00123 }
00124
00125
00126
00127