XMLGFPreprocessor.h 1.62 KB
Newer Older
Francois Gygi committed
1 2
////////////////////////////////////////////////////////////////////////////////
//
3
// Copyright (c) 2008-2012 The Regents of the University of California
Francois Gygi committed
4 5 6
//
// This file is part of Qbox
//
Francois Gygi committed
7 8
// Qbox is distributed under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 2 of
Francois Gygi committed
9 10 11 12 13 14
// the License, or (at your option) any later version.
// See the file COPYING in the root directory of this distribution
// or <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////
//
Francois Gygi committed
15 16 17 18 19 20 21 22 23 24 25 26 27
// XMLGFPreprocessor.h
//
////////////////////////////////////////////////////////////////////////////////
#include <string>
#include "Matrix.h"

////////////////////////////////////////////////////////////////////////////////
//
// XMLGFPreprocessor class
// Used to preprocess <grid_function> elements in an XML document
// Input: filename, DoubleMatrix& gfdata, string xmlcontent
// The preprocessor reads the file in parallel, processes all <grid_function>
// elements and stores the values of the grid_functions in the matrix gfdata
28
// which has dimensions (ngf,maxgridsize), where ngf is the total number of
Francois Gygi committed
29 30 31
// <grid_function> elements found in the file, and maxgridsize is the size of
// the largest grid_function.
// On return, the string xmlcontent contains (on task 0) the XML file
32
// with <grid_function> elements reduced to empty strings.
Francois Gygi committed
33 34 35 36 37
//
////////////////////////////////////////////////////////////////////////////////
class XMLGFPreprocessor
{
  public:
38

39
  int process(const char* const filename,
40
    DoubleMatrix& gfdata, std::string& xmlcontent, bool serial);
Francois Gygi committed
41
};