EpetraExt Package Browser (Single Doxygen Collection)  Development
EpetraExt_XMLReader.cpp
Go to the documentation of this file.
1 /*
2 //@HEADER
3 // ***********************************************************************
4 //
5 // EpetraExt: Epetra Extended - Linear Algebra Services Package
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 Michael A. Heroux (maherou@sandia.gov)
39 //
40 // ***********************************************************************
41 //@HEADER
42 */
43 
44 #include "EpetraExt_ConfigDefs.h"
45 #ifdef HAVE_MPI
46 #include "Epetra_MpiComm.h"
47 #include "mpi.h"
48 #else
49 #include "Epetra_SerialComm.h"
50 #endif
51 #include "EpetraExt_XMLReader.h"
53 #include "Teuchos_RCP.hpp"
54 #include "Teuchos_XMLObject.hpp"
59 #include "Teuchos_Assert.hpp"
60 #include "Epetra_ConfigDefs.h"
61 #include "Epetra_Map.h"
62 #include "Epetra_CrsGraph.h"
63 #include "Epetra_FECrsGraph.h"
64 #include "Epetra_RowMatrix.h"
65 #include "Epetra_CrsMatrix.h"
66 #include "Epetra_FECrsMatrix.h"
67 #include "Epetra_MultiVector.h"
68 #include "Epetra_Import.h"
69 
70 #if defined(__PGI)
71 #include <sstream>
72 #endif
73 
74 // ============================================================================
75 static void Tokenize(const std::string& str, std::vector<std::string>& tokens,
76  const std::string& delimiters = " ")
77 {
78  // Skip delimiters at beginning.
79  std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
80  // Find first "non-delimiter".
81  std::string::size_type pos = str.find_first_of(delimiters, lastPos);
82 
83  while (std::string::npos != pos || std::string::npos != lastPos)
84  {
85  // Found a token, add it to the std::vector.
86  tokens.push_back(str.substr(lastPos, pos - lastPos));
87  // Skip delimiters. Note the "not_of"
88  lastPos = str.find_first_not_of(delimiters, pos);
89  // Find next "non-delimiter"
90  pos = str.find_first_of(delimiters, lastPos);
91  }
92 }
93 using namespace Teuchos;
94 
95 // ============================================================================
96 EpetraExt::XMLReader::XMLReader(const Epetra_Comm& comm, const std::string& FileName) :
97  Comm_(comm)
98 {
99 #ifdef HAVE_TEUCHOS_EXPAT
100  FileInputSource fileSrc(FileName);
101  fileXML_ = rcp(new XMLObject(fileSrc.getObject()));
102  IsOpen_ = true;
103 #else
104  std::cerr << "Teuchos was not configured with support for expat." << std::endl;
105  std::cerr << "Please reconfigure teuchos with --enable-teuchos-expat." << std::endl;
106  exit(EXIT_FAILURE);
107 #endif
108 }
109 
110 // ============================================================================
111 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
113 Read(const std::string& Label, Epetra_CrsGraph*& Graph)
114 {
115  TEUCHOS_TEST_FOR_EXCEPTION(IsOpen_ == false, std::logic_error,
116  "No file has been opened");
117 
118  Graph = 0;
119 
120  for (int i = 0; i < fileXML_->numChildren(); ++i)
121  {
122  const XMLObject& child = fileXML_->getChild(i);
123  std::string tag = child.getTag();
124 
125  if (tag == "Graph")
126  {
127  if (child.hasAttribute("Label") && child.getRequired("Label") == Label)
128  {
129  bool debug = false;
130  int NumGlobalRows = child.getRequiredInt("Rows");
131  int NumGlobalCols = child.getRequiredInt("Columns");
132  int NumGlobalEntries = child.getRequiredInt("Entries");
133  int Offset = child.getRequiredInt("StartingIndex");
134  if (debug) std::cout << NumGlobalCols << NumGlobalEntries << Offset << std::endl;
135 
136  Epetra_Map map(NumGlobalRows, 0, Comm_);
137  Graph = new Epetra_CrsGraph(Copy, map, 0);
138 
139  for (int j = 0; j < child.numContentLines(); ++j)
140  {
141  std::vector<std::string> tokens;
142  const std::string& line = child.getContentLine(j);
143  Tokenize(line, tokens, " \n\r\t");
144  if (tokens.size() < 2) continue;
145 
146  int row, col;
147  row = atoi((char*)tokens[0].c_str());
148  col = atoi((char*)tokens[1].c_str());
149 
150  if (map.LID(row) != -1)
151  Graph->InsertGlobalIndices(row, 1, &col);
152  }
153  Graph->FillComplete();
154  }
155  }
156  }
157 }
158 #endif
159 
160 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
162 Read64(const std::string& Label, Epetra_CrsGraph*& Graph)
163 {
164  TEUCHOS_TEST_FOR_EXCEPTION(IsOpen_ == false, std::logic_error,
165  "No file has been opened");
166 
167  Graph = 0;
168 
169  for (int i = 0; i < fileXML_->numChildren(); ++i)
170  {
171  const XMLObject& child = fileXML_->getChild(i);
172  std::string tag = child.getTag();
173 
174  if (tag == "Graph")
175  {
176  if (child.hasAttribute("Label") && child.getRequired("Label") == Label)
177  {
178  bool debug = false;
179  long long NumGlobalRows = child.getRequired<long long>("Rows");
180  long long NumGlobalCols = child.getRequired<long long>("Columns");
181  long long NumGlobalEntries = child.getRequired<long long>("Entries");
182  int Offset = child.getRequiredInt("StartingIndex");
183  if (debug) std::cout << NumGlobalCols << NumGlobalEntries << Offset << std::endl;
184 
185  Epetra_Map map(NumGlobalRows, 0, Comm_);
186  Graph = new Epetra_CrsGraph(Copy, map, 0);
187 
188  for (int j = 0; j < child.numContentLines(); ++j)
189  {
190  std::vector<std::string> tokens;
191  const std::string& line = child.getContentLine(j);
192  Tokenize(line, tokens, " \n\r\t");
193  if (tokens.size() < 2) continue;
194 
195  long long row, col;
196  char *endp;
197  const int base = 10;
198 #if defined(_MSC_VER)
199  row = _strtoi64((char*)tokens[0].c_str(), &endp, base);
200  col = _strtoi64((char*)tokens[1].c_str(), &endp, base);
201 #else
202 #if defined(__PGI)
203  std::istringstream ss_row(tokens[0]);
204  ss_row >> row;
205  std::istringstream ss_col(tokens[1]);
206  ss_col >> col;
207 #else
208  row = strtoll((char*)tokens[0].c_str(), &endp, base);
209  col = strtoll((char*)tokens[1].c_str(), &endp, base);
210 #endif
211 #endif
212 
213  if (map.LID(row) != -1)
214  Graph->InsertGlobalIndices(row, 1, &col);
215  }
216  Graph->FillComplete();
217  }
218  }
219  }
220 }
221 #endif
222 
223 // ============================================================================
224 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
226 Read(const std::string& Label, Epetra_CrsMatrix*& matrix)
227 {
228  TEUCHOS_TEST_FOR_EXCEPTION(IsOpen_ == false, std::logic_error,
229  "No file has been opened");
230 
231  matrix = 0;
232 
233  for (int i = 0; i < fileXML_->numChildren(); ++i)
234  {
235  const XMLObject& child = fileXML_->getChild(i);
236  std::string tag = child.getTag();
237 
238  if (tag == "PointMatrix")
239  {
240  if (child.hasAttribute("Label") && child.getRequired("Label") == Label)
241  {
242  bool debug = false;
243  int NumGlobalRows = child.getRequiredInt("Rows");
244  int NumGlobalCols = child.getRequiredInt("Columns");
245  int NumGlobalNonzeros = child.getRequiredInt("Nonzeros");
246  int Offset = child.getRequiredInt("StartingIndex");
247  if (debug) std::cout << NumGlobalCols << NumGlobalNonzeros << Offset << std::endl;
248 
249  Epetra_Map map(NumGlobalRows, 0, Comm_);
250  matrix = new Epetra_CrsMatrix(Copy, map, 0);
251 
252  for (int j = 0; j < child.numContentLines(); ++j)
253  {
254  std::vector<std::string> tokens;
255  const std::string& line = child.getContentLine(j);
256  Tokenize(line, tokens, " \n\r\t");
257  if (tokens.size() < 3) continue;
258 
259  int row, col;
260  double val;
261  row = atoi((char*)tokens[0].c_str());
262  col = atoi((char*)tokens[1].c_str());
263  sscanf((char*)tokens[2].c_str(), "%lg", &val);
264  //val = atof((char*)tokens[2].c_str());
265 
266  if (map.LID(row) != -1)
267  matrix->InsertGlobalValues(row, 1, &val, &col);
268  }
269  matrix->FillComplete();
270  }
271  }
272  }
273 }
274 #endif
275 
276 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
278 Read64(const std::string& Label, Epetra_CrsMatrix*& matrix)
279 {
280  TEUCHOS_TEST_FOR_EXCEPTION(IsOpen_ == false, std::logic_error,
281  "No file has been opened");
282 
283  matrix = 0;
284 
285  for (int i = 0; i < fileXML_->numChildren(); ++i)
286  {
287  const XMLObject& child = fileXML_->getChild(i);
288  std::string tag = child.getTag();
289 
290  if (tag == "PointMatrix")
291  {
292  if (child.hasAttribute("Label") && child.getRequired("Label") == Label)
293  {
294  bool debug = false;
295  long long NumGlobalRows = child.getRequiredInt("Rows");
296  long long NumGlobalCols = child.getRequiredInt("Columns");
297  long long NumGlobalNonzeros = child.getRequiredInt("Nonzeros");
298  int Offset = child.getRequiredInt("StartingIndex");
299  if (debug) std::cout << NumGlobalCols << NumGlobalNonzeros << Offset << std::endl;
300 
301  Epetra_Map map(NumGlobalRows, 0, Comm_);
302  matrix = new Epetra_CrsMatrix(Copy, map, 0);
303 
304  for (int j = 0; j < child.numContentLines(); ++j)
305  {
306  std::vector<std::string> tokens;
307  const std::string& line = child.getContentLine(j);
308  Tokenize(line, tokens, " \n\r\t");
309  if (tokens.size() < 3) continue;
310 
311  long long row, col;
312  double val;
313  char *endp;
314  const int base = 10;
315 #if defined(_MSC_VER)
316  row = _strtoi64((char*)tokens[0].c_str(), &endp, base);
317  col = _strtoi64((char*)tokens[1].c_str(), &endp, base);
318 #else
319 #if defined(__PGI)
320  std::istringstream ss_row(tokens[0]);
321  ss_row >> row;
322  std::istringstream ss_col(tokens[1]);
323  ss_col >> col;
324 #else
325  row = strtoll((char*)tokens[0].c_str(), &endp, base);
326  col = strtoll((char*)tokens[1].c_str(), &endp, base);
327 #endif
328 #endif
329  sscanf((char*)tokens[2].c_str(), "%lg", &val);
330  //val = atof((char*)tokens[2].c_str());
331 
332  if (map.LID(row) != -1)
333  matrix->InsertGlobalValues(row, 1, &val, &col);
334  }
335  matrix->FillComplete();
336  }
337  }
338  }
339 }
340 #endif
341 // ============================================================================
342 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
344 Read(const std::string& Label, Epetra_MultiVector*& MultiVector)
345 {
346  TEUCHOS_TEST_FOR_EXCEPTION(IsOpen_ == false, std::logic_error,
347  "No file has been opened");
348 
349  MultiVector = 0;
350 
351  // read all file and create all objects in memory.
352  for (int i = 0; i < fileXML_->numChildren(); ++i)
353  {
354  const XMLObject& child = fileXML_->getChild(i);
355  std::string tag = child.getTag();
356 
357  if (tag == "MultiVector")
358  {
359  if (child.hasAttribute("Label") && child.getRequired("Label") == Label)
360  {
361  int GlobalLength = child.getRequiredInt("Length");
362  int NumVectors = child.getRequiredInt("NumVectors");
363 
364  Epetra_Map Map(GlobalLength, 0, Comm_);
365  MultiVector = new Epetra_MultiVector(Map, NumVectors);
366 
367  int count = 0;
368  double val;
369  for (int j = 0; j < child.numContentLines(); ++j)
370  {
371  std::vector<std::string> tokens;
372 
373  const std::string& line = child.getContentLine(j);
374 
375  Tokenize(line, tokens, " \n\r\t");
376 
377  if (tokens.size() == 0) continue;
378 
379  TEUCHOS_TEST_FOR_EXCEPTION(tokens.size() != (unsigned) NumVectors, std::logic_error,
380  "wrong number of tokens in line; "
381  << "tokens.size() = " << tokens.size()
382  << ", NumVectors = " << NumVectors);
383  int tsize = (int) tokens.size();
384  for (int k = 0; k < tsize; ++k)
385  {
386  if (Map.LID(count) != -1)
387  {
388  sscanf((char*)(tokens[k].c_str()), "%lf", &val);
389 
390  (*MultiVector)[k][Map.LID(count)] = val;
391  }
392  }
393  ++count;
394  }
395  }
396  }
397  }
398 }
399 #endif
400 
401 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
403 Read64(const std::string& Label, Epetra_MultiVector*& MultiVector)
404 {
405  TEUCHOS_TEST_FOR_EXCEPTION(IsOpen_ == false, std::logic_error,
406  "No file has been opened");
407 
408  MultiVector = 0;
409 
410  // read all file and create all objects in memory.
411  for (int i = 0; i < fileXML_->numChildren(); ++i)
412  {
413  const XMLObject& child = fileXML_->getChild(i);
414  std::string tag = child.getTag();
415 
416  if (tag == "MultiVector")
417  {
418  if (child.hasAttribute("Label") && child.getRequired("Label") == Label)
419  {
420  long long GlobalLength = child.getRequired<long long>("Length");
421  int NumVectors = child.getRequiredInt("NumVectors");
422 
423  Epetra_Map Map(GlobalLength, 0, Comm_);
424  MultiVector = new Epetra_MultiVector(Map, NumVectors);
425 
426  long long count = 0;
427  double val;
428  for (long long j = 0; j < child.numContentLines(); ++j)
429  {
430  std::vector<std::string> tokens;
431 
432  const std::string& line = child.getContentLine(j);
433 
434  Tokenize(line, tokens, " \n\r\t");
435 
436  if (tokens.size() == 0) continue;
437 
438  TEUCHOS_TEST_FOR_EXCEPTION(tokens.size() != (unsigned) NumVectors, std::logic_error,
439  "wrong number of tokens in line; "
440  << "tokens.size() = " << tokens.size()
441  << ", NumVectors = " << NumVectors);
442  int tsize = (int) tokens.size();
443  for (int k = 0; k < tsize; ++k)
444  {
445  if (Map.LID(count) != -1)
446  {
447  sscanf((char*)(tokens[k].c_str()), "%lf", &val);
448 
449  (*MultiVector)[k][Map.LID(count)] = val;
450  }
451  }
452  ++count;
453  }
454  }
455  }
456  }
457 }
458 #endif
459 // ============================================================================
460 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
462 Read(const std::string& Label, Epetra_Map*& Map)
463 {
464  TEUCHOS_TEST_FOR_EXCEPTION(IsOpen_ == false, std::logic_error,
465  "No file has been opened");
466 
467  Map = 0;
468 
469  // read all file and create all objects in memory.
470  for (int i = 0; i < fileXML_->numChildren(); ++i)
471  {
472  const XMLObject& child = fileXML_->getChild(i);
473  std::string tag = child.getTag();
474 
475  if (tag == "Map")
476  {
477  if (child.hasAttribute("Label") && child.getRequired("Label") == Label)
478  {
479  int NumGlobalElements = child.getRequiredInt("NumElements");
480  int IndexBase = child.getRequiredInt("IndexBase");
481  int NumProc = child.getRequiredInt("NumProc");
482 
483  TEUCHOS_TEST_FOR_EXCEPTION(NumProc != Comm_.NumProc(), std::logic_error,
484  "Requested map defined with different number of processors, "
485  << "NumProc = " << NumProc << " while "
486  << "Comm.NumProc() = " << Comm_.NumProc());
487 
488  char str[80];
489  sprintf(str, "ElementsOnProc%d", Comm_.MyPID());
490  int NumMyElements = child.getRequiredInt(str);
491 
492  sprintf(str, "ElementsOnProc%d", Comm_.MyPID());
493 
494  std::vector<int> MyGlobalElements(NumMyElements);
495 
496  for (int iproc = 0; iproc < child.numChildren(); ++iproc)
497  {
498  const XMLObject& newChild = child.getChild(iproc);
499  int count = 0;
500 
501  if (newChild.hasAttribute("ID") &&
502  newChild.getRequiredInt("ID") == Comm_.MyPID())
503  {
504  for (int j = 0; j < newChild.numContentLines(); ++j)
505  {
506  std::vector<std::string> tokens;
507 
508  const std::string& line = newChild.getContentLine(j);
509 
510  Tokenize(line, tokens, " \n\r\t");
511  int tsize = (int) tokens.size();
512  for (int k = 0; k < tsize; ++k)
513  {
514  MyGlobalElements[count++] = atoi((char*)tokens[k].c_str());
515  }
516  }
517  }
518  }
519 
520  Map = new Epetra_Map(NumGlobalElements, NumMyElements,
521  &MyGlobalElements[0], IndexBase, Comm_);
522  }
523  }
524  }
525 }
526 #endif
527 
528 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
530 Read64(const std::string& Label, Epetra_Map*& Map)
531 {
532  TEUCHOS_TEST_FOR_EXCEPTION(IsOpen_ == false, std::logic_error,
533  "No file has been opened");
534 
535  Map = 0;
536 
537  // read all file and create all objects in memory.
538  for (int i = 0; i < fileXML_->numChildren(); ++i)
539  {
540  const XMLObject& child = fileXML_->getChild(i);
541  std::string tag = child.getTag();
542 
543  if (tag == "Map")
544  {
545  if (child.hasAttribute("Label") && child.getRequired("Label") == Label)
546  {
547  long long NumGlobalElements = child.getRequired<long long>("NumElements");
548  long long IndexBase = child.getRequired<long long>("IndexBase");
549  int NumProc = child.getRequiredInt("NumProc");
550 
551  TEUCHOS_TEST_FOR_EXCEPTION(NumProc != Comm_.NumProc(), std::logic_error,
552  "Requested map defined with different number of processors, "
553  << "NumProc = " << NumProc << " while "
554  << "Comm.NumProc() = " << Comm_.NumProc());
555 
556  char str[80];
557  sprintf(str, "ElementsOnProc%d", Comm_.MyPID());
558  int NumMyElements = child.getRequiredInt(str);
559 
560  sprintf(str, "ElementsOnProc%d", Comm_.MyPID());
561 
562  std::vector<long long> MyGlobalElements(NumMyElements);
563 
564  for (int iproc = 0; iproc < child.numChildren(); ++iproc)
565  {
566  const XMLObject& newChild = child.getChild(iproc);
567  int count = 0;
568 
569  if (newChild.hasAttribute("ID") &&
570  newChild.getRequiredInt("ID") == Comm_.MyPID())
571  {
572  for (int j = 0; j < newChild.numContentLines(); ++j)
573  {
574  std::vector<std::string> tokens;
575 
576  const std::string& line = newChild.getContentLine(j);
577 
578  Tokenize(line, tokens, " \n\r\t");
579  int tsize = (int) tokens.size();
580  for (int k = 0; k < tsize; ++k)
581  {
582  char *endp;
583  const int base = 10;
584 #if defined(_MSC_VER)
585  MyGlobalElements[count++] = _strtoi64((char*)tokens[k].c_str(), &endp, base);
586 #else
587 #if defined(__PGI)
588  std::istringstream ss(tokens[k]);
589  ss >> MyGlobalElements[count++];
590 #else
591  MyGlobalElements[count++] = strtoll((char*)tokens[k].c_str(), &endp, base);
592 #endif
593 #endif
594  }
595  }
596  }
597  }
598 
599  Map = new Epetra_Map(NumGlobalElements, NumMyElements,
600  &MyGlobalElements[0], IndexBase, Comm_);
601  }
602  }
603  }
604 }
605 #endif
606 
607 // ============================================================================
609 Read(const std::string& Label, std::vector<std::string>& Content)
610 {
611  TEUCHOS_TEST_FOR_EXCEPTION(IsOpen_ == false, std::logic_error,
612  "No file has been opened");
613 
614  for (int i = 0; i < fileXML_->numChildren(); ++i)
615  {
616  const XMLObject& child = fileXML_->getChild(i);
617  std::string tag = child.getTag();
618 
619  if (tag == "Text")
620  {
621  if (child.hasAttribute("Label") && child.getRequired("Label") == Label)
622  {
623  for (int j = 0; j < child.numContentLines(); ++j)
624  {
625  const std::string& line = child.getContentLine(j);
626  if (line == "\n") continue;
627  Content.push_back(line);
628  }
629  }
630  }
631  }
632 }
633 
634 // ============================================================================
636 Read(const std::string& Label, Teuchos::ParameterList& List)
637 {
638  TEUCHOS_TEST_FOR_EXCEPTION(IsOpen_ == false, std::logic_error,
639  "No file has been opened");
640 
641  for (int i = 0; i < fileXML_->numChildren(); ++i)
642  {
643  const XMLObject& child = fileXML_->getChild(i);
644  std::string tag = child.getTag();
645 
646  if (tag == "List")
647  {
648  if (child.hasAttribute("Label") && child.getRequired("Label") == Label)
649  {
651  List = ListReader.toParameterList(child.getChild(0));
652  }
653  }
654  }
655 }
int getRequiredInt(const std::string &name) const
bool hasAttribute(const std::string &name) const
void Read(const std::string &Label, Epetra_Map *&Map)
Reads the Epetra_Map stored with label Label.
Teuchos::RCP< Teuchos::XMLObject > fileXML_
parsed XML object.
virtual int InsertGlobalValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
const XMLObject & getChild(int i) const
RCP< ParameterList > toParameterList(const XMLObject &xml, RCP< DependencySheet > depSheet) const
int InsertGlobalIndices(int_type GlobalRow, int NumIndices, int_type *Indices)
int FillComplete(bool OptimizeDataStorage=true)
const std::string & getContentLine(int i) const
static void Tokenize(const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" ")
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
XMLReader(const Epetra_Comm &Comm, const std::string &FileName)
ctor
int numContentLines() const
const std::string & getTag() const
int LID(int GID) const
XMLObject getObject() const
int numChildren() const
Copy
bool getRequired(const std::string &name) const
void Read64(const std::string &Label, Epetra_Map *&Map)
Reads the Epetra_Map stored with label Label. Long Long version.
bool IsOpen_
If true, then the file has been successfully opened.