Commit 74da5a80 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#859 Add a convenient method in Coords class.

parent 057105f8
......@@ -23,7 +23,7 @@
#include "Geometry/Coords/Coords.hpp"
#include "Geometry/Coords/Exceptions/Coords.hpp"
#include "Geometry/Domain/Domain.hpp"
namespace MoReFEM
......@@ -93,7 +93,8 @@ namespace MoReFEM
bool Coords::IsInDomain(unsigned int domain_unique_id) const
{
assert(GetNonCstCreateDomainListForCoords() == create_domain_list_for_coords::yes
&& "GetNonCstCreateDomainListForCoords() should be set to yes. You can do it at the creation of your model. See the TestDomainListInCoords model for example.");
&& "GetNonCstCreateDomainListForCoords() should be set to yes. You can do it at the creation of "
"your model. See the TestDomainListInCoords model for example.");
auto begin = domain_list_.cbegin();
auto end = domain_list_.cend();
......@@ -102,6 +103,13 @@ namespace MoReFEM
return it == end ? false : true;
}
bool Coords::IsInDomain(const Domain& domain) const
{
const auto domain_id = domain.GetUniqueId();
return IsInDomain(domain_id);
}
create_domain_list_for_coords& Coords::GetNonCstCreateDomainListForCoords()
......
......@@ -50,6 +50,7 @@ namespace MoReFEM
class Mesh;
class Domain;
namespace Internal
......@@ -292,6 +293,18 @@ namespace MoReFEM
*/
bool IsInDomain(unsigned int domain_unique_id) const;
/*!
* \brief Whether the given Coords belongs to the domain or not.
*
* \param[in] domain \a Domain for which the test is done.
*
* This method makes sense only if SetCreateDomainListForCoordsToYes() was called.
*
* \return A boolean.
*/
bool IsInDomain(const Domain& domain) const;
/*!
* \brief Indicates we should keep track of the \a Domain to which the \a Coords belongs.
*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment