/usr/include/dolfin/mesh/SubDomain.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 216 217 218 219 220 221 222 223 | // Copyright (C) 2007-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/>.
//
// First added: 2007-04-10
// Last changed: 2011-09-15
#ifndef __SUB_DOMAIN_H
#define __SUB_DOMAIN_H
#include <dolfin/common/types.h>
namespace dolfin
{
// Forward declarations
template <typename T> class MeshFunction;
template <typename T> class MeshValueCollection;
template <typename T> class Array;
/// This class defines the interface for definition of subdomains.
/// Alternatively, subdomains may be defined by a _Mesh_ and a
/// _MeshFunction_ <uint> over the mesh.
class SubDomain
{
public:
/// Constructor
SubDomain();
/// Destructor
virtual ~SubDomain();
/// Return true for points inside the subdomain
///
/// *Arguments*
/// x (_Array_ <double>)
/// The coordinates of the point.
/// on_boundary (bool)
/// True for points on the boundary.
///
/// *Returns*
/// bool
/// True for points inside the subdomain.
virtual bool inside(const Array<double>& x, bool on_boundary) const;
/// Map coordinate x in domain H to coordinate y in domain G (used for
/// periodic boundary conditions)
///
/// *Arguments*
/// x (_Array_ <double>)
/// The coordinates in domain H.
/// unnamed (_Array_ <double>)
/// The coordinates in domain G.
virtual void map(const Array<double>& x, Array<double>&) const;
/// Snap coordinate to boundary of subdomain
///
/// *Arguments*
/// x (_Array_ <double>)
/// The coordinates.
virtual void snap(Array<double>& x) const {}
//--- Marking of Mesh ---
/// Set subdomain markers (uint) on cells for given subdomain number
///
/// *Arguments*
/// mesh (_Mesh_)
/// The mesh to be marked.
/// sub_domain (unsigned int)
/// The subdomain number.
void mark_cells(Mesh& mesh, unsigned int sub_domain) const;
/// Set subdomain markers (uint) on facets for given subdomain number
///
/// *Arguments*
/// mesh (_Mesh_)
/// The mesh to be marked.
/// sub_domain (unsigned int)
/// The subdomain number.
void mark_facets(Mesh& mesh, unsigned int sub_domain) const;
/// Set subdomain markers (uint) for given topological dimension
/// and subdomain number
///
/// *Arguments*
/// mesh (_Mesh_)
/// The mesh to be marked.
/// dim (unsigned int)
/// The topological dimension of entities to be marked.
/// sub_domain (unsigned int)
/// The subdomain number.
void mark(Mesh& mesh, unsigned int dim, unsigned int sub_domain) const;
//--- Marking of MeshFunction ---
/// Set subdomain markers (uint) for given subdomain number
///
/// *Arguments*
/// sub_domains (_MeshFunction_ <unsigned int>)
/// The subdomain markers.
/// sub_domain (unsigned int)
/// The subdomain number.
void mark(MeshFunction<unsigned int>& sub_domains,
unsigned int sub_domain) const;
/// Set subdomain markers (int) for given subdomain number
///
/// *Arguments*
/// sub_domains (_MeshFunction_ <int>)
/// The subdomain markers.
/// sub_domain (int)
/// The subdomain number.
void mark(MeshFunction<int>& sub_domains, int sub_domain) const;
/// Set subdomain markers (double) for given subdomain number
///
/// *Arguments*
/// sub_domains (_MeshFunction_ <double>)
/// The subdomain markers.
/// sub_domain (double)
/// The subdomain number.
void mark(MeshFunction<double>& sub_domains, double sub_domain) const;
/// Set subdomain markers (bool) for given subdomain
///
/// *Arguments*
/// sub_domains (_MeshFunction_ <bool>)
/// The subdomain markers.
/// sub_domain (bool)
/// The subdomain number.
void mark(MeshFunction<bool>& sub_domains, bool sub_domain) const;
//--- Marking of MeshValueCollection ---
/// Set subdomain markers (uint) for given subdomain number
///
/// *Arguments*
/// sub_domains (_MeshValueCollection_ <unsigned int>)
/// The subdomain markers.
/// sub_domain (unsigned int)
/// The subdomain number.
/// mesn (_Mesh_)
/// The mesh.
void mark(MeshValueCollection<unsigned int>& sub_domains,
unsigned int sub_domain,
const Mesh& mesh) const;
/// Set subdomain markers (int) for given subdomain number
///
/// *Arguments*
/// sub_domains (_MeshValueCollection_ <int>)
/// The subdomain markers
/// sub_domain (int)
/// The subdomain number
void mark(MeshValueCollection<int>& sub_domains,
int sub_domain,
const Mesh& mesh) const;
/// Set subdomain markers (double) for given subdomain number
///
/// *Arguments*
/// sub_domains (_MeshValueCollection_ <double>)
/// The subdomain markers.
/// sub_domain (double)
/// The subdomain number
void mark(MeshValueCollection<double>& sub_domains,
double sub_domain,
const Mesh& mesh) const;
/// Set subdomain markers (bool) for given subdomain
///
/// *Arguments*
/// sub_domains (_MeshValueCollection_ <bool>)
/// The subdomain markers
/// sub_domain (bool)
/// The subdomain number
void mark(MeshValueCollection<bool>& sub_domains,
bool sub_domain,
const Mesh& mesh) const;
/// Return geometric dimension
///
/// *Returns*
/// uint
/// The geometric dimension.
uint geometric_dimension() const;
private:
/// Apply marker of type T (most likely an uint) to object of class
/// S (most likely MeshFunction or MeshValueCollection)
template<typename S, typename T>
void apply_markers(S& sub_domains, T sub_domain, const Mesh& mesh) const;
// Friends
friend class DirichletBC;
friend class PeriodicBC;
// Geometric dimension, needed for SWIG interface, will be set before
// calls to inside() and map()
mutable uint _geometric_dimension;
};
}
#endif
|