/usr/include/dolfin/mesh/MeshData.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 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 206 207 208 209 210 211 212 213 214 215 | // 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 <utility>
#include <vector>
#include <boost/shared_ptr.hpp>
#include <dolfin/common/types.h>
#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 _MeshFunction_ over topological mesh
/// entities, arrays or maps. Each dataset is identified by a unique
/// user-specified string. Only uint-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" - _MeshFunction_ <uint> of dimension D - 1
///
/// Sub meshes (used by the class SubMesh)
///
/// * "parent_vertex_indices" - _MeshFunction_ <uint> of dimension 0
///
/// Note to developers: use underscore in names in place of spaces.
class MeshData : public Variable
{
public:
/// Constructor
MeshData(Mesh& mesh);
/// Destructor
~MeshData();
/// Assignment operator
///
/// *Arguments*
/// data (_MeshData_)
/// Another MeshData object.
const MeshData& operator= (const MeshData& data);
/// Clear all data
void clear();
//--- Creation of data ---
/// Create MeshFunction with given name (uninitialized)
///
/// *Arguments*
/// name (std::string)
/// The name of the mesh function.
///
/// *Returns*
/// _MeshFunction_ <unsigned int>
/// The mesh function.
boost::shared_ptr<MeshFunction<unsigned int> >
create_mesh_function(std::string name);
/// Create MeshFunction with given name and dimension
///
/// *Arguments*
/// name (std::string)
/// The name of the mesh function.
/// dim (uint)
/// The dimension of the mesh function.
///
/// *Returns*
/// _MeshFunction_ <unsigned int>
/// The mesh function.
boost::shared_ptr<MeshFunction<unsigned int> >
create_mesh_function(std::string name, uint dim);
/// Create empty array (vector) with given name
///
/// *Arguments*
/// name (std::string)
/// The name of the array.
///
/// *Returns*
/// std::vector<uint>
/// The array.
boost::shared_ptr<std::vector<uint> > create_array(std::string name);
/// Create array (vector) with given name and size
///
/// *Arguments*
/// name (std::string)
/// The name of the array.
/// size (unit)
/// The size (length) of the array.
///
/// *Returns*
/// std::vector<uint>
/// The array.
boost::shared_ptr<std::vector<uint> > create_array(std::string name, uint size);
//--- Retrieval of data ---
/// Return MeshFunction with given name (returning zero if data is
/// not available)
///
/// *Arguments*
/// name (std::string)
/// The name of the MeshFunction.
///
/// *Returns*
/// _MeshFunction_ <unsigned int>
/// The mesh function with given name
boost::shared_ptr<MeshFunction<unsigned int> > 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<uint>
/// The array.
boost::shared_ptr<std::vector<uint> > array(const std::string name) const;
//--- Removal of data ---
/// Erase MeshFunction with given name
///
/// *Arguments*
/// name (std::string)
/// The name of the mesh function
void erase_mesh_function(const std::string name);
/// Erase array with given name
///
/// *Arguments*
/// name (std::string)
/// The name of the array.
void erase_array(const std::string name);
//--- 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;
friend class MeshPartitioning;
private:
// Check if name is deprecated
void check_deprecated(std::string name) const;
// The mesh
Mesh& mesh;
// A map from named mesh data to MeshFunctions
std::map<std::string, boost::shared_ptr<MeshFunction<uint> > > mesh_functions;
// A map from named mesh data to vector
std::map<std::string, boost::shared_ptr<std::vector<uint> > > arrays;
// List of depcrecated named data
std::vector<std::string> _deprecated_names;
};
}
#endif
|