Loading...
Searching...
No Matches
MeshDomains.h
// Copyright (C) 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 Garth N. Wells, 2012
//
// First added: 2011-08-29
// Last changed: 2012-04-03
#ifndef __MESH_DOMAINS_H
#define __MESH_DOMAINS_H
#include <map>
#include <vector>
namespace dolfin
{
class MeshDomains
{
public:
MeshDomains();
~MeshDomains();
std::size_t max_dim() const;
std::size_t num_marked(std::size_t dim) const;
bool is_empty() const;
std::map<std::size_t, std::size_t>& markers(std::size_t dim);
const std::map<std::size_t, std::size_t>& markers(std::size_t dim) const;
bool set_marker(std::pair<std::size_t, std::size_t> marker,
std::size_t dim);
std::size_t get_marker(std::size_t entity_index, std::size_t dim) const;
const MeshDomains& operator= (const MeshDomains& domains);
void init(std::size_t dim);
void clear();
private:
// Subdomain markers for each geometric dimension
std::vector<std::map<std::size_t, std::size_t> > _markers;
};
}
#endif
dolfin::MeshDomains::is_empty
bool is_empty() const
Check whether domain data is empty.
Definition MeshDomains.cpp:54
dolfin::MeshDomains::num_marked
std::size_t num_marked(std::size_t dim) const
Return number of marked entities of given dimension.
Definition MeshDomains.cpp:48
dolfin::MeshDomains::operator=
const MeshDomains & operator=(const MeshDomains &domains)
Assignment operator.
Definition MeshDomains.cpp:108
dolfin::MeshDomains::init
void init(std::size_t dim)
Initialize mesh domains for given topological dimension.
Definition MeshDomains.cpp:116
dolfin::MeshDomains::get_marker
std::size_t get_marker(std::size_t entity_index, std::size_t dim) const
Definition MeshDomains.cpp:92
dolfin::MeshDomains::max_dim
std::size_t max_dim() const
Return maximum topological dimension of stored markers.
Definition MeshDomains.cpp:40
dolfin::MeshDomains::clear
void clear()
Clear all data.
Definition MeshDomains.cpp:125
dolfin::MeshDomains::markers
std::map< std::size_t, std::size_t > & markers(std::size_t dim)
Definition MeshDomains.cpp:62
dolfin::MeshDomains::~MeshDomains
~MeshDomains()
Destructor.
Definition MeshDomains.cpp:35
dolfin::MeshDomains::MeshDomains
MeshDomains()
Create empty mesh domains.
Definition MeshDomains.cpp:30
dolfin::MeshDomains::set_marker
bool set_marker(std::pair< std::size_t, std::size_t > marker, std::size_t dim)
Definition MeshDomains.cpp:75
dolfin
Definition adapt.h:30