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 "TSFSerialVectorType.hpp"
00028 #include "TSFSerialVectorSpace.hpp"
00029 #include "TSFDenseSerialMatrixFactory.hpp"
00030 #include "TSFSerialGhostImporter.hpp"
00031 #include "SundanceOut.hpp"
00032
00033 #include "Teuchos_RefCountPtr.hpp"
00034
00035 using namespace TSFExtended;
00036 using namespace Teuchos;
00037
00038 SerialVectorType::SerialVectorType()
00039 {;}
00040
00041
00042 RCP<const Thyra::VectorSpaceBase<double> >
00043 SerialVectorType::createSpace(int dimension,
00044 int nLocal,
00045 const int* localIndices,
00046 const MPIComm& comm) const
00047 {
00048 TEST_FOR_EXCEPTION(nLocal < 0, std::runtime_error, "negative vector size n=" << nLocal);
00049 TEST_FOR_EXCEPTION(dimension != nLocal, std::runtime_error,
00050 "nLocal=" << nLocal << " and dimension=" << dimension
00051 << " should be equal for a replicated space");
00052
00053 return rcp(new SerialVectorSpace(dimension));
00054 }
00055
00056 RCP<GhostImporter<double> >
00057 SerialVectorType::createGhostImporter(const VectorSpace<double>& space,
00058 int nGhost,
00059 const int* ghostIndices) const
00060 {
00061 TEST_FOR_EXCEPTION(dynamic_cast<const SerialVectorSpace*>(space.ptr().get())==0, std::runtime_error, "expected "
00062 << space << " to be a SerialVectorSpace");
00063 return rcp(new SerialGhostImporter());
00064 }
00065
00066 RCP<MatrixFactory<double> >
00067 SerialVectorType::createMatrixFactory(const VectorSpace<double>& domain,
00068 const VectorSpace<double>& range) const
00069 {
00070 RCP<const SerialVectorSpace> serDomain
00071 = rcp_dynamic_cast<const SerialVectorSpace>(domain.ptr());
00072 RCP<const SerialVectorSpace> serRange
00073 = rcp_dynamic_cast<const SerialVectorSpace>(range.ptr());
00074
00075 RCP<MatrixFactory<double> > rtn
00076 = rcp(new DenseSerialMatrixFactory(serDomain, serRange));
00077
00078 return rtn;
00079 }
00080
00081
00082 VectorSpace<double> SerialVectorType
00083 ::createEvenlyPartitionedSpace(const MPIComm& ,
00084 int nLocal) const
00085 {
00086 RCP<const VectorSpaceBase<double> > rtn = rcp(new SerialVectorSpace(nLocal));
00087 return rtn;
00088 }
00089
00090
00091
00092
00093
00094