Loading...
Searching...
No Matches
MeshData.h
// 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 <memory>
#include <string>
#include <vector>
#include <dolfin/common/Variable.h>
namespace dolfin
{
class Mesh;
class MeshData : public Variable
{
public:
MeshData();
~MeshData();
const MeshData& operator= (const MeshData& data);
void clear();
//--- Query of data ---
bool exists(std::string name, std::size_t dim) const;
//--- Creation of data ---
std::vector<std::size_t>& create_array(std::string name, std::size_t dim);
//--- Retrieval of data ---
std::vector<std::size_t>& array(std::string name, std::size_t dim);
const std::vector<std::size_t>& array(std::string name,
std::size_t dim) const;
//--- Removal of data ---
void erase_array(const std::string name, std::size_t dim);
//--- Misc ---
std::string str(bool verbose) const;
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 deprecated named data
std::vector<std::string> _deprecated_names;
};
}
#endif
dolfin::MeshData::array
std::vector< std::size_t > & array(std::string name, std::size_t dim)
Definition MeshData.cpp:105
dolfin::MeshData::create_array
std::vector< std::size_t > & create_array(std::string name, std::size_t dim)
Definition MeshData.cpp:78
dolfin::MeshData::clear
void clear()
Clear all data.
Definition MeshData.cpp:73
dolfin::MeshData::~MeshData
~MeshData()
Destructor.
Definition MeshData.cpp:47
dolfin::MeshData::XMLMesh
friend class XMLMesh
Friends.
Definition MeshData.h:150
dolfin::MeshData::erase_array
void erase_array(const std::string name, std::size_t dim)
Definition MeshData.cpp:137
dolfin::MeshData::exists
bool exists(std::string name, std::size_t dim) const
Definition MeshData.cpp:60
dolfin::MeshData::MeshData
MeshData()
Constructor.
Definition MeshData.cpp:35
dolfin::MeshData::operator=
const MeshData & operator=(const MeshData &data)
Definition MeshData.cpp:52
dolfin::MeshData::str
std::string str(bool verbose) const
Definition MeshData.cpp:147
dolfin::Mesh
Definition Mesh.h:84
dolfin::Variable::name
std::string name() const
Return name.
Definition Variable.cpp:71
dolfin::Variable::Variable
Variable()
Create unnamed variable.
Definition Variable.cpp:31
dolfin
Definition adapt.h:30