.. Documentation for the header file dolfin/mesh/SubDomain.h .. _programmers_reference_cpp_mesh_subdomain: SubDomain.h =========== .. note:: The documentation on this page was automatically extracted from the DOLFIN C++ code and may need to be edited or expanded. .. cpp:class:: SubDomain This class defines the interface for definition of subdomains. Alternatively, subdomains may be defined by a :cpp:class:`Mesh` and a :cpp:class:`MeshFunction` over the mesh. .. cpp:function:: SubDomain(const double map_tol=1.0e-10) Constructor *Arguments* map_tol (double) The tolerance used when identifying mapped points using the function SubDomain::map. .. cpp:function:: bool inside(const Array& x, bool on_boundary) const Return true for points inside the subdomain *Arguments* x (:cpp:class:`Array` ) The coordinates of the point. on_boundary (bool) True for points on the boundary. *Returns* bool True for points inside the subdomain. .. cpp:function:: void map(const Array& x, Array& y) const Map coordinate x in domain H to coordinate y in domain G (used for periodic boundary conditions) *Arguments* x (:cpp:class:`Array` ) The coordinates in domain H. y (:cpp:class:`Array` ) The coordinates in domain G. .. cpp:function:: void snap(Array& x) const Snap coordinate to boundary of subdomain *Arguments* x (:cpp:class:`Array` ) The coordinates. .. cpp:function:: void mark_cells(Mesh& mesh, std::size_t sub_domain, bool check_midpoint=true) const Set subdomain markers (std::size_t) on cells for given subdomain number *Arguments* mesh (:cpp:class:`Mesh`) The mesh to be marked. sub_domain (std::size_t) The subdomain number. check_midpoint (bool) Flag for whether midpoint of cell should be checked (default). .. cpp:function:: void mark_facets(Mesh& mesh, std::size_t sub_domain, bool check_midpoint=true) const Set subdomain markers (std::size_t) on facets for given subdomain number *Arguments* mesh (:cpp:class:`Mesh`) The mesh to be marked. sub_domain (std::size_t) The subdomain number. check_midpoint (bool) Flag for whether midpoint of cell should be checked (default). .. cpp:function:: void mark(Mesh& mesh, std::size_t dim, std::size_t sub_domain, bool check_midpoint=true) const Set subdomain markers (std::size_t) for given topological dimension and subdomain number *Arguments* mesh (:cpp:class:`Mesh`) The mesh to be marked. dim (std::size_t) The topological dimension of entities to be marked. sub_domain (std::size_t) The subdomain number. check_midpoint (bool) Flag for whether midpoint of cell should be checked (default). .. cpp:function:: void mark(MeshFunction& sub_domains, std::size_t sub_domain, bool check_midpoint=true) const Set subdomain markers (std::size_t) for given subdomain number *Arguments* sub_domains (:cpp:class:`MeshFunction` ) The subdomain markers. sub_domain (std::size_t) The subdomain number. check_midpoint (bool) Flag for whether midpoint of cell should be checked (default). .. cpp:function:: void mark(MeshFunction& sub_domains, int sub_domain, bool check_midpoint=true) const Set subdomain markers (int) for given subdomain number *Arguments* sub_domains (:cpp:class:`MeshFunction` ) The subdomain markers. sub_domain (int) The subdomain number. check_midpoint (bool) Flag for whether midpoint of cell should be checked (default). .. cpp:function:: void mark(MeshFunction& sub_domains, double sub_domain, bool check_midpoint=true) const Set subdomain markers (double) for given subdomain number *Arguments* sub_domains (:cpp:class:`MeshFunction` ) The subdomain markers. sub_domain (double) The subdomain number. check_midpoint (bool) Flag for whether midpoint of cell should be checked (default). .. cpp:function:: void mark(MeshFunction& sub_domains, bool sub_domain, bool check_midpoint=true) const Set subdomain markers (bool) for given subdomain *Arguments* sub_domains (:cpp:class:`MeshFunction` ) The subdomain markers. sub_domain (bool) The subdomain number. check_midpoint (bool) Flag for whether midpoint of cell should be checked (default). .. cpp:function:: void mark(MeshValueCollection& sub_domains, std::size_t sub_domain, const Mesh& mesh, bool check_midpoint=true) const Set subdomain markers (std::size_t) for given subdomain number *Arguments* sub_domains (:cpp:class:`MeshValueCollection` ) The subdomain markers. sub_domain (std::size_t) The subdomain number. mesh (:cpp:class:`Mesh`) The mesh. check_midpoint (bool) Flag for whether midpoint of cell should be checked (default). .. cpp:function:: void mark(MeshValueCollection& sub_domains, int sub_domain, const Mesh& mesh, bool check_midpoint=true) const Set subdomain markers (int) for given subdomain number *Arguments* sub_domains (:cpp:class:`MeshValueCollection` ) The subdomain markers sub_domain (int) The subdomain number check_midpoint (bool) Flag for whether midpoint of cell should be checked (default). .. cpp:function:: void mark(MeshValueCollection& sub_domains, double sub_domain, const Mesh& mesh, bool check_midpoint=true) const Set subdomain markers (double) for given subdomain number *Arguments* sub_domains (:cpp:class:`MeshValueCollection` ) The subdomain markers. sub_domain (double) The subdomain number check_midpoint (bool) Flag for whether midpoint of cell should be checked (default). .. cpp:function:: void mark(MeshValueCollection& sub_domains, bool sub_domain, const Mesh& mesh, bool check_midpoint=true) const Set subdomain markers (bool) for given subdomain *Arguments* sub_domains (:cpp:class:`MeshValueCollection` ) The subdomain markers sub_domain (bool) The subdomain number check_midpoint (bool) Flag for whether midpoint of cell should be checked (default). .. cpp:function:: std::size_t geometric_dimension() const Return geometric dimension *Returns* std::size_t The geometric dimension. .. cpp:function:: void apply_markers(S& sub_domains, T sub_domain, const Mesh& mesh, bool check_midpoint) const Apply marker of type T (most likely an std::size_t) to object of class S (most likely MeshFunction or MeshValueCollection)