Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_STK_SetupLOWSFactory.cpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Panzer: A partial differential equation assembly
5 // engine for strongly coupled complex multiphysics systems
6 // Copyright (2011) Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Roger P. Pawlowski (rppawlo@sandia.gov) and
39 // Eric C. Cyr (eccyr@sandia.gov)
40 // ***********************************************************************
41 // @HEADER
42 
43 #include "PanzerAdaptersSTK_config.hpp"
44 
48 
49 #include "Teuchos_AbstractFactoryStd.hpp"
50 
51 #include "Stratimikos_DefaultLinearSolverBuilder.hpp"
52 
53 #ifdef PANZER_HAVE_EPETRA_STACK
54 #include "Epetra_MpiComm.h"
55 #include "Epetra_Vector.h"
56 #include "EpetraExt_VectorOut.h"
57 #endif // PANZER_HAVE_EPETRA_STACK
58 
59 #include "Tpetra_Map.hpp"
60 #include "Tpetra_MultiVector.hpp"
61 
62 #ifdef PANZER_HAVE_TEKO
63 #include "Teko_StratimikosFactory.hpp"
64 #endif
65 
66 #ifdef PANZER_HAVE_MUELU
67 #include "Stratimikos_MueLuHelpers.hpp"
68 //#include "MatrixMarket_Tpetra.hpp"
69 #include "Xpetra_MapFactory.hpp"
70 #include "Xpetra_MultiVectorFactory.hpp"
71 #endif
72 
73 namespace panzer_stk {
74 
75 namespace {
76 
77  bool
78  determineCoordinateField(const panzer::GlobalIndexer & globalIndexer,std::string & fieldName)
79  {
80  std::vector<std::string> elementBlocks;
81  globalIndexer.getElementBlockIds(elementBlocks);
82 
83  // grab fields for first block
84  std::set<int> runningFields;
85  {
86  const std::vector<int> & fields = globalIndexer.getBlockFieldNumbers(elementBlocks[0]);
87  runningFields.insert(fields.begin(),fields.end());
88  }
89 
90  // grab fields for first block
91  for(std::size_t i=1;i<elementBlocks.size();i++) {
92  const std::vector<int> & fields = globalIndexer.getBlockFieldNumbers(elementBlocks[i]);
93 
94  std::set<int> currentFields(runningFields);
95  runningFields.clear();
96  std::set_intersection(fields.begin(),fields.end(),
97  currentFields.begin(),currentFields.end(),
98  std::inserter(runningFields,runningFields.begin()));
99  }
100 
101  if(runningFields.size()<1)
102  return false;
103 
104  fieldName = globalIndexer.getFieldString(*runningFields.begin());
105  return true;
106  }
107 
108  void
109  fillFieldPatternMap(const panzer::DOFManager & globalIndexer,
110  const std::string & fieldName,
111  std::map<std::string,Teuchos::RCP<const panzer::Intrepid2FieldPattern> > & fieldPatterns)
112  {
113  std::vector<std::string> elementBlocks;
114  globalIndexer.getElementBlockIds(elementBlocks);
115 
116  for(std::size_t e=0;e<elementBlocks.size();e++) {
117  std::string blockId = elementBlocks[e];
118 
119  if(globalIndexer.fieldInBlock(fieldName,blockId))
120  fieldPatterns[blockId] =
121  Teuchos::rcp_dynamic_cast<const panzer::Intrepid2FieldPattern>(globalIndexer.getFieldPattern(blockId,fieldName),true);
122  }
123  }
124 
125  void
126  fillFieldPatternMap(const panzer::GlobalIndexer & globalIndexer,
127  const std::string & fieldName,
128  std::map<std::string,Teuchos::RCP<const panzer::Intrepid2FieldPattern> > & fieldPatterns)
129  {
130  using Teuchos::Ptr;
131  using Teuchos::ptrFromRef;
132  using Teuchos::ptr_dynamic_cast;
133  using panzer::DOFManager;
134 
135  // first standard dof manager
136  {
137  Ptr<const DOFManager> dofManager = ptr_dynamic_cast<const DOFManager>(ptrFromRef(globalIndexer));
138 
139  if(dofManager!=Teuchos::null) {
140  fillFieldPatternMap(*dofManager,fieldName,fieldPatterns);
141  return;
142  }
143  }
144  }
145 } // end anonymous namespace
146 
148  buildLOWSFactory(bool blockedAssembly,
149  const Teuchos::RCP<const panzer::GlobalIndexer> & globalIndexer,
150  const Teuchos::RCP<panzer_stk::STKConnManager> & stkConn_manager,
151  int spatialDim,
152  const Teuchos::RCP<const Teuchos::MpiComm<int> > & mpi_comm,
153  const Teuchos::RCP<Teuchos::ParameterList> & strat_params,
154  #ifdef PANZER_HAVE_TEKO
155  const Teuchos::RCP<Teko::RequestHandler> & reqHandler,
156  #endif
157  bool writeCoordinates,
158  bool writeTopo,
159  const Teuchos::RCP<const panzer::GlobalIndexer> & auxGlobalIndexer,
160  bool useCoordinates
161  )
162  {
163  using Teuchos::RCP;
164  using Teuchos::rcp;
165  using Teuchos::rcp_dynamic_cast;
166 
167  Stratimikos::DefaultLinearSolverBuilder linearSolverBuilder;
168 
169  // Note if you want to use new solvers within Teko they have to be added to the solver builer
170  // before teko is added. This is because Teko steals its defaults from the solver its being injected
171  // into!
172 
173  #ifdef PANZER_HAVE_MUELU
174  {
175  Stratimikos::enableMueLu<double,int,panzer::GlobalOrdinal,panzer::TpetraNodeType>(linearSolverBuilder,"MueLu");
176  Stratimikos::enableMueLuRefMaxwell<double,int,panzer::GlobalOrdinal,panzer::TpetraNodeType>(linearSolverBuilder,"MueLuRefMaxwell");
177  Stratimikos::enableMueLuMaxwell1<double,int,panzer::GlobalOrdinal,panzer::TpetraNodeType>(linearSolverBuilder,"MueLuMaxwell1");
178  #ifndef PANZER_HIDE_DEPRECATED_CODE
179  // the next two are only for backwards compatibility
180  Stratimikos::enableMueLu<double,int,panzer::GlobalOrdinal,panzer::TpetraNodeType>(linearSolverBuilder,"MueLu-Tpetra");
181  Stratimikos::enableMueLuRefMaxwell<double,int,panzer::GlobalOrdinal,panzer::TpetraNodeType>(linearSolverBuilder,"MueLuRefMaxwell-Tpetra");
182  #endif
183  }
184  #endif // MUELU
185 
186  #ifdef PANZER_HAVE_TEKO
187  RCP<Teko::RequestHandler> reqHandler_local = reqHandler;
188 
189  if(!blockedAssembly) {
190 
191  std::string fieldName;
192 
193  // try to set request handler from member variable; This is a potential segfault
194  // if its internally stored data (e.g. callback) gets released and all its data
195  // required by ML or whatever gets hosed
196  if(reqHandler_local==Teuchos::null)
197  reqHandler_local = rcp(new Teko::RequestHandler);
198 
199  // add in the coordinate parameter list callback handler
200  if(determineCoordinateField(*globalIndexer,fieldName)) {
201  std::map<std::string,RCP<const panzer::Intrepid2FieldPattern> > fieldPatterns;
202  fillFieldPatternMap(*globalIndexer,fieldName,fieldPatterns);
203 
205  panzer_stk::ParameterListCallback(fieldName,fieldPatterns,stkConn_manager,
206  rcp_dynamic_cast<const panzer::GlobalIndexer>(globalIndexer)));
207  reqHandler_local->addRequestCallback(callback);
208 
209  // determine if you want rigid body null space modes...currently an extremely specialized case!
210  if(strat_params->sublist("Preconditioner Types").isSublist("ML")) {
211 /* COMMENTING THIS OUT FOR NOW, this is causing problems with some of the preconditioners in optimization...not sure why
212 
213  Teuchos::ParameterList & ml_params = strat_params->sublist("Preconditioner Types").sublist("ML").sublist("ML Settings");
214 
215  {
216  // force parameterlistcallback to build coordinates
217  callback->preRequest(Teko::RequestMesg(rcp(new Teuchos::ParameterList())));
218 
219  // extract coordinate vectors
220  std::vector<double> & xcoords = const_cast<std::vector<double> & >(callback->getXCoordsVector());
221  std::vector<double> & ycoords = const_cast<std::vector<double> & >(callback->getYCoordsVector());
222  std::vector<double> & zcoords = const_cast<std::vector<double> & >(callback->getZCoordsVector());
223 
224  ml_params.set<double*>("x-coordinates",&xcoords[0]);
225  ml_params.set<double*>("y-coordinates",&ycoords[0]);
226  ml_params.set<double*>("z-coordinates",&zcoords[0]);
227  }
228 */
229 /*
230  bool useRigidBodyNullSpace = false;
231  if(ml_params.isType<std::string>("null space: type"))
232  useRigidBodyNullSpace = ml_params.get<std::string>("null space: type") == "pre-computed";
233 
234  if(useRigidBodyNullSpace) {
235  // force parameterlistcallback to build coordinates
236  callback->preRequest(Teko::RequestMesg(rcp(new Teuchos::ParameterList())));
237 
238  RCP<std::vector<double> > rbm = rcp(new std::vector<double>);
239  std::vector<double> & rbm_ref = *rbm;
240 
241  // extract coordinate vectors
242  std::vector<double> & xcoords = const_cast<std::vector<double> & >(callback->getXCoordsVector());
243  std::vector<double> & ycoords = const_cast<std::vector<double> & >(callback->getYCoordsVector());
244  std::vector<double> & zcoords = const_cast<std::vector<double> & >(callback->getZCoordsVector());
245 
246  // use ML to build the null space modes for ML
247  int Nnodes = Teuchos::as<int>(xcoords.size());
248  int NscalarDof = 0;
249  int Ndof = spatialDim;
250  int nRBM = spatialDim==3 ? 6 : (spatialDim==2 ? 3 : 1);
251  int rbmSize = Nnodes*(nRBM+NscalarDof)*(Ndof+NscalarDof);
252  rbm_ref.resize(rbmSize);
253 
254  ML_Coord2RBM(Nnodes,&xcoords[0],&ycoords[0],&zcoords[0],&rbm_ref[0],Ndof,NscalarDof);
255 
256  ml_params.set<double*>("null space: vectors",&rbm_ref[0]);
257  ml_params.set<int>("null space: dimension",nRBM);
258 
259  callback->storeExtraVector(rbm);
260  }
261 */
262  }
263 
264  if(writeCoordinates) {
265 #ifdef PANZER_HAVE_EPETRA_STACK
266  // force parameterlistcallback to build coordinates
267  callback->preRequest(Teko::RequestMesg(rcp(new Teuchos::ParameterList())));
268 
269  // extract coordinate vectors
270  const std::vector<double> & xcoords = callback->getXCoordsVector();
271  const std::vector<double> & ycoords = callback->getYCoordsVector();
272  const std::vector<double> & zcoords = callback->getZCoordsVector();
273 
274  // use epetra to write coordinates to matrix market files
275  Epetra_MpiComm ep_comm(*mpi_comm->getRawMpiComm()); // this is OK access to RawMpiComm becase its declared on the stack?
276  // and all users of this object are on the stack (within scope of mpi_comm
277  Epetra_Map map(-1,xcoords.size(),0,ep_comm);
278 
279  RCP<Epetra_Vector> vec;
280  switch(spatialDim) {
281  case 3:
282  vec = rcp(new Epetra_Vector(Copy,map,const_cast<double *>(&zcoords[0])));
283  EpetraExt::VectorToMatrixMarketFile("zcoords.mm",*vec);
284  // Intentional fall-through.
285  case 2:
286  vec = rcp(new Epetra_Vector(Copy,map,const_cast<double *>(&ycoords[0])));
287  EpetraExt::VectorToMatrixMarketFile("ycoords.mm",*vec);
288  // Intentional fall-through.
289  case 1:
290  vec = rcp(new Epetra_Vector(Copy,map,const_cast<double *>(&xcoords[0])));
291  EpetraExt::VectorToMatrixMarketFile("xcoords.mm",*vec);
292  break;
293  default:
294  TEUCHOS_ASSERT(false);
295  }
296 #else
297  TEUCHOS_TEST_FOR_EXCEPTION(true,std::runtime_error,"ERROR: Panzer_STK_SetupLOWSFactory.cpp - writeCoordinates not implemented for Tpetra yet!");
298 #endif
299  }
300 
301 #ifdef PANZER_HAVE_MUELU
302  if(rcp_dynamic_cast<const panzer::GlobalIndexer>(globalIndexer)!=Teuchos::null
303  && useCoordinates) {
304  if(!writeCoordinates)
305  callback->preRequest(Teko::RequestMesg(rcp(new Teuchos::ParameterList())));
306 
307  typedef Tpetra::Map<int,panzer::GlobalOrdinal,panzer::TpetraNodeType> Map;
308  typedef Tpetra::MultiVector<double,int,panzer::GlobalOrdinal,panzer::TpetraNodeType> MV;
309 
310  // extract coordinate vectors and modify strat_params to include coordinate vectors
311  unsigned dim = Teuchos::as<unsigned>(spatialDim);
312  RCP<MV> coords;
313  for(unsigned d=0;d<dim;d++) {
314  const std::vector<double> & coord = callback->getCoordsVector(d);
315 
316  // no coords vector has been build yet, build one
317  if(coords==Teuchos::null) {
318  if(globalIndexer->getNumFields()==1) {
320  = rcp_dynamic_cast<const panzer::GlobalIndexer>(globalIndexer);
321  std::vector<panzer::GlobalOrdinal> ownedIndices;
322  ugi->getOwnedIndices(ownedIndices);
323  RCP<const Map> coords_map = rcp(new Map(Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::invalid(),ownedIndices,0,mpi_comm));
324  coords = rcp(new MV(coords_map,dim));
325  }
326  else {
327  RCP<const Map> coords_map = rcp(new Map(Teuchos::OrdinalTraits<panzer::GlobalOrdinal>::invalid(),coord.size(),0,mpi_comm));
328  coords = rcp(new MV(coords_map,dim));
329  }
330  }
331 
332  // sanity check the size
333  TEUCHOS_ASSERT(coords->getLocalLength()==coord.size());
334 
335  // fill appropriate coords vector
336  Teuchos::ArrayRCP<double> dest = coords->getDataNonConst(d);
337  for(std::size_t i=0;i<coord.size();i++)
338  dest[i] = coord[i];
339  }
340 
341  // inject coordinates into parameter list
342  Teuchos::ParameterList & muelu_params = strat_params->sublist("Preconditioner Types").sublist("MueLu");
343  muelu_params.set<RCP<MV> >("Coordinates",coords);
344  }
345  #endif
346  }
347  // else write_out_the_mesg("Warning: No unique field determines the coordinates, coordinates unavailable!")
348 
349  Teko::addTekoToStratimikosBuilder(linearSolverBuilder,reqHandler_local);
350  }
351  else {
352  // try to set request handler from member variable
353  if(reqHandler_local==Teuchos::null)
354  reqHandler_local = rcp(new Teko::RequestHandler);
355 
356  std::string fieldName;
357  if(determineCoordinateField(*globalIndexer,fieldName)) {
359  rcp_dynamic_cast<const panzer::BlockedDOFManager>(globalIndexer);
361  rcp_dynamic_cast<const panzer::BlockedDOFManager>(auxGlobalIndexer);
363  rcp(new panzer_stk::ParameterListCallbackBlocked(stkConn_manager,blkDofs,auxBlkDofs));
364  reqHandler_local->addRequestCallback(callback);
365  }
366 
367  Teko::addTekoToStratimikosBuilder(linearSolverBuilder,reqHandler_local);
368 
369  if(writeCoordinates) {
370 #ifdef PANZER_HAVE_EPETRA_STACK
372  rcp_dynamic_cast<const panzer::BlockedDOFManager>(globalIndexer);
373 
374  // loop over blocks
375  const std::vector<RCP<panzer::GlobalIndexer>> & dofVec
376  = blkDofs->getFieldDOFManagers();
377  for(std::size_t i=0;i<dofVec.size();i++) {
378 
379  // add in the coordinate parameter list callback handler
380  TEUCHOS_ASSERT(determineCoordinateField(*dofVec[i],fieldName));
381 
382  std::map<std::string,RCP<const panzer::Intrepid2FieldPattern> > fieldPatterns;
383  fillFieldPatternMap(*dofVec[i],fieldName,fieldPatterns);
384  panzer_stk::ParameterListCallback plCall(fieldName,fieldPatterns,stkConn_manager,dofVec[i]);
385  plCall.buildArrayToVector();
386  plCall.buildCoordinates();
387 
388  // extract coordinate vectors
389  const std::vector<double> & xcoords = plCall.getXCoordsVector();
390  const std::vector<double> & ycoords = plCall.getYCoordsVector();
391  const std::vector<double> & zcoords = plCall.getZCoordsVector();
392 
393  // use epetra to write coordinates to matrix market files
394  Epetra_MpiComm ep_comm(*mpi_comm->getRawMpiComm()); // this is OK access to RawMpiComm becase its declared on the stack?
395  // and all users of this object are on the stack (within scope of mpi_comm
396  Epetra_Map map(-1,xcoords.size(),0,ep_comm);
397 
398  RCP<Epetra_Vector> vec;
399  switch(spatialDim) {
400  case 3:
401  vec = rcp(new Epetra_Vector(Copy,map,const_cast<double *>(&zcoords[0])));
402  EpetraExt::VectorToMatrixMarketFile((fieldName+"_zcoords.mm").c_str(),*vec);
403  // Intentional fall-through.
404  case 2:
405  vec = rcp(new Epetra_Vector(Copy,map,const_cast<double *>(&ycoords[0])));
406  EpetraExt::VectorToMatrixMarketFile((fieldName+"_ycoords.mm").c_str(),*vec);
407  // Intentional fall-through.
408  case 1:
409  vec = rcp(new Epetra_Vector(Copy,map,const_cast<double *>(&xcoords[0])));
410  EpetraExt::VectorToMatrixMarketFile((fieldName+"_xcoords.mm").c_str(),*vec);
411  break;
412  default:
413  TEUCHOS_ASSERT(false);
414  }
415 
416  // TODO add MueLu code...
417  #ifdef PANZER_HAVE_MUELU
418  if(useCoordinates) {
419 
420  typedef Xpetra::Map<int,panzer::GlobalOrdinal> Map;
421  typedef Xpetra::MultiVector<double,int,panzer::GlobalOrdinal> MV;
422 
423  // TODO This is Epetra-specific
424  RCP<const Map> coords_map = Xpetra::MapFactory<int,panzer::GlobalOrdinal>::Build(Xpetra::UseEpetra,
426  //Teuchos::ArrayView<GO>(ownedIndices),
427  xcoords.size(),
428  0,
429  mpi_comm
430  );
431 
432  unsigned dim = Teuchos::as<unsigned>(spatialDim);
433 
434  RCP<MV> coords = Xpetra::MultiVectorFactory<double,int,panzer::GlobalOrdinal>::Build(coords_map,spatialDim);
435 
436  for(unsigned d=0;d<dim;d++) {
437  // sanity check the size
438  TEUCHOS_ASSERT(coords->getLocalLength()==xcoords.size());
439 
440  // fill appropriate coords vector
441  Teuchos::ArrayRCP<double> dest = coords->getDataNonConst(d);
442  for(std::size_t j=0;j<coords->getLocalLength();++j) {
443  if (d == 0) dest[j] = xcoords[j];
444  if (d == 1) dest[j] = ycoords[j];
445  if (d == 2) dest[j] = zcoords[j];
446  }
447  }
448 
449  // TODO This is Epetra-specific
450  // inject coordinates into parameter list
451  Teuchos::ParameterList & muelu_params = strat_params->sublist("Preconditioner Types").sublist("MueLu");
452  muelu_params.set<RCP<MV> >("Coordinates",coords);
453 
454  }
455  #endif
456 
457  } /* end loop over all physical fields */
458 #else // PANZER_HAVE EPETRA
459  TEUCHOS_TEST_FOR_EXCEPTION(true,std::runtime_error,"ERROR: Panzer_STK_SetupLOWSFactory - writeCoordinates not implemented for Tpetra yet!")
460 #endif
461  }
462 
463  if(writeTopo) {
464  /*
465  RCP<const panzer::BlockedDOFManager> blkDofs =
466  rcp_dynamic_cast<const panzer::BlockedDOFManager>(globalIndexer);
467 
468  writeTopology(*blkDofs);
469  */
470  TEUCHOS_TEST_FOR_EXCEPTION(true,std::logic_error,
471  "Topology writing is no longer implemented. It needs to be reimplemented for the "
472  "default DOFManager (estimate 2 days with testing)");
473  }
474  }
475  #endif
476 
477  linearSolverBuilder.setParameterList(strat_params);
478  RCP<Thyra::LinearOpWithSolveFactoryBase<double> > lowsFactory = createLinearSolveStrategy(linearSolverBuilder);
479 
480  return lowsFactory;
481  }
482 
483 
485  buildLOWSFactory(bool blockedAssembly,
486  const Teuchos::RCP<const panzer::GlobalIndexer> & globalIndexer,
487  const Teuchos::RCP<panzer::ConnManager> & conn_manager,
488  int spatialDim,
489  const Teuchos::RCP<const Teuchos::MpiComm<int> > & mpi_comm,
490  const Teuchos::RCP<Teuchos::ParameterList> & strat_params,
491  #ifdef PANZER_HAVE_TEKO
492  const Teuchos::RCP<Teko::RequestHandler> & reqHandler,
493  #endif
494  bool writeCoordinates,
495  bool writeTopo,
496  const Teuchos::RCP<const panzer::GlobalIndexer> & auxGlobalIndexer,
497  bool useCoordinates
498  )
499  {
500  #ifdef PANZER_HAVE_TEKO
501  Teuchos::RCP<Teko::RequestHandler> reqHandler_local = reqHandler;
502  if(reqHandler_local==Teuchos::null)
503  reqHandler_local = Teuchos::rcp(new Teko::RequestHandler);
504  #endif
505 
506  auto stk_conn_manager = Teuchos::rcp_dynamic_cast<panzer_stk::STKConnManager>(conn_manager,true);
507 
508  return buildLOWSFactory(blockedAssembly,globalIndexer,stk_conn_manager,spatialDim,mpi_comm,strat_params,
509 #ifdef PANZER_HAVE_TEKO
510  reqHandler_local,
511 #endif
512  writeCoordinates,
513  writeTopo,
514  auxGlobalIndexer,
515  useCoordinates
516  );
517 
518  // should never reach this
519  TEUCHOS_ASSERT(false);
520  return Teuchos::null;
521  }
522 }
bool fieldInBlock(const std::string &field, const std::string &block) const
virtual const std::string & getFieldString(int num) const =0
Reverse lookup of the field string from a field number.
void getElementBlockIds(std::vector< std::string > &elementBlockIds) const
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
const std::vector< Teuchos::RCP< GlobalIndexer > > & getFieldDOFManagers() const
virtual void getElementBlockIds(std::vector< std::string > &elementBlockIds) const =0
virtual void getOwnedIndices(std::vector< panzer::GlobalOrdinal > &indices) const =0
Get the set of indices owned by this processor.
virtual int getNumFields() const =0
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
bool isSublist(const std::string &name) const
Teuchos::RCP< Thyra::LinearOpWithSolveFactoryBase< double > > buildLOWSFactory(bool blockedAssembly, const Teuchos::RCP< const panzer::GlobalIndexer > &globalIndexer, const Teuchos::RCP< panzer_stk::STKConnManager > &stkConn_manager, int spatialDim, const Teuchos::RCP< const Teuchos::MpiComm< int > > &mpi_comm, const Teuchos::RCP< Teuchos::ParameterList > &strat_params, bool writeCoordinates, bool writeTopo, const Teuchos::RCP< const panzer::GlobalIndexer > &auxGlobalIndexer, bool useCoordinates)
int VectorToMatrixMarketFile(const char *filename, const Epetra_Vector &A, const char *matrixName=0, const char *matrixDescription=0, bool writeHeader=true)
virtual const std::vector< int > & getBlockFieldNumbers(const std::string &blockId) const =0
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
#define TEUCHOS_ASSERT(assertion_test)
Teuchos::RCP< const FieldPattern > getFieldPattern(const std::string &name) const
Find a field pattern stored for a particular block and field number. This will retrive the pattern ad...