43 #ifndef PANZER_SG_EPETRA_LINEAR_OBJ_FACTORY_IMPL_HPP
44 #define PANZER_SG_EPETRA_LINEAR_OBJ_FACTORY_IMPL_HPP
49 #include "Epetra_LocalMap.h"
53 template <
typename Traits,
typename LocalOrdinalT>
58 : epetraFact_(epetraFact), expansion_(expansion), globalMultiComm_(globalMultiComm)
62 this->buildGatherScatterEvaluators(*
this);
65 template <
typename Traits,
typename LocalOrdinalT>
71 template <
typename Traits,
typename LocalOrdinalT>
77 for(
int i=0;i<expansion_->size();i++) {
80 coeffContainers.push_back(eCont);
86 template <
typename Traits,
typename LocalOrdinalT>
91 return epetraFact_->buildLinearObjContainer();
94 template <
typename Traits,
typename LocalOrdinalT>
100 for(
int i=0;i<expansion_->size();i++) {
103 coeffContainers.push_back(eCont);
109 template <
typename Traits,
typename LocalOrdinalT>
114 return epetraFact_->buildGhostedLinearObjContainer();
117 template <
typename Traits,
typename LocalOrdinalT>
122 bool completed =
false;
130 for(inItr=containerSG.
begin(),outItr=ghostContainerSG.
begin();
131 inItr!=containerSG.
end();inItr++,outItr++) {
132 epetraFact_->globalToGhostContainer(**inItr,**outItr,mem);
137 catch(
const std::bad_cast & bad_cast) { }
143 epetraFact_->globalToGhostContainer(container,ghostContainer,mem);
147 template <
typename Traits,
typename LocalOrdinalT>
152 bool completed =
false;
160 for(inItr=ghostContainerSG.
begin(),outItr=containerSG.
begin();
161 inItr!=ghostContainerSG.
end();inItr++,outItr++) {
162 epetraFact_->ghostToGlobalContainer(**inItr,**outItr,mem);
167 catch(
const std::bad_cast & bad_cast) { }
173 epetraFact_->ghostToGlobalContainer(ghostContainer,container,mem);
177 template <
typename Traits,
typename LocalOrdinalT>
182 bool zeroVectorRows,
bool adjustX)
const
184 bool completed =
false;
190 for(ghostObjsItr=ghostContainerSG.
begin();ghostObjsItr!=ghostContainerSG.
end();ghostObjsItr++)
191 epetraFact_->adjustForDirichletConditions(localBCRows,globalBCRows,**ghostObjsItr,zeroVectorRows);
195 catch(
const std::bad_cast & bad_cast) { }
201 epetraFact_->adjustForDirichletConditions(localBCRows,globalBCRows,ghostedObjs,zeroVectorRows);
205 template <
typename Traits,
typename LocalOrdinalT>
213 template <
typename Traits,
typename LocalOrdinalT>
217 return epetraFact_->getComm();
220 template <
typename Traits,
typename LocalOrdinalT>
224 bool completed =
false;
229 for(itr=eloc.
begin();itr!=eloc.
end();++itr)
230 epetraFact_->initializeContainer(mem,**itr);
234 catch(
const std::bad_cast & bad_cast) { }
240 epetraFact_->initializeContainer(mem,loc);
244 template <
typename Traits,
typename LocalOrdinalT>
249 bool completed =
false;
254 for(itr=eloc.
begin();itr!=eloc.
end();++itr)
255 epetraFact_->initializeGhostedContainer(mem,**itr);
259 catch(
const std::bad_cast & bad_cast) { }
265 epetraFact_->initializeGhostedContainer(mem,loc);
269 template <
typename Traits,
typename LocalOrdinalT>
275 return Teuchos::rcp(
new Stokhos::EpetraVectorOrthogPoly(expansion_->getBasis(),blockMap,epMap,globalMultiComm_));
278 template <
typename Traits,
typename LocalOrdinalT>
287 template <
typename Traits,
typename LocalOrdinalT>
291 if(sgBlockMap_==Teuchos::null)
std::vector< Teuchos::RCP< EpetraLinearObjContainer > > CoeffVector
CoeffVector::iterator end()
virtual void applyDirichletBCs(const LinearObjContainer &counter, LinearObjContainer &result) const
virtual Teuchos::MpiComm< int > getComm() const
virtual Teuchos::RCP< LinearObjContainer > buildPrimitiveLinearObjContainer() const
virtual void adjustForDirichletConditions(const LinearObjContainer &localBCRows, const LinearObjContainer &globalBCRows, LinearObjContainer &ghostedObjs, bool zeroVectorRows=false, bool adjustX=false) const
void initializeGhostedContainer(int mem, LinearObjContainer &loc) const
void initializeContainer(int mem, LinearObjContainer &loc) const
Teuchos::RCP< const Epetra_Map > getSGBlockMap() const
get the block map needed by Stokhos to describe the parallel layout of the SG unknowns ...
virtual Teuchos::RCP< LinearObjContainer > buildPrimitiveGhostedLinearObjContainer() const
CoeffVector::iterator begin()
virtual void ghostToGlobalContainer(const LinearObjContainer &ghostContainer, LinearObjContainer &container, int mem) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
SGEpetraLinearObjFactory(const Teuchos::RCP< EpetraLinearObjFactory< Traits, LocalOrdinalT > > &epetraFact, const Teuchos::RCP< Stokhos::OrthogPolyExpansion< int, double > > &expansion, const Teuchos::RCP< const EpetraExt::MultiComm > &globalMultiComm)
Teuchos::RCP< const Epetra_Map > getMap()
get the map from the matrix, this is the map for the solution vector
virtual Teuchos::RCP< LinearObjContainer > buildGhostedLinearObjContainer() const
virtual void globalToGhostContainer(const LinearObjContainer &container, LinearObjContainer &ghostContainer, int mem) const
virtual Teuchos::RCP< LinearObjContainer > buildLinearObjContainer() const
virtual ~SGEpetraLinearObjFactory()
static Epetra_Map * GenerateBlockMap(const Epetra_BlockMap &BaseMap, const int *RowIndices, int num_indices, const Epetra_Comm &GlobalComm, int Offset=0)
CoeffVector::iterator iterator
#define TEUCHOS_ASSERT(assertion_test)
Teuchos::RCP< Stokhos::EpetraVectorOrthogPoly > getVectorOrthogPoly() const
Set orthog poly object, this serves as a template for converting vectors to block vectors...
CoeffVector::const_iterator const_iterator