/usr/include/dolfin/mesh/MeshData.h is in libdolfin1.3-dev 1.3.0+dfsg-2.
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 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | // Copyright (C) 2008-2011 Anders Logg
//
// 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 Niclas Jansson, 2008.
// Modified by Garth N. Wells, 2011.
//
// First added: 2008-05-19
// Last changed: 2011-09-15
#ifndef __MESH_DATA_H
#define __MESH_DATA_H
#include <map>
#include <string>
#include <vector>
#include <boost/shared_ptr.hpp>
#include <dolfin/common/Variable.h>
namespace dolfin
{
class Mesh;
template <typename T> class MeshFunction;
/// The class MeshData is a container for auxiliary mesh data,
/// represented either as arrays or maps. Each dataset is identified
/// by a unique user-specified string. Only std::size_t-valued data
/// are currently supported.
///
/// Auxiliary mesh data may be attached to a mesh by users as a
/// convenient way to store data associated with a mesh. It is also
/// used internally by DOLFIN to communicate data associated with
/// meshes. The following named mesh data are recognized by DOLFIN:
///
/// Facet orientation (used for assembly over interior facets)
///
/// * "facet_orientation" - _std:vector_ <std::size_t> of dimension D - 1
///
/// Sub meshes (used by the class SubMesh)
///
/// * "parent_vertex_indices" - _std::vector_ <std::size_t> of dimension 0
///
/// Note to developers: use underscore in names in place of spaces.
class MeshData : public Variable
{
public:
/// Constructor
MeshData();
/// Destructor
~MeshData();
/// Assignment operator
///
/// *Arguments*
/// data (_MeshData_)
/// Another MeshData object.
const MeshData& operator= (const MeshData& data);
/// Clear all data
void clear();
//--- Query of data ---
/// Check is array exists
///
/// *Arguments*
/// name (std::string)
/// The name of the array.
///
/// *Returns*
/// bool
/// True is array exists, false otherwise.
bool exists(std::string name, std::size_t dim) const;
//--- Creation of data ---
/// This function is no longer supported. It is retained to print
/// an informative error message. It will be removed in the
/// future.
boost::shared_ptr<MeshFunction<std::size_t> >
create_mesh_function(std::string name);
/// This function is no longer supported. It is retained to print
/// an informative error message. It will be removed in the
/// future.
boost::shared_ptr<MeshFunction<std::size_t> >
create_mesh_function(std::string name, std::size_t dim);
/// Create empty array (vector) with given name
///
/// *Arguments*
/// name (std::string)
/// The name of the array.
///
/// *Returns*
/// std::vector<std::size_t>
/// The array.
//std::vector<std::size_t>& create_array(std::string name);
/// Create array (vector) with given name and size
///
/// *Arguments*
/// name (std::string)
/// The name of the array.
/// size (std::size_t)
/// The size (length) of the array.
///
/// *Returns*
/// std::vector<std::size_t>
/// The array.
//private:
std::vector<std::size_t>& create_array(std::string name, std::size_t dim);
//public:
//--- Retrieval of data ---
/// This function is no longer supported. It is retained to print
/// an informative error message. It will be removed in the
/// future.
boost::shared_ptr<MeshFunction<std::size_t> >
mesh_function(const std::string name) const;
/// Return array with given name (returning zero if data is not
/// available)
///
/// *Arguments*
/// name (std::string)
/// The name of the array.
///
/// *Returns*
/// std::vector<std::size_t>
/// The array.
std::vector<std::size_t>& array(std::string name, std::size_t dim);
/// Return array with given name (returning zero if data is not
/// available)
///
/// *Arguments*
/// name (std::string)
/// The name of the array.
///
/// *Returns*
/// std::vector<std::size_t>
/// The array.
const std::vector<std::size_t>& array(std::string name,
std::size_t dim) const;
//--- Removal of data ---
/// Erase array with given name
///
/// *Arguments*
/// name (std::string)
/// The name of the array.
void erase_array(const std::string name, std::size_t dim);
//--- Misc ---
/// Return informal string representation (pretty-print)
///
/// *Arguments*
/// verbose (bool)
/// Flag to turn on additional output.
///
/// *Returns*
/// std::string
/// An informal representation.
std::string str(bool verbose) const;
/// Friends
friend class XMLMesh;
private:
// Check if name is deprecated
void check_deprecated(std::string name) const;
// A map from named mesh array data to vector for dim
std::vector<std::map<std::string, std::vector<std::size_t> > > _arrays;
// List of depcrecated named data
std::vector<std::string> _deprecated_names;
};
}
#endif
|