/usr/include/dolfin/io/XMLFile.h is in libdolfin1.0-dev 1.0.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | // Copyright (C) 2011 Garth N. Wells
//
// This file is part of DOLFIN.
//
// DOLFIN is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOLFIN is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
//
// Modified by Anders Logg, 2011.
//
// First added: 2009-03-03
// Last changed: 2011-09-17
#ifndef __XMLFILE_H
#define __XMLFILE_H
#include <map>
#include <ostream>
#include <string>
#include <boost/shared_ptr.hpp>
#include "GenericFile.h"
namespace pugi
{
class xml_document;
class xml_node;
}
namespace dolfin
{
class Function;
class GenericVector;
class LocalMeshData;
class Mesh;
class Parameters;
template<typename T> class Array;
template<typename T> class MeshFunction;
template<typename T> class MeshValueCollection;
class XMLFile: public GenericFile
{
public:
/// Constructor
XMLFile(const std::string filename);
/// Constructor from a stream
XMLFile(std::ostream& s);
~XMLFile();
// Mesh
void operator>> (Mesh& input);
void operator<< (const Mesh& output);
// LocalMeshData
void operator>> (LocalMeshData& input);
void operator<< (const LocalMeshData& output);
// Vector
void operator>> (GenericVector& input);
void read_vector(Array<double>& input, Array<uint>& indices);
void operator<< (const GenericVector& output);
// Parameters
void operator>> (Parameters& input);
void operator<< (const Parameters& output);
// Function data
void operator>>(Function& input);
void operator<<(const Function& output);
// FunctionPlotData
void operator>> (FunctionPlotData& input);
void operator<< (const FunctionPlotData& output);
// MeshFunction (uint)
void operator>> (MeshFunction<unsigned int>& input)
{ read_mesh_function(input, "uint"); }
void operator<< (const MeshFunction<unsigned int>& output)
{ write_mesh_function(output, "uint"); }
// MeshFunction (int)
void operator>> (MeshFunction<int>& input)
{ read_mesh_function(input, "int"); }
void operator<< (const MeshFunction<int>& output)
{ write_mesh_function(output, "int"); }
// MeshFunction (double)
void operator>> (MeshFunction<double>& input)
{ read_mesh_function(input, "double"); }
void operator<< (const MeshFunction<double>& output)
{ write_mesh_function(output, "double"); }
// MeshFunction (bool)
void operator>> (MeshFunction<bool>& input)
{ read_mesh_function(input, "bool"); }
void operator<< (const MeshFunction<bool>& input)
{ write_mesh_function(input, "bool"); }
// MeshValueCollection (uint)
void operator>> (MeshValueCollection<unsigned int>& input)
{ read_mesh_value_collection(input, "uint"); }
void operator<< (const MeshValueCollection<unsigned int>& output)
{ write_mesh_value_collection(output, "uint"); }
// MeshValueCollection (int)
void operator>> (MeshValueCollection<int>& input)
{ read_mesh_value_collection(input, "int"); }
void operator<< (const MeshValueCollection<int>& output)
{ write_mesh_value_collection(output, "int"); }
// MeshValueCollection (double)
void operator>> (MeshValueCollection<double>& input)
{ read_mesh_value_collection(input, "double"); }
void operator<< (const MeshValueCollection<double>& output)
{ write_mesh_value_collection(output, "double"); }
// MeshValueCollection (bool)
void operator>> (MeshValueCollection<bool>& input)
{ read_mesh_value_collection(input, "bool"); }
void operator<< (const MeshValueCollection<bool>& input)
{ write_mesh_value_collection(input, "bool"); }
private:
// Read MeshFunction
template<typename T> void read_mesh_function(MeshFunction<T>& t,
const std::string type) const;
// Write MeshFunction
template<typename T> void write_mesh_function(const MeshFunction<T>& t,
const std::string type);
// Read MeshValueCollection
template<typename T>
void read_mesh_value_collection(MeshValueCollection<T>& t,
const std::string type) const;
// Write MeshValueCollection
template<typename T>
void write_mesh_value_collection(const MeshValueCollection<T>& t,
const std::string type);
// Load/open XML doc (from file)
void load_xml_doc(pugi::xml_document& xml_doc) const;
// Save XML doc (to file or stream)
void save_xml_doc(const pugi::xml_document& xml_doc) const;
// Get DOLFIN XML node
const pugi::xml_node get_dolfin_xml_node(pugi::xml_document& xml_doc) const;
static pugi::xml_node write_dolfin(pugi::xml_document& doc);
boost::shared_ptr<std::ostream> outstream;
};
}
#endif
|