Panzer  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Panzer_STK_SetupLOWSFactory_impl.hpp
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 #ifndef __Panzer_STK_SetupLOWSFactory_impl_hpp__
44 #define __Panzer_STK_SetupLOWSFactory_impl_hpp__
45 
46 #include "PanzerAdaptersSTK_config.hpp"
49 
50 #include "Teuchos_AbstractFactoryStd.hpp"
51 
52 #include "Stratimikos_DefaultLinearSolverBuilder.hpp"
53 
54 #include "Epetra_MpiComm.h"
55 #include "Epetra_Vector.h"
56 #include "EpetraExt_VectorOut.h"
57 
58 #include "ml_rbm.h"
59 
60 #include "Tpetra_Map.hpp"
61 #include "Tpetra_MultiVector.hpp"
62 
63 #ifdef PANZER_HAVE_TEKO
64 #include "Teko_StratimikosFactory.hpp"
65 #endif
66 
67 #ifdef PANZER_HAVE_MUELU
68 #include <Thyra_MueLuPreconditionerFactory.hpp>
69 #include <Thyra_MueLuRefMaxwellPreconditionerFactory.hpp>
70 #include "Stratimikos_MueLuHelpers.hpp"
71 #include "MatrixMarket_Tpetra.hpp"
72 #include "Xpetra_MapFactory.hpp"
73 #include "Xpetra_MultiVectorFactory.hpp"
74 #endif
75 
76 #ifdef PANZER_HAVE_IFPACK2
77 #include <Thyra_Ifpack2PreconditionerFactory.hpp>
78 #endif
79 
80 namespace panzer_stk {
81 
82 namespace {
83 
84  bool
85  determineCoordinateField(const panzer::UniqueGlobalIndexerBase & globalIndexer,std::string & fieldName)
86  {
87  std::vector<std::string> elementBlocks;
88  globalIndexer.getElementBlockIds(elementBlocks);
89 
90  // grab fields for first block
91  std::set<int> runningFields;
92  {
93  const std::vector<int> & fields = globalIndexer.getBlockFieldNumbers(elementBlocks[0]);
94  runningFields.insert(fields.begin(),fields.end());
95  }
96 
97  // grab fields for first block
98  for(std::size_t i=1;i<elementBlocks.size();i++) {
99  const std::vector<int> & fields = globalIndexer.getBlockFieldNumbers(elementBlocks[i]);
100 
101  std::set<int> currentFields(runningFields);
102  runningFields.clear();
103  std::set_intersection(fields.begin(),fields.end(),
104  currentFields.begin(),currentFields.end(),
105  std::inserter(runningFields,runningFields.begin()));
106  }
107 
108  if(runningFields.size()<1)
109  return false;
110 
111  fieldName = globalIndexer.getFieldString(*runningFields.begin());
112  return true;
113  }
114 
115  template<typename GO>
116  void
117  fillFieldPatternMap(const panzer::DOFManager<int,GO> & globalIndexer,
118  const std::string & fieldName,
119  std::map<std::string,Teuchos::RCP<const panzer::Intrepid2FieldPattern> > & fieldPatterns)
120  {
121  std::vector<std::string> elementBlocks;
122  globalIndexer.getElementBlockIds(elementBlocks);
123 
124  for(std::size_t e=0;e<elementBlocks.size();e++) {
125  std::string blockId = elementBlocks[e];
126 
127  if(globalIndexer.fieldInBlock(fieldName,blockId))
128  fieldPatterns[blockId] =
129  Teuchos::rcp_dynamic_cast<const panzer::Intrepid2FieldPattern>(globalIndexer.getFieldPattern(blockId,fieldName),true);
130  }
131  }
132 
133  void
134  fillFieldPatternMap(const panzer::UniqueGlobalIndexerBase & globalIndexer,
135  const std::string & fieldName,
136  std::map<std::string,Teuchos::RCP<const panzer::Intrepid2FieldPattern> > & fieldPatterns)
137  {
138  using Teuchos::Ptr;
139  using Teuchos::ptrFromRef;
140  using Teuchos::ptr_dynamic_cast;
141  using panzer::DOFManager;
142 
143  // first standard dof manager
144  {
145  Ptr<const DOFManager<int,int> > dofManager = ptr_dynamic_cast<const DOFManager<int,int> >(ptrFromRef(globalIndexer));
146 
147  if(dofManager!=Teuchos::null) {
148  fillFieldPatternMap(*dofManager,fieldName,fieldPatterns);
149  return;
150  }
151  }
152  {
153  Ptr<const DOFManager<int,panzer::Ordinal64> > dofManager = ptr_dynamic_cast<const DOFManager<int,panzer::Ordinal64> >(ptrFromRef(globalIndexer));
154 
155  if(dofManager!=Teuchos::null) {
156  fillFieldPatternMap(*dofManager,fieldName,fieldPatterns);
157  return;
158  }
159  }
160  }
161 }
162 
163  template<typename GO>
165  buildLOWSFactory(bool blockedAssembly,
167  const Teuchos::RCP<panzer_stk::STKConnManager<GO> > & stkConn_manager,
168  int spatialDim,
169  const Teuchos::RCP<const Teuchos::MpiComm<int> > & mpi_comm,
170  const Teuchos::RCP<Teuchos::ParameterList> & strat_params,
171  #ifdef PANZER_HAVE_TEKO
172  const Teuchos::RCP<Teko::RequestHandler> & reqHandler,
173  #endif
174  bool writeCoordinates,
175  bool writeTopo,
177  bool useCoordinates
178  )
179  {
180  using Teuchos::RCP;
181  using Teuchos::rcp;
182  using Teuchos::rcp_dynamic_cast;
183 
184  Stratimikos::DefaultLinearSolverBuilder linearSolverBuilder;
185 
186  // Note if you want to use new solvers within Teko they have to be added to the solver builer
187  // before teko is added. This is because Teko steals its defaults from the solver its being injected
188  // into!
189 
190  #ifdef PANZER_HAVE_MUELU
191  {
192  // TAW: the following is probably not optimal but it corresponds to what have been there before...
193  Stratimikos::enableMueLu(linearSolverBuilder,"MueLu");
194  Stratimikos::enableMueLuRefMaxwell(linearSolverBuilder,"MueLuRefMaxwell");
195  Stratimikos::enableMueLu<int,panzer::Ordinal64,panzer::TpetraNodeType>(linearSolverBuilder,"MueLu-Tpetra");
196  Stratimikos::enableMueLuRefMaxwell<int,panzer::Ordinal64,panzer::TpetraNodeType>(linearSolverBuilder,"MueLuRefMaxwell-Tpetra");
197  }
198  #endif // MUELU
199  #ifdef PANZER_HAVE_IFPACK2
200  {
202  typedef Thyra::Ifpack2PreconditionerFactory<Tpetra::CrsMatrix<double, int, panzer::Ordinal64,panzer::TpetraNodeType> > Impl;
203 
204  linearSolverBuilder.setPreconditioningStrategyFactory(Teuchos::abstractFactoryStd<Base, Impl>(), "Ifpack2");
205  }
206  #endif // MUELU
207 
208 
209  #ifdef PANZER_HAVE_TEKO
210  RCP<Teko::RequestHandler> reqHandler_local = reqHandler;
211 
212  if(!blockedAssembly) {
213 
214  std::string fieldName;
215 
216  // try to set request handler from member variable; This is a potential segfault
217  // if its internally stored data (e.g. callback) gets released and all its data
218  // required by ML or whatever gets hosed
219  if(reqHandler_local==Teuchos::null)
220  reqHandler_local = rcp(new Teko::RequestHandler);
221 
222  // add in the coordinate parameter list callback handler
223  if(determineCoordinateField(*globalIndexer,fieldName)) {
224  std::map<std::string,RCP<const panzer::Intrepid2FieldPattern> > fieldPatterns;
225  fillFieldPatternMap(*globalIndexer,fieldName,fieldPatterns);
226 
228  panzer_stk::ParameterListCallback<int,GO>(fieldName,fieldPatterns,stkConn_manager,
229  rcp_dynamic_cast<const panzer::UniqueGlobalIndexer<int,GO> >(globalIndexer)));
230  reqHandler_local->addRequestCallback(callback);
231 
232  // determine if you want rigid body null space modes...currently an extremely specialized case!
233  if(strat_params->sublist("Preconditioner Types").isSublist("ML")) {
234 /* COMMENTING THIS OUT FOR NOW, this is causing problems with some of the preconditioners in optimization...not sure why
235 
236  Teuchos::ParameterList & ml_params = strat_params->sublist("Preconditioner Types").sublist("ML").sublist("ML Settings");
237 
238  {
239  // force parameterlistcallback to build coordinates
240  callback->preRequest(Teko::RequestMesg(rcp(new Teuchos::ParameterList())));
241 
242  // extract coordinate vectors
243  std::vector<double> & xcoords = const_cast<std::vector<double> & >(callback->getXCoordsVector());
244  std::vector<double> & ycoords = const_cast<std::vector<double> & >(callback->getYCoordsVector());
245  std::vector<double> & zcoords = const_cast<std::vector<double> & >(callback->getZCoordsVector());
246 
247  ml_params.set<double*>("x-coordinates",&xcoords[0]);
248  ml_params.set<double*>("y-coordinates",&ycoords[0]);
249  ml_params.set<double*>("z-coordinates",&zcoords[0]);
250  }
251 */
252 /*
253  bool useRigidBodyNullSpace = false;
254  if(ml_params.isType<std::string>("null space: type"))
255  useRigidBodyNullSpace = ml_params.get<std::string>("null space: type") == "pre-computed";
256 
257  if(useRigidBodyNullSpace) {
258  // force parameterlistcallback to build coordinates
259  callback->preRequest(Teko::RequestMesg(rcp(new Teuchos::ParameterList())));
260 
261  RCP<std::vector<double> > rbm = rcp(new std::vector<double>);
262  std::vector<double> & rbm_ref = *rbm;
263 
264  // extract coordinate vectors
265  std::vector<double> & xcoords = const_cast<std::vector<double> & >(callback->getXCoordsVector());
266  std::vector<double> & ycoords = const_cast<std::vector<double> & >(callback->getYCoordsVector());
267  std::vector<double> & zcoords = const_cast<std::vector<double> & >(callback->getZCoordsVector());
268 
269  // use ML to build the null space modes for ML
270  int Nnodes = Teuchos::as<int>(xcoords.size());
271  int NscalarDof = 0;
272  int Ndof = spatialDim;
273  int nRBM = spatialDim==3 ? 6 : (spatialDim==2 ? 3 : 1);
274  int rbmSize = Nnodes*(nRBM+NscalarDof)*(Ndof+NscalarDof);
275  rbm_ref.resize(rbmSize);
276 
277  ML_Coord2RBM(Nnodes,&xcoords[0],&ycoords[0],&zcoords[0],&rbm_ref[0],Ndof,NscalarDof);
278 
279  ml_params.set<double*>("null space: vectors",&rbm_ref[0]);
280  ml_params.set<int>("null space: dimension",nRBM);
281 
282  callback->storeExtraVector(rbm);
283  }
284 */
285  }
286 
287  if(writeCoordinates) {
288  // force parameterlistcallback to build coordinates
289  callback->preRequest(Teko::RequestMesg(rcp(new Teuchos::ParameterList())));
290 
291  // extract coordinate vectors
292  const std::vector<double> & xcoords = callback->getXCoordsVector();
293  const std::vector<double> & ycoords = callback->getYCoordsVector();
294  const std::vector<double> & zcoords = callback->getZCoordsVector();
295 
296  // use epetra to write coordinates to matrix market files
297  Epetra_MpiComm ep_comm(*mpi_comm->getRawMpiComm()); // this is OK access to RawMpiComm becase its declared on the stack?
298  // and all users of this object are on the stack (within scope of mpi_comm
299  Epetra_Map map(-1,xcoords.size(),0,ep_comm);
300 
301  RCP<Epetra_Vector> vec;
302  switch(spatialDim) {
303  case 3:
304  vec = rcp(new Epetra_Vector(Copy,map,const_cast<double *>(&zcoords[0])));
305  EpetraExt::VectorToMatrixMarketFile("zcoords.mm",*vec);
306  // Intentional fall-through.
307  case 2:
308  vec = rcp(new Epetra_Vector(Copy,map,const_cast<double *>(&ycoords[0])));
309  EpetraExt::VectorToMatrixMarketFile("ycoords.mm",*vec);
310  // Intentional fall-through.
311  case 1:
312  vec = rcp(new Epetra_Vector(Copy,map,const_cast<double *>(&xcoords[0])));
313  EpetraExt::VectorToMatrixMarketFile("xcoords.mm",*vec);
314  break;
315  default:
316  TEUCHOS_ASSERT(false);
317  }
318  }
319 
320  #ifdef PANZER_HAVE_MUELU
321  if(rcp_dynamic_cast<const panzer::UniqueGlobalIndexer<int,panzer::Ordinal64> >(globalIndexer)!=Teuchos::null
322  && useCoordinates) {
323  if(!writeCoordinates)
324  callback->preRequest(Teko::RequestMesg(rcp(new Teuchos::ParameterList())));
325 
326  typedef Tpetra::Map<int,panzer::Ordinal64,panzer::TpetraNodeType> Map;
327  typedef Tpetra::MultiVector<double,int,panzer::Ordinal64,panzer::TpetraNodeType> MV;
328 
329  // extract coordinate vectors and modify strat_params to include coordinate vectors
330  unsigned dim = Teuchos::as<unsigned>(spatialDim);
331  RCP<MV> coords;
332  for(unsigned d=0;d<dim;d++) {
333  const std::vector<double> & coord = callback->getCoordsVector(d);
334 
335  // no coords vector has been build yet, build one
336  if(coords==Teuchos::null) {
337  if(globalIndexer->getNumFields()==1) {
339  = rcp_dynamic_cast<const panzer::UniqueGlobalIndexer<int,panzer::Ordinal64> >(globalIndexer);
340  std::vector<panzer::Ordinal64> ownedIndices;
341  ugi->getOwnedIndices(ownedIndices);
342  RCP<const Map> coords_map = rcp(new Map(Teuchos::OrdinalTraits<panzer::Ordinal64>::invalid(),ownedIndices,0,mpi_comm));
343  coords = rcp(new MV(coords_map,dim));
344  }
345  else {
346  RCP<const Map> coords_map = rcp(new Map(Teuchos::OrdinalTraits<panzer::Ordinal64>::invalid(),coord.size(),0,mpi_comm));
347  coords = rcp(new MV(coords_map,dim));
348  }
349  }
350 
351  // sanity check the size
352  TEUCHOS_ASSERT(coords->getLocalLength()==coord.size());
353 
354  // fill appropriate coords vector
355  Teuchos::ArrayRCP<double> dest = coords->getDataNonConst(d);
356  for(std::size_t i=0;i<coord.size();i++)
357  dest[i] = coord[i];
358  }
359 
360  // inject coordinates into parameter list
361  Teuchos::ParameterList & muelu_params = strat_params->sublist("Preconditioner Types").sublist("MueLu-Tpetra");
362  muelu_params.set<RCP<MV> >("Coordinates",coords);
363  }
364  #endif
365  }
366  // else write_out_the_mesg("Warning: No unique field determines the coordinates, coordinates unavailable!")
367 
368  Teko::addTekoToStratimikosBuilder(linearSolverBuilder,reqHandler_local);
369  }
370  else {
371  // try to set request handler from member variable
372  if(reqHandler_local==Teuchos::null)
373  reqHandler_local = rcp(new Teko::RequestHandler);
374 
375  std::string fieldName;
376  if(determineCoordinateField(*globalIndexer,fieldName)) {
378  rcp_dynamic_cast<const panzer::BlockedDOFManager<int,GO> >(globalIndexer);
380  rcp_dynamic_cast<const panzer::BlockedDOFManager<int,GO> >(auxGlobalIndexer);
382  rcp(new panzer_stk::ParameterListCallbackBlocked<int,GO>(stkConn_manager,blkDofs,auxBlkDofs));
383  reqHandler_local->addRequestCallback(callback);
384  }
385 
386  Teko::addTekoToStratimikosBuilder(linearSolverBuilder,reqHandler_local);
387 
388  if(writeCoordinates) {
390  rcp_dynamic_cast<const panzer::BlockedDOFManager<int,GO> >(globalIndexer);
391 
392  // loop over blocks
393  const std::vector<RCP<panzer::UniqueGlobalIndexer<int,GO> > > & dofVec
394  = blkDofs->getFieldDOFManagers();
395  for(std::size_t i=0;i<dofVec.size();i++) {
396 
397  // add in the coordinate parameter list callback handler
398  TEUCHOS_ASSERT(determineCoordinateField(*dofVec[i],fieldName));
399 
400  std::map<std::string,RCP<const panzer::Intrepid2FieldPattern> > fieldPatterns;
401  fillFieldPatternMap(*dofVec[i],fieldName,fieldPatterns);
402  panzer_stk::ParameterListCallback<int,GO> plCall(fieldName,fieldPatterns,stkConn_manager,dofVec[i]);
403  plCall.buildArrayToVector();
404  plCall.buildCoordinates();
405 
406  // extract coordinate vectors
407  const std::vector<double> & xcoords = plCall.getXCoordsVector();
408  const std::vector<double> & ycoords = plCall.getYCoordsVector();
409  const std::vector<double> & zcoords = plCall.getZCoordsVector();
410 
411  // use epetra to write coordinates to matrix market files
412  Epetra_MpiComm ep_comm(*mpi_comm->getRawMpiComm()); // this is OK access to RawMpiComm becase its declared on the stack?
413  // and all users of this object are on the stack (within scope of mpi_comm
414  Epetra_Map map(-1,xcoords.size(),0,ep_comm);
415 
416  RCP<Epetra_Vector> vec;
417  switch(spatialDim) {
418  case 3:
419  vec = rcp(new Epetra_Vector(Copy,map,const_cast<double *>(&zcoords[0])));
420  EpetraExt::VectorToMatrixMarketFile((fieldName+"_zcoords.mm").c_str(),*vec);
421  // Intentional fall-through.
422  case 2:
423  vec = rcp(new Epetra_Vector(Copy,map,const_cast<double *>(&ycoords[0])));
424  EpetraExt::VectorToMatrixMarketFile((fieldName+"_ycoords.mm").c_str(),*vec);
425  // Intentional fall-through.
426  case 1:
427  vec = rcp(new Epetra_Vector(Copy,map,const_cast<double *>(&xcoords[0])));
428  EpetraExt::VectorToMatrixMarketFile((fieldName+"_xcoords.mm").c_str(),*vec);
429  break;
430  default:
431  TEUCHOS_ASSERT(false);
432  }
433 
434  // TODO add MueLu code...
435  #ifdef PANZER_HAVE_MUELU
436  if(useCoordinates) {
437 
438  typedef Xpetra::Map<int,GO> Map;
439  typedef Xpetra::MultiVector<double,int,GO> MV;
440 
441  // TODO This is Epetra-specific
442  RCP<const Map> coords_map = Xpetra::MapFactory<int,GO>::Build(Xpetra::UseEpetra,
444  //Teuchos::ArrayView<GO>(ownedIndices),
445  xcoords.size(),
446  0,
447  mpi_comm
448  );
449 
450  unsigned dim = Teuchos::as<unsigned>(spatialDim);
451 
452  RCP<MV> coords = Xpetra::MultiVectorFactory<double,int,GO>::Build(coords_map,spatialDim);
453 
454  for(unsigned d=0;d<dim;d++) {
455  // sanity check the size
456  TEUCHOS_ASSERT(coords->getLocalLength()==xcoords.size());
457 
458  // fill appropriate coords vector
459  Teuchos::ArrayRCP<double> dest = coords->getDataNonConst(d);
460  for(std::size_t j=0;j<coords->getLocalLength();++j) {
461  if (d == 0) dest[j] = xcoords[j];
462  if (d == 1) dest[j] = ycoords[j];
463  if (d == 2) dest[j] = zcoords[j];
464  }
465  }
466 
467  // TODO This is Epetra-specific
468  // inject coordinates into parameter list
469  Teuchos::ParameterList & muelu_params = strat_params->sublist("Preconditioner Types").sublist("MueLu");
470  muelu_params.set<RCP<MV> >("Coordinates",coords);
471 
472  }
473  #endif
474 
475  } /* end loop over all physical fields */
476  }
477 
478  if(writeTopo) {
479  /*
480  RCP<const panzer::BlockedDOFManager<int,GO> > blkDofs =
481  rcp_dynamic_cast<const panzer::BlockedDOFManager<int,GO> >(globalIndexer);
482 
483  writeTopology(*blkDofs);
484  */
485  TEUCHOS_TEST_FOR_EXCEPTION(true,std::logic_error,
486  "Topology writing is no longer implemented. It needs to be reimplemented for the "
487  "default DOFManager (estimate 2 days with testing)");
488  }
489  }
490  #endif
491 
492  linearSolverBuilder.setParameterList(strat_params);
493  RCP<Thyra::LinearOpWithSolveFactoryBase<double> > lowsFactory = createLinearSolveStrategy(linearSolverBuilder);
494 
495  return lowsFactory;
496  }
497 
498 }
499 
500 #endif
Teuchos::RCP< Thyra::LinearOpWithSolveFactoryBase< double > > buildLOWSFactory(bool blockedAssembly, const Teuchos::RCP< const panzer::UniqueGlobalIndexerBase > &globalIndexer, const Teuchos::RCP< panzer::ConnManagerBase< int > > &conn_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::UniqueGlobalIndexerBase > &auxGlobalIndexer, bool useCoordinates)
virtual int getNumFields() const =0
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)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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...
bool isSublist(const std::string &name) const
virtual void getElementBlockIds(std::vector< std::string > &elementBlockIds) const =0
virtual const std::vector< int > & getBlockFieldNumbers(const std::string &blockId) const =0
int VectorToMatrixMarketFile(const char *filename, const Epetra_Vector &A, const char *matrixName=0, const char *matrixDescription=0, bool writeHeader=true)
virtual const std::string & getFieldString(int num) const =0
Reverse lookup of the field string from a field number.
bool fieldInBlock(const std::string &field, const std::string &block) const
void getElementBlockIds(std::vector< std::string > &elementBlockIds) const
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
#define TEUCHOS_ASSERT(assertion_test)